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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1818613002: Implement UMA log throttling for cellular connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build for gn, fix unittests, add comments Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index c4e0cd99ea99340dd0a1c09db223a65b0e501053..66d6d2ce9bf8b1e2eee88fc2ce8eff96493bd09d 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -63,6 +63,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/metrics/metrics_pref_names.h"
+#include "components/metrics/metrics_service.h"
#include "components/net_log/chrome_net_log.h"
#include "components/policy/core/browser/url_blacklist_manager.h"
#include "components/policy/core/common/cloud/policy_header_io_helper.h"
@@ -545,6 +546,11 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
// are associated with each ResourceContext because we might post this
// object to the IO thread after this function.
BrowserContext::EnsureResourceContextInitialized(profile);
+
+ // Callback for updating data use prefs should be obtained on UI thread.
+ metrics_data_use_forwarder_ = metrics::DataUseTracker::GetForwardingCallback(
+ g_browser_process->metrics_service()->GetDataUseTracker(),
+ base::ThreadTaskRunnerHandle::Get());
}
ProfileIOData::MediaRequestContext::MediaRequestContext() {
@@ -1016,14 +1022,13 @@ void ProfileIOData::Init(
main_request_context_.reset(new net::URLRequestContext());
extensions_request_context_.reset(new net::URLRequestContext());
- scoped_ptr<ChromeNetworkDelegate> network_delegate(
- new ChromeNetworkDelegate(
+ scoped_ptr<ChromeNetworkDelegate> network_delegate(new ChromeNetworkDelegate(
#if defined(ENABLE_EXTENSIONS)
- io_thread_globals->extension_event_router_forwarder.get(),
+ io_thread_globals->extension_event_router_forwarder.get(),
#else
- NULL,
+ NULL,
#endif
- &enable_referrers_));
+ &enable_referrers_, metrics_data_use_forwarder_));
#if defined(ENABLE_EXTENSIONS)
network_delegate->set_extension_info_map(
profile_params_->extension_info_map.get());

Powered by Google App Engine
This is Rietveld 408576698