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

Unified Diff: Source/modules/quota/StorageQuota.cpp

Issue 133503002: Quota: Implement StorageQuotaClient (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/modules/modules.gypi ('k') | Source/modules/quota/StorageQuotaClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
{
}
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/quota/StorageQuotaClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698