| // components/services/storage/shared_storage/public/mojom/shared_storage.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 COMPONENTS_SERVICES_STORAGE_SHARED_STORAGE_PUBLIC_MOJOM_SHARED_STORAGE_MOJOM_H_ |
| #define COMPONENTS_SERVICES_STORAGE_SHARED_STORAGE_PUBLIC_MOJOM_SHARED_STORAGE_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 "components/services/storage/shared_storage/public/mojom/shared_storage.mojom-shared.h" |
| #include "components/services/storage/shared_storage/public/mojom/shared_storage.mojom-forward.h" |
| #include "mojo/public/mojom/base/string16.mojom.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" |
| |
| |
| |
| #ifdef KYTHE_IS_RUNNING |
| #pragma kythe_inline_metadata "Metadata comment" |
| #endif |
| |
| |
| namespace shared_storage_worklet { |
| namespace mojom { |
| |
| class SharedStorageEntriesListenerProxy; |
| |
| template <typename ImplRefTraits> |
| class SharedStorageEntriesListenerStub; |
| |
| class SharedStorageEntriesListenerRequestValidator; |
| |
| |
| // @generated_from: shared_storage_worklet.mojom.SharedStorageEntriesListener |
| class SharedStorageEntriesListener |
| : public SharedStorageEntriesListenerInterfaceBase { |
| 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_ = SharedStorageEntriesListenerInterfaceBase; |
| using Proxy_ = SharedStorageEntriesListenerProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = SharedStorageEntriesListenerStub<ImplRefTraits>; |
| |
| using RequestValidator_ = SharedStorageEntriesListenerRequestValidator; |
| using ResponseValidator_ = mojo::PassThroughFilter; |
| enum MethodMinVersions : uint32_t { |
| kDidReadEntriesMinVersion = 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 DidReadEntries_Sym { |
| NOINLINE static void IPCSymbol(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~SharedStorageEntriesListener() = default; |
| |
| |
| // @generated_from: shared_storage_worklet.mojom.SharedStorageEntriesListener.DidReadEntries |
| virtual void DidReadEntries(bool success, const std::string& error_message, std::vector<SharedStorageKeyAndOrValuePtr> entries, bool has_more_entries) = 0; |
| }; |
| |
| |
| |
| // @generated_from: shared_storage_worklet.mojom.SharedStorageEntriesListener |
| class SharedStorageEntriesListenerProxy |
| : public SharedStorageEntriesListener { |
| public: |
| using InterfaceType = SharedStorageEntriesListener; |
| |
| explicit SharedStorageEntriesListenerProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| // @generated_from: shared_storage_worklet.mojom.SharedStorageEntriesListener.DidReadEntries |
| void DidReadEntries(bool success, const std::string& error_message, std::vector<SharedStorageKeyAndOrValuePtr> entries, bool has_more_entries) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| class SharedStorageEntriesListenerStubDispatch { |
| public: |
| static bool Accept(SharedStorageEntriesListener* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| SharedStorageEntriesListener* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<SharedStorageEntriesListener>> |
| class SharedStorageEntriesListenerStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| SharedStorageEntriesListenerStub() = default; |
| ~SharedStorageEntriesListenerStub() 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 SharedStorageEntriesListenerStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return SharedStorageEntriesListenerStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class SharedStorageEntriesListenerRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| // @generated_from: shared_storage_worklet.mojom.SharedStorageKeyAndOrValue |
| class SharedStorageKeyAndOrValue { |
| public: |
| template <typename T> |
| using EnableIfSame = std::enable_if_t<std::is_same<SharedStorageKeyAndOrValue, T>::value>; |
| using DataView = SharedStorageKeyAndOrValueDataView; |
| using Data_ = internal::SharedStorageKeyAndOrValue_Data; |
| |
| template <typename... Args> |
| static SharedStorageKeyAndOrValuePtr New(Args&&... args) { |
| return SharedStorageKeyAndOrValuePtr( |
| absl::in_place, std::forward<Args>(args)...); |
| } |
| |
| template <typename U> |
| static SharedStorageKeyAndOrValuePtr From(const U& u) { |
| return mojo::TypeConverter<SharedStorageKeyAndOrValuePtr, U>::Convert(u); |
| } |
| |
| template <typename U> |
| U To() const { |
| return mojo::TypeConverter<U, SharedStorageKeyAndOrValue>::Convert(*this); |
| } |
| |
| |
| SharedStorageKeyAndOrValue(); |
| |
| SharedStorageKeyAndOrValue( |
| const ::std::u16string& key, |
| const ::std::u16string& value); |
| |
| |
| ~SharedStorageKeyAndOrValue(); |
| |
| // 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 = SharedStorageKeyAndOrValuePtr> |
| SharedStorageKeyAndOrValuePtr 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, SharedStorageKeyAndOrValue::EnableIfSame<T>* = nullptr> |
| bool Equals(const T& other) const; |
| |
| template <typename T, SharedStorageKeyAndOrValue::EnableIfSame<T>* = nullptr> |
| bool operator==(const T& rhs) const { return Equals(rhs); } |
| template <typename UserType> |
| static std::vector<uint8_t> Serialize(UserType* input) { |
| return mojo::internal::SerializeImpl< |
| SharedStorageKeyAndOrValue::DataView, std::vector<uint8_t>>(input); |
| } |
| |
| template <typename UserType> |
| static mojo::Message SerializeAsMessage(UserType* input) { |
| return mojo::internal::SerializeAsMessageImpl< |
| SharedStorageKeyAndOrValue::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::SharedStorageKeyAndOrValue_UnserializedMessageContext< |
| UserType, SharedStorageKeyAndOrValue::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<SharedStorageKeyAndOrValue::DataView>( |
| message, data, data_num_bytes, output, Validate); |
| } |
| |
| template <typename UserType> |
| static bool Deserialize(const std::vector<uint8_t>& input, |
| UserType* output) { |
| return SharedStorageKeyAndOrValue::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::SharedStorageKeyAndOrValue_UnserializedMessageContext< |
| UserType, SharedStorageKeyAndOrValue::DataView>>(); |
| if (context) { |
| *output = std::move(context->TakeData()); |
| return true; |
| } |
| input.SerializeIfNecessary(); |
| return mojo::internal::DeserializeImpl<SharedStorageKeyAndOrValue::DataView>( |
| input, input.payload(), input.payload_num_bytes(), output, Validate); |
| } |
| |
| |
| // @generated_from: shared_storage_worklet.mojom.SharedStorageKeyAndOrValue.key |
| ::std::u16string key; |
| |
| // @generated_from: shared_storage_worklet.mojom.SharedStorageKeyAndOrValue.value |
| ::std::u16string value; |
| |
| // 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, SharedStorageKeyAndOrValue::EnableIfSame<T>* = nullptr> |
| bool operator<(const T& lhs, const T& rhs); |
| |
| template <typename T, SharedStorageKeyAndOrValue::EnableIfSame<T>* = nullptr> |
| bool operator<=(const T& lhs, const T& rhs) { |
| return !(rhs < lhs); |
| } |
| |
| template <typename T, SharedStorageKeyAndOrValue::EnableIfSame<T>* = nullptr> |
| bool operator>(const T& lhs, const T& rhs) { |
| return rhs < lhs; |
| } |
| |
| template <typename T, SharedStorageKeyAndOrValue::EnableIfSame<T>* = nullptr> |
| bool operator>=(const T& lhs, const T& rhs) { |
| return !(lhs < rhs); |
| } |
| |
| template <typename StructPtrType> |
| SharedStorageKeyAndOrValuePtr SharedStorageKeyAndOrValue::Clone() const { |
| return New( |
| mojo::Clone(key), |
| mojo::Clone(value) |
| ); |
| } |
| |
| template <typename T, SharedStorageKeyAndOrValue::EnableIfSame<T>*> |
| bool SharedStorageKeyAndOrValue::Equals(const T& other_struct) const { |
| if (!mojo::Equals(this->key, other_struct.key)) |
| return false; |
| if (!mojo::Equals(this->value, other_struct.value)) |
| return false; |
| return true; |
| } |
| |
| template <typename T, SharedStorageKeyAndOrValue::EnableIfSame<T>*> |
| bool operator<(const T& lhs, const T& rhs) { |
| if (lhs.key < rhs.key) |
| return true; |
| if (rhs.key < lhs.key) |
| return false; |
| if (lhs.value < rhs.value) |
| return true; |
| if (rhs.value < lhs.value) |
| return false; |
| return false; |
| } |
| |
| |
| } // namespace mojom |
| } // namespace shared_storage_worklet |
| |
| namespace mojo { |
| |
| |
| template <> |
| struct StructTraits<::shared_storage_worklet::mojom::SharedStorageKeyAndOrValue::DataView, |
| ::shared_storage_worklet::mojom::SharedStorageKeyAndOrValuePtr> { |
| static bool IsNull(const ::shared_storage_worklet::mojom::SharedStorageKeyAndOrValuePtr& input) { return !input; } |
| static void SetToNull(::shared_storage_worklet::mojom::SharedStorageKeyAndOrValuePtr* output) { output->reset(); } |
| |
| static const decltype(::shared_storage_worklet::mojom::SharedStorageKeyAndOrValue::key)& key( |
| const ::shared_storage_worklet::mojom::SharedStorageKeyAndOrValuePtr& input) { |
| return input->key; |
| } |
| |
| static const decltype(::shared_storage_worklet::mojom::SharedStorageKeyAndOrValue::value)& value( |
| const ::shared_storage_worklet::mojom::SharedStorageKeyAndOrValuePtr& input) { |
| return input->value; |
| } |
| |
| static bool Read(::shared_storage_worklet::mojom::SharedStorageKeyAndOrValue::DataView input, ::shared_storage_worklet::mojom::SharedStorageKeyAndOrValuePtr* output); |
| }; |
| |
| } // namespace mojo |
| |
| #endif // COMPONENTS_SERVICES_STORAGE_SHARED_STORAGE_PUBLIC_MOJOM_SHARED_STORAGE_MOJOM_H_ |
| |
| /* Metadata comment |
| eyJtZXRhIjogW3siZW5kIjogMTg1MywgImJlZ2luIjogMTgyNSwgImVkZ2UiOiAiJS9reXRoZS9l |
| ZGdlL2dlbmVyYXRlcyIsICJ0eXBlIjogImFuY2hvcl9kZWZpbmVzIiwgInZuYW1lIjogeyJjb3Jw |
| dXMiOiAiY2hyb21pdW0uZ29vZ2xlc291cmNlLmNvbS9jaHJvbWl1bS9zcmMiLCAibGFuZ3VhZ2Ui |
| OiAibW9qb20iLCAic2lnbmF0dXJlIjogInNoYXJlZF9zdG9yYWdlX3dvcmtsZXQubW9qb20uU2hh |
| cmVkU3RvcmFnZUVudHJpZXNMaXN0ZW5lciJ9fSwgeyJlbmQiOiAzMTY5LCAiYmVnaW4iOiAzMTU1 |
| LCAiZWRnZSI6ICIlL2t5dGhlL2VkZ2UvZ2VuZXJhdGVzIiwgInR5cGUiOiAiYW5jaG9yX2RlZmlu |
| ZXMiLCAidm5hbWUiOiB7ImNvcnB1cyI6ICJjaHJvbWl1bS5nb29nbGVzb3VyY2UuY29tL2Nocm9t |
| aXVtL3NyYyIsICJsYW5ndWFnZSI6ICJtb2pvbSIsICJzaWduYXR1cmUiOiAic2hhcmVkX3N0b3Jh |
| Z2Vfd29ya2xldC5tb2pvbS5TaGFyZWRTdG9yYWdlRW50cmllc0xpc3RlbmVyLkRpZFJlYWRFbnRy |
| aWVzIn19LCB7ImVuZCI6IDM3NDAsICJiZWdpbiI6IDM3MjYsICJlZGdlIjogIiUva3l0aGUvZWRn |
| ZS9nZW5lcmF0ZXMiLCAidHlwZSI6ICJhbmNob3JfZGVmaW5lcyIsICJ2bmFtZSI6IHsiY29ycHVz |
| IjogImNocm9taXVtLmdvb2dsZXNvdXJjZS5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