#include "third_party/blink/renderer/modules/buckets/storage_bucket.h"
#include "base/time/time.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable_creation_key.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_storage_bucket_durability.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/dom_high_res_time_stamp.h"
#include "third_party/blink/renderer/core/fetch/global_fetch.h"
#include "third_party/blink/renderer/core/frame/navigator.h"
#include "third_party/blink/renderer/modules/cache_storage/cache_storage.h"
#include "third_party/blink/renderer/modules/cache_storage/global_cache_storage.h"
#include "third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_factory.h"
#include "third_party/blink/renderer/modules/locks/lock_manager.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
namespace blink {
StorageBucket::StorageBucket(
NavigatorBase* navigator,
const String& name,
mojo::PendingRemote<mojom::blink::BucketHost> remote)
: … { … }
const String& StorageBucket::name() { … }
ScriptPromise<IDLBoolean> StorageBucket::persist(ScriptState* script_state) { … }
ScriptPromise<IDLBoolean> StorageBucket::persisted(ScriptState* script_state) { … }
ScriptPromise<StorageEstimate> StorageBucket::estimate(
ScriptState* script_state) { … }
ScriptPromise<V8StorageBucketDurability> StorageBucket::durability(
ScriptState* script_state) { … }
ScriptPromise<IDLUndefined> StorageBucket::setExpires(
ScriptState* script_state,
const DOMHighResTimeStamp& expires) { … }
ScriptPromise<IDLNullable<IDLDOMHighResTimeStamp>> StorageBucket::expires(
ScriptState* script_state) { … }
IDBFactory* StorageBucket::indexedDB() { … }
LockManager* StorageBucket::locks() { … }
CacheStorage* StorageBucket::caches(ExceptionState& exception_state) { … }
ScriptPromise<FileSystemDirectoryHandle> StorageBucket::getDirectory(
ScriptState* script_state,
ExceptionState& exception_state) { … }
void StorageBucket::GetDirectoryForDevTools(
ExecutionContext* context,
Vector<String> directory_path_components,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr,
FileSystemDirectoryHandle*)> callback) { … }
void StorageBucket::Trace(Visitor* visitor) const { … }
void StorageBucket::DidRequestPersist(
ScriptPromiseResolver<IDLBoolean>* resolver,
bool persisted,
bool success) { … }
void StorageBucket::DidGetPersisted(ScriptPromiseResolver<IDLBoolean>* resolver,
bool persisted,
bool success) { … }
void StorageBucket::DidGetEstimate(
ScriptPromiseResolver<StorageEstimate>* resolver,
int64_t current_usage,
int64_t current_quota,
bool success) { … }
void StorageBucket::DidGetDurability(
ScriptPromiseResolver<V8StorageBucketDurability>* resolver,
mojom::blink::BucketDurability durability,
bool success) { … }
void StorageBucket::DidSetExpires(ScriptPromiseResolver<IDLUndefined>* resolver,
bool success) { … }
void StorageBucket::DidGetExpires(
ScriptPromiseResolver<IDLNullable<IDLDOMHighResTimeStamp>>* resolver,
const std::optional<base::Time> expires,
bool success) { … }
void StorageBucket::GetSandboxedFileSystem(
ScriptPromiseResolver<FileSystemDirectoryHandle>* resolver) { … }
void StorageBucket::GetSandboxedFileSystemForDevtools(
ExecutionContext* context,
const Vector<String>& directory_path_components,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr,
FileSystemDirectoryHandle*)> callback,
mojom::blink::FileSystemAccessErrorPtr result) { … }
}