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 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return create_backend_callback_.get() != NULL; | 89 return create_backend_callback_.get() != NULL; |
90 } | 90 } |
91 disk_cache::Backend* disk_cache() { return disk_cache_.get(); } | 91 disk_cache::Backend* disk_cache() { return disk_cache_.get(); } |
92 int Init(net::CacheType cache_type, | 92 int Init(net::CacheType cache_type, |
93 const base::FilePath& directory, | 93 const base::FilePath& directory, |
94 int cache_size, | 94 int cache_size, |
95 bool force, | 95 bool force, |
96 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread, | 96 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread, |
97 const net::CompletionCallback& callback); | 97 const net::CompletionCallback& callback); |
98 void OnCreateBackendComplete(int rv); | 98 void OnCreateBackendComplete(int rv); |
99 void AddActiveCall(ActiveCall* call) { active_calls_.insert(call); } | |
100 void RemoveActiveCall(ActiveCall* call) { active_calls_.erase(call); } | |
101 void AddOpenEntry(EntryImpl* entry) { open_entries_.insert(entry); } | 99 void AddOpenEntry(EntryImpl* entry) { open_entries_.insert(entry); } |
102 void RemoveOpenEntry(EntryImpl* entry) { open_entries_.erase(entry); } | 100 void RemoveOpenEntry(EntryImpl* entry) { open_entries_.erase(entry); } |
103 | 101 |
104 bool is_disabled_; | 102 bool is_disabled_; |
105 net::CompletionCallback init_callback_; | 103 net::CompletionCallback init_callback_; |
106 scoped_refptr<CreateBackendCallbackShim> create_backend_callback_; | 104 scoped_refptr<CreateBackendCallbackShim> create_backend_callback_; |
107 PendingCalls pending_calls_; | 105 PendingCalls pending_calls_; |
108 ActiveCalls active_calls_; | |
109 OpenEntries open_entries_; | 106 OpenEntries open_entries_; |
110 scoped_ptr<disk_cache::Backend> disk_cache_; | 107 scoped_ptr<disk_cache::Backend> disk_cache_; |
| 108 |
| 109 base::WeakPtrFactory<AppCacheDiskCache> weak_factory_; |
111 }; | 110 }; |
112 | 111 |
113 } // namespace content | 112 } // namespace content |
114 | 113 |
115 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ | 114 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ |
OLD | NEW |