| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 467 |
| 468 if (force_safe_search && rv == net::OK && new_url->is_empty()) | 468 if (force_safe_search && rv == net::OK && new_url->is_empty()) |
| 469 ForceGoogleSafeSearch(request, new_url); | 469 ForceGoogleSafeSearch(request, new_url); |
| 470 | 470 |
| 471 if (connect_interceptor_) | 471 if (connect_interceptor_) |
| 472 connect_interceptor_->WitnessURLRequest(request); | 472 connect_interceptor_->WitnessURLRequest(request); |
| 473 | 473 |
| 474 return rv; | 474 return rv; |
| 475 } | 475 } |
| 476 | 476 |
| 477 void ChromeNetworkDelegate::OnResolveProxy( |
| 478 const GURL& url, int load_flags, net::ProxyInfo* result) { |
| 479 if (!on_resolve_proxy_handler_.is_null()) { |
| 480 on_resolve_proxy_handler_.Run(url, load_flags, |
| 481 data_reduction_proxy_params_, result); |
| 482 } |
| 483 } |
| 484 |
| 477 int ChromeNetworkDelegate::OnBeforeSendHeaders( | 485 int ChromeNetworkDelegate::OnBeforeSendHeaders( |
| 478 net::URLRequest* request, | 486 net::URLRequest* request, |
| 479 const net::CompletionCallback& callback, | 487 const net::CompletionCallback& callback, |
| 480 net::HttpRequestHeaders* headers) { | 488 net::HttpRequestHeaders* headers) { |
| 481 TRACE_EVENT_ASYNC_STEP_PAST0("net", "URLRequest", request, "SendRequest"); | 489 TRACE_EVENT_ASYNC_STEP_PAST0("net", "URLRequest", request, "SendRequest"); |
| 482 return extensions_delegate_->OnBeforeSendHeaders(request, callback, headers); | 490 return extensions_delegate_->OnBeforeSendHeaders(request, callback, headers); |
| 483 } | 491 } |
| 484 | 492 |
| 485 void ChromeNetworkDelegate::OnBeforeSendProxyHeaders( | 493 void ChromeNetworkDelegate::OnBeforeSendProxyHeaders( |
| 486 net::URLRequest* request, | 494 net::URLRequest* request, |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 data_reduction_proxy::DataReductionProxyRequestType request_type) { | 832 data_reduction_proxy::DataReductionProxyRequestType request_type) { |
| 825 DCHECK_GE(received_content_length, 0); | 833 DCHECK_GE(received_content_length, 0); |
| 826 DCHECK_GE(original_content_length, 0); | 834 DCHECK_GE(original_content_length, 0); |
| 827 StoreAccumulatedContentLength(received_content_length, | 835 StoreAccumulatedContentLength(received_content_length, |
| 828 original_content_length, | 836 original_content_length, |
| 829 request_type, | 837 request_type, |
| 830 reinterpret_cast<Profile*>(profile_)); | 838 reinterpret_cast<Profile*>(profile_)); |
| 831 received_content_length_ += received_content_length; | 839 received_content_length_ += received_content_length; |
| 832 original_content_length_ += original_content_length; | 840 original_content_length_ += original_content_length; |
| 833 } | 841 } |
| OLD | NEW |