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 "net/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 connection->Init(endpoint_host_port_pair_.ToString(), | 200 connection->Init(endpoint_host_port_pair_.ToString(), |
201 transport_params_, LOWEST, CompletionCallback(), | 201 transport_params_, LOWEST, CompletionCallback(), |
202 session_->GetTransportSocketPool( | 202 session_->GetTransportSocketPool( |
203 HttpNetworkSession::NORMAL_SOCKET_POOL), | 203 HttpNetworkSession::NORMAL_SOCKET_POOL), |
204 net_log_.bound())); | 204 net_log_.bound())); |
205 spdy_session_->InitializeWithSocket(connection.release(), false, OK); | 205 spdy_session_->InitializeWithSocket(connection.release(), false, OK); |
206 | 206 |
207 // Create the SPDY Stream. | 207 // Create the SPDY Stream. |
208 base::WeakPtr<SpdyStream> spdy_stream( | 208 base::WeakPtr<SpdyStream> spdy_stream( |
209 CreateStreamSynchronously( | 209 CreateStreamSynchronously( |
210 spdy_session_, url_, LOWEST, net_log_.bound())); | 210 SPDY_BIDIRECTIONAL_STREAM, spdy_session_, url_, LOWEST, |
| 211 net_log_.bound())); |
211 ASSERT_TRUE(spdy_stream.get() != NULL); | 212 ASSERT_TRUE(spdy_stream.get() != NULL); |
212 | 213 |
213 // Create the SpdyProxyClientSocket. | 214 // Create the SpdyProxyClientSocket. |
214 sock_.reset( | 215 sock_.reset( |
215 new SpdyProxyClientSocket(spdy_stream, user_agent_, | 216 new SpdyProxyClientSocket(spdy_stream, user_agent_, |
216 endpoint_host_port_pair_, url_, | 217 endpoint_host_port_pair_, url_, |
217 proxy_host_port_, net_log_.bound(), | 218 proxy_host_port_, net_log_.bound(), |
218 session_->http_auth_cache(), | 219 session_->http_auth_cache(), |
219 session_->http_auth_handler_factory())); | 220 session_->http_auth_handler_factory())); |
220 } | 221 } |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 write_callback_.callback())); | 1433 write_callback_.callback())); |
1433 | 1434 |
1434 Run(2); | 1435 Run(2); |
1435 | 1436 |
1436 EXPECT_FALSE(sock_.get()); | 1437 EXPECT_FALSE(sock_.get()); |
1437 EXPECT_TRUE(read_callback.have_result()); | 1438 EXPECT_TRUE(read_callback.have_result()); |
1438 EXPECT_FALSE(write_callback_.have_result()); | 1439 EXPECT_FALSE(write_callback_.have_result()); |
1439 } | 1440 } |
1440 | 1441 |
1441 } // namespace net | 1442 } // namespace net |
OLD | NEW |