| // 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 CONTENT_COMMON_FRAME_MESSAGES_MOJOM_H_ |
| #define CONTENT_COMMON_FRAME_MESSAGES_MOJOM_H_ |
| |
| #include <stdint.h> |
| |
| #include <limits> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/optional.h" |
| |
| #include "mojo/public/cpp/bindings/mojo_buildflags.h" |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| #include "base/trace_event/trace_event.h" |
| #endif |
| #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 "content/common/frame_messages.mojom-shared.h" |
| #include "content/common/frame_messages.mojom-forward.h" |
| #include "services/service_manager/public/mojom/interface_provider.mojom-forward.h" |
| #include "third_party/blink/public/mojom/frame/document_interface_broker.mojom-forward.h" |
| #include <string> |
| #include <vector> |
| |
| #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| #include "mojo/public/cpp/bindings/associated_interface_ptr_info.h" |
| #include "mojo/public/cpp/bindings/associated_interface_request.h" |
| #include "mojo/public/cpp/bindings/interface_ptr.h" |
| #include "mojo/public/cpp/bindings/interface_request.h" |
| #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
| #include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h" |
| #include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h" |
| |
| |
| #include "mojo/public/cpp/bindings/lib/native_enum_serialization.h" |
| #include "mojo/public/cpp/bindings/lib/native_struct_serialization.h" |
| #include "content/common/frame_messages_forward.h" |
| #include "content/common/content_export.h" |
| |
| #ifdef KYTHE_IS_RUNNING |
| #pragma kythe_inline_metadata "Metadata comment" |
| #endif |
| |
| |
| namespace content { |
| namespace mojom { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| // @generated_from: content.mojom.DidCommitProvisionalLoadInterfaceParams |
| class CONTENT_EXPORT DidCommitProvisionalLoadInterfaceParams { |
| public: |
| template <typename T> |
| using EnableIfSame = std::enable_if_t<std::is_same<DidCommitProvisionalLoadInterfaceParams, T>::value>; |
| using DataView = DidCommitProvisionalLoadInterfaceParamsDataView; |
| using Data_ = internal::DidCommitProvisionalLoadInterfaceParams_Data; |
| |
| template <typename... Args> |
| static DidCommitProvisionalLoadInterfaceParamsPtr New(Args&&... args) { |
| return DidCommitProvisionalLoadInterfaceParamsPtr( |
| base::in_place, std::forward<Args>(args)...); |
| } |
| |
| template <typename U> |
| static DidCommitProvisionalLoadInterfaceParamsPtr From(const U& u) { |
| return mojo::TypeConverter<DidCommitProvisionalLoadInterfaceParamsPtr, U>::Convert(u); |
| } |
| |
| template <typename U> |
| U To() const { |
| return mojo::TypeConverter<U, DidCommitProvisionalLoadInterfaceParams>::Convert(*this); |
| } |
| |
| |
| DidCommitProvisionalLoadInterfaceParams(); |
| |
| DidCommitProvisionalLoadInterfaceParams( |
| ::service_manager::mojom::InterfaceProviderRequest interface_provider_request, |
| ::blink::mojom::DocumentInterfaceBrokerRequest document_interface_broker_content_request, |
| ::blink::mojom::DocumentInterfaceBrokerRequest document_interface_broker_blink_request); |
| |
| ~DidCommitProvisionalLoadInterfaceParams(); |
| |
| // 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 = DidCommitProvisionalLoadInterfaceParamsPtr> |
| DidCommitProvisionalLoadInterfaceParamsPtr 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, DidCommitProvisionalLoadInterfaceParams::EnableIfSame<T>* = nullptr> |
| bool Equals(const T& other) const; |
| |
| template <typename UserType> |
| static std::vector<uint8_t> Serialize(UserType* input) { |
| return mojo::internal::SerializeImpl< |
| DidCommitProvisionalLoadInterfaceParams::DataView, std::vector<uint8_t>>(input); |
| } |
| |
| template <typename UserType> |
| static mojo::Message SerializeAsMessage(UserType* input) { |
| return mojo::internal::SerializeAsMessageImpl< |
| DidCommitProvisionalLoadInterfaceParams::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::DidCommitProvisionalLoadInterfaceParams_UnserializedMessageContext< |
| UserType, DidCommitProvisionalLoadInterfaceParams::DataView>>(0, 0, std::move(input))); |
| } |
| |
| template <typename UserType> |
| static bool Deserialize(const void* data, |
| size_t data_num_bytes, |
| UserType* output) { |
| return mojo::internal::DeserializeImpl<DidCommitProvisionalLoadInterfaceParams::DataView>( |
| data, data_num_bytes, std::vector<mojo::ScopedHandle>(), output, Validate); |
| } |
| |
| template <typename UserType> |
| static bool Deserialize(const std::vector<uint8_t>& input, |
| UserType* output) { |
| return DidCommitProvisionalLoadInterfaceParams::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::DidCommitProvisionalLoadInterfaceParams_UnserializedMessageContext< |
| UserType, DidCommitProvisionalLoadInterfaceParams::DataView>>(); |
| if (context) { |
| *output = std::move(context->TakeData()); |
| return true; |
| } |
| input.SerializeIfNecessary(); |
| return mojo::internal::DeserializeImpl<DidCommitProvisionalLoadInterfaceParams::DataView>( |
| input.payload(), input.payload_num_bytes(), |
| std::move(*input.mutable_handles()), output, Validate); |
| } |
| |
| |
| // @generated_from: content.mojom.DidCommitProvisionalLoadInterfaceParams.interface_provider_request |
| ::service_manager::mojom::InterfaceProviderRequest interface_provider_request; |
| |
| // @generated_from: content.mojom.DidCommitProvisionalLoadInterfaceParams.document_interface_broker_content_request |
| ::blink::mojom::DocumentInterfaceBrokerRequest document_interface_broker_content_request; |
| |
| // @generated_from: content.mojom.DidCommitProvisionalLoadInterfaceParams.document_interface_broker_blink_request |
| ::blink::mojom::DocumentInterfaceBrokerRequest document_interface_broker_blink_request; |
| |
| private: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| DISALLOW_COPY_AND_ASSIGN(DidCommitProvisionalLoadInterfaceParams); |
| }; |
| |
| // 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, DidCommitProvisionalLoadInterfaceParams::EnableIfSame<T>* = nullptr> |
| bool operator<(const T& lhs, const T& rhs); |
| |
| template <typename T, DidCommitProvisionalLoadInterfaceParams::EnableIfSame<T>* = nullptr> |
| bool operator<=(const T& lhs, const T& rhs) { |
| return !(rhs < lhs); |
| } |
| |
| template <typename T, DidCommitProvisionalLoadInterfaceParams::EnableIfSame<T>* = nullptr> |
| bool operator>(const T& lhs, const T& rhs) { |
| return rhs < lhs; |
| } |
| |
| template <typename T, DidCommitProvisionalLoadInterfaceParams::EnableIfSame<T>* = nullptr> |
| bool operator>=(const T& lhs, const T& rhs) { |
| return !(lhs < rhs); |
| } |
| |
| template <typename StructPtrType> |
| DidCommitProvisionalLoadInterfaceParamsPtr DidCommitProvisionalLoadInterfaceParams::Clone() const { |
| return New( |
| mojo::Clone(interface_provider_request), |
| mojo::Clone(document_interface_broker_content_request), |
| mojo::Clone(document_interface_broker_blink_request) |
| ); |
| } |
| |
| template <typename T, DidCommitProvisionalLoadInterfaceParams::EnableIfSame<T>*> |
| bool DidCommitProvisionalLoadInterfaceParams::Equals(const T& other_struct) const { |
| if (!mojo::Equals(this->interface_provider_request, other_struct.interface_provider_request)) |
| return false; |
| if (!mojo::Equals(this->document_interface_broker_content_request, other_struct.document_interface_broker_content_request)) |
| return false; |
| if (!mojo::Equals(this->document_interface_broker_blink_request, other_struct.document_interface_broker_blink_request)) |
| return false; |
| return true; |
| } |
| |
| template <typename T, DidCommitProvisionalLoadInterfaceParams::EnableIfSame<T>*> |
| bool operator<(const T& lhs, const T& rhs) { |
| if (lhs.interface_provider_request < rhs.interface_provider_request) |
| return true; |
| if (rhs.interface_provider_request < lhs.interface_provider_request) |
| return false; |
| if (lhs.document_interface_broker_content_request < rhs.document_interface_broker_content_request) |
| return true; |
| if (rhs.document_interface_broker_content_request < lhs.document_interface_broker_content_request) |
| return false; |
| if (lhs.document_interface_broker_blink_request < rhs.document_interface_broker_blink_request) |
| return true; |
| if (rhs.document_interface_broker_blink_request < lhs.document_interface_broker_blink_request) |
| return false; |
| return false; |
| } |
| |
| |
| } // namespace mojom |
| } // namespace content |
| |
| namespace mojo { |
| |
| |
| template <> |
| struct CONTENT_EXPORT StructTraits<::content::mojom::DidCommitProvisionalLoadInterfaceParams::DataView, |
| ::content::mojom::DidCommitProvisionalLoadInterfaceParamsPtr> { |
| static bool IsNull(const ::content::mojom::DidCommitProvisionalLoadInterfaceParamsPtr& input) { return !input; } |
| static void SetToNull(::content::mojom::DidCommitProvisionalLoadInterfaceParamsPtr* output) { output->reset(); } |
| |
| static decltype(::content::mojom::DidCommitProvisionalLoadInterfaceParams::interface_provider_request)& interface_provider_request( |
| ::content::mojom::DidCommitProvisionalLoadInterfaceParamsPtr& input) { |
| return input->interface_provider_request; |
| } |
| |
| static decltype(::content::mojom::DidCommitProvisionalLoadInterfaceParams::document_interface_broker_content_request)& document_interface_broker_content_request( |
| ::content::mojom::DidCommitProvisionalLoadInterfaceParamsPtr& input) { |
| return input->document_interface_broker_content_request; |
| } |
| |
| static decltype(::content::mojom::DidCommitProvisionalLoadInterfaceParams::document_interface_broker_blink_request)& document_interface_broker_blink_request( |
| ::content::mojom::DidCommitProvisionalLoadInterfaceParamsPtr& input) { |
| return input->document_interface_broker_blink_request; |
| } |
| |
| static bool Read(::content::mojom::DidCommitProvisionalLoadInterfaceParams::DataView input, ::content::mojom::DidCommitProvisionalLoadInterfaceParamsPtr* output); |
| }; |
| |
| } // namespace mojo |
| |
| #endif // CONTENT_COMMON_FRAME_MESSAGES_MOJOM_H_
|
|
|
| /* Metadata comment
|
| eyJtZXRhIjogW3siZW5kIjogMjE5MiwgImJlZ2luIjogMjE1MywgImVkZ2UiOiAiJS9reXRoZS9l
|
| ZGdlL2dlbmVyYXRlcyIsICJ0eXBlIjogImFuY2hvcl9kZWZpbmVzIiwgInZuYW1lIjogeyJjb3Jw
|
| dXMiOiAiY2hyb21pdW0uZ29vZ2xlc291cmNlLmNvbS9jaHJvbWl1bS9zcmMiLCAibGFuZ3VhZ2Ui
|
| OiAibW9qb20iLCAic2lnbmF0dXJlIjogImNvbnRlbnQubW9qb20uRGlkQ29tbWl0UHJvdmlzaW9u
|
| YWxMb2FkSW50ZXJmYWNlUGFyYW1zIn19LCB7ImVuZCI6IDY2MzIsICJiZWdpbiI6IDY2MDYsICJl
|
| ZGdlIjogIiUva3l0aGUvZWRnZS9nZW5lcmF0ZXMiLCAidHlwZSI6ICJhbmNob3JfZGVmaW5lcyIs
|
| ICJ2bmFtZSI6IHsiY29ycHVzIjogImNocm9taXVtLmdvb2dsZXNvdXJjZS5jb20vY2hyb21pdW0v
|
| c3JjIiwgImxhbmd1YWdlIjogIm1vam9tIiwgInNpZ25hdHVyZSI6ICJjb250ZW50Lm1vam9tLkRp
|
| ZENvbW1pdFByb3Zpc2lvbmFsTG9hZEludGVyZmFjZVBhcmFtcy5pbnRlcmZhY2VfcHJvdmlkZXJf
|
| cmVxdWVzdCJ9fSwgeyJlbmQiOiA2ODQzLCAiYmVnaW4iOiA2ODAyLCAiZWRnZSI6ICIlL2t5dGhl
|
| L2VkZ2UvZ2VuZXJhdGVzIiwgInR5cGUiOiAiYW5jaG9yX2R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