| 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 #include "net/disk_cache/blockfile/in_flight_backend_io.h" | 5 #include "net/disk_cache/blockfile/in_flight_backend_io.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 operation_ = OP_SIZE_ALL; | 121 operation_ = OP_SIZE_ALL; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void BackendIO::OpenNextEntry(Rankings::Iterator* iterator, | 124 void BackendIO::OpenNextEntry(Rankings::Iterator* iterator, |
| 125 Entry** next_entry) { | 125 Entry** next_entry) { |
| 126 operation_ = OP_OPEN_NEXT; | 126 operation_ = OP_OPEN_NEXT; |
| 127 iterator_ = iterator; | 127 iterator_ = iterator; |
| 128 entry_ptr_ = next_entry; | 128 entry_ptr_ = next_entry; |
| 129 } | 129 } |
| 130 | 130 |
| 131 void BackendIO::EndEnumeration(scoped_ptr<Rankings::Iterator> iterator) { | 131 void BackendIO::EndEnumeration(std::unique_ptr<Rankings::Iterator> iterator) { |
| 132 operation_ = OP_END_ENUMERATION; | 132 operation_ = OP_END_ENUMERATION; |
| 133 scoped_iterator_ = std::move(iterator); | 133 scoped_iterator_ = std::move(iterator); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void BackendIO::OnExternalCacheHit(const std::string& key) { | 136 void BackendIO::OnExternalCacheHit(const std::string& key) { |
| 137 operation_ = OP_ON_EXTERNAL_CACHE_HIT; | 137 operation_ = OP_ON_EXTERNAL_CACHE_HIT; |
| 138 key_ = key; | 138 key_ = key; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void BackendIO::CloseEntryImpl(EntryImpl* entry) { | 141 void BackendIO::CloseEntryImpl(EntryImpl* entry) { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 406 |
| 407 void InFlightBackendIO::OpenNextEntry(Rankings::Iterator* iterator, | 407 void InFlightBackendIO::OpenNextEntry(Rankings::Iterator* iterator, |
| 408 Entry** next_entry, | 408 Entry** next_entry, |
| 409 const net::CompletionCallback& callback) { | 409 const net::CompletionCallback& callback) { |
| 410 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); | 410 scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); |
| 411 operation->OpenNextEntry(iterator, next_entry); | 411 operation->OpenNextEntry(iterator, next_entry); |
| 412 PostOperation(operation.get()); | 412 PostOperation(operation.get()); |
| 413 } | 413 } |
| 414 | 414 |
| 415 void InFlightBackendIO::EndEnumeration( | 415 void InFlightBackendIO::EndEnumeration( |
| 416 scoped_ptr<Rankings::Iterator> iterator) { | 416 std::unique_ptr<Rankings::Iterator> iterator) { |
| 417 scoped_refptr<BackendIO> operation( | 417 scoped_refptr<BackendIO> operation( |
| 418 new BackendIO(this, backend_, net::CompletionCallback())); | 418 new BackendIO(this, backend_, net::CompletionCallback())); |
| 419 operation->EndEnumeration(std::move(iterator)); | 419 operation->EndEnumeration(std::move(iterator)); |
| 420 PostOperation(operation.get()); | 420 PostOperation(operation.get()); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void InFlightBackendIO::OnExternalCacheHit(const std::string& key) { | 423 void InFlightBackendIO::OnExternalCacheHit(const std::string& key) { |
| 424 scoped_refptr<BackendIO> operation( | 424 scoped_refptr<BackendIO> operation( |
| 425 new BackendIO(this, backend_, net::CompletionCallback())); | 425 new BackendIO(this, backend_, net::CompletionCallback())); |
| 426 operation->OnExternalCacheHit(key); | 426 operation->OnExternalCacheHit(key); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 background_thread_->PostTask( | 535 background_thread_->PostTask( |
| 536 FROM_HERE, base::Bind(&BackendIO::ExecuteOperation, operation)); | 536 FROM_HERE, base::Bind(&BackendIO::ExecuteOperation, operation)); |
| 537 OnOperationPosted(operation); | 537 OnOperationPosted(operation); |
| 538 } | 538 } |
| 539 | 539 |
| 540 base::WeakPtr<InFlightBackendIO> InFlightBackendIO::GetWeakPtr() { | 540 base::WeakPtr<InFlightBackendIO> InFlightBackendIO::GetWeakPtr() { |
| 541 return ptr_factory_.GetWeakPtr(); | 541 return ptr_factory_.GetWeakPtr(); |
| 542 } | 542 } |
| 543 | 543 |
| 544 } // namespace | 544 } // namespace |
| OLD | NEW |