OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_IN_FLIGHT_BACKEND_IO_H_ | 5 #ifndef NET_DISK_CACHE_IN_FLIGHT_BACKEND_IO_H_ |
6 #define NET_DISK_CACHE_IN_FLIGHT_BACKEND_IO_H_ | 6 #define NET_DISK_CACHE_IN_FLIGHT_BACKEND_IO_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 OP_MAX_BACKEND, | 96 OP_MAX_BACKEND, |
97 OP_READ, | 97 OP_READ, |
98 OP_WRITE, | 98 OP_WRITE, |
99 OP_READ_SPARSE, | 99 OP_READ_SPARSE, |
100 OP_WRITE_SPARSE, | 100 OP_WRITE_SPARSE, |
101 OP_GET_RANGE, | 101 OP_GET_RANGE, |
102 OP_CANCEL_IO, | 102 OP_CANCEL_IO, |
103 OP_IS_READY | 103 OP_IS_READY |
104 }; | 104 }; |
105 | 105 |
106 ~BackendIO(); | 106 virtual ~BackendIO(); |
107 | 107 |
108 void ExecuteBackendOperation(); | 108 void ExecuteBackendOperation(); |
109 void ExecuteEntryOperation(); | 109 void ExecuteEntryOperation(); |
110 | 110 |
111 BackendImpl* backend_; | 111 BackendImpl* backend_; |
112 net::CompletionCallback* callback_; | 112 net::CompletionCallback* callback_; |
113 Operation operation_; | 113 Operation operation_; |
114 net::CompletionCallbackImpl<BackendIO> my_callback_; | 114 net::CompletionCallbackImpl<BackendIO> my_callback_; |
115 | 115 |
116 // The arguments of all the operations we proxy: | 116 // The arguments of all the operations we proxy: |
(...skipping 15 matching lines...) Expand all Loading... |
132 Task* task_; | 132 Task* task_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(BackendIO); | 134 DISALLOW_COPY_AND_ASSIGN(BackendIO); |
135 }; | 135 }; |
136 | 136 |
137 // The specialized controller that keeps track of current operations. | 137 // The specialized controller that keeps track of current operations. |
138 class InFlightBackendIO : public InFlightIO { | 138 class InFlightBackendIO : public InFlightIO { |
139 public: | 139 public: |
140 InFlightBackendIO(BackendImpl* backend, | 140 InFlightBackendIO(BackendImpl* backend, |
141 base::MessageLoopProxy* background_thread); | 141 base::MessageLoopProxy* background_thread); |
142 ~InFlightBackendIO(); | 142 virtual ~InFlightBackendIO(); |
143 | 143 |
144 // The operations we proxy: | 144 // The operations we proxy: |
145 void Init(net::CompletionCallback* callback); | 145 void Init(net::CompletionCallback* callback); |
146 void OpenEntry(const std::string& key, Entry** entry, | 146 void OpenEntry(const std::string& key, Entry** entry, |
147 net::CompletionCallback* callback); | 147 net::CompletionCallback* callback); |
148 void CreateEntry(const std::string& key, Entry** entry, | 148 void CreateEntry(const std::string& key, Entry** entry, |
149 net::CompletionCallback* callback); | 149 net::CompletionCallback* callback); |
150 void DoomEntry(const std::string& key, net::CompletionCallback* callback); | 150 void DoomEntry(const std::string& key, net::CompletionCallback* callback); |
151 void DoomAllEntries(net::CompletionCallback* callback); | 151 void DoomAllEntries(net::CompletionCallback* callback); |
152 void DoomEntriesBetween(const base::Time initial_time, | 152 void DoomEntriesBetween(const base::Time initial_time, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 BackendImpl* backend_; | 197 BackendImpl* backend_; |
198 scoped_refptr<base::MessageLoopProxy> background_thread_; | 198 scoped_refptr<base::MessageLoopProxy> background_thread_; |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); | 200 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); |
201 }; | 201 }; |
202 | 202 |
203 } // namespace disk_cache | 203 } // namespace disk_cache |
204 | 204 |
205 #endif // NET_DISK_CACHE_IN_FLIGHT_BACKEND_IO_H_ | 205 #endif // NET_DISK_CACHE_IN_FLIGHT_BACKEND_IO_H_ |
OLD | NEW |