OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 int HttpCache::Transaction::DoSendRequest() { | 618 int HttpCache::Transaction::DoSendRequest() { |
619 DCHECK(mode_ & WRITE || mode_ == NONE); | 619 DCHECK(mode_ & WRITE || mode_ == NONE); |
620 DCHECK(!network_trans_.get()); | 620 DCHECK(!network_trans_.get()); |
621 | 621 |
622 // Create a network transaction. | 622 // Create a network transaction. |
623 int rv = cache_->network_layer_->CreateTransaction(&network_trans_); | 623 int rv = cache_->network_layer_->CreateTransaction(&network_trans_); |
624 if (rv != OK) | 624 if (rv != OK) |
625 return rv; | 625 return rv; |
626 | 626 |
627 next_state_ = STATE_SEND_REQUEST_COMPLETE; | 627 next_state_ = STATE_SEND_REQUEST_COMPLETE; |
| 628 if (request_->url.SchemeIs("https") && |
| 629 SSLConfigService::snap_start_enabled()) { |
| 630 // TODO(agl): in order to support AlternateProtocol there should probably |
| 631 // be an object hanging off the HttpNetworkSession which constructs these. |
| 632 // Note: when this test is removed, don't forget to remove the #include of |
| 633 // ssl_config_service.h |
| 634 scoped_refptr<DiskCacheBasedSSLHostInfo> hostinfo = |
| 635 new DiskCacheBasedSSLHostInfo(request_->url.host(), cache_); |
| 636 network_trans_->SetSSLHostInfo(hostinfo.get()); |
| 637 } |
628 rv = network_trans_->Start(request_, &io_callback_, net_log_); | 638 rv = network_trans_->Start(request_, &io_callback_, net_log_); |
629 return rv; | 639 return rv; |
630 } | 640 } |
631 | 641 |
632 int HttpCache::Transaction::DoSendRequestComplete(int result) { | 642 int HttpCache::Transaction::DoSendRequestComplete(int result) { |
633 if (!cache_) | 643 if (!cache_) |
634 return ERR_UNEXPECTED; | 644 return ERR_UNEXPECTED; |
635 | 645 |
636 if (result == OK) { | 646 if (result == OK) { |
637 next_state_ = STATE_SUCCESSFUL_SEND_REQUEST; | 647 next_state_ = STATE_SUCCESSFUL_SEND_REQUEST; |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 // |value| goes from 0 to 63. Actually, the max value should be 47 (0x2f) | 1916 // |value| goes from 0 to 63. Actually, the max value should be 47 (0x2f) |
1907 // but we'll see. | 1917 // but we'll see. |
1908 UMA_HISTOGRAM_ENUMERATION("HttpCache.ResponseHeaders", value, 65); | 1918 UMA_HISTOGRAM_ENUMERATION("HttpCache.ResponseHeaders", value, 65); |
1909 } | 1919 } |
1910 | 1920 |
1911 void HttpCache::Transaction::OnIOComplete(int result) { | 1921 void HttpCache::Transaction::OnIOComplete(int result) { |
1912 DoLoop(result); | 1922 DoLoop(result); |
1913 } | 1923 } |
1914 | 1924 |
1915 } // namespace net | 1925 } // namespace net |
OLD | NEW |