| 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 #include "net/disk_cache/in_flight_backend_io.h" | 5 #include "net/disk_cache/in_flight_backend_io.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/disk_cache/backend_impl.h" | 10 #include "net/disk_cache/backend_impl.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 void BackendIO::CancelSparseIO(EntryImpl* entry) { | 174 void BackendIO::CancelSparseIO(EntryImpl* entry) { |
| 175 operation_ = OP_CANCEL_IO; | 175 operation_ = OP_CANCEL_IO; |
| 176 entry_ = entry; | 176 entry_ = entry; |
| 177 } | 177 } |
| 178 | 178 |
| 179 void BackendIO::ReadyForSparseIO(EntryImpl* entry) { | 179 void BackendIO::ReadyForSparseIO(EntryImpl* entry) { |
| 180 operation_ = OP_IS_READY; | 180 operation_ = OP_IS_READY; |
| 181 entry_ = entry; | 181 entry_ = entry; |
| 182 } | 182 } |
| 183 | 183 |
| 184 BackendIO::~BackendIO() {} |
| 185 |
| 184 // Runs on the background thread. | 186 // Runs on the background thread. |
| 185 void BackendIO::ExecuteBackendOperation() { | 187 void BackendIO::ExecuteBackendOperation() { |
| 186 switch (operation_) { | 188 switch (operation_) { |
| 187 case OP_INIT: | 189 case OP_INIT: |
| 188 result_ = backend_->SyncInit(); | 190 result_ = backend_->SyncInit(); |
| 189 break; | 191 break; |
| 190 case OP_OPEN: | 192 case OP_OPEN: |
| 191 result_ = backend_->SyncOpenEntry(key_, entry_ptr_); | 193 result_ = backend_->SyncOpenEntry(key_, entry_ptr_); |
| 192 break; | 194 break; |
| 193 case OP_CREATE: | 195 case OP_CREATE: |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 | 510 |
| 509 void InFlightBackendIO::QueueOperationToList(BackendIO* operation, | 511 void InFlightBackendIO::QueueOperationToList(BackendIO* operation, |
| 510 OperationList* list) { | 512 OperationList* list) { |
| 511 if (list->empty()) | 513 if (list->empty()) |
| 512 return PostOperation(operation); | 514 return PostOperation(operation); |
| 513 | 515 |
| 514 list->push_back(operation); | 516 list->push_back(operation); |
| 515 } | 517 } |
| 516 | 518 |
| 517 } // namespace | 519 } // namespace |
| OLD | NEW |