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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 // Returns true if the current thread is the background thread. | 199 // Returns true if the current thread is the background thread. |
200 bool BackgroundIsCurrentThread() { | 200 bool BackgroundIsCurrentThread() { |
201 return background_thread_->RunsTasksOnCurrentThread(); | 201 return background_thread_->RunsTasksOnCurrentThread(); |
202 } | 202 } |
203 | 203 |
204 base::WeakPtr<InFlightBackendIO> GetWeakPtr(); | 204 base::WeakPtr<InFlightBackendIO> GetWeakPtr(); |
205 | 205 |
206 protected: | 206 protected: |
207 virtual void OnOperationComplete(BackgroundIO* operation, | 207 virtual void OnOperationComplete(BackgroundIO* operation, |
208 bool cancel) OVERRIDE; | 208 bool cancel) override; |
209 | 209 |
210 private: | 210 private: |
211 void PostOperation(BackendIO* operation); | 211 void PostOperation(BackendIO* operation); |
212 | 212 |
213 BackendImpl* backend_; | 213 BackendImpl* backend_; |
214 scoped_refptr<base::SingleThreadTaskRunner> background_thread_; | 214 scoped_refptr<base::SingleThreadTaskRunner> background_thread_; |
215 base::WeakPtrFactory<InFlightBackendIO> ptr_factory_; | 215 base::WeakPtrFactory<InFlightBackendIO> ptr_factory_; |
216 | 216 |
217 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); | 217 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); |
218 }; | 218 }; |
219 | 219 |
220 } // namespace disk_cache | 220 } // namespace disk_cache |
221 | 221 |
222 #endif // NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ | 222 #endif // NET_DISK_CACHE_BLOCKFILE_IN_FLIGHT_BACKEND_IO_H_ |
OLD | NEW |