| 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 <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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/chromeos/profiles/profile_helper.h" | 26 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 27 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 27 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 28 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 28 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 29 #include "chrome/browser/io_thread.h" | 29 #include "chrome/browser/io_thread.h" |
| 30 #include "chrome/browser/net/chrome_network_delegate.h" | 30 #include "chrome/browser/net/chrome_network_delegate.h" |
| 31 #include "chrome/browser/net/connect_interceptor.h" | |
| 32 #include "chrome/browser/net/http_server_properties_manager_factory.h" | 31 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
| 33 #include "chrome/browser/net/predictor.h" | 32 #include "chrome/browser/net/predictor.h" |
| 34 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 33 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
| 35 #include "chrome/browser/net/sdch_owner_pref_storage.h" | 34 #include "chrome/browser/net/sdch_owner_pref_storage.h" |
| 36 #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" |
| 37 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 36 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 38 #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" |
| 39 #include "chrome/browser/profiles/profile.h" | 38 #include "chrome/browser/profiles/profile.h" |
| 40 #include "chrome/common/chrome_constants.h" | 39 #include "chrome/common/chrome_constants.h" |
| 41 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 JsonPrefStore::GetTaskRunnerForFile(network_json_store_filepath, | 439 JsonPrefStore::GetTaskRunnerForFile(network_json_store_filepath, |
| 441 BrowserThread::GetBlockingPool()), | 440 BrowserThread::GetBlockingPool()), |
| 442 scoped_ptr<PrefFilter>()); | 441 scoped_ptr<PrefFilter>()); |
| 443 network_json_store_->ReadPrefsAsync(nullptr); | 442 network_json_store_->ReadPrefsAsync(nullptr); |
| 444 | 443 |
| 445 net::URLRequestContext* main_context = main_request_context(); | 444 net::URLRequestContext* main_context = main_request_context(); |
| 446 | 445 |
| 447 IOThread* const io_thread = profile_params->io_thread; | 446 IOThread* const io_thread = profile_params->io_thread; |
| 448 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 447 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
| 449 | 448 |
| 450 chrome_network_delegate->set_predictor(predictor_.get()); | |
| 451 | |
| 452 if (domain_reliability_monitor_) { | 449 if (domain_reliability_monitor_) { |
| 453 domain_reliability::DomainReliabilityMonitor* monitor = | 450 domain_reliability::DomainReliabilityMonitor* monitor = |
| 454 domain_reliability_monitor_.get(); | 451 domain_reliability_monitor_.get(); |
| 455 monitor->InitURLRequestContext(main_context); | 452 monitor->InitURLRequestContext(main_context); |
| 456 monitor->AddBakedInConfigs(); | 453 monitor->AddBakedInConfigs(); |
| 457 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); | 454 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); |
| 458 chrome_network_delegate->set_domain_reliability_monitor(monitor); | 455 chrome_network_delegate->set_domain_reliability_monitor(monitor); |
| 459 } | 456 } |
| 460 | 457 |
| 461 ApplyProfileParamsToContext(main_context); | 458 ApplyProfileParamsToContext(main_context); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 ProfileImplIOData::AcquireIsolatedMediaRequestContext( | 751 ProfileImplIOData::AcquireIsolatedMediaRequestContext( |
| 755 net::URLRequestContext* app_context, | 752 net::URLRequestContext* app_context, |
| 756 const StoragePartitionDescriptor& partition_descriptor) const { | 753 const StoragePartitionDescriptor& partition_descriptor) const { |
| 757 // We create per-app media contexts on demand, unlike the others above. | 754 // We create per-app media contexts on demand, unlike the others above. |
| 758 net::URLRequestContext* media_request_context = | 755 net::URLRequestContext* media_request_context = |
| 759 InitializeMediaRequestContext(app_context, partition_descriptor); | 756 InitializeMediaRequestContext(app_context, partition_descriptor); |
| 760 DCHECK(media_request_context); | 757 DCHECK(media_request_context); |
| 761 return media_request_context; | 758 return media_request_context; |
| 762 } | 759 } |
| 763 | 760 |
| 761 chrome_browser_net::Predictor* ProfileImplIOData::predictor() { |
| 762 return predictor_.get(); |
| 763 } |
| 764 |
| 764 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 765 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
| 765 base::Time time, | 766 base::Time time, |
| 766 const base::Closure& completion) { | 767 const base::Closure& completion) { |
| 767 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 768 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 768 DCHECK(initialized()); | 769 DCHECK(initialized()); |
| 769 | 770 |
| 770 DCHECK(transport_security_state()); | 771 DCHECK(transport_security_state()); |
| 771 // Completes synchronously. | 772 // Completes synchronously. |
| 772 transport_security_state()->DeleteAllDynamicDataSince(time); | 773 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 773 DCHECK(http_server_properties_manager_); | 774 DCHECK(http_server_properties_manager_); |
| 774 http_server_properties_manager_->Clear(completion); | 775 http_server_properties_manager_->Clear(completion); |
| 775 } | 776 } |
| OLD | NEW |