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

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

Issue 1818613002: Implement UMA log throttling for cellular connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 if (CanRequestBeDeltaEncoded(request)) { 279 if (CanRequestBeDeltaEncoded(request)) {
280 UMA_HISTOGRAM_COUNTS("Net.CacheState.EncodeableBytes", size); 280 UMA_HISTOGRAM_COUNTS("Net.CacheState.EncodeableBytes", size);
281 } 281 }
282 } 282 }
283 } 283 }
284 284
285 } // namespace 285 } // namespace
286 286
287 ChromeNetworkDelegate::ChromeNetworkDelegate( 287 ChromeNetworkDelegate::ChromeNetworkDelegate(
288 extensions::EventRouterForwarder* event_router, 288 extensions::EventRouterForwarder* event_router,
289 BooleanPrefMember* enable_referrers) 289 BooleanPrefMember* enable_referrers,
290 const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder)
290 : profile_(NULL), 291 : profile_(NULL),
291 enable_referrers_(enable_referrers), 292 enable_referrers_(enable_referrers),
292 enable_do_not_track_(NULL), 293 enable_do_not_track_(NULL),
293 force_google_safe_search_(NULL), 294 force_google_safe_search_(NULL),
294 force_youtube_safety_mode_(NULL), 295 force_youtube_safety_mode_(NULL),
295 url_blacklist_manager_(NULL), 296 url_blacklist_manager_(NULL),
296 domain_reliability_monitor_(NULL), 297 domain_reliability_monitor_(NULL),
298 data_use_measurement_(metrics_data_use_forwarder),
297 experimental_web_platform_features_enabled_( 299 experimental_web_platform_features_enabled_(
298 base::CommandLine::ForCurrentProcess() 300 base::CommandLine::ForCurrentProcess()->HasSwitch(
299 ->HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)), 301 switches::kEnableExperimentalWebPlatformFeatures)),
300 data_use_aggregator_(nullptr), 302 data_use_aggregator_(nullptr),
301 is_data_usage_off_the_record_(true) { 303 is_data_usage_off_the_record_(true) {
302 DCHECK(enable_referrers); 304 DCHECK(enable_referrers);
303 extensions_delegate_.reset( 305 extensions_delegate_.reset(
304 ChromeExtensionsNetworkDelegate::Create(event_router)); 306 ChromeExtensionsNetworkDelegate::Create(event_router));
305 } 307 }
306 308
307 ChromeNetworkDelegate::~ChromeNetworkDelegate() {} 309 ChromeNetworkDelegate::~ChromeNetworkDelegate() {}
308 310
309 void ChromeNetworkDelegate::set_extension_info_map( 311 void ChromeNetworkDelegate::set_extension_info_map(
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 if (!data_use_aggregator_) 743 if (!data_use_aggregator_)
742 return; 744 return;
743 745
744 if (is_data_usage_off_the_record_) { 746 if (is_data_usage_off_the_record_) {
745 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); 747 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes);
746 return; 748 return;
747 } 749 }
748 750
749 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); 751 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes);
750 } 752 }
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | chrome/browser/net/chrome_network_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698