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 |