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 "chrome/browser/net/http_pipelining_compatibility_client.h" | 5 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 net::URLRequestContext* url_request_context) { | 290 net::URLRequestContext* url_request_context) { |
291 net::HttpNetworkSession* old_session = | 291 net::HttpNetworkSession* old_session = |
292 url_request_context->http_transaction_factory()->GetSession(); | 292 url_request_context->http_transaction_factory()->GetSession(); |
293 net::HttpNetworkSession::Params params = old_session->params(); | 293 net::HttpNetworkSession::Params params = old_session->params(); |
294 params.force_http_pipelining = true; | 294 params.force_http_pipelining = true; |
295 scoped_refptr<net::HttpNetworkSession> session = | 295 scoped_refptr<net::HttpNetworkSession> session = |
296 new net::HttpNetworkSession(params); | 296 new net::HttpNetworkSession(params); |
297 http_transaction_factory_.reset( | 297 http_transaction_factory_.reset( |
298 net::HttpNetworkLayer::CreateFactory(session.get())); | 298 net::HttpNetworkLayer::CreateFactory(session.get())); |
299 | 299 |
300 url_request_context_ = new net::URLRequestContext; | 300 url_request_context_.reset(new net::URLRequestContext); |
301 url_request_context_->CopyFrom(url_request_context); | 301 url_request_context_->CopyFrom(url_request_context); |
302 url_request_context_->set_http_transaction_factory( | 302 url_request_context_->set_http_transaction_factory( |
303 http_transaction_factory_.get()); | 303 http_transaction_factory_.get()); |
304 | 304 |
305 finished_callback_ = callback; | 305 finished_callback_ = callback; |
306 for (size_t i = 0; i < requests.size(); ++i) { | 306 for (size_t i = 0; i < requests.size(); ++i) { |
307 requests_.push_back(factory_->NewRequest( | 307 requests_.push_back(factory_->NewRequest( |
308 i, base_url, requests[i], this, url_request_context_.get(), | 308 i, base_url, requests[i], this, url_request_context_.get(), |
309 internal::PipelineTestRequest::TYPE_PIPELINED)); | 309 internal::PipelineTestRequest::TYPE_PIPELINED)); |
310 } | 310 } |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 content::BrowserThread::PostTask( | 526 content::BrowserThread::PostTask( |
527 content::BrowserThread::IO, | 527 content::BrowserThread::IO, |
528 FROM_HERE, | 528 FROM_HERE, |
529 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread, | 529 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread, |
530 pipeline_test_server, | 530 pipeline_test_server, |
531 io_thread)); | 531 io_thread)); |
532 } | 532 } |
533 | 533 |
534 } // namespace chrome_browser_net | 534 } // namespace chrome_browser_net |
OLD | NEW |