| 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/http/http_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 scoped_refptr<HttpNetworkSession> | 1317 scoped_refptr<HttpNetworkSession> |
| 1318 session(SpdySessionDependencies::SpdyCreateSessionDeterministic( | 1318 session(SpdySessionDependencies::SpdyCreateSessionDeterministic( |
| 1319 &session_deps)); | 1319 &session_deps)); |
| 1320 | 1320 |
| 1321 // Now request a stream. | 1321 // Now request a stream. |
| 1322 HttpRequestInfo request_info; | 1322 HttpRequestInfo request_info; |
| 1323 request_info.method = "GET"; | 1323 request_info.method = "GET"; |
| 1324 request_info.url = GURL("ws://www.google.com:8888"); | 1324 request_info.url = GURL("ws://www.google.com:8888"); |
| 1325 request_info.load_flags = 0; | 1325 request_info.load_flags = 0; |
| 1326 | 1326 |
| 1327 session->http_server_properties()->SetAlternateProtocol( | 1327 session->http_server_properties()->SetAlternativeService( |
| 1328 HostPortPair("www.google.com", 8888), 9999, NPN_SPDY_3, 1.0); | 1328 HostPortPair("www.google.com", 8888), |
| 1329 AlternativeService(NPN_SPDY_3, "www.google.com", 9999), 1.0); |
| 1329 | 1330 |
| 1330 SSLConfig ssl_config; | 1331 SSLConfig ssl_config; |
| 1331 StreamRequestWaiter waiter; | 1332 StreamRequestWaiter waiter; |
| 1332 WebSocketStreamCreateHelper create_helper; | 1333 WebSocketStreamCreateHelper create_helper; |
| 1333 scoped_ptr<HttpStreamRequest> request( | 1334 scoped_ptr<HttpStreamRequest> request( |
| 1334 session->http_stream_factory_for_websocket() | 1335 session->http_stream_factory_for_websocket() |
| 1335 ->RequestWebSocketHandshakeStream(request_info, | 1336 ->RequestWebSocketHandshakeStream(request_info, |
| 1336 DEFAULT_PRIORITY, | 1337 DEFAULT_PRIORITY, |
| 1337 ssl_config, | 1338 ssl_config, |
| 1338 ssl_config, | 1339 ssl_config, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1360 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 1361 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
| 1361 | 1362 |
| 1362 // Make sure there is no orphaned job. it is already canceled. | 1363 // Make sure there is no orphaned job. it is already canceled. |
| 1363 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( | 1364 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( |
| 1364 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); | 1365 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); |
| 1365 } | 1366 } |
| 1366 | 1367 |
| 1367 } // namespace | 1368 } // namespace |
| 1368 | 1369 |
| 1369 } // namespace net | 1370 } // namespace net |
| OLD | NEW |