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