Index: Source/modules/quota/StorageQuota.cpp |
diff --git a/Source/modules/quota/StorageQuota.cpp b/Source/modules/quota/StorageQuota.cpp |
index 64f76853b64476aa4e592aef495bae1d95790d1f..6425945d3eedafcaeda63d5c3f55ad7b3161313a 100644 |
--- a/Source/modules/quota/StorageQuota.cpp |
+++ b/Source/modules/quota/StorageQuota.cpp |
@@ -34,6 +34,7 @@ |
#include "core/dom/ExceptionCode.h" |
#include "core/dom/ExecutionContext.h" |
#include "modules/quota/StorageErrorCallback.h" |
+#include "modules/quota/StorageQuotaClient.h" |
#include "modules/quota/StorageUsageCallback.h" |
#include "modules/quota/WebStorageQuotaCallbacksImpl.h" |
#include "platform/weborigin/KURL.h" |
@@ -71,6 +72,20 @@ void StorageQuota::queryUsageAndQuota(ExecutionContext* executionContext, PassOw |
blink::Platform::current()->queryStorageUsageAndQuota(storagePartition, storageType, WebStorageQuotaCallbacksImpl::createLeakedPtr(successCallback, errorCallback)); |
} |
+void StorageQuota::requestQuota(ExecutionContext* executionContext, unsigned long long newQuotaInBytes, PassOwnPtr<StorageQuotaCallback> successCallback, PassOwnPtr<StorageErrorCallback> errorCallback) |
+{ |
+ ASSERT(executionContext); |
+ |
+ blink::WebStorageQuotaType storageType = static_cast<blink::WebStorageQuotaType>(m_type); |
+ if (storageType != blink::WebStorageQuotaTypeTemporary && storageType != blink::WebStorageQuotaTypePersistent) { |
+ // Unknown storage type is requested. |
+ executionContext->postTask(StorageErrorCallback::CallbackTask::create(errorCallback, NotSupportedError)); |
+ return; |
+ } |
+ |
+ StorageQuotaClient::from(executionContext)->requestQuota(executionContext, storageType, newQuotaInBytes, successCallback, errorCallback); |
+} |
+ |
StorageQuota::~StorageQuota() |
{ |
} |