blob: 4aa61eab7fcb7519fd77b8581d882c9013b2d296 [file] [log] [blame]
// 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_FIELD_TRIAL_RECORDER_MOJOM_H_
#define CONTENT_COMMON_FIELD_TRIAL_RECORDER_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/field_trial_recorder.mojom-shared.h"
#include "content/common/field_trial_recorder.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/content_export.h"
#ifdef KYTHE_IS_RUNNING
#pragma kythe_inline_metadata "Metadata comment"
#endif
namespace content {
namespace mojom {
class FieldTrialRecorderProxy;
template <typename ImplRefTraits>
class FieldTrialRecorderStub;
class FieldTrialRecorderRequestValidator;
// @generated_from: content.mojom.FieldTrialRecorder
class CONTENT_EXPORT FieldTrialRecorder
: public FieldTrialRecorderInterfaceBase {
public:
static const char Name_[];
static constexpr uint32_t Version_ = 0;
static constexpr bool PassesAssociatedKinds_ = false;
static constexpr bool HasSyncMethods_ = false;
using Base_ = FieldTrialRecorderInterfaceBase;
using Proxy_ = FieldTrialRecorderProxy;
template <typename ImplRefTraits>
using Stub_ = FieldTrialRecorderStub<ImplRefTraits>;
using RequestValidator_ = FieldTrialRecorderRequestValidator;
using ResponseValidator_ = mojo::PassThroughFilter;
enum MethodMinVersions : uint32_t {
kFieldTrialActivatedMinVersion = 0,
};
virtual ~FieldTrialRecorder() {}
// @generated_from: content.mojom.FieldTrialRecorder.FieldTrialActivated
virtual void FieldTrialActivated(const std::string& trial_name) = 0;
};
class CONTENT_EXPORT FieldTrialRecorderProxy
: public FieldTrialRecorder {
public:
using InterfaceType = FieldTrialRecorder;
explicit FieldTrialRecorderProxy(mojo::MessageReceiverWithResponder* receiver);
void FieldTrialActivated(const std::string& trial_name) final;
private:
mojo::MessageReceiverWithResponder* receiver_;
};
class CONTENT_EXPORT FieldTrialRecorderStubDispatch {
public:
static bool Accept(FieldTrialRecorder* impl, mojo::Message* message);
static bool AcceptWithResponder(
FieldTrialRecorder* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};
template <typename ImplRefTraits =
mojo::RawPtrImplRefTraits<FieldTrialRecorder>>
class FieldTrialRecorderStub
: public mojo::MessageReceiverWithResponderStatus {
public:
using ImplPointerType = typename ImplRefTraits::PointerType;
FieldTrialRecorderStub() {}
~FieldTrialRecorderStub() override {}
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 FieldTrialRecorderStubDispatch::Accept(
ImplRefTraits::GetRawPointer(&sink_), message);
}
bool AcceptWithResponder(
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
if (ImplRefTraits::IsNull(sink_))
return false;
return FieldTrialRecorderStubDispatch::AcceptWithResponder(
ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
}
private:
ImplPointerType sink_;
};
class CONTENT_EXPORT FieldTrialRecorderRequestValidator : public mojo::MessageReceiver {
public:
bool Accept(mojo::Message* message) override;
};
} // namespace mojom
} // namespace content
namespace mojo {
} // namespace mojo
#endif // CONTENT_COMMON_FIELD_TRIAL_RECORDER_MOJOM_H_
/* Metadata comment
eyJtZXRhIjogW3siZW5kIjogMjA4MSwgImJlZ2luIjogMjA2MywgImVkZ2UiOiAiJS9reXRoZS9l
ZGdlL2dlbmVyYXRlcyIsICJ0eXBlIjogImFuY2hvcl9kZWZpbmVzIiwgInZuYW1lIjogeyJjb3Jw
dXMiOiAiY2hyb21pdW0uZ29vZ2xlc291cmNlLmNvbS9jaHJvbWl1bS9zcmMiLCAibGFuZ3VhZ2Ui
OiAibW9qb20iLCAic2lnbmF0dXJlIjogImNvbnRlbnQubW9qb20uRmllbGRUcmlhbFJlY29yZGVy
In19LCB7ImVuZCI6IDI4NDYsICJiZWdpbiI6IDI4MjcsICJlZGdlIjogIiUva3l0aGUvZWRnZS9n
ZW5lcmF0ZXMiLCAidHlwZSI6ICJhbmNob3JfZGVmaW5lcyIsICJ2bmFtZSI6IHsiY29ycHVzIjog
ImNocm9taXVtLmdvb2dsZXNvdXJjZS5jb20vY2hyb21pdW0vc3JjIiwgImxhbmd1YWdlIjogIm1v
am9tIiwgInNpZ25hdHVyZSI6ICJjb250ZW50Lm1vam9tLkZpZWxkVHJpYWxSZWNvcmRlci5GaWVs
ZFRyaWFsQWN0aXZhdGVkIn19XSwgInR5cGUiOiAia3l0aGUwIn0=
*/