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_settings.h" | 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
33 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
34 #include "chrome/common/chrome_constants.h" | 33 #include "chrome/common/chrome_constants.h" |
35 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
36 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 tracked_objects::ScopedTracker tracking_profile9( | 657 tracked_objects::ScopedTracker tracking_profile9( |
658 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 658 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
659 "436671 ProfileImplIOData::InitializeInternal9")); | 659 "436671 ProfileImplIOData::InitializeInternal9")); |
660 | 660 |
661 #if defined(ENABLE_EXTENSIONS) | 661 #if defined(ENABLE_EXTENSIONS) |
662 InitializeExtensionsRequestContext(profile_params); | 662 InitializeExtensionsRequestContext(profile_params); |
663 #endif | 663 #endif |
664 | 664 |
665 // Setup SDCH for this profile. | 665 // Setup SDCH for this profile. |
666 sdch_manager_.reset(new net::SdchManager); | 666 sdch_manager_.reset(new net::SdchManager); |
667 sdch_policy_.reset(new ChromeSdchPolicy(sdch_manager_.get(), main_context)); | 667 sdch_policy_.reset(new net::SdchOwner(sdch_manager_.get(), main_context)); |
668 main_context->set_sdch_manager(sdch_manager_.get()); | 668 main_context->set_sdch_manager(sdch_manager_.get()); |
669 | 669 |
670 // Create a media request context based on the main context, but using a | 670 // Create a media request context based on the main context, but using a |
671 // media cache. It shares the same job factory as the main context. | 671 // media cache. It shares the same job factory as the main context. |
672 StoragePartitionDescriptor details(profile_path_, false); | 672 StoragePartitionDescriptor details(profile_path_, false); |
673 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 673 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
674 details)); | 674 details)); |
675 | 675 |
676 lazy_params_.reset(); | 676 lazy_params_.reset(); |
677 } | 677 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 transport_security_state()->DeleteAllDynamicDataSince(time); | 910 transport_security_state()->DeleteAllDynamicDataSince(time); |
911 DCHECK(http_server_properties_manager_); | 911 DCHECK(http_server_properties_manager_); |
912 http_server_properties_manager_->Clear(completion); | 912 http_server_properties_manager_->Clear(completion); |
913 } | 913 } |
914 | 914 |
915 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | 915 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { |
916 return data_reduction_proxy_enabled_.GetValue() || | 916 return data_reduction_proxy_enabled_.GetValue() || |
917 base::CommandLine::ForCurrentProcess()->HasSwitch( | 917 base::CommandLine::ForCurrentProcess()->HasSwitch( |
918 data_reduction_proxy::switches::kEnableDataReductionProxy); | 918 data_reduction_proxy::switches::kEnableDataReductionProxy); |
919 } | 919 } |
OLD | NEW |