| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "base/prefs/pref_member.h" | 11 #include "base/prefs/pref_member.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
| 17 #include "base/threading/worker_pool.h" | 17 #include "base/threading/worker_pool.h" |
| 18 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
| 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 21 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 22 #include "chrome/browser/io_thread.h" | 22 #include "chrome/browser/io_thread.h" |
| 23 #include "chrome/browser/net/chrome_net_log.h" | 23 #include "chrome/browser/net/chrome_net_log.h" |
| 24 #include "chrome/browser/net/chrome_network_delegate.h" | 24 #include "chrome/browser/net/chrome_network_delegate.h" |
| 25 #include "chrome/browser/net/chrome_sdch_policy.h" |
| 25 #include "chrome/browser/net/connect_interceptor.h" | 26 #include "chrome/browser/net/connect_interceptor.h" |
| 26 #include "chrome/browser/net/cookie_store_util.h" | 27 #include "chrome/browser/net/cookie_store_util.h" |
| 27 #include "chrome/browser/net/http_server_properties_manager_factory.h" | 28 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
| 28 #include "chrome/browser/net/predictor.h" | 29 #include "chrome/browser/net/predictor.h" |
| 29 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 30 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
| 30 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" | 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" |
| 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 32 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
| 33 #include "chrome/common/chrome_constants.h" | 34 #include "chrome/common/chrome_constants.h" |
| 34 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
| 36 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 37 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ
est_handler.h" | 38 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ
est_handler.h" |
| 38 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" | 39 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" |
| 39 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic
s_prefs.h" | 40 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic
s_prefs.h" |
| 40 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" | 41 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" |
| 41 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" | 42 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" |
| 42 #include "components/domain_reliability/monitor.h" | 43 #include "components/domain_reliability/monitor.h" |
| 43 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
| 44 #include "content/public/browser/cookie_store_factory.h" | 45 #include "content/public/browser/cookie_store_factory.h" |
| 45 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/resource_context.h" | 47 #include "content/public/browser/resource_context.h" |
| 47 #include "content/public/browser/storage_partition.h" | 48 #include "content/public/browser/storage_partition.h" |
| 48 #include "extensions/browser/extension_protocols.h" | 49 #include "extensions/browser/extension_protocols.h" |
| 49 #include "extensions/common/constants.h" | 50 #include "extensions/common/constants.h" |
| 50 #include "net/base/cache_type.h" | 51 #include "net/base/cache_type.h" |
| 51 #include "net/base/sdch_dictionary_fetcher.h" | |
| 52 #include "net/base/sdch_manager.h" | 52 #include "net/base/sdch_manager.h" |
| 53 #include "net/ftp/ftp_network_layer.h" | 53 #include "net/ftp/ftp_network_layer.h" |
| 54 #include "net/http/http_cache.h" | 54 #include "net/http/http_cache.h" |
| 55 #include "net/http/http_server_properties_manager.h" | 55 #include "net/http/http_server_properties_manager.h" |
| 56 #include "net/ssl/channel_id_service.h" | 56 #include "net/ssl/channel_id_service.h" |
| 57 #include "net/url_request/url_request_job_factory_impl.h" | 57 #include "net/url_request/url_request_job_factory_impl.h" |
| 58 #include "storage/browser/quota/special_storage_policy.h" | 58 #include "storage/browser/quota/special_storage_policy.h" |
| 59 | 59 |
| 60 namespace { | 60 namespace { |
| 61 | 61 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 request_interceptors.Pass(), | 571 request_interceptors.Pass(), |
| 572 profile_params->protocol_handler_interceptor.Pass(), | 572 profile_params->protocol_handler_interceptor.Pass(), |
| 573 network_delegate(), | 573 network_delegate(), |
| 574 ftp_factory_.get()); | 574 ftp_factory_.get()); |
| 575 main_context->set_job_factory(main_job_factory_.get()); | 575 main_context->set_job_factory(main_job_factory_.get()); |
| 576 | 576 |
| 577 #if defined(ENABLE_EXTENSIONS) | 577 #if defined(ENABLE_EXTENSIONS) |
| 578 InitializeExtensionsRequestContext(profile_params); | 578 InitializeExtensionsRequestContext(profile_params); |
| 579 #endif | 579 #endif |
| 580 | 580 |
| 581 // Setup the SDCHManager for this profile. | 581 // Setup SDCH for this profile. |
| 582 sdch_manager_.reset(new net::SdchManager); | 582 sdch_manager_.reset(new net::SdchManager); |
| 583 sdch_manager_->set_sdch_fetcher(scoped_ptr<net::SdchFetcher>( | 583 sdch_policy_.reset(new ChromeSdchPolicy(sdch_manager_.get(), main_context)); |
| 584 new net::SdchDictionaryFetcher(sdch_manager_.get(), | |
| 585 main_context)).Pass()); | |
| 586 main_context->set_sdch_manager(sdch_manager_.get()); | 584 main_context->set_sdch_manager(sdch_manager_.get()); |
| 587 | 585 |
| 588 // Create a media request context based on the main context, but using a | 586 // Create a media request context based on the main context, but using a |
| 589 // media cache. It shares the same job factory as the main context. | 587 // media cache. It shares the same job factory as the main context. |
| 590 StoragePartitionDescriptor details(profile_path_, false); | 588 StoragePartitionDescriptor details(profile_path_, false); |
| 591 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 589 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
| 592 details)); | 590 details)); |
| 593 | 591 |
| 594 if (domain_reliability_monitor_) { | 592 if (domain_reliability_monitor_) { |
| 595 domain_reliability::DomainReliabilityMonitor* monitor = | 593 domain_reliability::DomainReliabilityMonitor* monitor = |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 const base::Closure& completion) { | 823 const base::Closure& completion) { |
| 826 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 824 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 827 DCHECK(initialized()); | 825 DCHECK(initialized()); |
| 828 | 826 |
| 829 DCHECK(transport_security_state()); | 827 DCHECK(transport_security_state()); |
| 830 // Completes synchronously. | 828 // Completes synchronously. |
| 831 transport_security_state()->DeleteAllDynamicDataSince(time); | 829 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 832 DCHECK(http_server_properties_manager_); | 830 DCHECK(http_server_properties_manager_); |
| 833 http_server_properties_manager_->Clear(completion); | 831 http_server_properties_manager_->Clear(completion); |
| 834 } | 832 } |
| OLD | NEW |