| // third_party/blink/public/mojom/background_sync/background_sync.mojom.h is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_BACKGROUND_SYNC_BACKGROUND_SYNC_MOJOM_H_ |
| #define THIRD_PARTY_BLINK_PUBLIC_MOJOM_BACKGROUND_SYNC_BACKGROUND_SYNC_MOJOM_H_ |
| |
| #include <stdint.h> |
| |
| #include <limits> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "third_party/abseil-cpp/absl/types/optional.h" |
| #include "mojo/public/cpp/bindings/clone_traits.h" |
| #include "mojo/public/cpp/bindings/equals_traits.h" |
| #include "mojo/public/cpp/bindings/lib/serialization.h" |
| #include "mojo/public/cpp/bindings/struct_ptr.h" |
| #include "mojo/public/cpp/bindings/struct_traits.h" |
| #include "mojo/public/cpp/bindings/union_traits.h" |
| |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h" |
| |
| #include "third_party/blink/public/mojom/background_sync/background_sync.mojom-shared.h" |
| #include "third_party/blink/public/mojom/background_sync/background_sync.mojom-forward.h" |
| #include <string> |
| #include <vector> |
| |
| #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
| #include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h" |
| |
| |
| #include "third_party/blink/public/common/common_export.h" |
| |
| #ifdef KYTHE_IS_RUNNING |
| #pragma kythe_inline_metadata "Metadata comment" |
| #endif |
| |
| |
| namespace blink { |
| namespace mojom { |
| |
| class OneShotBackgroundSyncServiceProxy; |
| |
| template <typename ImplRefTraits> |
| class OneShotBackgroundSyncServiceStub; |
| |
| class OneShotBackgroundSyncServiceRequestValidator; |
| class OneShotBackgroundSyncServiceResponseValidator; |
| |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService |
| class BLINK_COMMON_EXPORT OneShotBackgroundSyncService |
| : public OneShotBackgroundSyncServiceInterfaceBase { |
| public: |
| static const char Name_[]; |
| static std::pair<uint32_t, const void*> MessageToMethodInfo_(mojo::Message& message); |
| static const char* MessageToMethodName_(mojo::Message& message); |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasSyncMethods_ = false; |
| static constexpr bool HasUninterruptableMethods_ = false; |
| |
| using Base_ = OneShotBackgroundSyncServiceInterfaceBase; |
| using Proxy_ = OneShotBackgroundSyncServiceProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = OneShotBackgroundSyncServiceStub<ImplRefTraits>; |
| |
| using RequestValidator_ = OneShotBackgroundSyncServiceRequestValidator; |
| using ResponseValidator_ = OneShotBackgroundSyncServiceResponseValidator; |
| enum MethodMinVersions : uint32_t { |
| kRegisterMinVersion = 0, |
| kDidResolveRegistrationMinVersion = 0, |
| kGetRegistrationsMinVersion = 0, |
| }; |
| |
| // crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK |
| // with not having this data in traces there. |
| #if !BUILDFLAG(IS_FUCHSIA) |
| struct Register_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| struct DidResolveRegistration_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| struct GetRegistrations_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~OneShotBackgroundSyncService() = default; |
| |
| |
| using RegisterCallback = base::OnceCallback<void(BackgroundSyncError, SyncRegistrationOptionsPtr)>; |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService.Register |
| virtual void Register(SyncRegistrationOptionsPtr options, int64_t service_worker_registration_id, RegisterCallback callback) = 0; |
| |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService.DidResolveRegistration |
| virtual void DidResolveRegistration(BackgroundSyncRegistrationInfoPtr registration_info) = 0; |
| |
| |
| using GetRegistrationsCallback = base::OnceCallback<void(BackgroundSyncError, std::vector<SyncRegistrationOptionsPtr>)>; |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService.GetRegistrations |
| virtual void GetRegistrations(int64_t service_worker_registration_id, GetRegistrationsCallback callback) = 0; |
| }; |
| |
| class PeriodicBackgroundSyncServiceProxy; |
| |
| template <typename ImplRefTraits> |
| class PeriodicBackgroundSyncServiceStub; |
| |
| class PeriodicBackgroundSyncServiceRequestValidator; |
| class PeriodicBackgroundSyncServiceResponseValidator; |
| |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService |
| class BLINK_COMMON_EXPORT PeriodicBackgroundSyncService |
| : public PeriodicBackgroundSyncServiceInterfaceBase { |
| public: |
| static const char Name_[]; |
| static std::pair<uint32_t, const void*> MessageToMethodInfo_(mojo::Message& message); |
| static const char* MessageToMethodName_(mojo::Message& message); |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasSyncMethods_ = false; |
| static constexpr bool HasUninterruptableMethods_ = false; |
| |
| using Base_ = PeriodicBackgroundSyncServiceInterfaceBase; |
| using Proxy_ = PeriodicBackgroundSyncServiceProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = PeriodicBackgroundSyncServiceStub<ImplRefTraits>; |
| |
| using RequestValidator_ = PeriodicBackgroundSyncServiceRequestValidator; |
| using ResponseValidator_ = PeriodicBackgroundSyncServiceResponseValidator; |
| enum MethodMinVersions : uint32_t { |
| kRegisterMinVersion = 0, |
| kUnregisterMinVersion = 0, |
| kGetRegistrationsMinVersion = 0, |
| }; |
| |
| // crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK |
| // with not having this data in traces there. |
| #if !BUILDFLAG(IS_FUCHSIA) |
| struct Register_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| struct Unregister_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| struct GetRegistrations_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~PeriodicBackgroundSyncService() = default; |
| |
| |
| using RegisterCallback = base::OnceCallback<void(BackgroundSyncError, SyncRegistrationOptionsPtr)>; |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService.Register |
| virtual void Register(SyncRegistrationOptionsPtr options, int64_t service_worker_registration_id, RegisterCallback callback) = 0; |
| |
| |
| using UnregisterCallback = base::OnceCallback<void(BackgroundSyncError)>; |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService.Unregister |
| virtual void Unregister(int64_t service_worker_registration_id, const std::string& tag, UnregisterCallback callback) = 0; |
| |
| |
| using GetRegistrationsCallback = base::OnceCallback<void(BackgroundSyncError, std::vector<SyncRegistrationOptionsPtr>)>; |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService.GetRegistrations |
| virtual void GetRegistrations(int64_t service_worker_registration_id, GetRegistrationsCallback callback) = 0; |
| }; |
| |
| |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService |
| class BLINK_COMMON_EXPORT OneShotBackgroundSyncServiceProxy |
| : public OneShotBackgroundSyncService { |
| public: |
| using InterfaceType = OneShotBackgroundSyncService; |
| |
| explicit OneShotBackgroundSyncServiceProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService.Register |
| void Register(SyncRegistrationOptionsPtr options, int64_t service_worker_registration_id, RegisterCallback callback) final; |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService.DidResolveRegistration |
| void DidResolveRegistration(BackgroundSyncRegistrationInfoPtr registration_info) final; |
| |
| // @generated_from: blink.mojom.OneShotBackgroundSyncService.GetRegistrations |
| void GetRegistrations(int64_t service_worker_registration_id, GetRegistrationsCallback callback) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| |
| |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService |
| class BLINK_COMMON_EXPORT PeriodicBackgroundSyncServiceProxy |
| : public PeriodicBackgroundSyncService { |
| public: |
| using InterfaceType = PeriodicBackgroundSyncService; |
| |
| explicit PeriodicBackgroundSyncServiceProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService.Register |
| void Register(SyncRegistrationOptionsPtr options, int64_t service_worker_registration_id, RegisterCallback callback) final; |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService.Unregister |
| void Unregister(int64_t service_worker_registration_id, const std::string& tag, UnregisterCallback callback) final; |
| |
| // @generated_from: blink.mojom.PeriodicBackgroundSyncService.GetRegistrations |
| void GetRegistrations(int64_t service_worker_registration_id, GetRegistrationsCallback callback) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| class BLINK_COMMON_EXPORT OneShotBackgroundSyncServiceStubDispatch { |
| public: |
| static bool Accept(OneShotBackgroundSyncService* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| OneShotBackgroundSyncService* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<OneShotBackgroundSyncService>> |
| class OneShotBackgroundSyncServiceStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| OneShotBackgroundSyncServiceStub() = default; |
| ~OneShotBackgroundSyncServiceStub() override = default; |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return OneShotBackgroundSyncServiceStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return OneShotBackgroundSyncServiceStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class BLINK_COMMON_EXPORT PeriodicBackgroundSyncServiceStubDispatch { |
| public: |
| static bool Accept(PeriodicBackgroundSyncService* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| PeriodicBackgroundSyncService* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<PeriodicBackgroundSyncService>> |
| class PeriodicBackgroundSyncServiceStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| PeriodicBackgroundSyncServiceStub() = default; |
| ~PeriodicBackgroundSyncServiceStub() override = default; |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return PeriodicBackgroundSyncServiceStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return PeriodicBackgroundSyncServiceStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class BLINK_COMMON_EXPORT OneShotBackgroundSyncServiceRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class BLINK_COMMON_EXPORT PeriodicBackgroundSyncServiceRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class BLINK_COMMON_EXPORT OneShotBackgroundSyncServiceResponseValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class BLINK_COMMON_EXPORT PeriodicBackgroundSyncServiceResponseValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| |
| |
| |
| |
| |
| // @generated_from: blink.mojom.SyncRegistrationOptions |
| class BLINK_COMMON_EXPORT SyncRegistrationOptions { |
| public: |
| template <typename T> |
| using EnableIfSame = std::enable_if_t<std::is_same<SyncRegistrationOptions, T>::value>; |
| using DataView = SyncRegistrationOptionsDataView; |
| using Data_ = internal::SyncRegistrationOptions_Data; |
| |
| template <typename... Args> |
| static SyncRegistrationOptionsPtr New(Args&&... args) { |
| return SyncRegistrationOptionsPtr( |
| absl::in_place, std::forward<Args>(args)...); |
| } |
| |
| template <typename U> |
| static SyncRegistrationOptionsPtr From(const U& u) { |
| return mojo::TypeConverter<SyncRegistrationOptionsPtr, U>::Convert(u); |
| } |
| |
| template <typename U> |
| U To() const { |
| return mojo::TypeConverter<U, SyncRegistrationOptions>::Convert(*this); |
| } |
| |
| |
| SyncRegistrationOptions(); |
| |
| SyncRegistrationOptions( |
| const std::string& tag, |
| int64_t min_interval); |
| |
| |
| ~SyncRegistrationOptions(); |
| |
| // Clone() is a template so it is only instantiated if it is used. Thus, the |
| // bindings generator does not need to know whether Clone() or copy |
| // constructor/assignment are available for members. |
| template <typename StructPtrType = SyncRegistrationOptionsPtr> |
| SyncRegistrationOptionsPtr Clone() const; |
| |
| // Equals() is a template so it is only instantiated if it is used. Thus, the |
| // bindings generator does not need to know whether Equals() or == operator |
| // are available for members. |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>* = nullptr> |
| bool Equals(const T& other) const; |
| |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>* = nullptr> |
| bool operator==(const T& rhs) const { return Equals(rhs); } |
| size_t Hash(size_t seed) const; |
| template <typename UserType> |
| static std::vector<uint8_t> Serialize(UserType* input) { |
| return mojo::internal::SerializeImpl< |
| SyncRegistrationOptions::DataView, std::vector<uint8_t>>(input); |
| } |
| |
| template <typename UserType> |
| static mojo::Message SerializeAsMessage(UserType* input) { |
| return mojo::internal::SerializeAsMessageImpl< |
| SyncRegistrationOptions::DataView>(input); |
| } |
| |
| // The returned Message is serialized only if the message is moved |
| // cross-process or cross-language. Otherwise if the message is Deserialized |
| // as the same UserType |input| will just be moved to |output| in |
| // DeserializeFromMessage. |
| template <typename UserType> |
| static mojo::Message WrapAsMessage(UserType input) { |
| return mojo::Message(std::make_unique< |
| internal::SyncRegistrationOptions_UnserializedMessageContext< |
| UserType, SyncRegistrationOptions::DataView>>(0, 0, std::move(input)), |
| MOJO_CREATE_MESSAGE_FLAG_NONE); |
| } |
| |
| template <typename UserType> |
| static bool Deserialize(const void* data, |
| size_t data_num_bytes, |
| UserType* output) { |
| mojo::Message message; |
| return mojo::internal::DeserializeImpl<SyncRegistrationOptions::DataView>( |
| message, data, data_num_bytes, output, Validate); |
| } |
| |
| template <typename UserType> |
| static bool Deserialize(const std::vector<uint8_t>& input, |
| UserType* output) { |
| return SyncRegistrationOptions::Deserialize( |
| input.size() == 0 ? nullptr : &input.front(), input.size(), output); |
| } |
| |
| template <typename UserType> |
| static bool DeserializeFromMessage(mojo::Message input, |
| UserType* output) { |
| auto context = input.TakeUnserializedContext< |
| internal::SyncRegistrationOptions_UnserializedMessageContext< |
| UserType, SyncRegistrationOptions::DataView>>(); |
| if (context) { |
| *output = std::move(context->TakeData()); |
| return true; |
| } |
| input.SerializeIfNecessary(); |
| return mojo::internal::DeserializeImpl<SyncRegistrationOptions::DataView>( |
| input, input.payload(), input.payload_num_bytes(), output, Validate); |
| } |
| |
| |
| // @generated_from: blink.mojom.SyncRegistrationOptions.tag |
| std::string tag; |
| |
| // @generated_from: blink.mojom.SyncRegistrationOptions.min_interval |
| int64_t min_interval; |
| |
| // Serialise this struct into a trace. |
| void WriteIntoTrace(perfetto::TracedValue traced_context) const; |
| |
| private: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| }; |
| |
| // The comparison operators are templates, so they are only instantiated if they |
| // are used. Thus, the bindings generator does not need to know whether |
| // comparison operators are available for members. |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>* = nullptr> |
| bool operator<(const T& lhs, const T& rhs); |
| |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>* = nullptr> |
| bool operator<=(const T& lhs, const T& rhs) { |
| return !(rhs < lhs); |
| } |
| |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>* = nullptr> |
| bool operator>(const T& lhs, const T& rhs) { |
| return rhs < lhs; |
| } |
| |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>* = nullptr> |
| bool operator>=(const T& lhs, const T& rhs) { |
| return !(lhs < rhs); |
| } |
| |
| |
| |
| |
| |
| // @generated_from: blink.mojom.BackgroundSyncRegistrationInfo |
| class BLINK_COMMON_EXPORT BackgroundSyncRegistrationInfo { |
| public: |
| template <typename T> |
| using EnableIfSame = std::enable_if_t<std::is_same<BackgroundSyncRegistrationInfo, T>::value>; |
| using DataView = BackgroundSyncRegistrationInfoDataView; |
| using Data_ = internal::BackgroundSyncRegistrationInfo_Data; |
| |
| template <typename... Args> |
| static BackgroundSyncRegistrationInfoPtr New(Args&&... args) { |
| return BackgroundSyncRegistrationInfoPtr( |
| absl::in_place, std::forward<Args>(args)...); |
| } |
| |
| template <typename U> |
| static BackgroundSyncRegistrationInfoPtr From(const U& u) { |
| return mojo::TypeConverter<BackgroundSyncRegistrationInfoPtr, U>::Convert(u); |
| } |
| |
| template <typename U> |
| U To() const { |
| return mojo::TypeConverter<U, BackgroundSyncRegistrationInfo>::Convert(*this); |
| } |
| |
| |
| BackgroundSyncRegistrationInfo(); |
| |
| BackgroundSyncRegistrationInfo( |
| int64_t service_worker_registration_id, |
| const std::string& tag, |
| BackgroundSyncType sync_type); |
| |
| |
| ~BackgroundSyncRegistrationInfo(); |
| |
| // Clone() is a template so it is only instantiated if it is used. Thus, the |
| // bindings generator does not need to know whether Clone() or copy |
| // constructor/assignment are available for members. |
| template <typename StructPtrType = BackgroundSyncRegistrationInfoPtr> |
| BackgroundSyncRegistrationInfoPtr Clone() const; |
| |
| // Equals() is a template so it is only instantiated if it is used. Thus, the |
| // bindings generator does not need to know whether Equals() or == operator |
| // are available for members. |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>* = nullptr> |
| bool Equals(const T& other) const; |
| |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>* = nullptr> |
| bool operator==(const T& rhs) const { return Equals(rhs); } |
| size_t Hash(size_t seed) const; |
| template <typename UserType> |
| static std::vector<uint8_t> Serialize(UserType* input) { |
| return mojo::internal::SerializeImpl< |
| BackgroundSyncRegistrationInfo::DataView, std::vector<uint8_t>>(input); |
| } |
| |
| template <typename UserType> |
| static mojo::Message SerializeAsMessage(UserType* input) { |
| return mojo::internal::SerializeAsMessageImpl< |
| BackgroundSyncRegistrationInfo::DataView>(input); |
| } |
| |
| // The returned Message is serialized only if the message is moved |
| // cross-process or cross-language. Otherwise if the message is Deserialized |
| // as the same UserType |input| will just be moved to |output| in |
| // DeserializeFromMessage. |
| template <typename UserType> |
| static mojo::Message WrapAsMessage(UserType input) { |
| return mojo::Message(std::make_unique< |
| internal::BackgroundSyncRegistrationInfo_UnserializedMessageContext< |
| UserType, BackgroundSyncRegistrationInfo::DataView>>(0, 0, std::move(input)), |
| MOJO_CREATE_MESSAGE_FLAG_NONE); |
| } |
| |
| template <typename UserType> |
| static bool Deserialize(const void* data, |
| size_t data_num_bytes, |
| UserType* output) { |
| mojo::Message message; |
| return mojo::internal::DeserializeImpl<BackgroundSyncRegistrationInfo::DataView>( |
| message, data, data_num_bytes, output, Validate); |
| } |
| |
| template <typename UserType> |
| static bool Deserialize(const std::vector<uint8_t>& input, |
| UserType* output) { |
| return BackgroundSyncRegistrationInfo::Deserialize( |
| input.size() == 0 ? nullptr : &input.front(), input.size(), output); |
| } |
| |
| template <typename UserType> |
| static bool DeserializeFromMessage(mojo::Message input, |
| UserType* output) { |
| auto context = input.TakeUnserializedContext< |
| internal::BackgroundSyncRegistrationInfo_UnserializedMessageContext< |
| UserType, BackgroundSyncRegistrationInfo::DataView>>(); |
| if (context) { |
| *output = std::move(context->TakeData()); |
| return true; |
| } |
| input.SerializeIfNecessary(); |
| return mojo::internal::DeserializeImpl<BackgroundSyncRegistrationInfo::DataView>( |
| input, input.payload(), input.payload_num_bytes(), output, Validate); |
| } |
| |
| |
| // @generated_from: blink.mojom.BackgroundSyncRegistrationInfo.service_worker_registration_id |
| int64_t service_worker_registration_id; |
| |
| // @generated_from: blink.mojom.BackgroundSyncRegistrationInfo.tag |
| std::string tag; |
| |
| // @generated_from: blink.mojom.BackgroundSyncRegistrationInfo.sync_type |
| BackgroundSyncType sync_type; |
| |
| // Serialise this struct into a trace. |
| void WriteIntoTrace(perfetto::TracedValue traced_context) const; |
| |
| private: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| }; |
| |
| // The comparison operators are templates, so they are only instantiated if they |
| // are used. Thus, the bindings generator does not need to know whether |
| // comparison operators are available for members. |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>* = nullptr> |
| bool operator<(const T& lhs, const T& rhs); |
| |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>* = nullptr> |
| bool operator<=(const T& lhs, const T& rhs) { |
| return !(rhs < lhs); |
| } |
| |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>* = nullptr> |
| bool operator>(const T& lhs, const T& rhs) { |
| return rhs < lhs; |
| } |
| |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>* = nullptr> |
| bool operator>=(const T& lhs, const T& rhs) { |
| return !(lhs < rhs); |
| } |
| |
| |
| |
| |
| |
| template <typename StructPtrType> |
| SyncRegistrationOptionsPtr SyncRegistrationOptions::Clone() const { |
| return New( |
| mojo::Clone(tag), |
| mojo::Clone(min_interval) |
| ); |
| } |
| |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>*> |
| bool SyncRegistrationOptions::Equals(const T& other_struct) const { |
| if (!mojo::Equals(this->tag, other_struct.tag)) |
| return false; |
| if (!mojo::Equals(this->min_interval, other_struct.min_interval)) |
| return false; |
| return true; |
| } |
| |
| template <typename T, SyncRegistrationOptions::EnableIfSame<T>*> |
| bool operator<(const T& lhs, const T& rhs) { |
| if (lhs.tag < rhs.tag) |
| return true; |
| if (rhs.tag < lhs.tag) |
| return false; |
| if (lhs.min_interval < rhs.min_interval) |
| return true; |
| if (rhs.min_interval < lhs.min_interval) |
| return false; |
| return false; |
| } |
| template <typename StructPtrType> |
| BackgroundSyncRegistrationInfoPtr BackgroundSyncRegistrationInfo::Clone() const { |
| return New( |
| mojo::Clone(service_worker_registration_id), |
| mojo::Clone(tag), |
| mojo::Clone(sync_type) |
| ); |
| } |
| |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>*> |
| bool BackgroundSyncRegistrationInfo::Equals(const T& other_struct) const { |
| if (!mojo::Equals(this->service_worker_registration_id, other_struct.service_worker_registration_id)) |
| return false; |
| if (!mojo::Equals(this->tag, other_struct.tag)) |
| return false; |
| if (!mojo::Equals(this->sync_type, other_struct.sync_type)) |
| return false; |
| return true; |
| } |
| |
| template <typename T, BackgroundSyncRegistrationInfo::EnableIfSame<T>*> |
| bool operator<(const T& lhs, const T& rhs) { |
| if (lhs.service_worker_registration_id < rhs.service_worker_registration_id) |
| return true; |
| if (rhs.service_worker_registration_id < lhs.service_worker_registration_id) |
| return false; |
| if (lhs.tag < rhs.tag) |
| return true; |
| if (rhs.tag < lhs.tag) |
| return false; |
| if (lhs.sync_type < rhs.sync_type) |
| return true; |
| if (rhs.sync_type < lhs.sync_type) |
| return false; |
| return false; |
| } |
| |
| |
| } // namespace mojom |
| } // namespace blink |
| |
| namespace mojo { |
| |
| |
| template <> |
| struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::SyncRegistrationOptions::DataView, |
| ::blink::mojom::SyncRegistrationOptionsPtr> { |
| static bool IsNull(const ::blink::mojom::SyncRegistrationOptionsPtr& input) { return !input; } |
| static void SetToNull(::blink::mojom::SyncRegistrationOptionsPtr* output) { output->reset(); } |
| |
| static const decltype(::blink::mojom::SyncRegistrationOptions::tag)& tag( |
| const ::blink::mojom::SyncRegistrationOptionsPtr& input) { |
| return input->tag; |
| } |
| |
| static decltype(::blink::mojom::SyncRegistrationOptions::min_interval) min_interval( |
| const ::blink::mojom::SyncRegistrationOptionsPtr& input) { |
| return input->min_interval; |
| } |
| |
| static bool Read(::blink::mojom::SyncRegistrationOptions::DataView input, ::blink::mojom::SyncRegistrationOptionsPtr* output); |
| }; |
| |
| |
| template <> |
| struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::BackgroundSyncRegistrationInfo::DataView, |
| ::blink::mojom::BackgroundSyncRegistrationInfoPtr> { |
| static bool IsNull(const ::blink::mojom::BackgroundSyncRegistrationInfoPtr& input) { return !input; } |
| static void SetToNull(::blink::mojom::BackgroundSyncRegistrationInfoPtr* output) { output->reset(); } |
| |
| static decltype(::blink::mojom::BackgroundSyncRegistrationInfo::service_worker_registration_id) service_worker_registration_id( |
| const ::blink::mojom::BackgroundSyncRegistrationInfoPtr& input) { |
| return input->service_worker_registration_id; |
| } |
| |
| static const decltype(::blink::mojom::BackgroundSyncRegistrationInfo::tag)& tag( |
| const ::blink::mojom::BackgroundSyncRegistrationInfoPtr& input) { |
| return input->tag; |
| } |
| |
| static decltype(::blink::mojom::BackgroundSyncRegistrationInfo::sync_type) sync_type( |
| const ::blink::mojom::BackgroundSyncRegistrationInfoPtr& input) { |
| return input->sync_type; |
| } |
| |
| static bool Read(::blink::mojom::BackgroundSyncRegistrationInfo::DataView input, ::blink::mojom::BackgroundSyncRegistrationInfoPtr* output); |
| }; |
| |
| } // namespace mojo |
| |
| #endif // THIRD_PARTY_BLINK_PUBLIC_MOJOM_BACKGROUND_SYNC_BACKGROUND_SYNC_MOJOM_H_ |
| |
| /* Metadata comment |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