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/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" | 36 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" |
36 #include "components/domain_reliability/monitor.h" | 37 #include "components/domain_reliability/monitor.h" |
37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
38 #include "content/public/browser/cookie_store_factory.h" | 39 #include "content/public/browser/cookie_store_factory.h" |
39 #include "content/public/browser/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
40 #include "content/public/browser/resource_context.h" | 41 #include "content/public/browser/resource_context.h" |
41 #include "content/public/browser/storage_partition.h" | 42 #include "content/public/browser/storage_partition.h" |
42 #include "extensions/browser/extension_protocols.h" | 43 #include "extensions/browser/extension_protocols.h" |
43 #include "extensions/common/constants.h" | 44 #include "extensions/common/constants.h" |
44 #include "net/base/cache_type.h" | 45 #include "net/base/cache_type.h" |
| 46 #include "net/base/sdch_manager.h" |
45 #include "net/ftp/ftp_network_layer.h" | 47 #include "net/ftp/ftp_network_layer.h" |
46 #include "net/http/http_cache.h" | 48 #include "net/http/http_cache.h" |
47 #include "net/ssl/server_bound_cert_service.h" | 49 #include "net/ssl/server_bound_cert_service.h" |
48 #include "net/url_request/url_request_job_factory_impl.h" | 50 #include "net/url_request/url_request_job_factory_impl.h" |
49 #include "webkit/browser/quota/special_storage_policy.h" | 51 #include "webkit/browser/quota/special_storage_policy.h" |
50 | 52 |
51 #if defined(OS_ANDROID) || defined(OS_IOS) | 53 #if defined(OS_ANDROID) || defined(OS_IOS) |
52 #if defined(SPDY_PROXY_AUTH_VALUE) | 54 #if defined(SPDY_PROXY_AUTH_VALUE) |
53 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 55 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
54 #endif | 56 #endif |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 request_interceptors.Pass(), | 524 request_interceptors.Pass(), |
523 profile_params->protocol_handler_interceptor.Pass(), | 525 profile_params->protocol_handler_interceptor.Pass(), |
524 network_delegate(), | 526 network_delegate(), |
525 ftp_factory_.get()); | 527 ftp_factory_.get()); |
526 main_context->set_job_factory(main_job_factory_.get()); | 528 main_context->set_job_factory(main_job_factory_.get()); |
527 | 529 |
528 #if defined(ENABLE_EXTENSIONS) | 530 #if defined(ENABLE_EXTENSIONS) |
529 InitializeExtensionsRequestContext(profile_params); | 531 InitializeExtensionsRequestContext(profile_params); |
530 #endif | 532 #endif |
531 | 533 |
| 534 // Setup the SDCHManager for this profile. |
| 535 sdch_manager_.reset(new net::SdchManager); |
| 536 sdch_manager_->set_sdch_fetcher( |
| 537 new SdchDictionaryFetcher( |
| 538 sdch_manager_.get(), |
| 539 // SdchDictionaryFetcher takes a reference to the Getter, and |
| 540 // hence implicitly takes ownership. |
| 541 new net::TrivialURLRequestContextGetter( |
| 542 main_context, |
| 543 content::BrowserThread::GetMessageLoopProxyForThread( |
| 544 content::BrowserThread::IO)))); |
| 545 main_context->set_sdch_manager(sdch_manager_.get()); |
| 546 |
532 // Create a media request context based on the main context, but using a | 547 // Create a media request context based on the main context, but using a |
533 // media cache. It shares the same job factory as the main context. | 548 // media cache. It shares the same job factory as the main context. |
534 StoragePartitionDescriptor details(profile_path_, false); | 549 StoragePartitionDescriptor details(profile_path_, false); |
535 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 550 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
536 details)); | 551 details)); |
537 | 552 |
538 if (IsDomainReliabilityMonitoringEnabled()) { | 553 if (IsDomainReliabilityMonitoringEnabled()) { |
539 domain_reliability_monitor_.reset( | 554 domain_reliability_monitor_.reset( |
540 new domain_reliability::DomainReliabilityMonitor( | 555 new domain_reliability::DomainReliabilityMonitor( |
541 main_context, kDomainReliabilityUploadReporterString)); | 556 main_context, kDomainReliabilityUploadReporterString)); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 domain_reliability::DomainReliabilityClearMode mode, | 796 domain_reliability::DomainReliabilityClearMode mode, |
782 const base::Closure& completion) { | 797 const base::Closure& completion) { |
783 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 798 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
784 DCHECK(initialized()); | 799 DCHECK(initialized()); |
785 | 800 |
786 if (domain_reliability_monitor_) | 801 if (domain_reliability_monitor_) |
787 domain_reliability_monitor_->ClearBrowsingData(mode); | 802 domain_reliability_monitor_->ClearBrowsingData(mode); |
788 | 803 |
789 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); | 804 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); |
790 } | 805 } |
OLD | NEW |