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

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

Issue 11741034: Fix miss counting on http cache transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/http_cache_transaction.h" 5 #include "net/http/http_cache_transaction.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 result); 725 result);
726 cache_pending_ = false; 726 cache_pending_ = false;
727 727
728 if (!ShouldPassThrough()) { 728 if (!ShouldPassThrough()) {
729 cache_key_ = cache_->GenerateCacheKey(request_); 729 cache_key_ = cache_->GenerateCacheKey(request_);
730 730
731 // Requested cache access mode. 731 // Requested cache access mode.
732 if (effective_load_flags_ & LOAD_ONLY_FROM_CACHE) { 732 if (effective_load_flags_ & LOAD_ONLY_FROM_CACHE) {
733 mode_ = READ; 733 mode_ = READ;
734 } else if (effective_load_flags_ & LOAD_BYPASS_CACHE) { 734 } else if (effective_load_flags_ & LOAD_BYPASS_CACHE) {
735 UpdateTransactionPattern(PATTERN_NOT_COVERED);
gavinp 2013/01/04 16:37:56 Added bonus: this if statement now meets our codin
735 mode_ = WRITE; 736 mode_ = WRITE;
736 } else { 737 } else {
737 mode_ = READ_WRITE; 738 mode_ = READ_WRITE;
738 } 739 }
739 740
740 // Downgrade to UPDATE if the request has been externally conditionalized. 741 // Downgrade to UPDATE if the request has been externally conditionalized.
741 if (external_validation_.initialized) { 742 if (external_validation_.initialized) {
742 if (mode_ & WRITE) { 743 if (mode_ & WRITE) {
743 // Strip off the READ_DATA bit (and maybe add back a READ_META bit 744 // Strip off the READ_DATA bit (and maybe add back a READ_META bit
744 // in case READ was off). 745 // in case READ was off).
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after
2544 } 2545 }
2545 2546
2546 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { 2547 int HttpCache::Transaction::ResetCacheIOStart(int return_value) {
2547 DCHECK(cache_io_start_.is_null()); 2548 DCHECK(cache_io_start_.is_null());
2548 if (return_value == ERR_IO_PENDING) 2549 if (return_value == ERR_IO_PENDING)
2549 cache_io_start_ = base::TimeTicks::Now(); 2550 cache_io_start_ = base::TimeTicks::Now();
2550 return return_value; 2551 return return_value;
2551 } 2552 }
2552 2553
2553 } // namespace net 2554 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698