| 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 "chrome/browser/net/preconnect.h" | 5 #include "chrome/browser/net/preconnect.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 case UrlInfo::OMNIBOX_MOTIVATED: | 79 case UrlInfo::OMNIBOX_MOTIVATED: |
| 80 request_info.motivation = net::HttpRequestInfo::OMNIBOX_MOTIVATED; | 80 request_info.motivation = net::HttpRequestInfo::OMNIBOX_MOTIVATED; |
| 81 break; | 81 break; |
| 82 case UrlInfo::LEARNED_REFERAL_MOTIVATED: | 82 case UrlInfo::LEARNED_REFERAL_MOTIVATED: |
| 83 request_info.motivation = net::HttpRequestInfo::PRECONNECT_MOTIVATED; | 83 request_info.motivation = net::HttpRequestInfo::PRECONNECT_MOTIVATED; |
| 84 break; | 84 break; |
| 85 case UrlInfo::SELF_REFERAL_MOTIVATED: | 85 case UrlInfo::SELF_REFERAL_MOTIVATED: |
| 86 case UrlInfo::EARLY_LOAD_MOTIVATED: | 86 case UrlInfo::EARLY_LOAD_MOTIVATED: |
| 87 request_info.motivation = net::HttpRequestInfo::EARLY_LOAD_MOTIVATED; | 87 request_info.motivation = net::HttpRequestInfo::EARLY_LOAD_MOTIVATED; |
| 88 break; | 88 break; |
| 89 case UrlInfo::MOUSE_OVER_MOTIVATED: |
| 90 request_info.motivation = net::HttpRequestInfo::MOUSE_OVER_MOTIVATED; |
| 91 break; |
| 92 case UrlInfo::MOUSE_DOWN_MOTIVATED: |
| 93 request_info.motivation = net::HttpRequestInfo::MOUSE_DOWN_MOTIVATED; |
| 94 break; |
| 95 case UrlInfo::TAP_UNCONFIRMED_MOTIVATED: |
| 96 request_info.motivation = net::HttpRequestInfo::TAP_UNCONFIRMED_MOTIVATED; |
| 97 break; |
| 98 case UrlInfo::TAP_DOWN_MOTIVATED: |
| 99 request_info.motivation = net::HttpRequestInfo::TAP_DOWN_MOTIVATED; |
| 100 break; |
| 89 default: | 101 default: |
| 90 // Other motivations should never happen here. | 102 // Other motivations should never happen here. |
| 91 NOTREACHED(); | 103 NOTREACHED(); |
| 92 break; | 104 break; |
| 93 } | 105 } |
| 94 | 106 |
| 95 // Setup the SSL Configuration. | 107 // Setup the SSL Configuration. |
| 96 net::SSLConfig ssl_config; | 108 net::SSLConfig ssl_config; |
| 97 session->ssl_config_service()->GetSSLConfig(&ssl_config); | 109 session->ssl_config_service()->GetSSLConfig(&ssl_config); |
| 98 if (session->http_stream_factory()->has_next_protos()) | 110 if (session->http_stream_factory()->has_next_protos()) |
| 99 ssl_config.next_protos = session->http_stream_factory()->next_protos(); | 111 ssl_config.next_protos = session->http_stream_factory()->next_protos(); |
| 100 | 112 |
| 101 // All preconnects should perform EV certificate verification. | 113 // All preconnects should perform EV certificate verification. |
| 102 ssl_config.verify_ev_cert = true; | 114 ssl_config.verify_ev_cert = true; |
| 103 | 115 |
| 104 net::HttpStreamFactory* http_stream_factory = session->http_stream_factory(); | 116 net::HttpStreamFactory* http_stream_factory = session->http_stream_factory(); |
| 105 http_stream_factory->PreconnectStreams(count, request_info, priority, | 117 http_stream_factory->PreconnectStreams(count, request_info, priority, |
| 106 ssl_config, ssl_config); | 118 ssl_config, ssl_config); |
| 107 } | 119 } |
| 108 | 120 |
| 109 } // namespace chrome_browser_net | 121 } // namespace chrome_browser_net |
| OLD | NEW |