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

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

Issue 22926031: Sparse IO: Allow failover to network in debug builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 1523
1524 int HttpCache::Transaction::DoCacheQueryData() { 1524 int HttpCache::Transaction::DoCacheQueryData() {
1525 next_state_ = STATE_CACHE_QUERY_DATA_COMPLETE; 1525 next_state_ = STATE_CACHE_QUERY_DATA_COMPLETE;
1526 1526
1527 // Balanced in DoCacheQueryDataComplete. 1527 // Balanced in DoCacheQueryDataComplete.
1528 return ResetCacheIOStart( 1528 return ResetCacheIOStart(
1529 entry_->disk_entry->ReadyForSparseIO(io_callback_)); 1529 entry_->disk_entry->ReadyForSparseIO(io_callback_));
1530 } 1530 }
1531 1531
1532 int HttpCache::Transaction::DoCacheQueryDataComplete(int result) { 1532 int HttpCache::Transaction::DoCacheQueryDataComplete(int result) {
1533 DCHECK_EQ(OK, result); 1533 // Note: a backend may not support Sparse IO, in this case it is expected that
1534 // header validation will fail and transition to STATE_SEND_REQUEST.
rvargas (doing something else) 2013/08/23 17:54:13 I would prefer if you return a specific error code
pasko 2013/08/26 15:42:51 Done.
1534 if (!cache_.get()) 1535 if (!cache_.get())
1535 return ERR_UNEXPECTED; 1536 return ERR_UNEXPECTED;
1536 1537
1537 return ValidateEntryHeadersAndContinue(); 1538 return ValidateEntryHeadersAndContinue();
1538 } 1539 }
1539 1540
1540 int HttpCache::Transaction::DoCacheReadData() { 1541 int HttpCache::Transaction::DoCacheReadData() {
1541 DCHECK(entry_); 1542 DCHECK(entry_);
1542 next_state_ = STATE_CACHE_READ_DATA_COMPLETE; 1543 next_state_ = STATE_CACHE_READ_DATA_COMPLETE;
1543 1544
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 void HttpCache::Transaction::ResetNetworkTransaction() { 2596 void HttpCache::Transaction::ResetNetworkTransaction() {
2596 DCHECK(!old_network_trans_load_timing_); 2597 DCHECK(!old_network_trans_load_timing_);
2597 DCHECK(network_trans_); 2598 DCHECK(network_trans_);
2598 LoadTimingInfo load_timing; 2599 LoadTimingInfo load_timing;
2599 if (network_trans_->GetLoadTimingInfo(&load_timing)) 2600 if (network_trans_->GetLoadTimingInfo(&load_timing))
2600 old_network_trans_load_timing_.reset(new LoadTimingInfo(load_timing)); 2601 old_network_trans_load_timing_.reset(new LoadTimingInfo(load_timing));
2601 network_trans_.reset(); 2602 network_trans_.reset();
2602 } 2603 }
2603 2604
2604 } // namespace net 2605 } // 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