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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 | 1306 |
1307 scoped_refptr<HttpNetworkSession> session( | 1307 scoped_refptr<HttpNetworkSession> session( |
1308 SpdySessionDependencies::SpdyCreateSession(&session_deps)); | 1308 SpdySessionDependencies::SpdyCreateSession(&session_deps)); |
1309 | 1309 |
1310 // Now request a stream. | 1310 // Now request a stream. |
1311 HttpRequestInfo request_info; | 1311 HttpRequestInfo request_info; |
1312 request_info.method = "GET"; | 1312 request_info.method = "GET"; |
1313 request_info.url = GURL("ws://www.google.com:8888"); | 1313 request_info.url = GURL("ws://www.google.com:8888"); |
1314 request_info.load_flags = 0; | 1314 request_info.load_flags = 0; |
1315 | 1315 |
1316 session->http_server_properties()->SetAlternativeService( | 1316 session->http_server_properties()->AddAlternativeService( |
1317 HostPortPair("www.google.com", 8888), | 1317 HostPortPair("www.google.com", 8888), |
1318 AlternativeService(NPN_SPDY_4, "www.google.com", 9999), 1.0); | 1318 AlternativeService(NPN_SPDY_4, "www.google.com", 9999), 1.0); |
1319 | 1319 |
1320 SSLConfig ssl_config; | 1320 SSLConfig ssl_config; |
1321 StreamRequestWaiter waiter; | 1321 StreamRequestWaiter waiter; |
1322 WebSocketStreamCreateHelper create_helper; | 1322 WebSocketStreamCreateHelper create_helper; |
1323 scoped_ptr<HttpStreamRequest> request( | 1323 scoped_ptr<HttpStreamRequest> request( |
1324 session->http_stream_factory_for_websocket() | 1324 session->http_stream_factory_for_websocket() |
1325 ->RequestWebSocketHandshakeStream(request_info, | 1325 ->RequestWebSocketHandshakeStream(request_info, |
1326 DEFAULT_PRIORITY, | 1326 DEFAULT_PRIORITY, |
(...skipping 23 matching lines...) Expand all Loading... |
1350 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 1350 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
1351 | 1351 |
1352 // Make sure there is no orphaned job. it is already canceled. | 1352 // Make sure there is no orphaned job. it is already canceled. |
1353 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( | 1353 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( |
1354 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); | 1354 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); |
1355 } | 1355 } |
1356 | 1356 |
1357 } // namespace | 1357 } // namespace |
1358 | 1358 |
1359 } // namespace net | 1359 } // namespace net |
OLD | NEW |