| // Copyright 2016 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_SHARED_H_ |
| #define CONTENT_COMMON_FRAME_MESSAGES_MOJOM_SHARED_H_ |
| |
| #include <stdint.h> |
| |
| #include <functional> |
| #include <ostream> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "base/compiler_specific.h" |
| #include "base/containers/flat_map.h" |
| #include "mojo/public/cpp/bindings/array_data_view.h" |
| #include "mojo/public/cpp/bindings/enum_traits.h" |
| #include "mojo/public/cpp/bindings/interface_data_view.h" |
| #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
| #include "mojo/public/cpp/bindings/lib/serialization.h" |
| #include "mojo/public/cpp/bindings/map_data_view.h" |
| #include "mojo/public/cpp/bindings/string_data_view.h" |
| #include "content/common/frame_messages.mojom-shared-internal.h" |
| #include "services/service_manager/public/mojom/interface_provider.mojom-shared.h" |
| #include "third_party/blink/public/mojom/frame/document_interface_broker.mojom-shared.h" |
| |
| #include "mojo/public/cpp/bindings/lib/interface_serialization.h" |
| |
| |
| #include "mojo/public/cpp/bindings/native_enum.h" |
| #include "mojo/public/cpp/bindings/lib/native_struct_serialization.h" |
| #include "base/component_export.h" |
| |
| #ifdef KYTHE_IS_RUNNING |
| #pragma kythe_inline_metadata "Metadata comment" |
| #endif |
| |
| |
| namespace content { |
| namespace mojom { |
| using DidCommitProvisionalLoadParamsDataView = mojo::native::NativeStructDataView; |
| |
| class DidCommitProvisionalLoadInterfaceParamsDataView; |
| |
| |
| |
| } // namespace mojom |
| } // namespace content |
| |
| namespace mojo { |
| namespace internal { |
| |
| template <> |
| struct MojomTypeTraits<::content::mojom::DidCommitProvisionalLoadInterfaceParamsDataView> { |
| using Data = ::content::mojom::internal::DidCommitProvisionalLoadInterfaceParams_Data; |
| using DataAsArrayElement = Pointer<Data>; |
| static constexpr MojomTypeCategory category = MojomTypeCategory::STRUCT; |
| }; |
| |
| } // namespace internal |
| } // namespace mojo |
| |
| |
| namespace content { |
| namespace mojom { |
| class DidCommitProvisionalLoadInterfaceParamsDataView { |
| public: |
| DidCommitProvisionalLoadInterfaceParamsDataView() {} |
| |
| DidCommitProvisionalLoadInterfaceParamsDataView( |
| internal::DidCommitProvisionalLoadInterfaceParams_Data* data, |
| mojo::internal::SerializationContext* context) |
| : data_(data), context_(context) {} |
| |
| bool is_null() const { return !data_; } |
| template <typename UserType> |
| UserType TakeInterfaceProviderRequest() { |
| UserType result; |
| bool ret = |
| mojo::internal::Deserialize<::service_manager::mojom::InterfaceProviderRequestDataView>( |
| &data_->interface_provider_request, &result, context_); |
| DCHECK(ret); |
| return result; |
| } |
| template <typename UserType> |
| UserType TakeDocumentInterfaceBrokerContentRequest() { |
| UserType result; |
| bool ret = |
| mojo::internal::Deserialize<::blink::mojom::DocumentInterfaceBrokerRequestDataView>( |
| &data_->document_interface_broker_content_request, &result, context_); |
| DCHECK(ret); |
| return result; |
| } |
| template <typename UserType> |
| UserType TakeDocumentInterfaceBrokerBlinkRequest() { |
| UserType result; |
| bool ret = |
| mojo::internal::Deserialize<::blink::mojom::DocumentInterfaceBrokerRequestDataView>( |
| &data_->document_interface_broker_blink_request, &result, context_); |
| DCHECK(ret); |
| return result; |
| } |
| private: |
| internal::DidCommitProvisionalLoadInterfaceParams_Data* data_ = nullptr; |
| mojo::internal::SerializationContext* context_ = nullptr; |
| }; |
| |
| |
| |
| } // namespace mojom |
| } // namespace content |
| |
| namespace std { |
| |
| } // namespace std |
| |
| namespace mojo { |
| |
| |
| namespace internal { |
| |
| template <typename MaybeConstUserType> |
| struct Serializer<::content::mojom::DidCommitProvisionalLoadInterfaceParamsDataView, MaybeConstUserType> { |
| using UserType = typename std::remove_const<MaybeConstUserType>::type; |
| using Traits = StructTraits<::content::mojom::DidCommitProvisionalLoadInterfaceParamsDataView, UserType>; |
| |
| static void Serialize(MaybeConstUserType& input, |
| Buffer* buffer, |
| ::content::mojom::internal::DidCommitProvisionalLoadInterfaceParams_Data::BufferWriter* output, |
| SerializationContext* context) { |
| if (CallIsNullIfExists<Traits>(input)) |
| return; |
| (*output).Allocate(buffer); |
| decltype(Traits::interface_provider_request(input)) in_interface_provider_request = Traits::interface_provider_request(input); |
| mojo::internal::Serialize<::service_manager::mojom::InterfaceProviderRequestDataView>( |
| in_interface_provider_request, &(*output)->interface_provider_request, context); |
| MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( |
| !mojo::internal::IsHandleOrInterfaceValid((*output)->interface_provider_request), |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE, |
| "invalid interface_provider_request in DidCommitProvisionalLoadInterfaceParams struct"); |
| decltype(Traits::document_interface_broker_content_request(input)) in_document_interface_broker_content_request = Traits::document_interface_broker_content_request(input); |
| mojo::internal::Serialize<::blink::mojom::DocumentInterfaceBrokerRequestDataView>( |
| in_document_interface_broker_content_request, &(*output)->document_interface_broker_content_request, context); |
| MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( |
| !mojo::internal::IsHandleOrInterfaceValid((*output)->document_interface_broker_content_request), |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE, |
| "invalid document_interface_broker_content_request in DidCommitProvisionalLoadInterfaceParams struct"); |
| decltype(Traits::document_interface_broker_blink_request(input)) in_document_interface_broker_blink_request = Traits::document_interface_broker_blink_request(input); |
| mojo::internal::Serialize<::blink::mojom::DocumentInterfaceBrokerRequestDataView>( |
| in_document_interface_broker_blink_request, &(*output)->document_interface_broker_blink_request, context); |
| MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( |
| !mojo::internal::IsHandleOrInterfaceValid((*output)->document_interface_broker_blink_request), |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE, |
| "invalid document_interface_broker_blink_request in DidCommitProvisionalLoadInterfaceParams struct"); |
| } |
| |
| static bool Deserialize(::content::mojom::internal::DidCommitProvisionalLoadInterfaceParams_Data* input, |
| UserType* output, |
| SerializationContext* context) { |
| if (!input) |
| return CallSetToNullIfExists<Traits>(output); |
| |
| ::content::mojom::DidCommitProvisionalLoadInterfaceParamsDataView data_view(input, context); |
| return Traits::Read(data_view, output); |
| } |
| }; |
| |
| } // namespace internal |
| |
| } // namespace mojo |
| |
| |
| namespace content { |
| namespace mojom { |
| |
| |
| |
| |
| } // namespace mojom |
| } // namespace content |
| |
| #endif // CONTENT_COMMON_FRAME_MESSAGES_MOJOM_SHARED_H_
|
|
|
| /* Metadata comment
|
| eyJtZXRhIjogW10sICJ0eXBlIjogImt5dGhlMCJ9
|
| */ |