| 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);
|
|
|