| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 scoped_refptr<base::MessageLoopProxy> background_thread() { | 187 scoped_refptr<base::MessageLoopProxy> background_thread() { |
| 188 return background_thread_; | 188 return background_thread_; |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Returns true if the current thread is the background thread. | 191 // Returns true if the current thread is the background thread. |
| 192 bool BackgroundIsCurrentThread() { | 192 bool BackgroundIsCurrentThread() { |
| 193 return background_thread_->BelongsToCurrentThread(); | 193 return background_thread_->BelongsToCurrentThread(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 protected: | 196 protected: |
| 197 virtual void OnOperationComplete(BackgroundIO* operation, bool cancel); | 197 virtual void OnOperationComplete(BackgroundIO* operation, |
| 198 bool cancel) OVERRIDE; |
| 198 | 199 |
| 199 private: | 200 private: |
| 200 void PostOperation(BackendIO* operation); | 201 void PostOperation(BackendIO* operation); |
| 201 | 202 |
| 202 BackendImpl* backend_; | 203 BackendImpl* backend_; |
| 203 scoped_refptr<base::MessageLoopProxy> background_thread_; | 204 scoped_refptr<base::MessageLoopProxy> background_thread_; |
| 204 | 205 |
| 205 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); | 206 DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO); |
| 206 }; | 207 }; |
| 207 | 208 |
| 208 } // namespace disk_cache | 209 } // namespace disk_cache |
| 209 | 210 |
| 210 #endif // NET_DISK_CACHE_IN_FLIGHT_BACKEND_IO_H_ | 211 #endif // NET_DISK_CACHE_IN_FLIGHT_BACKEND_IO_H_ |
| OLD | NEW |