Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: net/http/mock_http_cache.cc

Issue 2671793002: Correct handling of ERR_CACHE_LOCK_TIMEOUT for read only transactions. (Closed)
Patch Set: Feedback addressed. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/mock_http_cache.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/http/mock_http_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698