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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 load_timing_info->send_end = first_cache_access_since_; | 526 load_timing_info->send_end = first_cache_access_since_; |
527 return true; | 527 return true; |
528 } | 528 } |
529 | 529 |
530 void HttpCache::Transaction::SetPriority(RequestPriority priority) { | 530 void HttpCache::Transaction::SetPriority(RequestPriority priority) { |
531 priority_ = priority; | 531 priority_ = priority; |
532 if (network_trans_) | 532 if (network_trans_) |
533 network_trans_->SetPriority(priority_); | 533 network_trans_->SetPriority(priority_); |
534 } | 534 } |
535 | 535 |
| 536 void HttpCache::Transaction::SetWebSocketHandshakeStreamFactory( |
| 537 WebSocketHandshakeStreamBase::Factory* factory) { |
| 538 if (network_trans_) |
| 539 network_trans_->SetWebSocketHandshakeStreamFactory(factory); |
| 540 } |
| 541 |
536 //----------------------------------------------------------------------------- | 542 //----------------------------------------------------------------------------- |
537 | 543 |
538 void HttpCache::Transaction::DoCallback(int rv) { | 544 void HttpCache::Transaction::DoCallback(int rv) { |
539 DCHECK(rv != ERR_IO_PENDING); | 545 DCHECK(rv != ERR_IO_PENDING); |
540 DCHECK(!callback_.is_null()); | 546 DCHECK(!callback_.is_null()); |
541 | 547 |
542 read_buf_ = NULL; // Release the buffer before invoking the callback. | 548 read_buf_ = NULL; // Release the buffer before invoking the callback. |
543 | 549 |
544 // Since Run may result in Read being called, clear callback_ up front. | 550 // Since Run may result in Read being called, clear callback_ up front. |
545 CompletionCallback c = callback_; | 551 CompletionCallback c = callback_; |
(...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend.Updated", | 2520 UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend.Updated", |
2515 before_send_percent); | 2521 before_send_percent); |
2516 break; | 2522 break; |
2517 } | 2523 } |
2518 default: | 2524 default: |
2519 NOTREACHED(); | 2525 NOTREACHED(); |
2520 } | 2526 } |
2521 } | 2527 } |
2522 | 2528 |
2523 } // namespace net | 2529 } // namespace net |
OLD | NEW |