#include "third_party/blink/renderer/modules/quota/storage_manager.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "third_party/blink/public/mojom/quota/quota_types.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_storage_estimate.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_storage_usage_details.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/event_type_names.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/frame.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/modules/permissions/permission_utils.h"
#include "third_party/blink/renderer/modules/quota/quota_utils.h"
#include "third_party/blink/renderer/platform/bindings/v8_throw_exception.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
PermissionName;
PermissionService;
UsageBreakdownPtr;
namespace {
const char kUniqueOriginErrorMessage[] = …;
const char kGenericErrorMessage[] = …;
const char kAbortErrorMessage[] = …;
void QueryStorageUsageAndQuotaCallback(
ScriptPromiseResolver<StorageEstimate>* resolver,
mojom::blink::QuotaStatusCode status_code,
int64_t usage_in_bytes,
int64_t quota_in_bytes,
UsageBreakdownPtr usage_breakdown) { … }
}
StorageManager::StorageManager(ExecutionContext* execution_context)
: … { … }
StorageManager::~StorageManager() = default;
ScriptPromise<IDLBoolean> StorageManager::persist(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<IDLBoolean> StorageManager::persisted(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<StorageEstimate> StorageManager::estimate(
ScriptState* script_state,
ExceptionState& exception_state) { … }
void StorageManager::Trace(Visitor* visitor) const { … }
const AtomicString& StorageManager::InterfaceName() const { … }
ExecutionContext* StorageManager::GetExecutionContext() const { … }
void StorageManager::OnQuotaChange() { … }
void StorageManager::AddedEventListener(
const AtomicString& event_type,
RegisteredEventListener& registered_listener) { … }
void StorageManager::RemovedEventListener(
const AtomicString& event_type,
const RegisteredEventListener& registered_listener) { … }
PermissionService* StorageManager::GetPermissionService(
ExecutionContext* execution_context) { … }
void StorageManager::PermissionServiceConnectionError() { … }
void StorageManager::PermissionRequestComplete(
ScriptPromiseResolver<IDLBoolean>* resolver,
mojom::blink::PermissionStatus status) { … }
void StorageManager::StartObserving() { … }
void StorageManager::StopObserving() { … }
mojom::blink::QuotaManagerHost* StorageManager::GetQuotaHost(
ExecutionContext* execution_context) { … }
}