| 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/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 const net::HttpRequestHeaders& headers) { | 490 const net::HttpRequestHeaders& headers) { |
| 491 extensions_delegate_->OnSendHeaders(request, headers); | 491 extensions_delegate_->OnSendHeaders(request, headers); |
| 492 } | 492 } |
| 493 | 493 |
| 494 int ChromeNetworkDelegate::OnHeadersReceived( | 494 int ChromeNetworkDelegate::OnHeadersReceived( |
| 495 net::URLRequest* request, | 495 net::URLRequest* request, |
| 496 const net::CompletionCallback& callback, | 496 const net::CompletionCallback& callback, |
| 497 const net::HttpResponseHeaders* original_response_headers, | 497 const net::HttpResponseHeaders* original_response_headers, |
| 498 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, | 498 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
| 499 GURL* allowed_unsafe_redirect_url) { | 499 GURL* allowed_unsafe_redirect_url) { |
| 500 data_reduction_proxy::DataReductionProxyBypassType bypass_type; | |
| 501 if (data_reduction_proxy::MaybeBypassProxyAndPrepareToRetry( | |
| 502 data_reduction_proxy_params_, | |
| 503 request, | |
| 504 original_response_headers, | |
| 505 override_response_headers, | |
| 506 &bypass_type)) { | |
| 507 if (data_reduction_proxy_usage_stats_) | |
| 508 data_reduction_proxy_usage_stats_->SetBypassType(bypass_type); | |
| 509 return net::OK; | |
| 510 } | |
| 511 | |
| 512 return extensions_delegate_->OnHeadersReceived( | 500 return extensions_delegate_->OnHeadersReceived( |
| 513 request, | 501 request, |
| 514 callback, | 502 callback, |
| 515 original_response_headers, | 503 original_response_headers, |
| 516 override_response_headers, | 504 override_response_headers, |
| 517 allowed_unsafe_redirect_url); | 505 allowed_unsafe_redirect_url); |
| 518 } | 506 } |
| 519 | 507 |
| 520 void ChromeNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, | 508 void ChromeNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, |
| 521 const GURL& new_location) { | 509 const GURL& new_location) { |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 if (data_reduction_proxy_statistics_prefs_) { | 816 if (data_reduction_proxy_statistics_prefs_) { |
| 829 StoreAccumulatedContentLength(received_content_length, | 817 StoreAccumulatedContentLength(received_content_length, |
| 830 original_content_length, | 818 original_content_length, |
| 831 request_type, | 819 request_type, |
| 832 reinterpret_cast<Profile*>(profile_), | 820 reinterpret_cast<Profile*>(profile_), |
| 833 data_reduction_proxy_statistics_prefs_); | 821 data_reduction_proxy_statistics_prefs_); |
| 834 } | 822 } |
| 835 received_content_length_ += received_content_length; | 823 received_content_length_ += received_content_length; |
| 836 original_content_length_ += original_content_length; | 824 original_content_length_ += original_content_length; |
| 837 } | 825 } |
| OLD | NEW |