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

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

Issue 2255883002: Pass ClientSocketHandle ownership around in unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) && 1150 bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) &&
1151 (request_info_.url.SchemeIs("http") || 1151 (request_info_.url.SchemeIs("http") ||
1152 request_info_.url.SchemeIs("ftp")); 1152 request_info_.url.SchemeIs("ftp"));
1153 if (delegate_->for_websockets()) { 1153 if (delegate_->for_websockets()) {
1154 DCHECK_NE(job_type_, PRECONNECT); 1154 DCHECK_NE(job_type_, PRECONNECT);
1155 DCHECK(delegate_->websocket_handshake_stream_create_helper()); 1155 DCHECK(delegate_->websocket_handshake_stream_create_helper());
1156 websocket_stream_.reset( 1156 websocket_stream_.reset(
1157 delegate_->websocket_handshake_stream_create_helper() 1157 delegate_->websocket_handshake_stream_create_helper()
1158 ->CreateBasicStream(std::move(connection_), using_proxy)); 1158 ->CreateBasicStream(std::move(connection_), using_proxy));
1159 } else { 1159 } else {
1160 stream_.reset(new HttpBasicStream(connection_.release(), using_proxy)); 1160 stream_.reset(new HttpBasicStream(std::move(connection_), using_proxy));
1161 } 1161 }
1162 return OK; 1162 return OK;
1163 } 1163 }
1164 1164
1165 CHECK(!stream_.get()); 1165 CHECK(!stream_.get());
1166 1166
1167 bool direct = !IsHttpsProxyAndHttpUrl(); 1167 bool direct = !IsHttpsProxyAndHttpUrl();
1168 if (existing_spdy_session_.get()) { 1168 if (existing_spdy_session_.get()) {
1169 // We picked up an existing session, so we don't need our socket. 1169 // We picked up an existing session, so we don't need our socket.
1170 if (connection_->socket()) 1170 if (connection_->socket())
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 1527
1528 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1528 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1529 if (connection_->socket()) { 1529 if (connection_->socket()) {
1530 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1530 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1531 } 1531 }
1532 1532
1533 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1533 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1534 } 1534 }
1535 1535
1536 } // namespace net 1536 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_factory_impl_job_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698