| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 void ChromeNetworkDelegate::OnResolveProxy( | 429 void ChromeNetworkDelegate::OnResolveProxy( |
| 430 const GURL& url, int load_flags, net::ProxyInfo* result) { | 430 const GURL& url, int load_flags, net::ProxyInfo* result) { |
| 431 if (!on_resolve_proxy_handler_.is_null()) { | 431 if (!on_resolve_proxy_handler_.is_null()) { |
| 432 on_resolve_proxy_handler_.Run(url, load_flags, | 432 on_resolve_proxy_handler_.Run(url, load_flags, |
| 433 data_reduction_proxy_params_, result); | 433 data_reduction_proxy_params_, result); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 void ChromeNetworkDelegate::OnProxyFallback(const net::ProxyServer& bad_proxy, | 437 void ChromeNetworkDelegate::OnProxyFallback(const net::ProxyServer& bad_proxy, |
| 438 int net_error, | 438 int net_error) { |
| 439 bool did_fallback) { | |
| 440 if (data_reduction_proxy_usage_stats_) { | 439 if (data_reduction_proxy_usage_stats_) { |
| 441 data_reduction_proxy_usage_stats_->RecordBypassEventHistograms( | 440 data_reduction_proxy_usage_stats_->RecordBypassEventHistograms( |
| 442 bad_proxy, net_error, did_fallback); | 441 bad_proxy, net_error); |
| 443 } | 442 } |
| 444 } | 443 } |
| 445 | 444 |
| 446 int ChromeNetworkDelegate::OnBeforeSendHeaders( | 445 int ChromeNetworkDelegate::OnBeforeSendHeaders( |
| 447 net::URLRequest* request, | 446 net::URLRequest* request, |
| 448 const net::CompletionCallback& callback, | 447 const net::CompletionCallback& callback, |
| 449 net::HttpRequestHeaders* headers) { | 448 net::HttpRequestHeaders* headers) { |
| 450 bool force_safe_search = force_google_safe_search_ && | 449 bool force_safe_search = force_google_safe_search_ && |
| 451 force_google_safe_search_->GetValue(); | 450 force_google_safe_search_->GetValue(); |
| 452 if (force_safe_search) | 451 if (force_safe_search) |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 data_reduction_proxy::DataReductionProxyRequestType request_type) { | 809 data_reduction_proxy::DataReductionProxyRequestType request_type) { |
| 811 DCHECK_GE(received_content_length, 0); | 810 DCHECK_GE(received_content_length, 0); |
| 812 DCHECK_GE(original_content_length, 0); | 811 DCHECK_GE(original_content_length, 0); |
| 813 StoreAccumulatedContentLength(received_content_length, | 812 StoreAccumulatedContentLength(received_content_length, |
| 814 original_content_length, | 813 original_content_length, |
| 815 request_type, | 814 request_type, |
| 816 reinterpret_cast<Profile*>(profile_)); | 815 reinterpret_cast<Profile*>(profile_)); |
| 817 received_content_length_ += received_content_length; | 816 received_content_length_ += received_content_length; |
| 818 original_content_length_ += original_content_length; | 817 original_content_length_ += original_content_length; |
| 819 } | 818 } |
| OLD | NEW |