Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: Source/web/StorageQuotaClientImpl.cpp

Issue 1110063011: WIP Durable storage, webkit side (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/StorageQuotaClientImpl.h ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/StorageQuotaClientImpl.cpp
diff --git a/Source/web/StorageQuotaClientImpl.cpp b/Source/web/StorageQuotaClientImpl.cpp
index 1d1a4a21ca70588c17bd78fc270c5aa14063ac05..bbfbc65dc658cacba44e0f9679f3f263002591d2 100644
--- a/Source/web/StorageQuotaClientImpl.cpp
+++ b/Source/web/StorageQuotaClientImpl.cpp
@@ -91,4 +91,21 @@ ScriptPromise StorageQuotaClientImpl::requestPersistentQuota(ScriptState* script
return promise;
}
+ScriptPromise StorageQuotaClientImpl::requestDurability(ScriptState* scriptState)
+{
+ RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
+ ScriptPromise promise = resolver->promise();
+
+ if (scriptState->executionContext()->isDocument()) {
+ Document* document = toDocument(scriptState->executionContext());
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
+ StorageQuotaCallbacks* callbacks = StorageQuotaCallbacksImpl::create(resolver);
+ webFrame->client()->requestDurability(webFrame, callbacks);
+ } else {
+ // Requesting quota in Worker is not supported.
+ resolver->reject(DOMError::create(NotSupportedError));
+ }
+ return promise;
+}
+
} // namespace blink
« no previous file with comments | « Source/web/StorageQuotaClientImpl.h ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698