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

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: trying another upload, hopefully it will override the previous "old chunk mismatch" Created 7 years, 3 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 | « net/disk_cache/simple/simple_entry_impl.cc ('k') | net/http/http_cache_unittest.cc » ('j') | 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 #if defined(OS_ANDROID)
1534 if (result == ERR_NOT_IMPLEMENTED) {
1535 // Restart the request overwriting the cache entry.
1536 //
1537 // Note: this would have fixed range requests for debug builds on all OSes,
1538 // not just Android, but karen@ prefers to limit the effect based on OS for
1539 // cherry-picked fixes.
1540 // TODO(pasko): remove the OS_ANDROID limitation as soon as the fix proves
1541 // useful after the cherry-pick.
1542 // TODO(pasko): remove this workaround as soon as the SimpleBackendImpl
1543 // supports Sparse IO.
1544 return DoRestartPartialRequest();
1545 }
1546 #endif
1533 DCHECK_EQ(OK, result); 1547 DCHECK_EQ(OK, result);
1534 if (!cache_.get()) 1548 if (!cache_.get())
1535 return ERR_UNEXPECTED; 1549 return ERR_UNEXPECTED;
1536 1550
1537 return ValidateEntryHeadersAndContinue(); 1551 return ValidateEntryHeadersAndContinue();
1538 } 1552 }
1539 1553
1540 int HttpCache::Transaction::DoCacheReadData() { 1554 int HttpCache::Transaction::DoCacheReadData() {
1541 DCHECK(entry_); 1555 DCHECK(entry_);
1542 next_state_ = STATE_CACHE_READ_DATA_COMPLETE; 1556 next_state_ = STATE_CACHE_READ_DATA_COMPLETE;
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 void HttpCache::Transaction::ResetNetworkTransaction() { 2609 void HttpCache::Transaction::ResetNetworkTransaction() {
2596 DCHECK(!old_network_trans_load_timing_); 2610 DCHECK(!old_network_trans_load_timing_);
2597 DCHECK(network_trans_); 2611 DCHECK(network_trans_);
2598 LoadTimingInfo load_timing; 2612 LoadTimingInfo load_timing;
2599 if (network_trans_->GetLoadTimingInfo(&load_timing)) 2613 if (network_trans_->GetLoadTimingInfo(&load_timing))
2600 old_network_trans_load_timing_.reset(new LoadTimingInfo(load_timing)); 2614 old_network_trans_load_timing_.reset(new LoadTimingInfo(load_timing));
2601 network_trans_.reset(); 2615 network_trans_.reset();
2602 } 2616 }
2603 2617
2604 } // namespace net 2618 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.cc ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698