Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/flip/flip_network_transaction.h" | 5 #include "net/flip/flip_network_transaction.h" |
| 6 | 6 |
| 7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/field_trial.h" | 9 #include "base/field_trial.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 connection_group.append(host); | 301 connection_group.append(host); |
| 302 | 302 |
| 303 HostResolver::RequestInfo resolve_info(host, port); | 303 HostResolver::RequestInfo resolve_info(host, port); |
| 304 | 304 |
| 305 // TODO(mbelshe): Cleanup these testing tricks. | 305 // TODO(mbelshe): Cleanup these testing tricks. |
| 306 // If we want to use multiple connections, grab the flip session | 306 // If we want to use multiple connections, grab the flip session |
| 307 // up front using the original domain name. | 307 // up front using the original domain name. |
| 308 #undef USE_MULTIPLE_CONNECTIONS | 308 #undef USE_MULTIPLE_CONNECTIONS |
| 309 #undef DIVERT_URLS_TO_TEST_SERVER | 309 #undef DIVERT_URLS_TO_TEST_SERVER |
| 310 #if defined(USE_MULTIPLE_CONNECTIONS) || !defined(DIVERT_URLS_TO_TEST_SERVER) | 310 #if defined(USE_MULTIPLE_CONNECTIONS) || !defined(DIVERT_URLS_TO_TEST_SERVER) |
| 311 flip_ = FlipSession::GetFlipSession(resolve_info, session_); | 311 flip_ = session_->flip_session_pool()->Get(resolve_info, session_); |
|
Mike Belshe
2009/11/04 00:21:54
Note: I have another CL with changes in this area
| |
| 312 #endif | 312 #endif |
| 313 | 313 |
| 314 // Use this to divert URLs to a test server. | 314 // Use this to divert URLs to a test server. |
| 315 #ifdef DIVERT_URLS_TO_TEST_SERVER | 315 #ifdef DIVERT_URLS_TO_TEST_SERVER |
| 316 // Fake out this session to go to our test server. | 316 // Fake out this session to go to our test server. |
| 317 host = "servername"; | 317 host = "servername"; |
| 318 port = 443; | 318 port = 443; |
| 319 resolve_info = HostResolver::RequestInfo(host, port); | 319 resolve_info = HostResolver::RequestInfo(host, port); |
| 320 #ifndef USE_MULTIPLE_CONNECTIONS | 320 #ifndef USE_MULTIPLE_CONNECTIONS |
| 321 flip_ = FlipSession::GetFlipSession(resolve_info, session_); | 321 flip_ = session_->flip_session_pool()->Get(resolve_info, session_); |
| 322 #endif // USE_MULTIPLE_CONNECTIONS | 322 #endif // USE_MULTIPLE_CONNECTIONS |
| 323 | 323 |
| 324 #endif // DIVERT_URLS_TO_TEST_SERVER | 324 #endif // DIVERT_URLS_TO_TEST_SERVER |
| 325 | 325 |
| 326 int rv = flip_->Connect(connection_group, resolve_info, request_->priority); | 326 int rv = flip_->Connect(connection_group, resolve_info, request_->priority); |
| 327 DCHECK(rv == net::OK); // The API says it will always return OK. | 327 DCHECK(rv == net::OK); // The API says it will always return OK. |
| 328 return net::OK; | 328 return net::OK; |
| 329 } | 329 } |
| 330 | 330 |
| 331 int FlipNetworkTransaction::DoInitConnectionComplete(int result) { | 331 int FlipNetworkTransaction::DoInitConnectionComplete(int result) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 } | 399 } |
| 400 | 400 |
| 401 int FlipNetworkTransaction::DoReadBodyComplete(int result) { | 401 int FlipNetworkTransaction::DoReadBodyComplete(int result) { |
| 402 // TODO(mbelshe): record success or failure of the transaction? | 402 // TODO(mbelshe): record success or failure of the transaction? |
| 403 if (user_callback_) | 403 if (user_callback_) |
| 404 DoHttpTransactionCallback(result); | 404 DoHttpTransactionCallback(result); |
| 405 return OK; | 405 return OK; |
| 406 } | 406 } |
| 407 | 407 |
| 408 } // namespace net | 408 } // namespace net |
| OLD | NEW |