#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "chrome/browser/ui/webui/discards/discards.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 "chrome/browser/ui/webui/discards/discards.mojom-params-data.h"
#include "chrome/browser/ui/webui/discards/discards.mojom-shared-message-ids.h"
#include "chrome/browser/ui/webui/discards/discards.mojom-import-headers.h"
#include "chrome/browser/ui/webui/discards/discards.mojom-test-utils.h"
namespace discards::mojom {
TabDiscardsInfo::TabDiscardsInfo()
: … { … }
TabDiscardsInfo::TabDiscardsInfo(
const std::string& tab_url_in,
const std::string& title_in,
LifecycleUnitVisibility visibility_in,
::mojom::LifecycleUnitLoadingState loading_state_in,
::mojom::LifecycleUnitState state_in,
bool can_discard_in,
std::vector<std::string> cannot_discard_reasons_in,
int32_t discard_count_in,
::mojom::LifecycleUnitDiscardReason discard_reason_in,
int32_t utility_rank_in,
int32_t last_active_seconds_in,
int32_t id_in,
bool is_auto_discardable_in,
double site_engagement_score_in,
bool has_focus_in,
::base::TimeDelta state_change_time_in)
: … { … }
TabDiscardsInfo::~TabDiscardsInfo() = default;
void TabDiscardsInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool TabDiscardsInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
PageInfo::PageInfo()
: … { … }
PageInfo::PageInfo(
int64_t id_in,
const ::GURL& main_frame_url_in,
int64_t opener_frame_id_in,
int64_t embedder_frame_id_in,
const std::string& description_json_in)
: … { … }
PageInfo::~PageInfo() = default;
void PageInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool PageInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
FrameInfo::FrameInfo()
: … { … }
FrameInfo::FrameInfo(
int64_t id_in,
const ::GURL& url_in,
int64_t page_id_in,
int64_t parent_frame_id_in,
int64_t process_id_in,
const std::string& description_json_in)
: … { … }
FrameInfo::~FrameInfo() = default;
void FrameInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool FrameInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ProcessInfo::ProcessInfo()
: … { … }
ProcessInfo::ProcessInfo(
int64_t id_in,
::base::ProcessId pid_in,
uint64_t private_footprint_kb_in,
const std::string& description_json_in)
: … { … }
ProcessInfo::~ProcessInfo() = default;
void ProcessInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ProcessInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WorkerInfo::WorkerInfo()
: … { … }
WorkerInfo::WorkerInfo(
int64_t id_in,
const ::GURL& url_in,
int64_t process_id_in,
std::vector<int64_t> client_frame_ids_in,
std::vector<int64_t> client_worker_ids_in,
std::vector<int64_t> child_worker_ids_in,
const std::string& description_json_in)
: … { … }
WorkerInfo::~WorkerInfo() = default;
void WorkerInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WorkerInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
FavIconInfo::FavIconInfo()
: … { … }
FavIconInfo::FavIconInfo(
int64_t node_id_in,
const std::string& icon_data_in)
: … { … }
FavIconInfo::~FavIconInfo() = default;
size_t FavIconInfo::Hash(size_t seed) const { … }
void FavIconInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool FavIconInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char DetailsProvider::Name_[] = …;
DetailsProvider::IPCStableHashFunction DetailsProvider::MessageToMethodInfo_(mojo::Message& message) { … }
const char* DetailsProvider::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t DetailsProvider::GetTabDiscardsInfo_Sym::IPCStableHash() { … }
uint32_t DetailsProvider::SetAutoDiscardable_Sym::IPCStableHash() { … }
uint32_t DetailsProvider::DiscardById_Sym::IPCStableHash() { … }
uint32_t DetailsProvider::LoadById_Sym::IPCStableHash() { … }
uint32_t DetailsProvider::Discard_Sym::IPCStableHash() { … }
uint32_t DetailsProvider::ToggleBatterySaverMode_Sym::IPCStableHash() { … }
uint32_t DetailsProvider::RefreshPerformanceTabCpuMeasurements_Sym::IPCStableHash() { … }
# endif
class DetailsProvider_GetTabDiscardsInfo_ForwardToCallback
: public mojo::MessageReceiver { … };
class DetailsProvider_SetAutoDiscardable_ForwardToCallback
: public mojo::MessageReceiver { … };
class DetailsProvider_DiscardById_ForwardToCallback
: public mojo::MessageReceiver { … };
class DetailsProvider_Discard_ForwardToCallback
: public mojo::MessageReceiver { … };
DetailsProviderProxy::DetailsProviderProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void DetailsProviderProxy::GetTabDiscardsInfo(
GetTabDiscardsInfoCallback callback) { … }
void DetailsProviderProxy::SetAutoDiscardable(
int32_t in_tab_id, bool in_is_auto_discardable, SetAutoDiscardableCallback callback) { … }
void DetailsProviderProxy::DiscardById(
int32_t in_tab_id, ::mojom::LifecycleUnitDiscardReason in_reason, DiscardByIdCallback callback) { … }
void DetailsProviderProxy::LoadById(
int32_t in_tab_id) { … }
void DetailsProviderProxy::Discard(
DiscardCallback callback) { … }
void DetailsProviderProxy::ToggleBatterySaverMode(
) { … }
void DetailsProviderProxy::RefreshPerformanceTabCpuMeasurements(
) { … }
class DetailsProvider_GetTabDiscardsInfo_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool DetailsProvider_GetTabDiscardsInfo_ForwardToCallback::Accept(
mojo::Message* message) { … }
void DetailsProvider_GetTabDiscardsInfo_ProxyToResponder::Run(
std::vector<TabDiscardsInfoPtr> in_infos) { … }
class DetailsProvider_SetAutoDiscardable_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool DetailsProvider_SetAutoDiscardable_ForwardToCallback::Accept(
mojo::Message* message) { … }
void DetailsProvider_SetAutoDiscardable_ProxyToResponder::Run(
) { … }
class DetailsProvider_DiscardById_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool DetailsProvider_DiscardById_ForwardToCallback::Accept(
mojo::Message* message) { … }
void DetailsProvider_DiscardById_ProxyToResponder::Run(
) { … }
class DetailsProvider_Discard_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool DetailsProvider_Discard_ForwardToCallback::Accept(
mojo::Message* message) { … }
void DetailsProvider_Discard_ProxyToResponder::Run(
) { … }
bool DetailsProviderStubDispatch::Accept(
DetailsProvider* impl,
mojo::Message* message) { … }
bool DetailsProviderStubDispatch::AcceptWithResponder(
DetailsProvider* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kDetailsProviderValidationInfo[] = …;
bool DetailsProviderRequestValidator::Accept(mojo::Message* message) { … }
bool DetailsProviderResponseValidator::Accept(mojo::Message* message) { … }
const char GraphChangeStream::Name_[] = …;
GraphChangeStream::IPCStableHashFunction GraphChangeStream::MessageToMethodInfo_(mojo::Message& message) { … }
const char* GraphChangeStream::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t GraphChangeStream::FrameCreated_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::PageCreated_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::ProcessCreated_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::WorkerCreated_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::FrameChanged_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::PageChanged_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::ProcessChanged_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::WorkerChanged_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::FavIconDataAvailable_Sym::IPCStableHash() { … }
uint32_t GraphChangeStream::NodeDeleted_Sym::IPCStableHash() { … }
# endif
GraphChangeStreamProxy::GraphChangeStreamProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void GraphChangeStreamProxy::FrameCreated(
FrameInfoPtr in_frame) { … }
void GraphChangeStreamProxy::PageCreated(
PageInfoPtr in_pages) { … }
void GraphChangeStreamProxy::ProcessCreated(
ProcessInfoPtr in_process) { … }
void GraphChangeStreamProxy::WorkerCreated(
WorkerInfoPtr in_worker) { … }
void GraphChangeStreamProxy::FrameChanged(
FrameInfoPtr in_frame) { … }
void GraphChangeStreamProxy::PageChanged(
PageInfoPtr in_page) { … }
void GraphChangeStreamProxy::ProcessChanged(
ProcessInfoPtr in_process) { … }
void GraphChangeStreamProxy::WorkerChanged(
WorkerInfoPtr in_worker) { … }
void GraphChangeStreamProxy::FavIconDataAvailable(
FavIconInfoPtr in_favicon) { … }
void GraphChangeStreamProxy::NodeDeleted(
int64_t in_node_id) { … }
bool GraphChangeStreamStubDispatch::Accept(
GraphChangeStream* impl,
mojo::Message* message) { … }
bool GraphChangeStreamStubDispatch::AcceptWithResponder(
GraphChangeStream* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kGraphChangeStreamValidationInfo[] = …;
bool GraphChangeStreamRequestValidator::Accept(mojo::Message* message) { … }
const char GraphDump::Name_[] = …;
GraphDump::IPCStableHashFunction GraphDump::MessageToMethodInfo_(mojo::Message& message) { … }
const char* GraphDump::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t GraphDump::SubscribeToChanges_Sym::IPCStableHash() { … }
uint32_t GraphDump::RequestNodeDescriptions_Sym::IPCStableHash() { … }
# endif
class GraphDump_RequestNodeDescriptions_ForwardToCallback
: public mojo::MessageReceiver { … };
GraphDumpProxy::GraphDumpProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void GraphDumpProxy::SubscribeToChanges(
::mojo::PendingRemote<GraphChangeStream> in_change_subscriber) { … }
void GraphDumpProxy::RequestNodeDescriptions(
const std::vector<int64_t>& in_node_ids, RequestNodeDescriptionsCallback callback) { … }
class GraphDump_RequestNodeDescriptions_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool GraphDump_RequestNodeDescriptions_ForwardToCallback::Accept(
mojo::Message* message) { … }
void GraphDump_RequestNodeDescriptions_ProxyToResponder::Run(
const base::flat_map<int64_t, std::string>& in_node_descriptions_json) { … }
bool GraphDumpStubDispatch::Accept(
GraphDump* impl,
mojo::Message* message) { … }
bool GraphDumpStubDispatch::AcceptWithResponder(
GraphDump* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kGraphDumpValidationInfo[] = …;
bool GraphDumpRequestValidator::Accept(mojo::Message* message) { … }
bool GraphDumpResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::discards::mojom::TabDiscardsInfo::DataView, ::discards::mojom::TabDiscardsInfoPtr>::Read(
::discards::mojom::TabDiscardsInfo::DataView input,
::discards::mojom::TabDiscardsInfoPtr* output) { … }
bool StructTraits<::discards::mojom::PageInfo::DataView, ::discards::mojom::PageInfoPtr>::Read(
::discards::mojom::PageInfo::DataView input,
::discards::mojom::PageInfoPtr* output) { … }
bool StructTraits<::discards::mojom::FrameInfo::DataView, ::discards::mojom::FrameInfoPtr>::Read(
::discards::mojom::FrameInfo::DataView input,
::discards::mojom::FrameInfoPtr* output) { … }
bool StructTraits<::discards::mojom::ProcessInfo::DataView, ::discards::mojom::ProcessInfoPtr>::Read(
::discards::mojom::ProcessInfo::DataView input,
::discards::mojom::ProcessInfoPtr* output) { … }
bool StructTraits<::discards::mojom::WorkerInfo::DataView, ::discards::mojom::WorkerInfoPtr>::Read(
::discards::mojom::WorkerInfo::DataView input,
::discards::mojom::WorkerInfoPtr* output) { … }
bool StructTraits<::discards::mojom::FavIconInfo::DataView, ::discards::mojom::FavIconInfoPtr>::Read(
::discards::mojom::FavIconInfo::DataView input,
::discards::mojom::FavIconInfoPtr* output) { … }
}
namespace discards::mojom {
void DetailsProviderInterceptorForTesting::GetTabDiscardsInfo(GetTabDiscardsInfoCallback callback) { … }
void DetailsProviderInterceptorForTesting::SetAutoDiscardable(int32_t tab_id, bool is_auto_discardable, SetAutoDiscardableCallback callback) { … }
void DetailsProviderInterceptorForTesting::DiscardById(int32_t tab_id, ::mojom::LifecycleUnitDiscardReason reason, DiscardByIdCallback callback) { … }
void DetailsProviderInterceptorForTesting::LoadById(int32_t tab_id) { … }
void DetailsProviderInterceptorForTesting::Discard(DiscardCallback callback) { … }
void DetailsProviderInterceptorForTesting::ToggleBatterySaverMode() { … }
void DetailsProviderInterceptorForTesting::RefreshPerformanceTabCpuMeasurements() { … }
DetailsProviderAsyncWaiter::DetailsProviderAsyncWaiter(
DetailsProvider* proxy) : … { … }
DetailsProviderAsyncWaiter::~DetailsProviderAsyncWaiter() = default;
void DetailsProviderAsyncWaiter::GetTabDiscardsInfo(
std::vector<TabDiscardsInfoPtr>* out_infos) { … }
std::vector<TabDiscardsInfoPtr> DetailsProviderAsyncWaiter::GetTabDiscardsInfo(
) { … }
void DetailsProviderAsyncWaiter::SetAutoDiscardable(
int32_t tab_id, bool is_auto_discardable) { … }
void DetailsProviderAsyncWaiter::DiscardById(
int32_t tab_id, ::mojom::LifecycleUnitDiscardReason reason) { … }
void DetailsProviderAsyncWaiter::Discard(
) { … }
void GraphChangeStreamInterceptorForTesting::FrameCreated(FrameInfoPtr frame) { … }
void GraphChangeStreamInterceptorForTesting::PageCreated(PageInfoPtr pages) { … }
void GraphChangeStreamInterceptorForTesting::ProcessCreated(ProcessInfoPtr process) { … }
void GraphChangeStreamInterceptorForTesting::WorkerCreated(WorkerInfoPtr worker) { … }
void GraphChangeStreamInterceptorForTesting::FrameChanged(FrameInfoPtr frame) { … }
void GraphChangeStreamInterceptorForTesting::PageChanged(PageInfoPtr page) { … }
void GraphChangeStreamInterceptorForTesting::ProcessChanged(ProcessInfoPtr process) { … }
void GraphChangeStreamInterceptorForTesting::WorkerChanged(WorkerInfoPtr worker) { … }
void GraphChangeStreamInterceptorForTesting::FavIconDataAvailable(FavIconInfoPtr favicon) { … }
void GraphChangeStreamInterceptorForTesting::NodeDeleted(int64_t node_id) { … }
GraphChangeStreamAsyncWaiter::GraphChangeStreamAsyncWaiter(
GraphChangeStream* proxy) : … { … }
GraphChangeStreamAsyncWaiter::~GraphChangeStreamAsyncWaiter() = default;
void GraphDumpInterceptorForTesting::SubscribeToChanges(::mojo::PendingRemote<GraphChangeStream> change_subscriber) { … }
void GraphDumpInterceptorForTesting::RequestNodeDescriptions(const std::vector<int64_t>& node_ids, RequestNodeDescriptionsCallback callback) { … }
GraphDumpAsyncWaiter::GraphDumpAsyncWaiter(
GraphDump* proxy) : … { … }
GraphDumpAsyncWaiter::~GraphDumpAsyncWaiter() = default;
void GraphDumpAsyncWaiter::RequestNodeDescriptions(
const std::vector<int64_t>& node_ids, base::flat_map<int64_t, std::string>* out_node_descriptions_json) { … }
base::flat_map<int64_t, std::string> GraphDumpAsyncWaiter::RequestNodeDescriptions(
const std::vector<int64_t>& node_ids) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif