| 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 #include "net/disk_cache/in_flight_backend_io.h" | 5 #include "net/disk_cache/in_flight_backend_io.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 PostOperation(operation); | 391 PostOperation(operation); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void InFlightBackendIO::OpenNextEntry(void** iter, Entry** next_entry, | 394 void InFlightBackendIO::OpenNextEntry(void** iter, Entry** next_entry, |
| 395 OldCompletionCallback* callback) { | 395 OldCompletionCallback* callback) { |
| 396 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); | 396 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); |
| 397 operation->OpenNextEntry(iter, next_entry); | 397 operation->OpenNextEntry(iter, next_entry); |
| 398 PostOperation(operation); | 398 PostOperation(operation); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void InFlightBackendIO::OpenNextEntry(void** iter, Entry** next_entry, |
| 402 const net::CompletionCallback& callback) { |
| 403 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); |
| 404 operation->OpenNextEntry(iter, next_entry); |
| 405 PostOperation(operation); |
| 406 } |
| 407 |
| 401 void InFlightBackendIO::OpenPrevEntry(void** iter, Entry** prev_entry, | 408 void InFlightBackendIO::OpenPrevEntry(void** iter, Entry** prev_entry, |
| 402 OldCompletionCallback* callback) { | 409 OldCompletionCallback* callback) { |
| 403 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); | 410 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); |
| 404 operation->OpenPrevEntry(iter, prev_entry); | 411 operation->OpenPrevEntry(iter, prev_entry); |
| 405 PostOperation(operation); | 412 PostOperation(operation); |
| 406 } | 413 } |
| 407 | 414 |
| 408 void InFlightBackendIO::EndEnumeration(void* iterator) { | 415 void InFlightBackendIO::EndEnumeration(void* iterator) { |
| 409 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, NULL)); | 416 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, NULL)); |
| 410 operation->EndEnumeration(iterator); | 417 operation->EndEnumeration(iterator); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 op->callback().Run(op->result()); | 537 op->callback().Run(op->result()); |
| 531 } | 538 } |
| 532 | 539 |
| 533 void InFlightBackendIO::PostOperation(BackendIO* operation) { | 540 void InFlightBackendIO::PostOperation(BackendIO* operation) { |
| 534 background_thread_->PostTask(FROM_HERE, | 541 background_thread_->PostTask(FROM_HERE, |
| 535 base::Bind(&BackendIO::ExecuteOperation, operation)); | 542 base::Bind(&BackendIO::ExecuteOperation, operation)); |
| 536 OnOperationPosted(operation); | 543 OnOperationPosted(operation); |
| 537 } | 544 } |
| 538 | 545 |
| 539 } // namespace | 546 } // namespace |
| OLD | NEW |