| 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/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
| 17 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
| 18 #include "base/sequenced_task_runner.h" | 18 #include "base/sequenced_task_runner.h" |
| 19 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
| 20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 21 #include "base/threading/sequenced_worker_pool.h" | 21 #include "base/threading/sequenced_worker_pool.h" |
| 22 #include "base/threading/worker_pool.h" | 22 #include "base/threading/worker_pool.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 25 #include "chrome/browser/chrome_notification_types.h" | 25 #include "chrome/browser/chrome_notification_types.h" |
| 26 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 26 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 27 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 27 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 28 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" |
| 28 #include "chrome/browser/io_thread.h" | 29 #include "chrome/browser/io_thread.h" |
| 29 #include "chrome/browser/net/chrome_network_delegate.h" | 30 #include "chrome/browser/net/chrome_network_delegate.h" |
| 30 #include "chrome/browser/net/http_server_properties_manager_factory.h" | 31 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
| 31 #include "chrome/browser/net/predictor.h" | 32 #include "chrome/browser/net/predictor.h" |
| 32 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 33 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
| 33 #include "chrome/browser/net/sdch_owner_pref_storage.h" | 34 #include "chrome/browser/net/sdch_owner_pref_storage.h" |
| 34 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" | 35 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" |
| 35 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 36 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 36 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 37 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
| 37 #include "chrome/browser/previews/previews_service.h" | 38 #include "chrome/browser/previews/previews_service.h" |
| 38 #include "chrome/browser/previews/previews_service_factory.h" | 39 #include "chrome/browser/previews/previews_service_factory.h" |
| 39 #include "chrome/browser/profiles/profile.h" | 40 #include "chrome/browser/profiles/profile.h" |
| 40 #include "chrome/common/chrome_constants.h" | 41 #include "chrome/common/chrome_constants.h" |
| 41 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 43 #include "chrome/common/url_constants.h" | 44 #include "chrome/common/url_constants.h" |
| 44 #include "components/cookie_config/cookie_store_util.h" | 45 #include "components/cookie_config/cookie_store_util.h" |
| 45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
| 47 #include "components/data_reduction_proxy/core/browser/data_store_impl.h" | 48 #include "components/data_reduction_proxy/core/browser/data_store_impl.h" |
| 49 #include "components/data_use_measurement/core/data_use_network_delegate.h" |
| 48 #include "components/domain_reliability/monitor.h" | 50 #include "components/domain_reliability/monitor.h" |
| 49 #include "components/net_log/chrome_net_log.h" | 51 #include "components/net_log/chrome_net_log.h" |
| 50 #include "components/prefs/json_pref_store.h" | 52 #include "components/prefs/json_pref_store.h" |
| 51 #include "components/prefs/pref_filter.h" | 53 #include "components/prefs/pref_filter.h" |
| 52 #include "components/prefs/pref_member.h" | 54 #include "components/prefs/pref_member.h" |
| 53 #include "components/prefs/pref_service.h" | 55 #include "components/prefs/pref_service.h" |
| 54 #include "components/previews/previews_io_data.h" | 56 #include "components/previews/previews_io_data.h" |
| 55 #include "components/previews/previews_ui_service.h" | 57 #include "components/previews/previews_ui_service.h" |
| 56 #include "content/public/browser/browser_thread.h" | 58 #include "content/public/browser/browser_thread.h" |
| 57 #include "content/public/browser/cookie_store_factory.h" | 59 #include "content/public/browser/cookie_store_factory.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 if (http_server_properties_manager_) | 472 if (http_server_properties_manager_) |
| 471 http_server_properties_manager_->InitializeOnNetworkThread(); | 473 http_server_properties_manager_->InitializeOnNetworkThread(); |
| 472 | 474 |
| 473 main_context->set_transport_security_state(transport_security_state()); | 475 main_context->set_transport_security_state(transport_security_state()); |
| 474 main_context->set_ct_policy_enforcer( | 476 main_context->set_ct_policy_enforcer( |
| 475 io_thread_globals->ct_policy_enforcer.get()); | 477 io_thread_globals->ct_policy_enforcer.get()); |
| 476 | 478 |
| 477 main_context->set_net_log(io_thread->net_log()); | 479 main_context->set_net_log(io_thread->net_log()); |
| 478 | 480 |
| 479 network_delegate_ = data_reduction_proxy_io_data()->CreateNetworkDelegate( | 481 network_delegate_ = data_reduction_proxy_io_data()->CreateNetworkDelegate( |
| 480 std::move(chrome_network_delegate), true); | 482 base::MakeUnique<data_use_measurement::DataUseNetworkDelegate>( |
| 483 std::move(chrome_network_delegate), |
| 484 io_thread_globals->data_use_ascriber.get()), |
| 485 true); |
| 481 | 486 |
| 482 main_context->set_network_delegate(network_delegate_.get()); | 487 main_context->set_network_delegate(network_delegate_.get()); |
| 483 | 488 |
| 484 main_context->set_http_server_properties(http_server_properties()); | 489 main_context->set_http_server_properties(http_server_properties()); |
| 485 | 490 |
| 486 main_context->set_host_resolver( | 491 main_context->set_host_resolver( |
| 487 io_thread_globals->host_resolver.get()); | 492 io_thread_globals->host_resolver.get()); |
| 488 | 493 |
| 489 main_context->set_http_auth_handler_factory( | 494 main_context->set_http_auth_handler_factory( |
| 490 io_thread_globals->http_auth_handler_factory.get()); | 495 io_thread_globals->http_auth_handler_factory.get()); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 const base::Closure& completion) { | 810 const base::Closure& completion) { |
| 806 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 811 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 807 DCHECK(initialized()); | 812 DCHECK(initialized()); |
| 808 | 813 |
| 809 DCHECK(transport_security_state()); | 814 DCHECK(transport_security_state()); |
| 810 // Completes synchronously. | 815 // Completes synchronously. |
| 811 transport_security_state()->DeleteAllDynamicDataSince(time); | 816 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 812 DCHECK(http_server_properties_manager_); | 817 DCHECK(http_server_properties_manager_); |
| 813 http_server_properties_manager_->Clear(completion); | 818 http_server_properties_manager_->Clear(completion); |
| 814 } | 819 } |
| OLD | NEW |