| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/browsing_data/browsing_data_quota_helper_impl.h" | 5 #include "chrome/browser/browsing_data/browsing_data_quota_helper_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 host, type, base::Bind(&BrowsingDataQuotaHelperImpl::GotHostUsage, | 116 host, type, base::Bind(&BrowsingDataQuotaHelperImpl::GotHostUsage, |
| 117 weak_factory_.GetWeakPtr(), quota_info, | 117 weak_factory_.GetWeakPtr(), quota_info, |
| 118 completion, host, type)); | 118 completion, host, type)); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 void BrowsingDataQuotaHelperImpl::GotHostUsage(QuotaInfoMap* quota_info, | 122 void BrowsingDataQuotaHelperImpl::GotHostUsage(QuotaInfoMap* quota_info, |
| 123 const base::Closure& completion, | 123 const base::Closure& completion, |
| 124 const std::string& host, | 124 const std::string& host, |
| 125 storage::StorageType type, | 125 storage::StorageType type, |
| 126 int64 usage) { | 126 int64_t usage) { |
| 127 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 127 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 128 switch (type) { | 128 switch (type) { |
| 129 case storage::kStorageTypeTemporary: | 129 case storage::kStorageTypeTemporary: |
| 130 (*quota_info)[host].temporary_usage = usage; | 130 (*quota_info)[host].temporary_usage = usage; |
| 131 break; | 131 break; |
| 132 case storage::kStorageTypePersistent: | 132 case storage::kStorageTypePersistent: |
| 133 (*quota_info)[host].persistent_usage = usage; | 133 (*quota_info)[host].persistent_usage = usage; |
| 134 break; | 134 break; |
| 135 case storage::kStorageTypeSyncable: | 135 case storage::kStorageTypeSyncable: |
| 136 (*quota_info)[host].syncable_usage = usage; | 136 (*quota_info)[host].syncable_usage = usage; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 164 | 164 |
| 165 void BrowsingDataQuotaHelperImpl::RevokeHostQuotaOnIOThread( | 165 void BrowsingDataQuotaHelperImpl::RevokeHostQuotaOnIOThread( |
| 166 const std::string& host) { | 166 const std::string& host) { |
| 167 quota_manager_->SetPersistentHostQuota( | 167 quota_manager_->SetPersistentHostQuota( |
| 168 host, 0, base::Bind(&BrowsingDataQuotaHelperImpl::DidRevokeHostQuota, | 168 host, 0, base::Bind(&BrowsingDataQuotaHelperImpl::DidRevokeHostQuota, |
| 169 weak_factory_.GetWeakPtr())); | 169 weak_factory_.GetWeakPtr())); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void BrowsingDataQuotaHelperImpl::DidRevokeHostQuota( | 172 void BrowsingDataQuotaHelperImpl::DidRevokeHostQuota( |
| 173 storage::QuotaStatusCode /*status*/, | 173 storage::QuotaStatusCode /*status*/, |
| 174 int64 /*quota*/) {} | 174 int64_t /*quota*/) {} |
| OLD | NEW |