blob: 77f315eda5ac04701940f9bd34d66acf1c9a9c8c [file] [log] [blame]
// services/network/public/mojom/client_security_state.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 SERVICES_NETWORK_PUBLIC_MOJOM_CLIENT_SECURITY_STATE_MOJOM_H_
#define SERVICES_NETWORK_PUBLIC_MOJOM_CLIENT_SECURITY_STATE_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 "services/network/public/mojom/client_security_state.mojom-shared.h"
#include "services/network/public/mojom/client_security_state.mojom-forward.h"
#include "services/network/public/mojom/cross_origin_embedder_policy.mojom.h"
#include "services/network/public/mojom/ip_address_space.mojom-forward.h"
#include <string>
#include <vector>
#ifdef KYTHE_IS_RUNNING
#pragma kythe_inline_metadata "Metadata comment"
#endif
namespace network {
namespace mojom {
// @generated_from: network.mojom.ClientSecurityState
class ClientSecurityState {
public:
template <typename T>
using EnableIfSame = std::enable_if_t<std::is_same<ClientSecurityState, T>::value>;
using DataView = ClientSecurityStateDataView;
using Data_ = internal::ClientSecurityState_Data;
template <typename... Args>
static ClientSecurityStatePtr New(Args&&... args) {
return ClientSecurityStatePtr(
absl::in_place, std::forward<Args>(args)...);
}
template <typename U>
static ClientSecurityStatePtr From(const U& u) {
return mojo::TypeConverter<ClientSecurityStatePtr, U>::Convert(u);
}
template <typename U>
U To() const {
return mojo::TypeConverter<U, ClientSecurityState>::Convert(*this);
}
ClientSecurityState();
ClientSecurityState(
const ::network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy,
bool is_web_secure_context,
::network::mojom::IPAddressSpace ip_address_space,
PrivateNetworkRequestPolicy private_network_request_policy);
~ClientSecurityState();
// 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 = ClientSecurityStatePtr>
ClientSecurityStatePtr 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, ClientSecurityState::EnableIfSame<T>* = nullptr>
bool Equals(const T& other) const;
template <typename T, ClientSecurityState::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<
ClientSecurityState::DataView, std::vector<uint8_t>>(input);
}
template <typename UserType>
static mojo::Message SerializeAsMessage(UserType* input) {
return mojo::internal::SerializeAsMessageImpl<
ClientSecurityState::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::ClientSecurityState_UnserializedMessageContext<
UserType, ClientSecurityState::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<ClientSecurityState::DataView>(
message, data, data_num_bytes, output, Validate);
}
template <typename UserType>
static bool Deserialize(const std::vector<uint8_t>& input,
UserType* output) {
return ClientSecurityState::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::ClientSecurityState_UnserializedMessageContext<
UserType, ClientSecurityState::DataView>>();
if (context) {
*output = std::move(context->TakeData());
return true;
}
input.SerializeIfNecessary();
return mojo::internal::DeserializeImpl<ClientSecurityState::DataView>(
input, input.payload(), input.payload_num_bytes(), output, Validate);
}
// @generated_from: network.mojom.ClientSecurityState.cross_origin_embedder_policy
::network::CrossOriginEmbedderPolicy cross_origin_embedder_policy;
// @generated_from: network.mojom.ClientSecurityState.is_web_secure_context
bool is_web_secure_context;
// @generated_from: network.mojom.ClientSecurityState.ip_address_space
::network::mojom::IPAddressSpace ip_address_space;
// @generated_from: network.mojom.ClientSecurityState.private_network_request_policy
PrivateNetworkRequestPolicy private_network_request_policy;
// 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, ClientSecurityState::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, ClientSecurityState::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
return !(rhs < lhs);
}
template <typename T, ClientSecurityState::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
return rhs < lhs;
}
template <typename T, ClientSecurityState::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
return !(lhs < rhs);
}
template <typename StructPtrType>
ClientSecurityStatePtr ClientSecurityState::Clone() const {
return New(
mojo::Clone(cross_origin_embedder_policy),
mojo::Clone(is_web_secure_context),
mojo::Clone(ip_address_space),
mojo::Clone(private_network_request_policy)
);
}
template <typename T, ClientSecurityState::EnableIfSame<T>*>
bool ClientSecurityState::Equals(const T& other_struct) const {
if (!mojo::Equals(this->cross_origin_embedder_policy, other_struct.cross_origin_embedder_policy))
return false;
if (!mojo::Equals(this->is_web_secure_context, other_struct.is_web_secure_context))
return false;
if (!mojo::Equals(this->ip_address_space, other_struct.ip_address_space))
return false;
if (!mojo::Equals(this->private_network_request_policy, other_struct.private_network_request_policy))
return false;
return true;
}
template <typename T, ClientSecurityState::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
if (lhs.cross_origin_embedder_policy < rhs.cross_origin_embedder_policy)
return true;
if (rhs.cross_origin_embedder_policy < lhs.cross_origin_embedder_policy)
return false;
if (lhs.is_web_secure_context < rhs.is_web_secure_context)
return true;
if (rhs.is_web_secure_context < lhs.is_web_secure_context)
return false;
if (lhs.ip_address_space < rhs.ip_address_space)
return true;
if (rhs.ip_address_space < lhs.ip_address_space)
return false;
if (lhs.private_network_request_policy < rhs.private_network_request_policy)
return true;
if (rhs.private_network_request_policy < lhs.private_network_request_policy)
return false;
return false;
}
} // namespace mojom
} // namespace network
namespace mojo {
template <>
struct StructTraits<::network::mojom::ClientSecurityState::DataView,
::network::mojom::ClientSecurityStatePtr> {
static bool IsNull(const ::network::mojom::ClientSecurityStatePtr& input) { return !input; }
static void SetToNull(::network::mojom::ClientSecurityStatePtr* output) { output->reset(); }
static const decltype(::network::mojom::ClientSecurityState::cross_origin_embedder_policy)& cross_origin_embedder_policy(
const ::network::mojom::ClientSecurityStatePtr& input) {
return input->cross_origin_embedder_policy;
}
static decltype(::network::mojom::ClientSecurityState::is_web_secure_context) is_web_secure_context(
const ::network::mojom::ClientSecurityStatePtr& input) {
return input->is_web_secure_context;
}
static decltype(::network::mojom::ClientSecurityState::ip_address_space) ip_address_space(
const ::network::mojom::ClientSecurityStatePtr& input) {
return input->ip_address_space;
}
static decltype(::network::mojom::ClientSecurityState::private_network_request_policy) private_network_request_policy(
const ::network::mojom::ClientSecurityStatePtr& input) {
return input->private_network_request_policy;
}
static bool Read(::network::mojom::ClientSecurityState::DataView input, ::network::mojom::ClientSecurityStatePtr* output);
};
} // namespace mojo
#endif // SERVICES_NETWORK_PUBLIC_MOJOM_CLIENT_SECURITY_STATE_MOJOM_H_
/* Metadata comment
eyJtZXRhIjogW3siZW5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