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

Unified Diff: content/common/web_quota_dispatcher_callback.cc

Issue 7438001: Cleanup: Make quota dispatcher code independent from WebKit types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 5 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
Index: content/common/web_quota_dispatcher_callback.cc
diff --git a/content/common/web_quota_dispatcher_callback.cc b/content/common/web_quota_dispatcher_callback.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9033d01009f4df6ca6cf993eb346af40ff4a5cfb
--- /dev/null
+++ b/content/common/web_quota_dispatcher_callback.cc
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/web_quota_dispatcher_callback.h"
+
+#include "base/basictypes.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h"
+
+using quota::QuotaStatusCode;
+using WebKit::WebStorageQuotaCallbacks;
+using WebKit::WebStorageQuotaError;
+using WebKit::WebStorageQuotaType;
+
+WebQuotaDispatcherCallback::WebQuotaDispatcherCallback(
+ WebStorageQuotaCallbacks* callbacks)
+ : callbacks_(callbacks) {
+ DCHECK(callbacks_);
+}
+
+WebQuotaDispatcherCallback::~WebQuotaDispatcherCallback() {
+}
+
+void WebQuotaDispatcherCallback::DidQueryStorageUsageAndQuota(
+ int64 usage, int64 quota) {
+ callbacks_->didQueryStorageUsageAndQuota(usage, quota);
+}
+
+void WebQuotaDispatcherCallback::DidGrantStorageQuota(int64 granted_quota){
+ callbacks_->didGrantStorageQuota(granted_quota);
+}
+
+void WebQuotaDispatcherCallback::DidFail(QuotaStatusCode error) {
+ callbacks_->didFail(static_cast<WebStorageQuotaError>(error));
+}
+
+COMPILE_ASSERT(int(WebKit::WebStorageQuotaTypeTemporary) == \
+ int(quota::kStorageTypeTemporary), mismatching_enums);
+COMPILE_ASSERT(int(WebKit::WebStorageQuotaTypePersistent) == \
+ int(quota::kStorageTypePersistent), mismatching_enums);
+
+COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorNotSupported) == \
+ int(quota::kQuotaErrorNotSupported), mismatching_enums);
+COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorAbort) == \
+ int(quota::kQuotaErrorAbort), mismatching_enums);

Powered by Google App Engine
This is Rietveld 408576698