| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 spdy_session_ = | 192 spdy_session_ = |
| 193 CreateInsecureSpdySession( | 193 CreateInsecureSpdySession( |
| 194 session_, endpoint_spdy_session_key_, BoundNetLog()); | 194 session_, endpoint_spdy_session_key_, BoundNetLog()); |
| 195 base::WeakPtr<SpdyStream> spdy_stream( | 195 base::WeakPtr<SpdyStream> spdy_stream( |
| 196 CreateStreamSynchronously( | 196 CreateStreamSynchronously( |
| 197 SPDY_BIDIRECTIONAL_STREAM, spdy_session_, url_, LOWEST, | 197 SPDY_BIDIRECTIONAL_STREAM, spdy_session_, url_, LOWEST, |
| 198 net_log_.bound())); | 198 net_log_.bound())); |
| 199 ASSERT_TRUE(spdy_stream.get() != NULL); | 199 ASSERT_TRUE(spdy_stream.get() != NULL); |
| 200 | 200 |
| 201 // Create the SpdyProxyClientSocket. | 201 // Create the SpdyProxyClientSocket. |
| 202 sock_.reset( | 202 sock_.reset(new SpdyProxyClientSocket( |
| 203 new SpdyProxyClientSocket(spdy_stream, user_agent_, | 203 spdy_stream, user_agent_, endpoint_host_port_pair_, proxy_host_port_, |
| 204 endpoint_host_port_pair_, url_, | 204 net_log_.bound(), session_->http_auth_cache(), |
| 205 proxy_host_port_, net_log_.bound(), | 205 session_->http_auth_handler_factory())); |
| 206 session_->http_auth_cache(), | |
| 207 session_->http_auth_handler_factory())); | |
| 208 } | 206 } |
| 209 | 207 |
| 210 scoped_refptr<IOBufferWithSize> SpdyProxyClientSocketTest::CreateBuffer( | 208 scoped_refptr<IOBufferWithSize> SpdyProxyClientSocketTest::CreateBuffer( |
| 211 const char* data, int size) { | 209 const char* data, int size) { |
| 212 scoped_refptr<IOBufferWithSize> buf(new IOBufferWithSize(size)); | 210 scoped_refptr<IOBufferWithSize> buf(new IOBufferWithSize(size)); |
| 213 memcpy(buf->data(), data, size); | 211 memcpy(buf->data(), data, size); |
| 214 return buf; | 212 return buf; |
| 215 } | 213 } |
| 216 | 214 |
| 217 void SpdyProxyClientSocketTest::AssertConnectSucceeds() { | 215 void SpdyProxyClientSocketTest::AssertConnectSucceeds() { |
| (...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 | 1372 |
| 1375 EXPECT_FALSE(sock_.get()); | 1373 EXPECT_FALSE(sock_.get()); |
| 1376 EXPECT_TRUE(read_callback.have_result()); | 1374 EXPECT_TRUE(read_callback.have_result()); |
| 1377 EXPECT_FALSE(write_callback_.have_result()); | 1375 EXPECT_FALSE(write_callback_.have_result()); |
| 1378 | 1376 |
| 1379 // Let the RST_STREAM write while |rst| is in-scope. | 1377 // Let the RST_STREAM write while |rst| is in-scope. |
| 1380 base::MessageLoop::current()->RunUntilIdle(); | 1378 base::MessageLoop::current()->RunUntilIdle(); |
| 1381 } | 1379 } |
| 1382 | 1380 |
| 1383 } // namespace net | 1381 } // namespace net |
| OLD | NEW |