| 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/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "net/base/load_flags.h" | 9 #include "net/base/load_flags.h" |
| 10 #include "net/disk_cache/histogram_macros.h" | 10 #include "net/disk_cache/histogram_macros.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const std::string& base_url, | 67 const std::string& base_url, |
| 68 const RequestInfo& info, | 68 const RequestInfo& info, |
| 69 HttpPipeliningCompatibilityClient* client, | 69 HttpPipeliningCompatibilityClient* client, |
| 70 net::URLRequestContext* url_request_context) | 70 net::URLRequestContext* url_request_context) |
| 71 : request_id_(request_id), | 71 : request_id_(request_id), |
| 72 request_(GURL(base_url + info.filename), this), | 72 request_(GURL(base_url + info.filename), this), |
| 73 info_(info), | 73 info_(info), |
| 74 client_(client), | 74 client_(client), |
| 75 finished_(false) { | 75 finished_(false) { |
| 76 request_.set_context(url_request_context); | 76 request_.set_context(url_request_context); |
| 77 // TODO(simonjam): Force pipelining. | |
| 78 request_.set_load_flags(net::LOAD_BYPASS_CACHE | | 77 request_.set_load_flags(net::LOAD_BYPASS_CACHE | |
| 79 net::LOAD_DISABLE_CACHE | | 78 net::LOAD_DISABLE_CACHE | |
| 80 net::LOAD_DO_NOT_SAVE_COOKIES | | 79 net::LOAD_DO_NOT_SAVE_COOKIES | |
| 81 net::LOAD_DO_NOT_SEND_COOKIES | | 80 net::LOAD_DO_NOT_SEND_COOKIES | |
| 82 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN | | 81 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN | |
| 83 net::LOAD_DO_NOT_SEND_AUTH_DATA); | 82 net::LOAD_DO_NOT_SEND_AUTH_DATA | |
| 83 net::LOAD_FORCE_HTTP_PIPELINING); |
| 84 request_.Start(); | 84 request_.Start(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 HttpPipeliningCompatibilityClient::Request::~Request() { | 87 HttpPipeliningCompatibilityClient::Request::~Request() { |
| 88 } | 88 } |
| 89 | 89 |
| 90 void HttpPipeliningCompatibilityClient::Request::OnReceivedRedirect( | 90 void HttpPipeliningCompatibilityClient::Request::OnReceivedRedirect( |
| 91 net::URLRequest* request, | 91 net::URLRequest* request, |
| 92 const GURL& new_url, | 92 const GURL& new_url, |
| 93 bool* defer_redirect) { | 93 bool* defer_redirect) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // that all pipelining errors can be detected by the network stack, then we | 179 // that all pipelining errors can be detected by the network stack, then we |
| 180 // don't need to worry about broken proxies. | 180 // don't need to worry about broken proxies. |
| 181 client_->ReportNetworkError(request_id_, status.error()); | 181 client_->ReportNetworkError(request_id_, status.error()); |
| 182 client_->OnRequestFinished(request_id_, NETWORK_ERROR); | 182 client_->OnRequestFinished(request_id_, NETWORK_ERROR); |
| 183 return; | 183 return; |
| 184 } | 184 } |
| 185 client_->OnRequestFinished(request_id_, result); | 185 client_->OnRequestFinished(request_id_, result); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace chrome_browser_net | 188 } // namespace chrome_browser_net |
| OLD | NEW |