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 net_log_.AddEvent(NetLog::TYPE_HTTP_CACHE_SET_PRIORITY, | |
470 NetLog::IntegerCallback("priority", priority)); | |
mmenke
2013/03/12 18:40:22
Same comment goes here as for the HttpNetworkTrans
akalin
2013/03/12 22:08:28
Done.
| |
471 // Do nothing for now. | |
mmenke
2013/03/12 18:40:22
The cache transaction wraps the network transactio
akalin
2013/03/12 22:08:28
Oh! Done.
| |
472 } | |
473 | |
468 //----------------------------------------------------------------------------- | 474 //----------------------------------------------------------------------------- |
469 | 475 |
470 void HttpCache::Transaction::DoCallback(int rv) { | 476 void HttpCache::Transaction::DoCallback(int rv) { |
471 DCHECK(rv != ERR_IO_PENDING); | 477 DCHECK(rv != ERR_IO_PENDING); |
472 DCHECK(!callback_.is_null()); | 478 DCHECK(!callback_.is_null()); |
473 | 479 |
474 read_buf_ = NULL; // Release the buffer before invoking the callback. | 480 read_buf_ = NULL; // Release the buffer before invoking the callback. |
475 | 481 |
476 // Since Run may result in Read being called, clear callback_ up front. | 482 // Since Run may result in Read being called, clear callback_ up front. |
477 CompletionCallback c = callback_; | 483 CompletionCallback c = callback_; |
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2503 } | 2509 } |
2504 | 2510 |
2505 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { | 2511 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { |
2506 DCHECK(cache_io_start_.is_null()); | 2512 DCHECK(cache_io_start_.is_null()); |
2507 if (return_value == ERR_IO_PENDING) | 2513 if (return_value == ERR_IO_PENDING) |
2508 cache_io_start_ = base::TimeTicks::Now(); | 2514 cache_io_start_ = base::TimeTicks::Now(); |
2509 return return_value; | 2515 return return_value; |
2510 } | 2516 } |
2511 | 2517 |
2512 } // namespace net | 2518 } // namespace net |
OLD | NEW |