| 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" |
| 11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
| 12 #include "chrome/browser/io_thread.h" | 12 #include "chrome/browser/io_thread.h" |
| 13 #include "chrome/common/chrome_version_info.h" | 13 #include "chrome/common/chrome_version_info.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "net/base/load_flags.h" | 15 #include "net/base/load_flags.h" |
| 16 #include "net/base/network_change_notifier.h" | 16 #include "net/base/network_change_notifier.h" |
| 17 #include "net/disk_cache/histogram_macros.h" | 17 #include "net/disk_cache/histogram_macros.h" |
| 18 #include "net/http/http_network_layer.h" | 18 #include "net/http/http_network_layer.h" |
| 19 #include "net/http/http_network_session.h" | 19 #include "net/http/http_network_session.h" |
| 20 #include "net/http/http_response_headers.h" | 20 #include "net/http/http_response_headers.h" |
| 21 #include "net/http/http_version.h" | 21 #include "net/http/http_version.h" |
| 22 #include "net/proxy/proxy_config.h" | 22 #include "net/proxy/proxy_config.h" |
| 23 #include "net/proxy/proxy_service.h" | 23 #include "net/proxy/proxy_service.h" |
| 24 #include "net/url_request/url_request_context.h" |
| 24 #include "net/url_request/url_request_context_getter.h" | 25 #include "net/url_request/url_request_context_getter.h" |
| 25 | 26 |
| 26 namespace chrome_browser_net { | 27 namespace chrome_browser_net { |
| 27 | 28 |
| 28 static const int kCanaryRequestId = 999; | 29 static const int kCanaryRequestId = 999; |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| 32 // There is one Request per RequestInfo passed in to Start() above. | 33 // There is one Request per RequestInfo passed in to Start() above. |
| 33 class Request : public internal::PipelineTestRequest, | 34 class Request : public internal::PipelineTestRequest, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 int response_code_; | 82 int response_code_; |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 Request::Request(int request_id, | 85 Request::Request(int request_id, |
| 85 const std::string& base_url, | 86 const std::string& base_url, |
| 86 const RequestInfo& info, | 87 const RequestInfo& info, |
| 87 internal::PipelineTestRequest::Delegate* delegate, | 88 internal::PipelineTestRequest::Delegate* delegate, |
| 88 net::URLRequestContext* url_request_context) | 89 net::URLRequestContext* url_request_context) |
| 89 : delegate_(delegate), | 90 : delegate_(delegate), |
| 90 request_id_(request_id), | 91 request_id_(request_id), |
| 91 url_request_(new net::URLRequest(GURL(base_url + info.filename), | 92 url_request_(url_request_context->CreateRequest( |
| 92 this, | 93 GURL(base_url + info.filename), this)), |
| 93 url_request_context)), | |
| 94 info_(info), | 94 info_(info), |
| 95 response_code_(0) { | 95 response_code_(0) { |
| 96 url_request_->set_load_flags(net::LOAD_BYPASS_CACHE | | 96 url_request_->set_load_flags(net::LOAD_BYPASS_CACHE | |
| 97 net::LOAD_DISABLE_CACHE | | 97 net::LOAD_DISABLE_CACHE | |
| 98 net::LOAD_DO_NOT_SAVE_COOKIES | | 98 net::LOAD_DO_NOT_SAVE_COOKIES | |
| 99 net::LOAD_DO_NOT_SEND_COOKIES | | 99 net::LOAD_DO_NOT_SEND_COOKIES | |
| 100 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN | | 100 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN | |
| 101 net::LOAD_DO_NOT_SEND_AUTH_DATA); | 101 net::LOAD_DO_NOT_SEND_AUTH_DATA); |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 526 |
| 527 content::BrowserThread::PostTask( | 527 content::BrowserThread::PostTask( |
| 528 content::BrowserThread::IO, | 528 content::BrowserThread::IO, |
| 529 FROM_HERE, | 529 FROM_HERE, |
| 530 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread, | 530 base::Bind(&CollectPipeliningCapabilityStatsOnIOThread, |
| 531 pipeline_test_server, | 531 pipeline_test_server, |
| 532 io_thread)); | 532 io_thread)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 } // namespace chrome_browser_net | 535 } // namespace chrome_browser_net |
| OLD | NEW |