OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "public/platform/WebStorageQuotaCallbacks.h" | 5 #include "public/platform/WebStorageQuotaCallbacks.h" |
6 | 6 |
7 #include "platform/StorageQuotaCallbacks.h" | 7 #include "platform/StorageQuotaCallbacks.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 WebStorageQuotaCallbacks::WebStorageQuotaCallbacks( | 11 WebStorageQuotaCallbacks::WebStorageQuotaCallbacks( |
12 StorageQuotaCallbacks* callbacks) | 12 StorageQuotaCallbacks* callbacks) |
13 : private_(callbacks) {} | 13 : private_(callbacks) {} |
14 | 14 |
15 void WebStorageQuotaCallbacks::Reset() { | 15 void WebStorageQuotaCallbacks::Reset() { |
16 private_.Reset(); | 16 private_.Reset(); |
17 } | 17 } |
18 | 18 |
19 void WebStorageQuotaCallbacks::Assign(const WebStorageQuotaCallbacks& other) { | 19 void WebStorageQuotaCallbacks::Assign(const WebStorageQuotaCallbacks& other) { |
20 private_ = other.private_; | 20 private_ = other.private_; |
21 } | 21 } |
22 | 22 |
23 void WebStorageQuotaCallbacks::DidQueryStorageUsageAndQuota( | 23 void WebStorageQuotaCallbacks::DidQueryStorageUsageAndQuota( |
24 unsigned long long usage_in_bytes, | 24 unsigned long long usage_in_bytes, |
25 unsigned long long quota_in_bytes) { | 25 unsigned long long quota_in_bytes) { |
26 ASSERT(!private_.IsNull()); | 26 DCHECK(!private_.IsNull()); |
27 private_->DidQueryStorageUsageAndQuota(usage_in_bytes, quota_in_bytes); | 27 private_->DidQueryStorageUsageAndQuota(usage_in_bytes, quota_in_bytes); |
28 private_.Reset(); | 28 private_.Reset(); |
29 } | 29 } |
30 | 30 |
31 void WebStorageQuotaCallbacks::DidGrantStorageQuota( | 31 void WebStorageQuotaCallbacks::DidGrantStorageQuota( |
32 unsigned long long usage_in_bytes, | 32 unsigned long long usage_in_bytes, |
33 unsigned long long granted_quota_in_bytes) { | 33 unsigned long long granted_quota_in_bytes) { |
34 ASSERT(!private_.IsNull()); | 34 DCHECK(!private_.IsNull()); |
35 private_->DidGrantStorageQuota(usage_in_bytes, granted_quota_in_bytes); | 35 private_->DidGrantStorageQuota(usage_in_bytes, granted_quota_in_bytes); |
36 private_.Reset(); | 36 private_.Reset(); |
37 } | 37 } |
38 | 38 |
39 void WebStorageQuotaCallbacks::DidFail(WebStorageQuotaError error) { | 39 void WebStorageQuotaCallbacks::DidFail(WebStorageQuotaError error) { |
40 ASSERT(!private_.IsNull()); | 40 DCHECK(!private_.IsNull()); |
41 private_->DidFail(error); | 41 private_->DidFail(error); |
42 private_.Reset(); | 42 private_.Reset(); |
43 } | 43 } |
44 | 44 |
45 } // namespace blink | 45 } // namespace blink |
OLD | NEW |