| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 PrefService* prefs = g_browser_process->local_state(); | 126 PrefService* prefs = g_browser_process->local_state(); |
| 127 if (!prefs) | 127 if (!prefs) |
| 128 return; | 128 return; |
| 129 | 129 |
| 130 // Ignore off-the-record data. | 130 // Ignore off-the-record data. |
| 131 if (!g_browser_process->profile_manager()->IsValidProfile(profile) || | 131 if (!g_browser_process->profile_manager()->IsValidProfile(profile) || |
| 132 profile->IsOffTheRecord()) { | 132 profile->IsOffTheRecord()) { |
| 133 return; | 133 return; |
| 134 } | 134 } |
| 135 #if defined(OS_ANDROID) | 135 #if defined(OS_ANDROID) && defined(SPDY_PROXY_AUTH_ORIGIN) |
| 136 // If Android ever goes multi profile, the profile should be passed so that | 136 // If Android ever goes multi profile, the profile should be passed so that |
| 137 // the browser preference will be taken. | 137 // the browser preference will be taken. |
| 138 bool with_data_reduction_proxy_enabled = | 138 bool with_data_reduction_proxy_enabled = |
| 139 ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean( | 139 ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean( |
| 140 data_reduction_proxy::prefs::kDataReductionProxyEnabled); | 140 data_reduction_proxy::prefs::kDataReductionProxyEnabled); |
| 141 #else | 141 #else |
| 142 bool with_data_reduction_proxy_enabled = false; | 142 bool with_data_reduction_proxy_enabled = false; |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 data_reduction_proxy::UpdateContentLengthPrefs(received_content_length, | 145 data_reduction_proxy::UpdateContentLengthPrefs(received_content_length, |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 data_reduction_proxy::DataReductionProxyRequestType request_type) { | 801 data_reduction_proxy::DataReductionProxyRequestType request_type) { |
| 802 DCHECK_GE(received_content_length, 0); | 802 DCHECK_GE(received_content_length, 0); |
| 803 DCHECK_GE(original_content_length, 0); | 803 DCHECK_GE(original_content_length, 0); |
| 804 StoreAccumulatedContentLength(received_content_length, | 804 StoreAccumulatedContentLength(received_content_length, |
| 805 original_content_length, | 805 original_content_length, |
| 806 request_type, | 806 request_type, |
| 807 reinterpret_cast<Profile*>(profile_)); | 807 reinterpret_cast<Profile*>(profile_)); |
| 808 received_content_length_ += received_content_length; | 808 received_content_length_ += received_content_length; |
| 809 original_content_length_ += original_content_length; | 809 original_content_length_ += original_content_length; |
| 810 } | 810 } |
| OLD | NEW |