| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/quota_dispatcher.h" | 5 #include "content/common/quota_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "content/common/child_thread.h" | 8 #include "content/common/child_thread.h" |
| 9 #include "content/common/quota_messages.h" | 9 #include "content/common/quota_messages.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h
" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h
" |
| 13 | 13 |
| 14 using quota::QuotaStatusCode; | 14 using quota::QuotaStatusCode; |
| 15 using quota::StorageType; | 15 using quota::StorageType; |
| 16 | 16 |
| 17 using WebKit::WebStorageQuotaCallbacks; | 17 using WebKit::WebStorageQuotaCallbacks; |
| 18 using WebKit::WebStorageQuotaError; | 18 using WebKit::WebStorageQuotaError; |
| 19 using WebKit::WebStorageQuotaType; | 19 using WebKit::WebStorageQuotaType; |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // QuotaDispatcher::Callback implementation for WebStorageQuotaCallbacks. | 24 // QuotaDispatcher::Callback implementation for WebStorageQuotaCallbacks. |
| 25 class WebStorageQuotaDispatcherCallback : public QuotaDispatcher::Callback { | 25 class WebStorageQuotaDispatcherCallback : public QuotaDispatcher::Callback { |
| 26 public: | 26 public: |
| 27 WebStorageQuotaDispatcherCallback(WebKit::WebStorageQuotaCallbacks* callback) | 27 explicit WebStorageQuotaDispatcherCallback( |
| 28 WebKit::WebStorageQuotaCallbacks* callback) |
| 28 : callbacks_(callback) { | 29 : callbacks_(callback) { |
| 29 DCHECK(callbacks_); | 30 DCHECK(callbacks_); |
| 30 } | 31 } |
| 31 virtual ~WebStorageQuotaDispatcherCallback() {} | 32 virtual ~WebStorageQuotaDispatcherCallback() {} |
| 32 virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) OVERRIDE { | 33 virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) OVERRIDE { |
| 33 callbacks_->didQueryStorageUsageAndQuota(usage, quota); | 34 callbacks_->didQueryStorageUsageAndQuota(usage, quota); |
| 34 } | 35 } |
| 35 virtual void DidGrantStorageQuota(int64 granted_quota) OVERRIDE { | 36 virtual void DidGrantStorageQuota(int64 granted_quota) OVERRIDE { |
| 36 callbacks_->didGrantStorageQuota(granted_quota); | 37 callbacks_->didGrantStorageQuota(granted_quota); |
| 37 } | 38 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 int(quota::kStorageTypeTemporary), mismatching_enums); | 132 int(quota::kStorageTypeTemporary), mismatching_enums); |
| 132 COMPILE_ASSERT(int(WebKit::WebStorageQuotaTypePersistent) == \ | 133 COMPILE_ASSERT(int(WebKit::WebStorageQuotaTypePersistent) == \ |
| 133 int(quota::kStorageTypePersistent), mismatching_enums); | 134 int(quota::kStorageTypePersistent), mismatching_enums); |
| 134 | 135 |
| 135 COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorNotSupported) == \ | 136 COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorNotSupported) == \ |
| 136 int(quota::kQuotaErrorNotSupported), mismatching_enums); | 137 int(quota::kQuotaErrorNotSupported), mismatching_enums); |
| 137 COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorAbort) == \ | 138 COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorAbort) == \ |
| 138 int(quota::kQuotaErrorAbort), mismatching_enums); | 139 int(quota::kQuotaErrorAbort), mismatching_enums); |
| 139 | 140 |
| 140 } // namespace content | 141 } // namespace content |
| OLD | NEW |