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 "content/browser/appcache/appcache.h" | 5 #include "content/browser/appcache/appcache.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 AppCache::~AppCache() { | 31 AppCache::~AppCache() { |
32 DCHECK(associated_hosts_.empty()); | 32 DCHECK(associated_hosts_.empty()); |
33 if (owning_group_.get()) { | 33 if (owning_group_.get()) { |
34 DCHECK(is_complete_); | 34 DCHECK(is_complete_); |
35 owning_group_->RemoveCache(this); | 35 owning_group_->RemoveCache(this); |
36 } | 36 } |
37 DCHECK(!owning_group_.get()); | 37 DCHECK(!owning_group_.get()); |
38 storage_->working_set()->RemoveCache(this); | 38 storage_->working_set()->RemoveCache(this); |
39 STLDeleteContainerPairSecondPointers( | 39 base::STLDeleteContainerPairSecondPointers(executable_handlers_.begin(), |
40 executable_handlers_.begin(), executable_handlers_.end()); | 40 executable_handlers_.end()); |
41 } | 41 } |
42 | 42 |
43 void AppCache::UnassociateHost(AppCacheHost* host) { | 43 void AppCache::UnassociateHost(AppCacheHost* host) { |
44 associated_hosts_.erase(host); | 44 associated_hosts_.erase(host); |
45 } | 45 } |
46 | 46 |
47 void AppCache::AddEntry(const GURL& url, const AppCacheEntry& entry) { | 47 void AppCache::AddEntry(const GURL& url, const AppCacheEntry& entry) { |
48 DCHECK(entries_.find(url) == entries_.end()); | 48 DCHECK(entries_.find(url) == entries_.end()); |
49 entries_.insert(EntryMap::value_type(url, entry)); | 49 entries_.insert(EntryMap::value_type(url, entry)); |
50 cache_size_ += entry.response_size(); | 50 cache_size_ += entry.response_size(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 const GURL& url) { | 322 const GURL& url) { |
323 size_t count = namespaces.size(); | 323 size_t count = namespaces.size(); |
324 for (size_t i = 0; i < count; ++i) { | 324 for (size_t i = 0; i < count; ++i) { |
325 if (namespaces[i].IsMatch(url)) | 325 if (namespaces[i].IsMatch(url)) |
326 return &namespaces[i]; | 326 return &namespaces[i]; |
327 } | 327 } |
328 return NULL; | 328 return NULL; |
329 } | 329 } |
330 | 330 |
331 } // namespace content | 331 } // namespace content |
OLD | NEW |