| 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 } | |
| 638 rv = network_trans_->Start(request_, &io_callback_, net_log_); | 628 rv = network_trans_->Start(request_, &io_callback_, net_log_); |
| 639 return rv; | 629 return rv; |
| 640 } | 630 } |
| 641 | 631 |
| 642 int HttpCache::Transaction::DoSendRequestComplete(int result) { | 632 int HttpCache::Transaction::DoSendRequestComplete(int result) { |
| 643 if (!cache_) | 633 if (!cache_) |
| 644 return ERR_UNEXPECTED; | 634 return ERR_UNEXPECTED; |
| 645 | 635 |
| 646 if (result == OK) { | 636 if (result == OK) { |
| 647 next_state_ = STATE_SUCCESSFUL_SEND_REQUEST; | 637 next_state_ = STATE_SUCCESSFUL_SEND_REQUEST; |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1916 // |value| goes from 0 to 63. Actually, the max value should be 47 (0x2f) | 1906 // |value| goes from 0 to 63. Actually, the max value should be 47 (0x2f) |
| 1917 // but we'll see. | 1907 // but we'll see. |
| 1918 UMA_HISTOGRAM_ENUMERATION("HttpCache.ResponseHeaders", value, 65); | 1908 UMA_HISTOGRAM_ENUMERATION("HttpCache.ResponseHeaders", value, 65); |
| 1919 } | 1909 } |
| 1920 | 1910 |
| 1921 void HttpCache::Transaction::OnIOComplete(int result) { | 1911 void HttpCache::Transaction::OnIOComplete(int result) { |
| 1922 DoLoop(result); | 1912 DoLoop(result); |
| 1923 } | 1913 } |
| 1924 | 1914 |
| 1925 } // namespace net | 1915 } // namespace net |
| OLD | NEW |