#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom-params-data.h"
#include "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom-shared-message-ids.h"
#include "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom-import-headers.h"
#include "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom-test-utils.h"
namespace heap_profiling::mojom {
ProfilingParams::ProfilingParams()
: … { … }
ProfilingParams::ProfilingParams(
StackMode stack_mode_in,
uint32_t sampling_rate_in)
: … { … }
ProfilingParams::~ProfilingParams() = default;
size_t ProfilingParams::Hash(size_t seed) const { … }
void ProfilingParams::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ProfilingParams::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
HeapProfileSample::HeapProfileSample()
: … { … }
HeapProfileSample::HeapProfileSample(
AllocatorType allocator_in,
uint64_t size_in,
uint64_t total_in,
uint64_t context_id_in,
std::vector<uint64_t> stack_in)
: … { … }
HeapProfileSample::~HeapProfileSample() = default;
void HeapProfileSample::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool HeapProfileSample::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
HeapProfile::HeapProfile()
: … { … }
HeapProfile::HeapProfile(
std::vector<HeapProfileSamplePtr> samples_in,
const base::flat_map<uint64_t, std::string>& strings_in)
: … { … }
HeapProfile::~HeapProfile() = default;
void HeapProfile::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool HeapProfile::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char ProfilingClient::Name_[] = …;
ProfilingClient::IPCStableHashFunction ProfilingClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* ProfilingClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t ProfilingClient::StartProfiling_Sym::IPCStableHash() { … }
uint32_t ProfilingClient::RetrieveHeapProfile_Sym::IPCStableHash() { … }
uint32_t ProfilingClient::AddHeapProfileToTrace_Sym::IPCStableHash() { … }
# endif
class ProfilingClient_StartProfiling_ForwardToCallback
: public mojo::MessageReceiver { … };
class ProfilingClient_RetrieveHeapProfile_ForwardToCallback
: public mojo::MessageReceiver { … };
class ProfilingClient_AddHeapProfileToTrace_ForwardToCallback
: public mojo::MessageReceiver { … };
ProfilingClientProxy::ProfilingClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void ProfilingClientProxy::StartProfiling(
ProfilingParamsPtr in_params, StartProfilingCallback callback) { … }
void ProfilingClientProxy::RetrieveHeapProfile(
RetrieveHeapProfileCallback callback) { … }
void ProfilingClientProxy::AddHeapProfileToTrace(
AddHeapProfileToTraceCallback callback) { … }
class ProfilingClient_StartProfiling_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ProfilingClient_StartProfiling_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ProfilingClient_StartProfiling_ProxyToResponder::Run(
) { … }
class ProfilingClient_RetrieveHeapProfile_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ProfilingClient_RetrieveHeapProfile_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ProfilingClient_RetrieveHeapProfile_ProxyToResponder::Run(
HeapProfilePtr in_profile) { … }
class ProfilingClient_AddHeapProfileToTrace_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ProfilingClient_AddHeapProfileToTrace_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ProfilingClient_AddHeapProfileToTrace_ProxyToResponder::Run(
bool in_success) { … }
bool ProfilingClientStubDispatch::Accept(
ProfilingClient* impl,
mojo::Message* message) { … }
bool ProfilingClientStubDispatch::AcceptWithResponder(
ProfilingClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kProfilingClientValidationInfo[] = …;
bool ProfilingClientRequestValidator::Accept(mojo::Message* message) { … }
bool ProfilingClientResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::heap_profiling::mojom::ProfilingParams::DataView, ::heap_profiling::mojom::ProfilingParamsPtr>::Read(
::heap_profiling::mojom::ProfilingParams::DataView input,
::heap_profiling::mojom::ProfilingParamsPtr* output) { … }
bool StructTraits<::heap_profiling::mojom::HeapProfileSample::DataView, ::heap_profiling::mojom::HeapProfileSamplePtr>::Read(
::heap_profiling::mojom::HeapProfileSample::DataView input,
::heap_profiling::mojom::HeapProfileSamplePtr* output) { … }
bool StructTraits<::heap_profiling::mojom::HeapProfile::DataView, ::heap_profiling::mojom::HeapProfilePtr>::Read(
::heap_profiling::mojom::HeapProfile::DataView input,
::heap_profiling::mojom::HeapProfilePtr* output) { … }
}
namespace heap_profiling::mojom {
void ProfilingClientInterceptorForTesting::StartProfiling(ProfilingParamsPtr params, StartProfilingCallback callback) { … }
void ProfilingClientInterceptorForTesting::RetrieveHeapProfile(RetrieveHeapProfileCallback callback) { … }
void ProfilingClientInterceptorForTesting::AddHeapProfileToTrace(AddHeapProfileToTraceCallback callback) { … }
ProfilingClientAsyncWaiter::ProfilingClientAsyncWaiter(
ProfilingClient* proxy) : … { … }
ProfilingClientAsyncWaiter::~ProfilingClientAsyncWaiter() = default;
void ProfilingClientAsyncWaiter::StartProfiling(
ProfilingParamsPtr params) { … }
void ProfilingClientAsyncWaiter::RetrieveHeapProfile(
HeapProfilePtr* out_profile) { … }
HeapProfilePtr ProfilingClientAsyncWaiter::RetrieveHeapProfile(
) { … }
void ProfilingClientAsyncWaiter::AddHeapProfileToTrace(
bool* out_success) { … }
bool ProfilingClientAsyncWaiter::AddHeapProfileToTrace(
) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif