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

Side by Side 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: 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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "chrome/common/pref_names.h" 56 #include "chrome/common/pref_names.h"
57 #include "chrome/common/url_constants.h" 57 #include "chrome/common/url_constants.h"
58 #include "components/about_handler/about_protocol_handler.h" 58 #include "components/about_handler/about_protocol_handler.h"
59 #include "components/content_settings/core/browser/content_settings_provider.h" 59 #include "components/content_settings/core/browser/content_settings_provider.h"
60 #include "components/content_settings/core/browser/cookie_settings.h" 60 #include "components/content_settings/core/browser/cookie_settings.h"
61 #include "components/content_settings/core/browser/host_content_settings_map.h" 61 #include "components/content_settings/core/browser/host_content_settings_map.h"
62 #include "components/cookie_config/cookie_store_util.h" 62 #include "components/cookie_config/cookie_store_util.h"
63 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 63 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
64 #include "components/dom_distiller/core/url_constants.h" 64 #include "components/dom_distiller/core/url_constants.h"
65 #include "components/metrics/metrics_pref_names.h" 65 #include "components/metrics/metrics_pref_names.h"
66 #include "components/metrics/metrics_service.h"
66 #include "components/net_log/chrome_net_log.h" 67 #include "components/net_log/chrome_net_log.h"
67 #include "components/policy/core/browser/url_blacklist_manager.h" 68 #include "components/policy/core/browser/url_blacklist_manager.h"
68 #include "components/policy/core/common/cloud/policy_header_io_helper.h" 69 #include "components/policy/core/common/cloud/policy_header_io_helper.h"
69 #include "components/policy/core/common/cloud/policy_header_service.h" 70 #include "components/policy/core/common/cloud/policy_header_service.h"
70 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" 71 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
71 #include "components/prefs/pref_service.h" 72 #include "components/prefs/pref_service.h"
72 #include "components/signin/core/common/signin_pref_names.h" 73 #include "components/signin/core/common/signin_pref_names.h"
73 #include "components/sync_driver/pref_names.h" 74 #include "components/sync_driver/pref_names.h"
74 #include "components/url_formatter/url_fixer.h" 75 #include "components/url_formatter/url_fixer.h"
75 #include "content/public/browser/browser_thread.h" 76 #include "content/public/browser/browser_thread.h"
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 incognito_availibility_pref_.Init( 539 incognito_availibility_pref_.Init(
539 prefs::kIncognitoModeAvailability, pref_service); 540 prefs::kIncognitoModeAvailability, pref_service);
540 incognito_availibility_pref_.MoveToThread(io_task_runner); 541 incognito_availibility_pref_.MoveToThread(io_task_runner);
541 542
542 initialized_on_UI_thread_ = true; 543 initialized_on_UI_thread_ = true;
543 544
544 // We need to make sure that content initializes its own data structures that 545 // We need to make sure that content initializes its own data structures that
545 // are associated with each ResourceContext because we might post this 546 // are associated with each ResourceContext because we might post this
546 // object to the IO thread after this function. 547 // object to the IO thread after this function.
547 BrowserContext::EnsureResourceContextInitialized(profile); 548 BrowserContext::EnsureResourceContextInitialized(profile);
549
550 // Callback for updating data use prefs should be obtained on UI thread.
551 metrics_data_use_forwarder_ =
552 g_browser_process->metrics_service()->GetDataUseForwardingCallback();
mmenke 2016/04/04 17:26:23 Can we just grab the callback from the IOThread?
gayane -on leave until 09-2017 2016/04/05 14:26:46 Did you mean to get from IOThread object ? If so,
548 } 553 }
549 554
550 ProfileIOData::MediaRequestContext::MediaRequestContext() { 555 ProfileIOData::MediaRequestContext::MediaRequestContext() {
551 } 556 }
552 557
553 void ProfileIOData::MediaRequestContext::SetHttpTransactionFactory( 558 void ProfileIOData::MediaRequestContext::SetHttpTransactionFactory(
554 scoped_ptr<net::HttpTransactionFactory> http_factory) { 559 scoped_ptr<net::HttpTransactionFactory> http_factory) {
555 http_factory_ = std::move(http_factory); 560 http_factory_ = std::move(http_factory);
556 set_http_transaction_factory(http_factory_.get()); 561 set_http_transaction_factory(http_factory_.get());
557 } 562 }
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 1014
1010 IOThread* const io_thread = profile_params_->io_thread; 1015 IOThread* const io_thread = profile_params_->io_thread;
1011 IOThread::Globals* const io_thread_globals = io_thread->globals(); 1016 IOThread::Globals* const io_thread_globals = io_thread->globals();
1012 const base::CommandLine& command_line = 1017 const base::CommandLine& command_line =
1013 *base::CommandLine::ForCurrentProcess(); 1018 *base::CommandLine::ForCurrentProcess();
1014 1019
1015 // Create the common request contexts. 1020 // Create the common request contexts.
1016 main_request_context_.reset(new net::URLRequestContext()); 1021 main_request_context_.reset(new net::URLRequestContext());
1017 extensions_request_context_.reset(new net::URLRequestContext()); 1022 extensions_request_context_.reset(new net::URLRequestContext());
1018 1023
1019 scoped_ptr<ChromeNetworkDelegate> network_delegate( 1024 scoped_ptr<ChromeNetworkDelegate> network_delegate(new ChromeNetworkDelegate(
1020 new ChromeNetworkDelegate(
1021 #if defined(ENABLE_EXTENSIONS) 1025 #if defined(ENABLE_EXTENSIONS)
1022 io_thread_globals->extension_event_router_forwarder.get(), 1026 io_thread_globals->extension_event_router_forwarder.get(),
1023 #else 1027 #else
1024 NULL, 1028 NULL,
1025 #endif 1029 #endif
1026 &enable_referrers_)); 1030 &enable_referrers_, metrics_data_use_forwarder_));
1027 #if defined(ENABLE_EXTENSIONS) 1031 #if defined(ENABLE_EXTENSIONS)
1028 network_delegate->set_extension_info_map( 1032 network_delegate->set_extension_info_map(
1029 profile_params_->extension_info_map.get()); 1033 profile_params_->extension_info_map.get());
1030 if (!command_line.HasSwitch(switches::kDisableExtensionsHttpThrottling)) { 1034 if (!command_line.HasSwitch(switches::kDisableExtensionsHttpThrottling)) {
1031 extension_throttle_manager_.reset( 1035 extension_throttle_manager_.reset(
1032 new extensions::ExtensionThrottleManager()); 1036 new extensions::ExtensionThrottleManager());
1033 } 1037 }
1034 #endif 1038 #endif
1035 1039
1036 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); 1040 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get());
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 make_scoped_ptr(new DevToolsNetworkTransactionFactory( 1323 make_scoped_ptr(new DevToolsNetworkTransactionFactory(
1320 network_controller_handle_.GetController(), shared_session)), 1324 network_controller_handle_.GetController(), shared_session)),
1321 std::move(backend), true /* set_up_quic_server_info */)); 1325 std::move(backend), true /* set_up_quic_server_info */));
1322 } 1326 }
1323 1327
1324 void ProfileIOData::SetCookieSettingsForTesting( 1328 void ProfileIOData::SetCookieSettingsForTesting(
1325 content_settings::CookieSettings* cookie_settings) { 1329 content_settings::CookieSettings* cookie_settings) {
1326 DCHECK(!cookie_settings_.get()); 1330 DCHECK(!cookie_settings_.get());
1327 cookie_settings_ = cookie_settings; 1331 cookie_settings_ = cookie_settings;
1328 } 1332 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698