| 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 NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ | 5 #ifndef NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ |
| 6 #define NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ | 6 #define NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // The operations we proxy: | 50 // The operations we proxy: |
| 51 void Init(); | 51 void Init(); |
| 52 void OpenEntry(const std::string& key, Entry** entry); | 52 void OpenEntry(const std::string& key, Entry** entry); |
| 53 void CreateEntry(const std::string& key, Entry** entry); | 53 void CreateEntry(const std::string& key, Entry** entry); |
| 54 void DoomEntry(const std::string& key); | 54 void DoomEntry(const std::string& key); |
| 55 void DoomAllEntries(); | 55 void DoomAllEntries(); |
| 56 void DoomEntriesBetween(const base::Time initial_time, | 56 void DoomEntriesBetween(const base::Time initial_time, |
| 57 const base::Time end_time); | 57 const base::Time end_time); |
| 58 void DoomEntriesSince(const base::Time initial_time); | 58 void DoomEntriesSince(const base::Time initial_time); |
| 59 void CalculateSizeOfEntriesBetween(const base::Time initial_time, |
| 60 const base::Time end_time); |
| 59 void OpenNextEntry(Rankings::Iterator* iterator, Entry** next_entry); | 61 void OpenNextEntry(Rankings::Iterator* iterator, Entry** next_entry); |
| 60 void EndEnumeration(scoped_ptr<Rankings::Iterator> iterator); | 62 void EndEnumeration(scoped_ptr<Rankings::Iterator> iterator); |
| 61 void OnExternalCacheHit(const std::string& key); | 63 void OnExternalCacheHit(const std::string& key); |
| 62 void CloseEntryImpl(EntryImpl* entry); | 64 void CloseEntryImpl(EntryImpl* entry); |
| 63 void DoomEntryImpl(EntryImpl* entry); | 65 void DoomEntryImpl(EntryImpl* entry); |
| 64 void FlushQueue(); // Dummy operation. | 66 void FlushQueue(); // Dummy operation. |
| 65 void RunTask(const base::Closure& task); | 67 void RunTask(const base::Closure& task); |
| 66 void ReadData(EntryImpl* entry, int index, int offset, net::IOBuffer* buf, | 68 void ReadData(EntryImpl* entry, int index, int offset, net::IOBuffer* buf, |
| 67 int buf_len); | 69 int buf_len); |
| 68 void WriteData(EntryImpl* entry, int index, int offset, net::IOBuffer* buf, | 70 void WriteData(EntryImpl* entry, int index, int offset, net::IOBuffer* buf, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 83 // are subject to throttling, so we keep an explicit queue. | 85 // are subject to throttling, so we keep an explicit queue. |
| 84 enum Operation { | 86 enum Operation { |
| 85 OP_NONE = 0, | 87 OP_NONE = 0, |
| 86 OP_INIT, | 88 OP_INIT, |
| 87 OP_OPEN, | 89 OP_OPEN, |
| 88 OP_CREATE, | 90 OP_CREATE, |
| 89 OP_DOOM, | 91 OP_DOOM, |
| 90 OP_DOOM_ALL, | 92 OP_DOOM_ALL, |
| 91 OP_DOOM_BETWEEN, | 93 OP_DOOM_BETWEEN, |
| 92 OP_DOOM_SINCE, | 94 OP_DOOM_SINCE, |
| 95 OP_SIZE_BETWEEN, |
| 93 OP_OPEN_NEXT, | 96 OP_OPEN_NEXT, |
| 94 OP_END_ENUMERATION, | 97 OP_END_ENUMERATION, |
| 95 OP_ON_EXTERNAL_CACHE_HIT, | 98 OP_ON_EXTERNAL_CACHE_HIT, |
| 96 OP_CLOSE_ENTRY, | 99 OP_CLOSE_ENTRY, |
| 97 OP_DOOM_ENTRY, | 100 OP_DOOM_ENTRY, |
| 98 OP_FLUSH_QUEUE, | 101 OP_FLUSH_QUEUE, |
| 99 OP_RUN_TASK, | 102 OP_RUN_TASK, |
| 100 OP_MAX_BACKEND, | 103 OP_MAX_BACKEND, |
| 101 OP_READ, | 104 OP_READ, |
| 102 OP_WRITE, | 105 OP_WRITE, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 void CreateEntry(const std::string& key, Entry** entry, | 161 void CreateEntry(const std::string& key, Entry** entry, |
| 159 const net::CompletionCallback& callback); | 162 const net::CompletionCallback& callback); |
| 160 void DoomEntry(const std::string& key, | 163 void DoomEntry(const std::string& key, |
| 161 const net::CompletionCallback& callback); | 164 const net::CompletionCallback& callback); |
| 162 void DoomAllEntries(const net::CompletionCallback& callback); | 165 void DoomAllEntries(const net::CompletionCallback& callback); |
| 163 void DoomEntriesBetween(const base::Time initial_time, | 166 void DoomEntriesBetween(const base::Time initial_time, |
| 164 const base::Time end_time, | 167 const base::Time end_time, |
| 165 const net::CompletionCallback& callback); | 168 const net::CompletionCallback& callback); |
| 166 void DoomEntriesSince(const base::Time initial_time, | 169 void DoomEntriesSince(const base::Time initial_time, |
| 167 const net::CompletionCallback& callback); | 170 const net::CompletionCallback& callback); |
| 171 void CalculateSizeOfEntriesBetween(const base::Time initial_time, |
| 172 const base::Time end_time, |
| 173 const net::CompletionCallback& callback); |
| 168 void OpenNextEntry(Rankings::Iterator* iterator, Entry** next_entry, | 174 void OpenNextEntry(Rankings::Iterator* iterator, Entry** next_entry, |
| 169 const net::CompletionCallback& callback); | 175 const net::CompletionCallback& callback); |
| 170 void EndEnumeration(scoped_ptr<Rankings::Iterator> iterator); | 176 void EndEnumeration(scoped_ptr<Rankings::Iterator> iterator); |
| 171 void OnExternalCacheHit(const std::string& key); | 177 void OnExternalCacheHit(const std::string& key); |
| 172 void CloseEntryImpl(EntryImpl* entry); | 178 void CloseEntryImpl(EntryImpl* entry); |
| 173 void DoomEntryImpl(EntryImpl* entry); | 179 void DoomEntryImpl(EntryImpl* entry); |
| 174 void FlushQueue(const net::CompletionCallback& callback); | 180 void FlushQueue(const net::CompletionCallback& callback); |
| 175 void RunTask(const base::Closure& task, | 181 void RunTask(const base::Closure& task, |
| 176 const net::CompletionCallback& callback); | 182 const net::CompletionCallback& callback); |
| 177 void ReadData(EntryImpl* entry, int index, int offset, net::IOBuffer* buf, | 183 void ReadData(EntryImpl* entry, int index, int offset, net::IOBuffer* buf, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 BackendImpl* backend_; | 218 BackendImpl* backend_; |
| 213 scoped_refptr<base::SingleThreadTaskRunner> background_thread_; | 219 scoped_refptr<base::SingleThreadTaskRunner> background_thread_; |
| 214 base::WeakPtrFactory<InFlightBackendIO> ptr_factory_; | 220 base::WeakPtrFactory<InFlightBackendIO> ptr_factory_; |
| 215 | 221 |
| 216 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); | 222 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); |
| 217 }; | 223 }; |
| 218 | 224 |
| 219 } // namespace disk_cache | 225 } // namespace disk_cache |
| 220 | 226 |
| 221 #endif // NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ | 227 #endif // NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ |
| OLD | NEW |