| 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/connect_interceptor.h" | 25 #include "chrome/browser/net/connect_interceptor.h" |
| 26 #include "chrome/browser/net/cookie_store_util.h" | 26 #include "chrome/browser/net/cookie_store_util.h" |
| 27 #include "chrome/browser/net/http_server_properties_manager.h" | 27 #include "chrome/browser/net/http_server_properties_manager.h" |
| 28 #include "chrome/browser/net/predictor.h" | 28 #include "chrome/browser/net/predictor.h" |
| 29 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 29 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" | 30 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
| 32 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 34 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 35 #include "components/domain_reliability/monitor.h" | 36 #include "components/domain_reliability/monitor.h" |
| 36 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/cookie_store_factory.h" | 38 #include "content/public/browser/cookie_store_factory.h" |
| 38 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
| 39 #include "content/public/browser/resource_context.h" | 40 #include "content/public/browser/resource_context.h" |
| 40 #include "content/public/browser/storage_partition.h" | 41 #include "content/public/browser/storage_partition.h" |
| 41 #include "extensions/browser/extension_protocols.h" | 42 #include "extensions/browser/extension_protocols.h" |
| 42 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
| 43 #include "net/base/cache_type.h" | 44 #include "net/base/cache_type.h" |
| 45 #include "net/base/sdch_manager.h" |
| 44 #include "net/ftp/ftp_network_layer.h" | 46 #include "net/ftp/ftp_network_layer.h" |
| 45 #include "net/http/http_cache.h" | 47 #include "net/http/http_cache.h" |
| 46 #include "net/ssl/server_bound_cert_service.h" | 48 #include "net/ssl/server_bound_cert_service.h" |
| 47 #include "net/url_request/protocol_intercept_job_factory.h" | 49 #include "net/url_request/protocol_intercept_job_factory.h" |
| 50 #include "net/url_request/url_request_context_getter.h" |
| 48 #include "net/url_request/url_request_job_factory_impl.h" | 51 #include "net/url_request/url_request_job_factory_impl.h" |
| 49 #include "webkit/browser/quota/special_storage_policy.h" | 52 #include "webkit/browser/quota/special_storage_policy.h" |
| 50 | 53 |
| 51 #if defined(OS_ANDROID) || defined(OS_IOS) | 54 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 52 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 55 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
| 53 #endif | 56 #endif |
| 54 | 57 |
| 55 namespace { | 58 namespace { |
| 56 | 59 |
| 57 net::BackendType ChooseCacheBackendType() { | 60 net::BackendType ChooseCacheBackendType() { |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 protocol_interceptors.Pass(), | 491 protocol_interceptors.Pass(), |
| 489 profile_params->protocol_handler_interceptor.Pass(), | 492 profile_params->protocol_handler_interceptor.Pass(), |
| 490 network_delegate(), | 493 network_delegate(), |
| 491 ftp_factory_.get()); | 494 ftp_factory_.get()); |
| 492 main_context->set_job_factory(main_job_factory_.get()); | 495 main_context->set_job_factory(main_job_factory_.get()); |
| 493 | 496 |
| 494 #if defined(ENABLE_EXTENSIONS) | 497 #if defined(ENABLE_EXTENSIONS) |
| 495 InitializeExtensionsRequestContext(profile_params); | 498 InitializeExtensionsRequestContext(profile_params); |
| 496 #endif | 499 #endif |
| 497 | 500 |
| 501 // Setup the SDCHManager for this profile. |
| 502 sdch_manager_.reset(new net::SdchManager); |
| 503 sdch_manager_->set_sdch_fetcher( |
| 504 new SdchDictionaryFetcher( |
| 505 sdch_manager_.get(), |
| 506 // SdchDictionaryFetcher takes a reference to the Getter, and |
| 507 // hence implicitly takes ownership. |
| 508 new net::TrivialURLRequestContextGetter( |
| 509 main_context, |
| 510 content::BrowserThread::GetMessageLoopProxyForThread( |
| 511 content::BrowserThread::IO)))); |
| 512 |
| 498 // Create a media request context based on the main context, but using a | 513 // Create a media request context based on the main context, but using a |
| 499 // media cache. It shares the same job factory as the main context. | 514 // media cache. It shares the same job factory as the main context. |
| 500 StoragePartitionDescriptor details(profile_path_, false); | 515 StoragePartitionDescriptor details(profile_path_, false); |
| 501 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 516 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
| 502 details)); | 517 details)); |
| 503 | 518 |
| 504 if (IsDomainReliabilityMonitoringEnabled()) { | 519 if (IsDomainReliabilityMonitoringEnabled()) { |
| 505 domain_reliability_monitor_.reset( | 520 domain_reliability_monitor_.reset( |
| 506 new domain_reliability::DomainReliabilityMonitor(main_context)); | 521 new domain_reliability::DomainReliabilityMonitor(main_context)); |
| 507 domain_reliability_monitor_->AddBakedInConfigs(); | 522 domain_reliability_monitor_->AddBakedInConfigs(); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 const base::Closure& completion) { | 747 const base::Closure& completion) { |
| 733 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 748 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 734 DCHECK(initialized()); | 749 DCHECK(initialized()); |
| 735 | 750 |
| 736 DCHECK(transport_security_state()); | 751 DCHECK(transport_security_state()); |
| 737 // Completes synchronously. | 752 // Completes synchronously. |
| 738 transport_security_state()->DeleteAllDynamicDataSince(time); | 753 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 739 DCHECK(http_server_properties_manager_); | 754 DCHECK(http_server_properties_manager_); |
| 740 http_server_properties_manager_->Clear(completion); | 755 http_server_properties_manager_->Clear(completion); |
| 741 } | 756 } |
| OLD | NEW |