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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 1393073002: Add external data use observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@datause_accounting_scliitle_cl_do_not_edit_2
Patch Set: More tests Created 5 years, 2 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/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 #include "chrome/browser/net/chrome_network_delegate.h" 33 #include "chrome/browser/net/chrome_network_delegate.h"
34 #include "chrome/browser/net/connect_interceptor.h" 34 #include "chrome/browser/net/connect_interceptor.h"
35 #include "chrome/browser/net/dns_probe_service.h" 35 #include "chrome/browser/net/dns_probe_service.h"
36 #include "chrome/browser/net/proxy_service_factory.h" 36 #include "chrome/browser/net/proxy_service_factory.h"
37 #include "chrome/common/channel_info.h" 37 #include "chrome/common/channel_info.h"
38 #include "chrome/common/chrome_content_client.h" 38 #include "chrome/common/chrome_content_client.h"
39 #include "chrome/common/chrome_switches.h" 39 #include "chrome/common/chrome_switches.h"
40 #include "chrome/common/pref_names.h" 40 #include "chrome/common/pref_names.h"
41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h"
42 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 42 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
43 #include "components/data_usage/core/data_use_aggregator.h"
44 #include "components/net_log/chrome_net_log.h" 43 #include "components/net_log/chrome_net_log.h"
45 #include "components/policy/core/common/policy_service.h" 44 #include "components/policy/core/common/policy_service.h"
46 #include "components/proxy_config/pref_proxy_config_tracker.h" 45 #include "components/proxy_config/pref_proxy_config_tracker.h"
47 #include "components/variations/variations_associated_data.h" 46 #include "components/variations/variations_associated_data.h"
48 #include "components/version_info/version_info.h" 47 #include "components/version_info/version_info.h"
49 #include "content/public/browser/browser_thread.h" 48 #include "content/public/browser/browser_thread.h"
50 #include "content/public/browser/cookie_store_factory.h" 49 #include "content/public/browser/cookie_store_factory.h"
51 #include "content/public/common/user_agent.h" 50 #include "content/public/common/user_agent.h"
52 #include "net/base/external_estimate_provider.h" 51 #include "net/base/external_estimate_provider.h"
53 #include "net/base/host_mapping_rules.h" 52 #include "net/base/host_mapping_rules.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 #if defined(ENABLE_EXTENSIONS) 100 #if defined(ENABLE_EXTENSIONS)
102 #include "chrome/browser/extensions/event_router_forwarder.h" 101 #include "chrome/browser/extensions/event_router_forwarder.h"
103 #endif 102 #endif
104 103
105 #if defined(USE_NSS_CERTS) || defined(OS_IOS) 104 #if defined(USE_NSS_CERTS) || defined(OS_IOS)
106 #include "net/cert_net/nss_ocsp.h" 105 #include "net/cert_net/nss_ocsp.h"
107 #endif 106 #endif
108 107
109 #if defined(OS_ANDROID) 108 #if defined(OS_ANDROID)
110 #include "base/android/build_info.h" 109 #include "base/android/build_info.h"
110 #include "chrome/browser/android/datausage/external_data_use_observer_android.h"
111 #include "chrome/browser/android/net/external_estimate_provider_android.h" 111 #include "chrome/browser/android/net/external_estimate_provider_android.h"
112 #endif 112 #endif
113 113
114 #if defined(OS_CHROMEOS) 114 #if defined(OS_CHROMEOS)
115 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" 115 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h"
116 #include "chromeos/network/host_resolver_impl_chromeos.h" 116 #include "chromeos/network/host_resolver_impl_chromeos.h"
117 #endif 117 #endif
118 118
119 using content::BrowserThread; 119 using content::BrowserThread;
120 120
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 FROM_HERE_WITH_EXPLICIT_FUNCTION( 576 FROM_HERE_WITH_EXPLICIT_FUNCTION(
577 "466432 IOThread::InitAsync::ChromeNetworkDelegate")); 577 "466432 IOThread::InitAsync::ChromeNetworkDelegate"));
578 scoped_ptr<ChromeNetworkDelegate> chrome_network_delegate( 578 scoped_ptr<ChromeNetworkDelegate> chrome_network_delegate(
579 new ChromeNetworkDelegate(extension_event_router_forwarder(), 579 new ChromeNetworkDelegate(extension_event_router_forwarder(),
580 &system_enable_referrers_)); 580 &system_enable_referrers_));
581 // By default, data usage is considered off the record. 581 // By default, data usage is considered off the record.
582 chrome_network_delegate->set_data_use_aggregator( 582 chrome_network_delegate->set_data_use_aggregator(
583 globals_->data_use_aggregator.get(), 583 globals_->data_use_aggregator.get(),
584 true /* is_data_usage_off_the_record */); 584 true /* is_data_usage_off_the_record */);
585 585
586 #if defined(OS_ANDROID)
587 globals_->external_data_use_observer.reset(
588 new chrome::android::ExternalDataUseObserverAndroid(
589 globals_->data_use_aggregator.get()));
590 #endif
591
586 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 592 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
587 // is fixed. 593 // is fixed.
588 tracked_objects::ScopedTracker tracking_profile4( 594 tracked_objects::ScopedTracker tracking_profile4(
589 FROM_HERE_WITH_EXPLICIT_FUNCTION( 595 FROM_HERE_WITH_EXPLICIT_FUNCTION(
590 "466432 IOThread::InitAsync::CreateGlobalHostResolver")); 596 "466432 IOThread::InitAsync::CreateGlobalHostResolver"));
591 globals_->system_network_delegate = chrome_network_delegate.Pass(); 597 globals_->system_network_delegate = chrome_network_delegate.Pass();
592 globals_->host_resolver = CreateGlobalHostResolver(net_log_); 598 globals_->host_resolver = CreateGlobalHostResolver(net_log_);
593 599
594 std::map<std::string, std::string> network_quality_estimator_params; 600 std::map<std::string, std::string> network_quality_estimator_params;
595 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, 601 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName,
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); 1596 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass();
1591 1597
1592 context->set_job_factory( 1598 context->set_job_factory(
1593 globals->proxy_script_fetcher_url_request_job_factory.get()); 1599 globals->proxy_script_fetcher_url_request_job_factory.get());
1594 1600
1595 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1601 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1596 // system URLRequestContext too. There's no reason this should be tied to a 1602 // system URLRequestContext too. There's no reason this should be tied to a
1597 // profile. 1603 // profile.
1598 return context; 1604 return context;
1599 } 1605 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698