blob: 36da84e7cad85fa78a3ef526bc1658b94389619b [file] [log] [blame]
// mojo/public/interfaces/bindings/tests/test_export.mojom-blink.h is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_TEST_EXPORT_MOJOM_BLINK_H_
#define MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_TEST_EXPORT_MOJOM_BLINK_H_
#include <stdint.h>
#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "base/types/cxx23_to_underlying.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 "mojo/public/interfaces/bindings/tests/test_export.mojom-features.h"
#include "mojo/public/interfaces/bindings/tests/test_export.mojom-shared.h"
#include "mojo/public/interfaces/bindings/tests/test_export.mojom-blink-forward.h"
#include "mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h"
#include "mojo/public/cpp/bindings/lib/wtf_hash_util.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/lib/message_size_estimator.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"
#include "mojo/public/cpp/bindings/tests/mojo_test_blink_export.h"
#ifdef KYTHE_IS_RUNNING
#pragma kythe_inline_metadata "Metadata comment"
#endif
namespace mojo::test::test_export::blink {
class ExportedInterfaceProxy;
template <typename ImplRefTraits>
class ExportedInterfaceStub;
class ExportedInterfaceRequestValidator;
// @generated_from: mojo.test.test_export.ExportedInterface
class MOJO_TEST_BLINK_EXPORT ExportedInterface
: public ExportedInterfaceInterfaceBase {
public:
using IPCStableHashFunction = uint32_t(*)();
static const char Name_[];
static IPCStableHashFunction 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 HasUninterruptableMethods_ = false;
using Base_ = ExportedInterfaceInterfaceBase;
using Proxy_ = ExportedInterfaceProxy;
template <typename ImplRefTraits>
using Stub_ = ExportedInterfaceStub<ImplRefTraits>;
using RequestValidator_ = ExportedInterfaceRequestValidator;
using ResponseValidator_ = mojo::PassThroughFilter;
enum MethodMinVersions : uint32_t {
};
// 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)
#endif // !BUILDFLAG(IS_FUCHSIA)
virtual ~ExportedInterface() = default;
};
// @generated_from: mojo.test.test_export.ExportedInterface
class MOJO_TEST_BLINK_EXPORT ExportedInterfaceProxy
: public ExportedInterface {
public:
using InterfaceType = ExportedInterface;
explicit ExportedInterfaceProxy(mojo::MessageReceiverWithResponder* receiver);
private:
mojo::MessageReceiverWithResponder* receiver_;
};
class MOJO_TEST_BLINK_EXPORT ExportedInterfaceStubDispatch {
public:
static bool Accept(ExportedInterface* impl, mojo::Message* message);
static bool AcceptWithResponder(
ExportedInterface* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};
template <typename ImplRefTraits =
mojo::RawPtrImplRefTraits<ExportedInterface>>
class ExportedInterfaceStub
: public mojo::MessageReceiverWithResponderStatus {
public:
using ImplPointerType = typename ImplRefTraits::PointerType;
ExportedInterfaceStub() = default;
~ExportedInterfaceStub() 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 ExportedInterfaceStubDispatch::Accept(
ImplRefTraits::GetRawPointer(&sink_), message);
}
bool AcceptWithResponder(
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
if (ImplRefTraits::IsNull(sink_))
return false;
return ExportedInterfaceStubDispatch::AcceptWithResponder(
ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
}
private:
ImplPointerType sink_;
};
class MOJO_TEST_BLINK_EXPORT ExportedInterfaceRequestValidator : public mojo::MessageReceiver {
public:
bool Accept(mojo::Message* message) override;
};
// @generated_from: mojo.test.test_export.StringPair
class MOJO_TEST_BLINK_EXPORT StringPair {
public:
template <typename T>
using EnableIfSame = std::enable_if_t<std::is_same<StringPair, T>::value>;
using DataView = StringPairDataView;
using Data_ = internal::StringPair_Data;
template <typename... Args>
static StringPairPtr New(Args&&... args) {
return StringPairPtr(
std::in_place, std::forward<Args>(args)...);
}
template <typename U>
static StringPairPtr From(const U& u) {
return mojo::TypeConverter<StringPairPtr, U>::Convert(u);
}
template <typename U>
U To() const {
return mojo::TypeConverter<U, StringPair>::Convert(*this);
}
StringPair();
StringPair(
const WTF::String& s1,
const WTF::String& s2);
~StringPair();
// 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 = StringPairPtr>
StringPairPtr 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, StringPair::EnableIfSame<T>* = nullptr>
bool Equals(const T& other) const;
template <typename T, StringPair::EnableIfSame<T>* = nullptr>
bool operator==(const T& rhs) const { return Equals(rhs); }
template <typename T, StringPair::EnableIfSame<T>* = nullptr>
bool operator!=(const T& rhs) const { return !operator==(rhs); }
size_t Hash(size_t seed) const;
template <typename UserType>
static WTF::Vector<uint8_t> Serialize(UserType* input) {
return mojo::internal::SerializeImpl<
StringPair::DataView, WTF::Vector<uint8_t>>(input);
}
template <typename UserType>
static mojo::Message SerializeAsMessage(UserType* input) {
return mojo::internal::SerializeAsMessageImpl<
StringPair::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::StringPair_UnserializedMessageContext<
UserType, StringPair::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<StringPair::DataView>(
message, data, data_num_bytes, output, Validate);
}
template <typename UserType>
static bool Deserialize(const WTF::Vector<uint8_t>& input,
UserType* output) {
return StringPair::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::StringPair_UnserializedMessageContext<
UserType, StringPair::DataView>>();
if (context) {
*output = std::move(context->TakeData());
return true;
}
input.SerializeIfNecessary();
return mojo::internal::DeserializeImpl<StringPair::DataView>(
input, input.payload(), input.payload_num_bytes(), output, Validate);
}
// @generated_from: mojo.test.test_export.StringPair.s1
WTF::String s1;
// @generated_from: mojo.test.test_export.StringPair.s2
WTF::String s2;
// 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, StringPair::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, StringPair::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
return !(rhs < lhs);
}
template <typename T, StringPair::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
return rhs < lhs;
}
template <typename T, StringPair::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
return !(lhs < rhs);
}
// @generated_from: mojo.test.test_export.StringPairContainer
class MOJO_TEST_BLINK_EXPORT StringPairContainer {
public:
template <typename T>
using EnableIfSame = std::enable_if_t<std::is_same<StringPairContainer, T>::value>;
using DataView = StringPairContainerDataView;
using Data_ = internal::StringPairContainer_Data;
template <typename... Args>
static StringPairContainerPtr New(Args&&... args) {
return StringPairContainerPtr(
std::in_place, std::forward<Args>(args)...);
}
template <typename U>
static StringPairContainerPtr From(const U& u) {
return mojo::TypeConverter<StringPairContainerPtr, U>::Convert(u);
}
template <typename U>
U To() const {
return mojo::TypeConverter<U, StringPairContainer>::Convert(*this);
}
StringPairContainer();
explicit StringPairContainer(
WTF::Vector<StringPairPtr> pairs);
StringPairContainer(const StringPairContainer&) = delete;
StringPairContainer& operator=(const StringPairContainer&) = delete;
~StringPairContainer();
// 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 = StringPairContainerPtr>
StringPairContainerPtr 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, StringPairContainer::EnableIfSame<T>* = nullptr>
bool Equals(const T& other) const;
template <typename T, StringPairContainer::EnableIfSame<T>* = nullptr>
bool operator==(const T& rhs) const { return Equals(rhs); }
template <typename T, StringPairContainer::EnableIfSame<T>* = nullptr>
bool operator!=(const T& rhs) const { return !operator==(rhs); }
template <typename UserType>
static WTF::Vector<uint8_t> Serialize(UserType* input) {
return mojo::internal::SerializeImpl<
StringPairContainer::DataView, WTF::Vector<uint8_t>>(input);
}
template <typename UserType>
static mojo::Message SerializeAsMessage(UserType* input) {
return mojo::internal::SerializeAsMessageImpl<
StringPairContainer::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::StringPairContainer_UnserializedMessageContext<
UserType, StringPairContainer::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<StringPairContainer::DataView>(
message, data, data_num_bytes, output, Validate);
}
template <typename UserType>
static bool Deserialize(const WTF::Vector<uint8_t>& input,
UserType* output) {
return StringPairContainer::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::StringPairContainer_UnserializedMessageContext<
UserType, StringPairContainer::DataView>>();
if (context) {
*output = std::move(context->TakeData());
return true;
}
input.SerializeIfNecessary();
return mojo::internal::DeserializeImpl<StringPairContainer::DataView>(
input, input.payload(), input.payload_num_bytes(), output, Validate);
}
// @generated_from: mojo.test.test_export.StringPairContainer.pairs
WTF::Vector<StringPairPtr> pairs;
// 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, StringPairContainer::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, StringPairContainer::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
return !(rhs < lhs);
}
template <typename T, StringPairContainer::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
return rhs < lhs;
}
template <typename T, StringPairContainer::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
return !(lhs < rhs);
}
template <typename StructPtrType>
StringPairPtr StringPair::Clone() const {
return New(
mojo::Clone(s1),
mojo::Clone(s2)
);
}
template <typename T, StringPair::EnableIfSame<T>*>
bool StringPair::Equals(const T& other_struct) const {
if (!mojo::Equals(this->s1, other_struct.s1))
return false;
if (!mojo::Equals(this->s2, other_struct.s2))
return false;
return true;
}
template <typename T, StringPair::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
if (lhs.s1 < rhs.s1)
return true;
if (rhs.s1 < lhs.s1)
return false;
if (lhs.s2 < rhs.s2)
return true;
if (rhs.s2 < lhs.s2)
return false;
return false;
}
template <typename StructPtrType>
StringPairContainerPtr StringPairContainer::Clone() const {
return New(
mojo::Clone(pairs)
);
}
template <typename T, StringPairContainer::EnableIfSame<T>*>
bool StringPairContainer::Equals(const T& other_struct) const {
if (!mojo::Equals(this->pairs, other_struct.pairs))
return false;
return true;
}
template <typename T, StringPairContainer::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
if (lhs.pairs < rhs.pairs)
return true;
if (rhs.pairs < lhs.pairs)
return false;
return false;
}
} // mojo::test::test_export::blink
namespace mojo {
template <>
struct MOJO_TEST_BLINK_EXPORT StructTraits<::mojo::test::test_export::blink::StringPair::DataView,
::mojo::test::test_export::blink::StringPairPtr> {
static bool IsNull(const ::mojo::test::test_export::blink::StringPairPtr& input) { return !input; }
static void SetToNull(::mojo::test::test_export::blink::StringPairPtr* output) { output->reset(); }
static const decltype(::mojo::test::test_export::blink::StringPair::s1)& s1(
const ::mojo::test::test_export::blink::StringPairPtr& input) {
return input->s1;
}
static const decltype(::mojo::test::test_export::blink::StringPair::s2)& s2(
const ::mojo::test::test_export::blink::StringPairPtr& input) {
return input->s2;
}
static bool Read(::mojo::test::test_export::blink::StringPair::DataView input, ::mojo::test::test_export::blink::StringPairPtr* output);
};
template <>
struct MOJO_TEST_BLINK_EXPORT StructTraits<::mojo::test::test_export::blink::StringPairContainer::DataView,
::mojo::test::test_export::blink::StringPairContainerPtr> {
static bool IsNull(const ::mojo::test::test_export::blink::StringPairContainerPtr& input) { return !input; }
static void SetToNull(::mojo::test::test_export::blink::StringPairContainerPtr* output) { output->reset(); }
static const decltype(::mojo::test::test_export::blink::StringPairContainer::pairs)& pairs(
const ::mojo::test::test_export::blink::StringPairContainerPtr& input) {
return input->pairs;
}
static bool Read(::mojo::test::test_export::blink::StringPairContainer::DataView input, ::mojo::test::test_export::blink::StringPairContainerPtr* output);
};
} // namespace mojo
#endif // MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_TEST_EXPORT_MOJOM_BLINK_H_
/* Metadata comment
eyJ0eXBlIjogImt5dGhlMCIsICJtZXRhIjogW3sidHlwZSI6ICJhbmNob3JfZGVmaW5lcyIsICJi
ZWdpbiI6IDIwNzIsICJlbmQiOiAyMDg5LCAidm5hbWUiOiB7Imxhbmd1YWdlIjogIm1vam9tIiwg
ImNvcnB1cyI6ICJjaHJvbWl1bS5nb29nbGVzb3VyY2UuY29tL2NvZGVzZWFyY2gvY2hyb21pdW0v
c3JjLy9tYWluIiwgInNpZ25hdHVyZSI6ICJtb2pvLnRlc3QudGVzdF9leHBvcnQuRXhwb3J0ZWRJ
bnRlcmZhY2UifSwgImVkZ2UiOiAiJS9reXRoZS9lZGdlL2dlbmVyYXRlcyJ9LCB7InR5cGUiOiAi
YW5jaG9yX2RlZmluZXMiLCAiYmVnaW4iOiA1MDM2LCAiZW5kIjogNTA0NiwgInZuYW1lIjogeyJs
YW5ndWFnZSI6ICJtb2pvbSIsICJjb3JwdXMiOiAiY2hyb21pdW0uZ29vZ2xlc291cmNlLmNvbS9j
b2Rlc2VhcmNoL2Nocm9taXVtL3NyYy8vbWFpbiIsICJzaWduYXR1cmUiOiAibW9qby50ZXN0LnRl
c3RfZXhwb3J0LlN0cmluZ1BhaXIifSwgImVkZ2UiOiAiJS9reXRoZS9lZGdlL2dlbmVyYXRlcyJ9
LCB7InR5cGUiOiAiYW5jaG9yX2RlZmluZXMiLCAiYmVnaW4iOiA4Nzg2LCAiZW5kIjogODc4OCwg
InZuY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