OLD | NEW |
---|---|
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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 #include "base/strings/string_util.h" | 27 #include "base/strings/string_util.h" |
28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
29 #include "base/threading/sequenced_worker_pool.h" | 29 #include "base/threading/sequenced_worker_pool.h" |
30 #include "base/threading/thread.h" | 30 #include "base/threading/thread.h" |
31 #include "base/threading/worker_pool.h" | 31 #include "base/threading/worker_pool.h" |
32 #include "base/time/time.h" | 32 #include "base/time/time.h" |
33 #include "base/trace_event/trace_event.h" | 33 #include "base/trace_event/trace_event.h" |
34 #include "build/build_config.h" | 34 #include "build/build_config.h" |
35 #include "chrome/browser/browser_process.h" | 35 #include "chrome/browser/browser_process.h" |
36 #include "chrome/browser/data_usage/tab_id_annotator.h" | 36 #include "chrome/browser/data_usage/tab_id_annotator.h" |
37 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" | |
37 #include "chrome/browser/net/async_dns_field_trial.h" | 38 #include "chrome/browser/net/async_dns_field_trial.h" |
38 #include "chrome/browser/net/chrome_network_delegate.h" | 39 #include "chrome/browser/net/chrome_network_delegate.h" |
39 #include "chrome/browser/net/dns_probe_service.h" | 40 #include "chrome/browser/net/dns_probe_service.h" |
40 #include "chrome/browser/net/proxy_service_factory.h" | 41 #include "chrome/browser/net/proxy_service_factory.h" |
41 #include "chrome/browser/net/sth_distributor_provider.h" | 42 #include "chrome/browser/net/sth_distributor_provider.h" |
42 #include "chrome/common/channel_info.h" | 43 #include "chrome/common/channel_info.h" |
43 #include "chrome/common/chrome_content_client.h" | 44 #include "chrome/common/chrome_content_client.h" |
44 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
46 #include "components/certificate_transparency/tree_state_tracker.h" | 47 #include "components/certificate_transparency/tree_state_tracker.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
495 #if defined(ENABLE_EXTENSIONS) | 496 #if defined(ENABLE_EXTENSIONS) |
496 globals_->extension_event_router_forwarder = | 497 globals_->extension_event_router_forwarder = |
497 extension_event_router_forwarder_; | 498 extension_event_router_forwarder_; |
498 #endif | 499 #endif |
499 | 500 |
500 std::unique_ptr<data_usage::DataUseAmortizer> data_use_amortizer; | 501 std::unique_ptr<data_usage::DataUseAmortizer> data_use_amortizer; |
501 #if BUILDFLAG(ANDROID_JAVA_UI) | 502 #if BUILDFLAG(ANDROID_JAVA_UI) |
502 data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); | 503 data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); |
503 #endif | 504 #endif |
504 | 505 |
506 globals_->data_use_ascriber.reset( | |
Lei Zhang
2016/09/08 22:04:43
data_use_ascriber = base::MakeUnique<data_use_meas
Not at Google. Contact bengr
2016/09/09 18:37:17
Done.
| |
507 new data_use_measurement::ChromeDataUseAscriber()); | |
508 | |
505 globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator( | 509 globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator( |
506 std::unique_ptr<data_usage::DataUseAnnotator>( | 510 std::unique_ptr<data_usage::DataUseAnnotator>( |
507 new chrome_browser_data_usage::TabIdAnnotator()), | 511 new chrome_browser_data_usage::TabIdAnnotator()), |
508 std::move(data_use_amortizer))); | 512 std::move(data_use_amortizer))); |
509 | 513 |
510 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( | 514 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( |
511 new ChromeNetworkDelegate(extension_event_router_forwarder(), | 515 new ChromeNetworkDelegate(extension_event_router_forwarder(), |
512 &system_enable_referrers_, | 516 &system_enable_referrers_, |
513 metrics_data_use_forwarder_)); | 517 metrics_data_use_forwarder_)); |
514 // By default, data usage is considered off the record. | 518 // By default, data usage is considered off the record. |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1070 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1074 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1071 // system URLRequestContext too. There's no reason this should be tied to a | 1075 // system URLRequestContext too. There's no reason this should be tied to a |
1072 // profile. | 1076 // profile. |
1073 return context; | 1077 return context; |
1074 } | 1078 } |
1075 | 1079 |
1076 const metrics::UpdateUsagePrefCallbackType& | 1080 const metrics::UpdateUsagePrefCallbackType& |
1077 IOThread::GetMetricsDataUseForwarder() { | 1081 IOThread::GetMetricsDataUseForwarder() { |
1078 return metrics_data_use_forwarder_; | 1082 return metrics_data_use_forwarder_; |
1079 } | 1083 } |
OLD | NEW |