Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 PrefService* prefs = g_browser_process->local_state(); 128 PrefService* prefs = g_browser_process->local_state();
129 if (!prefs) 129 if (!prefs)
130 return; 130 return;
131 131
132 // Ignore off-the-record data. 132 // Ignore off-the-record data.
133 if (!g_browser_process->profile_manager()->IsValidProfile(profile) || 133 if (!g_browser_process->profile_manager()->IsValidProfile(profile) ||
134 profile->IsOffTheRecord()) { 134 profile->IsOffTheRecord()) {
135 return; 135 return;
136 } 136 }
137 #if defined(OS_ANDROID) && defined(SPDY_PROXY_AUTH_ORIGIN)
138 // If Android ever goes multi profile, the profile should be passed so that 137 // If Android ever goes multi profile, the profile should be passed so that
139 // the browser preference will be taken. 138 // the browser preference will be taken.
Ryan Sleevi 2014/08/28 17:21:01 1) This comment should be updated 2) You should "d
Not at Google. Contact bengr 2014/08/28 18:59:28 Good catch! Done. Note that the "received content
140 bool with_data_reduction_proxy_enabled = 139 bool with_data_reduction_proxy_enabled =
141 ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean( 140 ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
142 data_reduction_proxy::prefs::kDataReductionProxyEnabled); 141 data_reduction_proxy::prefs::kDataReductionProxyEnabled);
143 #else
144 bool with_data_reduction_proxy_enabled = false;
145 #endif
146 142
147 data_reduction_proxy::UpdateContentLengthPrefs(received_content_length, 143 data_reduction_proxy::UpdateContentLengthPrefs(received_content_length,
148 original_content_length, 144 original_content_length,
149 with_data_reduction_proxy_enabled, 145 with_data_reduction_proxy_enabled,
150 request_type, prefs); 146 request_type, prefs);
151 } 147 }
152 148
153 void StoreAccumulatedContentLength( 149 void StoreAccumulatedContentLength(
154 int received_content_length, 150 int received_content_length,
155 int original_content_length, 151 int original_content_length,
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 data_reduction_proxy::DataReductionProxyRequestType request_type) { 813 data_reduction_proxy::DataReductionProxyRequestType request_type) {
818 DCHECK_GE(received_content_length, 0); 814 DCHECK_GE(received_content_length, 0);
819 DCHECK_GE(original_content_length, 0); 815 DCHECK_GE(original_content_length, 0);
820 StoreAccumulatedContentLength(received_content_length, 816 StoreAccumulatedContentLength(received_content_length,
821 original_content_length, 817 original_content_length,
822 request_type, 818 request_type,
823 reinterpret_cast<Profile*>(profile_)); 819 reinterpret_cast<Profile*>(profile_));
824 received_content_length_ += received_content_length; 820 received_content_length_ += received_content_length;
825 original_content_length_ += original_content_length; 821 original_content_length_ += original_content_length;
826 } 822 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698