| 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/io_thread.h" | 28 #include "chrome/browser/io_thread.h" |
| 29 #include "chrome/browser/net/chrome_network_delegate.h" | 29 #include "chrome/browser/net/chrome_network_delegate.h" |
| 30 #include "chrome/browser/net/connect_interceptor.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" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 JsonPrefStore::GetTaskRunnerForFile(network_json_store_filepath, | 450 JsonPrefStore::GetTaskRunnerForFile(network_json_store_filepath, |
| 450 BrowserThread::GetBlockingPool()), | 451 BrowserThread::GetBlockingPool()), |
| 451 std::unique_ptr<PrefFilter>()); | 452 std::unique_ptr<PrefFilter>()); |
| 452 network_json_store_->ReadPrefsAsync(nullptr); | 453 network_json_store_->ReadPrefsAsync(nullptr); |
| 453 | 454 |
| 454 net::URLRequestContext* main_context = main_request_context(); | 455 net::URLRequestContext* main_context = main_request_context(); |
| 455 | 456 |
| 456 IOThread* const io_thread = profile_params->io_thread; | 457 IOThread* const io_thread = profile_params->io_thread; |
| 457 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 458 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
| 458 | 459 |
| 460 chrome_network_delegate->set_predictor(predictor_.get()); |
| 461 |
| 459 if (domain_reliability_monitor_) { | 462 if (domain_reliability_monitor_) { |
| 460 domain_reliability::DomainReliabilityMonitor* monitor = | 463 domain_reliability::DomainReliabilityMonitor* monitor = |
| 461 domain_reliability_monitor_.get(); | 464 domain_reliability_monitor_.get(); |
| 462 monitor->InitURLRequestContext(main_context); | 465 monitor->InitURLRequestContext(main_context); |
| 463 monitor->AddBakedInConfigs(); | 466 monitor->AddBakedInConfigs(); |
| 464 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); | 467 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); |
| 465 chrome_network_delegate->set_domain_reliability_monitor(monitor); | 468 chrome_network_delegate->set_domain_reliability_monitor(monitor); |
| 466 } | 469 } |
| 467 | 470 |
| 468 ApplyProfileParamsToContext(main_context); | 471 ApplyProfileParamsToContext(main_context); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 ProfileImplIOData::AcquireIsolatedMediaRequestContext( | 791 ProfileImplIOData::AcquireIsolatedMediaRequestContext( |
| 789 net::URLRequestContext* app_context, | 792 net::URLRequestContext* app_context, |
| 790 const StoragePartitionDescriptor& partition_descriptor) const { | 793 const StoragePartitionDescriptor& partition_descriptor) const { |
| 791 // We create per-app media contexts on demand, unlike the others above. | 794 // We create per-app media contexts on demand, unlike the others above. |
| 792 net::URLRequestContext* media_request_context = | 795 net::URLRequestContext* media_request_context = |
| 793 InitializeMediaRequestContext(app_context, partition_descriptor); | 796 InitializeMediaRequestContext(app_context, partition_descriptor); |
| 794 DCHECK(media_request_context); | 797 DCHECK(media_request_context); |
| 795 return media_request_context; | 798 return media_request_context; |
| 796 } | 799 } |
| 797 | 800 |
| 798 chrome_browser_net::Predictor* ProfileImplIOData::GetPredictor() { | |
| 799 return predictor_.get(); | |
| 800 } | |
| 801 | |
| 802 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 801 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
| 803 base::Time time, | 802 base::Time time, |
| 804 const base::Closure& completion) { | 803 const base::Closure& completion) { |
| 805 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 804 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 806 DCHECK(initialized()); | 805 DCHECK(initialized()); |
| 807 | 806 |
| 808 DCHECK(transport_security_state()); | 807 DCHECK(transport_security_state()); |
| 809 // Completes synchronously. | 808 // Completes synchronously. |
| 810 transport_security_state()->DeleteAllDynamicDataSince(time); | 809 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 811 DCHECK(http_server_properties_manager_); | 810 DCHECK(http_server_properties_manager_); |
| 812 http_server_properties_manager_->Clear(completion); | 811 http_server_properties_manager_->Clear(completion); |
| 813 } | 812 } |
| OLD | NEW |