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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 | 460 |
461 bool HttpCache::Transaction::GetLoadTimingInfo( | 461 bool HttpCache::Transaction::GetLoadTimingInfo( |
462 LoadTimingInfo* load_timing_info) const { | 462 LoadTimingInfo* load_timing_info) const { |
463 if (network_trans_) | 463 if (network_trans_) |
464 return network_trans_->GetLoadTimingInfo(load_timing_info); | 464 return network_trans_->GetLoadTimingInfo(load_timing_info); |
465 // Don't modify |load_timing_info| when reading from the cache instead of the | 465 // Don't modify |load_timing_info| when reading from the cache instead of the |
466 // network. | 466 // network. |
467 return false; | 467 return false; |
468 } | 468 } |
469 | 469 |
| 470 void HttpCache::Transaction::SetPriority(RequestPriority priority) { |
| 471 priority_ = priority; |
| 472 if (network_trans_) |
| 473 network_trans_->SetPriority(priority_); |
| 474 } |
| 475 |
470 //----------------------------------------------------------------------------- | 476 //----------------------------------------------------------------------------- |
471 | 477 |
472 void HttpCache::Transaction::DoCallback(int rv) { | 478 void HttpCache::Transaction::DoCallback(int rv) { |
473 DCHECK(rv != ERR_IO_PENDING); | 479 DCHECK(rv != ERR_IO_PENDING); |
474 DCHECK(!callback_.is_null()); | 480 DCHECK(!callback_.is_null()); |
475 | 481 |
476 read_buf_ = NULL; // Release the buffer before invoking the callback. | 482 read_buf_ = NULL; // Release the buffer before invoking the callback. |
477 | 483 |
478 // Since Run may result in Read being called, clear callback_ up front. | 484 // Since Run may result in Read being called, clear callback_ up front. |
479 CompletionCallback c = callback_; | 485 CompletionCallback c = callback_; |
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2506 } | 2512 } |
2507 | 2513 |
2508 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { | 2514 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { |
2509 DCHECK(cache_io_start_.is_null()); | 2515 DCHECK(cache_io_start_.is_null()); |
2510 if (return_value == ERR_IO_PENDING) | 2516 if (return_value == ERR_IO_PENDING) |
2511 cache_io_start_ = base::TimeTicks::Now(); | 2517 cache_io_start_ = base::TimeTicks::Now(); |
2512 return return_value; | 2518 return return_value; |
2513 } | 2519 } |
2514 | 2520 |
2515 } // namespace net | 2521 } // namespace net |
OLD | NEW |