| 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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 579 |
| 580 MockDiskCache* MockHttpCache::disk_cache() { | 580 MockDiskCache* MockHttpCache::disk_cache() { |
| 581 return static_cast<MockDiskCache*>(backend()); | 581 return static_cast<MockDiskCache*>(backend()); |
| 582 } | 582 } |
| 583 | 583 |
| 584 int MockHttpCache::CreateTransaction(std::unique_ptr<HttpTransaction>* trans) { | 584 int MockHttpCache::CreateTransaction(std::unique_ptr<HttpTransaction>* trans) { |
| 585 return http_cache_.CreateTransaction(DEFAULT_PRIORITY, trans); | 585 return http_cache_.CreateTransaction(DEFAULT_PRIORITY, trans); |
| 586 } | 586 } |
| 587 | 587 |
| 588 void MockHttpCache::SimulateCacheLockTimeout() { | 588 void MockHttpCache::SimulateCacheLockTimeout() { |
| 589 http_cache_.SimulateCacheLockTimeout(); | 589 http_cache_.SimulateCacheLockTimeoutForTesting(); |
| 590 } |
| 591 |
| 592 void MockHttpCache::SimulateCacheLockTimeoutAfterHeaders() { |
| 593 http_cache_.SimulateCacheLockTimeoutAfterHeadersForTesting(); |
| 590 } | 594 } |
| 591 | 595 |
| 592 void MockHttpCache::FailConditionalizations() { | 596 void MockHttpCache::FailConditionalizations() { |
| 593 http_cache_.FailConditionalizationForTest(); | 597 http_cache_.FailConditionalizationForTest(); |
| 594 } | 598 } |
| 595 | 599 |
| 596 bool MockHttpCache::ReadResponseInfo(disk_cache::Entry* disk_entry, | 600 bool MockHttpCache::ReadResponseInfo(disk_cache::Entry* disk_entry, |
| 597 HttpResponseInfo* response_info, | 601 HttpResponseInfo* response_info, |
| 598 bool* response_truncated) { | 602 bool* response_truncated) { |
| 599 int size = disk_entry->GetDataSize(0); | 603 int size = disk_entry->GetDataSize(0); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 if (!callback_.is_null()) { | 742 if (!callback_.is_null()) { |
| 739 if (!fail_) | 743 if (!fail_) |
| 740 backend_->reset(new MockDiskCache()); | 744 backend_->reset(new MockDiskCache()); |
| 741 CompletionCallback cb = callback_; | 745 CompletionCallback cb = callback_; |
| 742 callback_.Reset(); | 746 callback_.Reset(); |
| 743 cb.Run(Result()); // This object can be deleted here. | 747 cb.Run(Result()); // This object can be deleted here. |
| 744 } | 748 } |
| 745 } | 749 } |
| 746 | 750 |
| 747 } // namespace net | 751 } // namespace net |
| OLD | NEW |