| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "net/disk_cache/file.h" | 5 #include "net/disk_cache/file.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/threading/worker_pool.h" | 10 #include "base/threading/worker_pool.h" |
| 11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 12 #include "net/disk_cache/blockfile/in_flight_io.h" |
| 12 #include "net/disk_cache/disk_cache.h" | 13 #include "net/disk_cache/disk_cache.h" |
| 13 #include "net/disk_cache/in_flight_io.h" | |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // This class represents a single asynchronous IO operation while it is being | 17 // This class represents a single asynchronous IO operation while it is being |
| 18 // bounced between threads. | 18 // bounced between threads. |
| 19 class FileBackgroundIO : public disk_cache::BackgroundIO { | 19 class FileBackgroundIO : public disk_cache::BackgroundIO { |
| 20 public: | 20 public: |
| 21 // Other than the actual parameters for the IO operation (including the | 21 // Other than the actual parameters for the IO operation (including the |
| 22 // |callback| that must be notified at the end), we need the controller that | 22 // |callback| that must be notified at the end), we need the controller that |
| 23 // is keeping track of all operations. When done, we notify the controller | 23 // is keeping track of all operations. When done, we notify the controller |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 return false; | 303 return false; |
| 304 | 304 |
| 305 GetFileInFlightIO()->PostWrite(this, buffer, buffer_len, offset, callback); | 305 GetFileInFlightIO()->PostWrite(this, buffer, buffer_len, offset, callback); |
| 306 | 306 |
| 307 if (completed) | 307 if (completed) |
| 308 *completed = false; | 308 *completed = false; |
| 309 return true; | 309 return true; |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace disk_cache | 312 } // namespace disk_cache |
| OLD | NEW |