Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: net/http/http_network_transaction.cc

Issue 1850043002: Check whether to enable token binding in preconnect.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ssl_config args from PreconnectStreams and remove privacy mode/token binding duplicate logic Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 request_headers_(), 116 request_headers_(),
117 read_buf_len_(0), 117 read_buf_len_(0),
118 total_received_bytes_(0), 118 total_received_bytes_(0),
119 total_sent_bytes_(0), 119 total_sent_bytes_(0),
120 next_state_(STATE_NONE), 120 next_state_(STATE_NONE),
121 establishing_tunnel_(false), 121 establishing_tunnel_(false),
122 websocket_handshake_stream_base_create_helper_(NULL), 122 websocket_handshake_stream_base_create_helper_(NULL),
123 net_error_details_() { 123 net_error_details_() {
124 session->ssl_config_service()->GetSSLConfig(&server_ssl_config_); 124 session->ssl_config_service()->GetSSLConfig(&server_ssl_config_);
125 session->GetAlpnProtos(&server_ssl_config_.alpn_protos); 125 session->GetAlpnProtos(&server_ssl_config_.alpn_protos);
126 session->GetNpnProtos(&server_ssl_config_.npn_protos); 126 session->GetNpnProtos(&server_ssl_config_.npn_protos);
mmenke 2016/04/13 16:21:05 I think these three lines are no longer needed?
nharper 2016/04/18 22:22:55 If I fix two NPN tests in http_network_transaction
127 proxy_ssl_config_ = server_ssl_config_; 127 proxy_ssl_config_ = server_ssl_config_;
128 } 128 }
129 129
130 HttpNetworkTransaction::~HttpNetworkTransaction() { 130 HttpNetworkTransaction::~HttpNetworkTransaction() {
131 if (stream_.get()) { 131 if (stream_.get()) {
132 // TODO(mbelshe): The stream_ should be able to compute whether or not the 132 // TODO(mbelshe): The stream_ should be able to compute whether or not the
133 // stream should be kept alive. No reason to compute here 133 // stream should be kept alive. No reason to compute here
134 // and pass it in. 134 // and pass it in.
135 if (!stream_->CanReuseConnection() || next_state_ != STATE_NONE) { 135 if (!stream_->CanReuseConnection() || next_state_ != STATE_NONE) {
136 stream_->Close(true /* not reusable */); 136 stream_->Close(true /* not reusable */);
(...skipping 10 matching lines...) Expand all
147 if (request_ && request_->upload_data_stream) 147 if (request_ && request_->upload_data_stream)
148 request_->upload_data_stream->Reset(); // Invalidate pending callbacks. 148 request_->upload_data_stream->Reset(); // Invalidate pending callbacks.
149 } 149 }
150 150
151 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, 151 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info,
152 const CompletionCallback& callback, 152 const CompletionCallback& callback,
153 const BoundNetLog& net_log) { 153 const BoundNetLog& net_log) {
154 net_log_ = net_log; 154 net_log_ = net_log;
155 request_ = request_info; 155 request_ = request_info;
156 156
157 // Now that we have an HttpRequestInfo object, update server_ssl_config_.
158 session_->GetSSLConfig(*request_, &server_ssl_config_);
159
157 if (request_->load_flags & LOAD_DISABLE_CERT_REVOCATION_CHECKING) { 160 if (request_->load_flags & LOAD_DISABLE_CERT_REVOCATION_CHECKING) {
158 server_ssl_config_.rev_checking_enabled = false; 161 server_ssl_config_.rev_checking_enabled = false;
159 proxy_ssl_config_.rev_checking_enabled = false; 162 proxy_ssl_config_.rev_checking_enabled = false;
160 } 163 }
161 164
162 if (request_->load_flags & LOAD_PREFETCH) 165 if (request_->load_flags & LOAD_PREFETCH)
163 response_.unused_since_prefetch = true; 166 response_.unused_since_prefetch = true;
164 167
165 // Channel ID is disabled if privacy mode is enabled for this request.
166 if (request_->privacy_mode == PRIVACY_MODE_ENABLED) {
167 server_ssl_config_.channel_id_enabled = false;
168 } else if (session_->params().enable_token_binding &&
169 session_->params().channel_id_service) {
170 server_ssl_config_.token_binding_params.push_back(TB_PARAM_ECDSAP256);
171 }
172
173 next_state_ = STATE_NOTIFY_BEFORE_CREATE_STREAM; 168 next_state_ = STATE_NOTIFY_BEFORE_CREATE_STREAM;
174 int rv = DoLoop(OK); 169 int rv = DoLoop(OK);
175 if (rv == ERR_IO_PENDING) 170 if (rv == ERR_IO_PENDING)
176 callback_ = callback; 171 callback_ = callback;
177 return rv; 172 return rv;
178 } 173 }
179 174
180 int HttpNetworkTransaction::RestartIgnoringLastError( 175 int HttpNetworkTransaction::RestartIgnoringLastError(
181 const CompletionCallback& callback) { 176 const CompletionCallback& callback) {
182 DCHECK(!stream_.get()); 177 DCHECK(!stream_.get());
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 DCHECK(stream_request_); 1799 DCHECK(stream_request_);
1805 1800
1806 // Since the transaction can restart with auth credentials, it may create a 1801 // Since the transaction can restart with auth credentials, it may create a
1807 // stream more than once. Accumulate all of the connection attempts across 1802 // stream more than once. Accumulate all of the connection attempts across
1808 // those streams by appending them to the vector: 1803 // those streams by appending them to the vector:
1809 for (const auto& attempt : stream_request_->connection_attempts()) 1804 for (const auto& attempt : stream_request_->connection_attempts())
1810 connection_attempts_.push_back(attempt); 1805 connection_attempts_.push_back(attempt);
1811 } 1806 }
1812 1807
1813 } // namespace net 1808 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698