| 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/http/mock_http_cache.h" | 5 #include "net/http/mock_http_cache.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 } | 558 } |
| 559 | 559 |
| 560 MockDiskCache* MockHttpCache::disk_cache() { | 560 MockDiskCache* MockHttpCache::disk_cache() { |
| 561 return static_cast<MockDiskCache*>(backend()); | 561 return static_cast<MockDiskCache*>(backend()); |
| 562 } | 562 } |
| 563 | 563 |
| 564 int MockHttpCache::CreateTransaction(std::unique_ptr<HttpTransaction>* trans) { | 564 int MockHttpCache::CreateTransaction(std::unique_ptr<HttpTransaction>* trans) { |
| 565 return http_cache_.CreateTransaction(DEFAULT_PRIORITY, trans); | 565 return http_cache_.CreateTransaction(DEFAULT_PRIORITY, trans); |
| 566 } | 566 } |
| 567 | 567 |
| 568 void MockHttpCache::BypassCacheLock() { | 568 void MockHttpCache::SimulateCacheLockTimeout() { |
| 569 http_cache_.BypassLockForTest(); | 569 http_cache_.SimulateCacheLockTimeout(); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void MockHttpCache::FailConditionalizations() { | 572 void MockHttpCache::FailConditionalizations() { |
| 573 http_cache_.FailConditionalizationForTest(); | 573 http_cache_.FailConditionalizationForTest(); |
| 574 } | 574 } |
| 575 | 575 |
| 576 bool MockHttpCache::ReadResponseInfo(disk_cache::Entry* disk_entry, | 576 bool MockHttpCache::ReadResponseInfo(disk_cache::Entry* disk_entry, |
| 577 HttpResponseInfo* response_info, | 577 HttpResponseInfo* response_info, |
| 578 bool* response_truncated) { | 578 bool* response_truncated) { |
| 579 int size = disk_entry->GetDataSize(0); | 579 int size = disk_entry->GetDataSize(0); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 if (!callback_.is_null()) { | 683 if (!callback_.is_null()) { |
| 684 if (!fail_) | 684 if (!fail_) |
| 685 backend_->reset(new MockDiskCache()); | 685 backend_->reset(new MockDiskCache()); |
| 686 CompletionCallback cb = callback_; | 686 CompletionCallback cb = callback_; |
| 687 callback_.Reset(); | 687 callback_.Reset(); |
| 688 cb.Run(Result()); // This object can be deleted here. | 688 cb.Run(Result()); // This object can be deleted here. |
| 689 } | 689 } |
| 690 } | 690 } |
| 691 | 691 |
| 692 } // namespace net | 692 } // namespace net |
| OLD | NEW |