#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "storage/browser/quota/quota_internals.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 "storage/browser/quota/quota_internals.mojom-params-data.h"
#include "storage/browser/quota/quota_internals.mojom-shared-message-ids.h"
#include "storage/browser/quota/quota_internals.mojom-import-headers.h"
#include "storage/browser/quota/quota_internals.mojom-test-utils.h"
namespace storage::mojom {
BucketTableEntry::BucketTableEntry()
: … { … }
BucketTableEntry::BucketTableEntry(
int64_t bucket_id_in,
const std::string& storage_key_in,
::blink::mojom::StorageType type_in,
const std::string& name_in,
int64_t usage_in,
int64_t use_count_in,
::base::Time last_accessed_in,
::base::Time last_modified_in)
: … { … }
BucketTableEntry::~BucketTableEntry() = default;
void BucketTableEntry::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool BucketTableEntry::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char QuotaInternalsHandler::Name_[] = …;
QuotaInternalsHandler::IPCStableHashFunction QuotaInternalsHandler::MessageToMethodInfo_(mojo::Message& message) { … }
const char* QuotaInternalsHandler::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t QuotaInternalsHandler::GetDiskAvailabilityAndTempPoolSize_Sym::IPCStableHash() { … }
uint32_t QuotaInternalsHandler::GetStatistics_Sym::IPCStableHash() { … }
uint32_t QuotaInternalsHandler::SimulateStoragePressure_Sym::IPCStableHash() { … }
uint32_t QuotaInternalsHandler::RetrieveBucketsTable_Sym::IPCStableHash() { … }
uint32_t QuotaInternalsHandler::GetGlobalUsageForInternals_Sym::IPCStableHash() { … }
uint32_t QuotaInternalsHandler::IsSimulateStoragePressureAvailable_Sym::IPCStableHash() { … }
# endif
class QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ForwardToCallback
: public mojo::MessageReceiver { … };
class QuotaInternalsHandler_GetStatistics_ForwardToCallback
: public mojo::MessageReceiver { … };
class QuotaInternalsHandler_RetrieveBucketsTable_ForwardToCallback
: public mojo::MessageReceiver { … };
class QuotaInternalsHandler_GetGlobalUsageForInternals_ForwardToCallback
: public mojo::MessageReceiver { … };
class QuotaInternalsHandler_IsSimulateStoragePressureAvailable_ForwardToCallback
: public mojo::MessageReceiver { … };
QuotaInternalsHandlerProxy::QuotaInternalsHandlerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void QuotaInternalsHandlerProxy::GetDiskAvailabilityAndTempPoolSize(
GetDiskAvailabilityAndTempPoolSizeCallback callback) { … }
void QuotaInternalsHandlerProxy::GetStatistics(
GetStatisticsCallback callback) { … }
void QuotaInternalsHandlerProxy::SimulateStoragePressure(
const ::url::Origin& in_origin_url) { … }
void QuotaInternalsHandlerProxy::RetrieveBucketsTable(
RetrieveBucketsTableCallback callback) { … }
void QuotaInternalsHandlerProxy::GetGlobalUsageForInternals(
::blink::mojom::StorageType in_storage_type, GetGlobalUsageForInternalsCallback callback) { … }
void QuotaInternalsHandlerProxy::IsSimulateStoragePressureAvailable(
IsSimulateStoragePressureAvailableCallback callback) { … }
class QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ForwardToCallback::Accept(
mojo::Message* message) { … }
void QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ProxyToResponder::Run(
int64_t in_total_space, int64_t in_available_space, int64_t in_temp_pool_size) { … }
class QuotaInternalsHandler_GetStatistics_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool QuotaInternalsHandler_GetStatistics_ForwardToCallback::Accept(
mojo::Message* message) { … }
void QuotaInternalsHandler_GetStatistics_ProxyToResponder::Run(
const base::flat_map<std::string, std::string>& in_eviction_statistics) { … }
class QuotaInternalsHandler_RetrieveBucketsTable_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool QuotaInternalsHandler_RetrieveBucketsTable_ForwardToCallback::Accept(
mojo::Message* message) { … }
void QuotaInternalsHandler_RetrieveBucketsTable_ProxyToResponder::Run(
std::vector<BucketTableEntryPtr> in_entries) { … }
class QuotaInternalsHandler_GetGlobalUsageForInternals_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool QuotaInternalsHandler_GetGlobalUsageForInternals_ForwardToCallback::Accept(
mojo::Message* message) { … }
void QuotaInternalsHandler_GetGlobalUsageForInternals_ProxyToResponder::Run(
int64_t in_usage, int64_t in_unlimited_usage) { … }
class QuotaInternalsHandler_IsSimulateStoragePressureAvailable_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool QuotaInternalsHandler_IsSimulateStoragePressureAvailable_ForwardToCallback::Accept(
mojo::Message* message) { … }
void QuotaInternalsHandler_IsSimulateStoragePressureAvailable_ProxyToResponder::Run(
bool in_available) { … }
bool QuotaInternalsHandlerStubDispatch::Accept(
QuotaInternalsHandler* impl,
mojo::Message* message) { … }
bool QuotaInternalsHandlerStubDispatch::AcceptWithResponder(
QuotaInternalsHandler* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kQuotaInternalsHandlerValidationInfo[] = …;
bool QuotaInternalsHandlerRequestValidator::Accept(mojo::Message* message) { … }
bool QuotaInternalsHandlerResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::storage::mojom::BucketTableEntry::DataView, ::storage::mojom::BucketTableEntryPtr>::Read(
::storage::mojom::BucketTableEntry::DataView input,
::storage::mojom::BucketTableEntryPtr* output) { … }
}
namespace storage::mojom {
void QuotaInternalsHandlerInterceptorForTesting::GetDiskAvailabilityAndTempPoolSize(GetDiskAvailabilityAndTempPoolSizeCallback callback) { … }
void QuotaInternalsHandlerInterceptorForTesting::GetStatistics(GetStatisticsCallback callback) { … }
void QuotaInternalsHandlerInterceptorForTesting::SimulateStoragePressure(const ::url::Origin& origin_url) { … }
void QuotaInternalsHandlerInterceptorForTesting::RetrieveBucketsTable(RetrieveBucketsTableCallback callback) { … }
void QuotaInternalsHandlerInterceptorForTesting::GetGlobalUsageForInternals(::blink::mojom::StorageType storage_type, GetGlobalUsageForInternalsCallback callback) { … }
void QuotaInternalsHandlerInterceptorForTesting::IsSimulateStoragePressureAvailable(IsSimulateStoragePressureAvailableCallback callback) { … }
QuotaInternalsHandlerAsyncWaiter::QuotaInternalsHandlerAsyncWaiter(
QuotaInternalsHandler* proxy) : … { … }
QuotaInternalsHandlerAsyncWaiter::~QuotaInternalsHandlerAsyncWaiter() = default;
void QuotaInternalsHandlerAsyncWaiter::GetDiskAvailabilityAndTempPoolSize(
int64_t* out_total_space, int64_t* out_available_space, int64_t* out_temp_pool_size) { … }
void QuotaInternalsHandlerAsyncWaiter::GetStatistics(
base::flat_map<std::string, std::string>* out_eviction_statistics) { … }
base::flat_map<std::string, std::string> QuotaInternalsHandlerAsyncWaiter::GetStatistics(
) { … }
void QuotaInternalsHandlerAsyncWaiter::RetrieveBucketsTable(
std::vector<BucketTableEntryPtr>* out_entries) { … }
std::vector<BucketTableEntryPtr> QuotaInternalsHandlerAsyncWaiter::RetrieveBucketsTable(
) { … }
void QuotaInternalsHandlerAsyncWaiter::GetGlobalUsageForInternals(
::blink::mojom::StorageType storage_type, int64_t* out_usage, int64_t* out_unlimited_usage) { … }
void QuotaInternalsHandlerAsyncWaiter::IsSimulateStoragePressureAvailable(
bool* out_available) { … }
bool QuotaInternalsHandlerAsyncWaiter::IsSimulateStoragePressureAvailable(
) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif