Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 458 | 458 |
| 459 bool HttpCache::Transaction::GetLoadTimingInfo( | 459 bool HttpCache::Transaction::GetLoadTimingInfo( |
| 460 LoadTimingInfo* load_timing_info) const { | 460 LoadTimingInfo* load_timing_info) const { |
| 461 if (network_trans_) | 461 if (network_trans_) |
| 462 return network_trans_->GetLoadTimingInfo(load_timing_info); | 462 return network_trans_->GetLoadTimingInfo(load_timing_info); |
| 463 // Don't modify |load_timing_info| when reading from the cache instead of the | 463 // Don't modify |load_timing_info| when reading from the cache instead of the |
| 464 // network. | 464 // network. |
| 465 return false; | 465 return false; |
| 466 } | 466 } |
| 467 | 467 |
| 468 void HttpCache::Transaction::SetPriority(RequestPriority priority) { | |
| 469 if (network_trans_) | |
| 470 network_trans_->SetPriority(priority); | |
|
akalin
2013/03/13 18:53:04
One question: can HttpCache::Transaction have mult
mmenke
2013/03/13 19:01:23
RestartNetworkRequest() does this. There may be o
| |
| 471 } | |
| 472 | |
| 468 //----------------------------------------------------------------------------- | 473 //----------------------------------------------------------------------------- |
| 469 | 474 |
| 470 void HttpCache::Transaction::DoCallback(int rv) { | 475 void HttpCache::Transaction::DoCallback(int rv) { |
| 471 DCHECK(rv != ERR_IO_PENDING); | 476 DCHECK(rv != ERR_IO_PENDING); |
| 472 DCHECK(!callback_.is_null()); | 477 DCHECK(!callback_.is_null()); |
| 473 | 478 |
| 474 read_buf_ = NULL; // Release the buffer before invoking the callback. | 479 read_buf_ = NULL; // Release the buffer before invoking the callback. |
| 475 | 480 |
| 476 // Since Run may result in Read being called, clear callback_ up front. | 481 // Since Run may result in Read being called, clear callback_ up front. |
| 477 CompletionCallback c = callback_; | 482 CompletionCallback c = callback_; |
| (...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2503 } | 2508 } |
| 2504 | 2509 |
| 2505 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { | 2510 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { |
| 2506 DCHECK(cache_io_start_.is_null()); | 2511 DCHECK(cache_io_start_.is_null()); |
| 2507 if (return_value == ERR_IO_PENDING) | 2512 if (return_value == ERR_IO_PENDING) |
| 2508 cache_io_start_ = base::TimeTicks::Now(); | 2513 cache_io_start_ = base::TimeTicks::Now(); |
| 2509 return return_value; | 2514 return return_value; |
| 2510 } | 2515 } |
| 2511 | 2516 |
| 2512 } // namespace net | 2517 } // namespace net |
| OLD | NEW |