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()->AddAlternateProtocol( |
1328 HostPortPair("www.google.com", 8888), 9999, NPN_SPDY_3, 1.0); | 1328 HostPortPair("www.google.com", 8888), 9999, NPN_SPDY_3, 1.0); |
1329 | 1329 |
1330 SSLConfig ssl_config; | 1330 SSLConfig ssl_config; |
1331 StreamRequestWaiter waiter; | 1331 StreamRequestWaiter waiter; |
1332 WebSocketStreamCreateHelper create_helper; | 1332 WebSocketStreamCreateHelper create_helper; |
1333 scoped_ptr<HttpStreamRequest> request( | 1333 scoped_ptr<HttpStreamRequest> request( |
1334 session->http_stream_factory_for_websocket() | 1334 session->http_stream_factory_for_websocket() |
1335 ->RequestWebSocketHandshakeStream(request_info, | 1335 ->RequestWebSocketHandshakeStream(request_info, |
1336 DEFAULT_PRIORITY, | 1336 DEFAULT_PRIORITY, |
1337 ssl_config, | 1337 ssl_config, |
(...skipping 22 matching lines...) Expand all Loading... |
1360 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 1360 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
1361 | 1361 |
1362 // Make sure there is no orphaned job. it is already canceled. | 1362 // Make sure there is no orphaned job. it is already canceled. |
1363 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( | 1363 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( |
1364 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); | 1364 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); |
1365 } | 1365 } |
1366 | 1366 |
1367 } // namespace | 1367 } // namespace |
1368 | 1368 |
1369 } // namespace net | 1369 } // namespace net |
OLD | NEW |