| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/appcache/appcache_storage.h" | 5 #include "content/browser/appcache/appcache_storage.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "content/browser/appcache/appcache_response.h" | 10 #include "content/browser/appcache/appcache_response.h" |
| 11 #include "content/browser/appcache/appcache_service_impl.h" | 11 #include "content/browser/appcache/appcache_service_impl.h" |
| 12 #include "storage/browser/quota/quota_client.h" | 12 #include "storage/browser/quota/quota_client.h" |
| 13 #include "storage/browser/quota/quota_manager_proxy.h" | 13 #include "storage/browser/quota/quota_manager_proxy.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 // static | 17 // static |
| 18 const int64_t AppCacheStorage::kUnitializedId = -1; | 18 const int64_t AppCacheStorage::kUnitializedId = -1; |
| 19 | 19 |
| 20 AppCacheStorage::AppCacheStorage(AppCacheServiceImpl* service) | 20 AppCacheStorage::AppCacheStorage(AppCacheServiceImpl* service) |
| 21 : last_cache_id_(kUnitializedId), last_group_id_(kUnitializedId), | 21 : last_cache_id_(kUnitializedId), last_group_id_(kUnitializedId), |
| 22 last_response_id_(kUnitializedId), service_(service) { | 22 last_response_id_(kUnitializedId), service_(service) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 AppCacheStorage::~AppCacheStorage() { | 25 AppCacheStorage::~AppCacheStorage() { |
| 26 STLDeleteValues(&pending_info_loads_); | 26 base::STLDeleteValues(&pending_info_loads_); |
| 27 DCHECK(delegate_references_.empty()); | 27 DCHECK(delegate_references_.empty()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 AppCacheStorage::DelegateReference::DelegateReference( | 30 AppCacheStorage::DelegateReference::DelegateReference( |
| 31 Delegate* delegate, AppCacheStorage* storage) | 31 Delegate* delegate, AppCacheStorage* storage) |
| 32 : delegate(delegate), storage(storage) { | 32 : delegate(delegate), storage(storage) { |
| 33 storage->delegate_references_.insert( | 33 storage->delegate_references_.insert( |
| 34 DelegateReferenceMap::value_type(delegate, this)); | 34 DelegateReferenceMap::value_type(delegate, this)); |
| 35 } | 35 } |
| 36 | 36 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 if (service()->quota_manager_proxy() && | 127 if (service()->quota_manager_proxy() && |
| 128 usage_map_.find(origin) != usage_map_.end()) | 128 usage_map_.find(origin) != usage_map_.end()) |
| 129 service()->quota_manager_proxy()->NotifyStorageAccessed( | 129 service()->quota_manager_proxy()->NotifyStorageAccessed( |
| 130 storage::QuotaClient::kAppcache, | 130 storage::QuotaClient::kAppcache, |
| 131 origin, | 131 origin, |
| 132 storage::kStorageTypeTemporary); | 132 storage::kStorageTypeTemporary); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace content | 135 } // namespace content |
| 136 | 136 |
| OLD | NEW |