| 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 WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ | 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ |
| 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ | 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 PendingCall(PendingCallType call_type, int64 key, | 69 PendingCall(PendingCallType call_type, int64 key, |
| 70 Entry** entry, const net::CompletionCallback& callback); | 70 Entry** entry, const net::CompletionCallback& callback); |
| 71 | 71 |
| 72 ~PendingCall(); | 72 ~PendingCall(); |
| 73 }; | 73 }; |
| 74 typedef std::vector<PendingCall> PendingCalls; | 74 typedef std::vector<PendingCall> PendingCalls; |
| 75 | 75 |
| 76 class ActiveCall; | 76 class ActiveCall; |
| 77 typedef std::set<ActiveCall*> ActiveCalls; | 77 typedef std::set<ActiveCall*> ActiveCalls; |
| 78 typedef std::set<EntryImpl*> OpenEntries; |
| 78 | 79 |
| 79 bool is_initializing() const { | 80 bool is_initializing() const { |
| 80 return create_backend_callback_.get() != NULL; | 81 return create_backend_callback_.get() != NULL; |
| 81 } | 82 } |
| 82 disk_cache::Backend* disk_cache() { return disk_cache_.get(); } | 83 disk_cache::Backend* disk_cache() { return disk_cache_.get(); } |
| 83 int Init(net::CacheType cache_type, const base::FilePath& directory, | 84 int Init(net::CacheType cache_type, const base::FilePath& directory, |
| 84 int cache_size, bool force, base::MessageLoopProxy* cache_thread, | 85 int cache_size, bool force, base::MessageLoopProxy* cache_thread, |
| 85 const net::CompletionCallback& callback); | 86 const net::CompletionCallback& callback); |
| 86 void OnCreateBackendComplete(int rv); | 87 void OnCreateBackendComplete(int rv); |
| 87 void AddActiveCall(ActiveCall* call) { active_calls_.insert(call); } | 88 void AddActiveCall(ActiveCall* call) { active_calls_.insert(call); } |
| 88 void RemoveActiveCall(ActiveCall* call) { active_calls_.erase(call); } | 89 void RemoveActiveCall(ActiveCall* call) { active_calls_.erase(call); } |
| 90 void AddOpenEntry(EntryImpl* entry) { open_entries_.insert(entry); } |
| 91 void RemoveOpenEntry(EntryImpl* entry) { open_entries_.erase(entry); } |
| 89 | 92 |
| 90 bool is_disabled_; | 93 bool is_disabled_; |
| 91 net::CompletionCallback init_callback_; | 94 net::CompletionCallback init_callback_; |
| 92 scoped_refptr<CreateBackendCallbackShim> create_backend_callback_; | 95 scoped_refptr<CreateBackendCallbackShim> create_backend_callback_; |
| 93 PendingCalls pending_calls_; | 96 PendingCalls pending_calls_; |
| 94 ActiveCalls active_calls_; | 97 ActiveCalls active_calls_; |
| 98 OpenEntries open_entries_; |
| 95 scoped_ptr<disk_cache::Backend> disk_cache_; | 99 scoped_ptr<disk_cache::Backend> disk_cache_; |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 } // namespace appcache | 102 } // namespace appcache |
| 99 | 103 |
| 100 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ | 104 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ |
| OLD | NEW |