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

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

Issue 10959026: Http cache: Make sure we separate the infinite cache simulation from the real cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « no previous file | net/http/infinite_cache.h » ('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 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 return ERR_UNEXPECTED; 1412 return ERR_UNEXPECTED;
1413 1413
1414 return ValidateEntryHeadersAndContinue(); 1414 return ValidateEntryHeadersAndContinue();
1415 } 1415 }
1416 1416
1417 int HttpCache::Transaction::DoCacheReadData() { 1417 int HttpCache::Transaction::DoCacheReadData() {
1418 DCHECK(entry_); 1418 DCHECK(entry_);
1419 next_state_ = STATE_CACHE_READ_DATA_COMPLETE; 1419 next_state_ = STATE_CACHE_READ_DATA_COMPLETE;
1420 1420
1421 if (infinite_cache_transaction_.get()) 1421 if (infinite_cache_transaction_.get())
1422 infinite_cache_transaction_->OnServedFromCache(); 1422 infinite_cache_transaction_->OnServedFromCache(&response_);
1423 1423
1424 if (net_log_.IsLoggingAllEvents()) 1424 if (net_log_.IsLoggingAllEvents())
1425 net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_READ_DATA); 1425 net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_READ_DATA);
1426 ReportCacheActionStart(); 1426 ReportCacheActionStart();
1427 if (partial_.get()) { 1427 if (partial_.get()) {
1428 return partial_->CacheRead(entry_->disk_entry, read_buf_, io_buf_len_, 1428 return partial_->CacheRead(entry_->disk_entry, read_buf_, io_buf_len_,
1429 io_callback_); 1429 io_callback_);
1430 } 1430 }
1431 1431
1432 return entry_->disk_entry->ReadData(kResponseContentIndex, read_offset_, 1432 return entry_->disk_entry->ReadData(kResponseContentIndex, read_offset_,
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2404 before_send_percent); 2404 before_send_percent);
2405 } 2405 }
2406 break; 2406 break;
2407 } 2407 }
2408 default: 2408 default:
2409 NOTREACHED(); 2409 NOTREACHED();
2410 } 2410 }
2411 } 2411 }
2412 2412
2413 } // namespace net 2413 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/infinite_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698