| 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/profiler/scoped_tracker.h" | 13 #include "base/profiler/scoped_tracker.h" |
| 14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "base/threading/worker_pool.h" | 18 #include "base/threading/worker_pool.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 20 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 23 #include "chrome/browser/io_thread.h" | 23 #include "chrome/browser/io_thread.h" |
| 24 #include "chrome/browser/net/chrome_net_log.h" | 24 #include "chrome/browser/net/chrome_net_log.h" |
| 25 #include "chrome/browser/net/chrome_network_delegate.h" | 25 #include "chrome/browser/net/chrome_network_delegate.h" |
| 26 #include "chrome/browser/net/chrome_sdch_policy.h" | |
| 27 #include "chrome/browser/net/connect_interceptor.h" | 26 #include "chrome/browser/net/connect_interceptor.h" |
| 28 #include "chrome/browser/net/cookie_store_util.h" | 27 #include "chrome/browser/net/cookie_store_util.h" |
| 29 #include "chrome/browser/net/http_server_properties_manager_factory.h" | 28 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
| 30 #include "chrome/browser/net/predictor.h" | 29 #include "chrome/browser/net/predictor.h" |
| 31 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 30 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
| 32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" | 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" |
| 33 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 34 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
| 35 #include "chrome/common/chrome_constants.h" | 34 #include "chrome/common/chrome_constants.h" |
| 36 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 50 #include "content/public/browser/notification_service.h" | 49 #include "content/public/browser/notification_service.h" |
| 51 #include "content/public/browser/resource_context.h" | 50 #include "content/public/browser/resource_context.h" |
| 52 #include "content/public/browser/storage_partition.h" | 51 #include "content/public/browser/storage_partition.h" |
| 53 #include "extensions/browser/extension_protocols.h" | 52 #include "extensions/browser/extension_protocols.h" |
| 54 #include "extensions/common/constants.h" | 53 #include "extensions/common/constants.h" |
| 55 #include "net/base/cache_type.h" | 54 #include "net/base/cache_type.h" |
| 56 #include "net/base/sdch_manager.h" | 55 #include "net/base/sdch_manager.h" |
| 57 #include "net/ftp/ftp_network_layer.h" | 56 #include "net/ftp/ftp_network_layer.h" |
| 58 #include "net/http/http_cache.h" | 57 #include "net/http/http_cache.h" |
| 59 #include "net/http/http_server_properties_manager.h" | 58 #include "net/http/http_server_properties_manager.h" |
| 59 #include "net/sdch/sdch_owner.h" |
| 60 #include "net/ssl/channel_id_service.h" | 60 #include "net/ssl/channel_id_service.h" |
| 61 #include "net/url_request/url_request_intercepting_job_factory.h" | 61 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 62 #include "net/url_request/url_request_job_factory_impl.h" | 62 #include "net/url_request/url_request_job_factory_impl.h" |
| 63 #include "storage/browser/quota/special_storage_policy.h" | 63 #include "storage/browser/quota/special_storage_policy.h" |
| 64 | 64 |
| 65 namespace { | 65 namespace { |
| 66 | 66 |
| 67 net::BackendType ChooseCacheBackendType() { | 67 net::BackendType ChooseCacheBackendType() { |
| 68 #if defined(OS_ANDROID) | 68 #if defined(OS_ANDROID) |
| 69 return net::CACHE_BACKEND_SIMPLE; | 69 return net::CACHE_BACKEND_SIMPLE; |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 tracked_objects::ScopedTracker tracking_profile9( | 656 tracked_objects::ScopedTracker tracking_profile9( |
| 657 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 657 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 658 "436671 ProfileImplIOData::InitializeInternal9")); | 658 "436671 ProfileImplIOData::InitializeInternal9")); |
| 659 | 659 |
| 660 #if defined(ENABLE_EXTENSIONS) | 660 #if defined(ENABLE_EXTENSIONS) |
| 661 InitializeExtensionsRequestContext(profile_params); | 661 InitializeExtensionsRequestContext(profile_params); |
| 662 #endif | 662 #endif |
| 663 | 663 |
| 664 // Setup SDCH for this profile. | 664 // Setup SDCH for this profile. |
| 665 sdch_manager_.reset(new net::SdchManager); | 665 sdch_manager_.reset(new net::SdchManager); |
| 666 sdch_policy_.reset(new ChromeSdchPolicy(sdch_manager_.get(), main_context)); | 666 sdch_policy_.reset(new net::SdchOwner(sdch_manager_.get(), main_context)); |
| 667 main_context->set_sdch_manager(sdch_manager_.get()); | 667 main_context->set_sdch_manager(sdch_manager_.get()); |
| 668 | 668 |
| 669 // Create a media request context based on the main context, but using a | 669 // Create a media request context based on the main context, but using a |
| 670 // media cache. It shares the same job factory as the main context. | 670 // media cache. It shares the same job factory as the main context. |
| 671 StoragePartitionDescriptor details(profile_path_, false); | 671 StoragePartitionDescriptor details(profile_path_, false); |
| 672 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 672 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
| 673 details)); | 673 details)); |
| 674 | 674 |
| 675 lazy_params_.reset(); | 675 lazy_params_.reset(); |
| 676 } | 676 } |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 transport_security_state()->DeleteAllDynamicDataSince(time); | 909 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 910 DCHECK(http_server_properties_manager_); | 910 DCHECK(http_server_properties_manager_); |
| 911 http_server_properties_manager_->Clear(completion); | 911 http_server_properties_manager_->Clear(completion); |
| 912 } | 912 } |
| 913 | 913 |
| 914 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | 914 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { |
| 915 return data_reduction_proxy_enabled_.GetValue() || | 915 return data_reduction_proxy_enabled_.GetValue() || |
| 916 base::CommandLine::ForCurrentProcess()->HasSwitch( | 916 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 917 data_reduction_proxy::switches::kEnableDataReductionProxy); | 917 data_reduction_proxy::switches::kEnableDataReductionProxy); |
| 918 } | 918 } |
| OLD | NEW |