| 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_special_storage_policy_delegate.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/sqlite_server_bound_cert_store.h" | |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/common/chrome_constants.h" | 31 #include "chrome/common/chrome_constants.h" |
| 32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
| 34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 35 #include "components/domain_reliability/monitor.h" | 35 #include "components/domain_reliability/monitor.h" |
| 36 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/cookie_store_factory.h" | 37 #include "content/public/browser/cookie_store_factory.h" |
| 38 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
| 39 #include "content/public/browser/resource_context.h" | 39 #include "content/public/browser/resource_context.h" |
| 40 #include "content/public/browser/storage_partition.h" | 40 #include "content/public/browser/storage_partition.h" |
| 41 #include "extensions/browser/extension_protocols.h" | 41 #include "extensions/browser/extension_protocols.h" |
| 42 #include "extensions/common/constants.h" | 42 #include "extensions/common/constants.h" |
| 43 #include "net/base/cache_type.h" | 43 #include "net/base/cache_type.h" |
| 44 #include "net/base/sdch_dictionary_fetcher.h" | 44 #include "net/base/sdch_dictionary_fetcher.h" |
| 45 #include "net/base/sdch_manager.h" | 45 #include "net/base/sdch_manager.h" |
| 46 #include "net/ftp/ftp_network_layer.h" | 46 #include "net/ftp/ftp_network_layer.h" |
| 47 #include "net/http/http_cache.h" | 47 #include "net/http/http_cache.h" |
| 48 #include "net/http/http_server_properties_manager.h" | 48 #include "net/http/http_server_properties_manager.h" |
| 49 #include "net/sqlite/sqlite_server_bound_cert_store.h" |
| 49 #include "net/ssl/server_bound_cert_service.h" | 50 #include "net/ssl/server_bound_cert_service.h" |
| 50 #include "net/url_request/url_request_job_factory_impl.h" | 51 #include "net/url_request/url_request_job_factory_impl.h" |
| 51 #include "webkit/browser/quota/special_storage_policy.h" | 52 #include "webkit/browser/quota/special_storage_policy.h" |
| 52 | 53 |
| 53 namespace { | 54 namespace { |
| 54 | 55 |
| 55 net::BackendType ChooseCacheBackendType() { | 56 net::BackendType ChooseCacheBackendType() { |
| 56 #if defined(OS_ANDROID) | 57 #if defined(OS_ANDROID) |
| 57 return net::CACHE_BACKEND_SIMPLE; | 58 return net::CACHE_BACKEND_SIMPLE; |
| 58 #else | 59 #else |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 chrome_browser_net::GetCookieCryptoDelegate(); | 435 chrome_browser_net::GetCookieCryptoDelegate(); |
| 435 cookie_store = content::CreateCookieStore(cookie_config); | 436 cookie_store = content::CreateCookieStore(cookie_config); |
| 436 } | 437 } |
| 437 | 438 |
| 438 main_context->set_cookie_store(cookie_store.get()); | 439 main_context->set_cookie_store(cookie_store.get()); |
| 439 | 440 |
| 440 // Setup server bound cert service. | 441 // Setup server bound cert service. |
| 441 if (!server_bound_cert_service) { | 442 if (!server_bound_cert_service) { |
| 442 DCHECK(!lazy_params_->server_bound_cert_path.empty()); | 443 DCHECK(!lazy_params_->server_bound_cert_path.empty()); |
| 443 | 444 |
| 444 scoped_refptr<SQLiteServerBoundCertStore> server_bound_cert_db = | 445 scoped_refptr<net::SQLiteServerBoundCertStore> server_bound_cert_db = |
| 445 new SQLiteServerBoundCertStore( | 446 new net::SQLiteServerBoundCertStore( |
| 446 lazy_params_->server_bound_cert_path, | 447 lazy_params_->server_bound_cert_path, |
| 447 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 448 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( |
| 448 BrowserThread::GetBlockingPool()->GetSequenceToken()), | 449 BrowserThread::GetBlockingPool()->GetSequenceToken()), |
| 449 lazy_params_->special_storage_policy.get()); | 450 scoped_ptr<net::SpecialStoragePolicyDelegate>( |
| 451 new ChromeSpecialStoragePolicyDelegate( |
| 452 lazy_params_->special_storage_policy.get())).Pass()); |
| 450 server_bound_cert_service = new net::ServerBoundCertService( | 453 server_bound_cert_service = new net::ServerBoundCertService( |
| 451 new net::DefaultServerBoundCertStore(server_bound_cert_db.get()), | 454 new net::DefaultServerBoundCertStore(server_bound_cert_db.get()), |
| 452 base::WorkerPool::GetTaskRunner(true)); | 455 base::WorkerPool::GetTaskRunner(true)); |
| 453 } | 456 } |
| 454 | 457 |
| 455 set_server_bound_cert_service(server_bound_cert_service); | 458 set_server_bound_cert_service(server_bound_cert_service); |
| 456 main_context->set_server_bound_cert_service(server_bound_cert_service); | 459 main_context->set_server_bound_cert_service(server_bound_cert_service); |
| 457 | 460 |
| 458 net::HttpCache::DefaultBackend* main_backend = | 461 net::HttpCache::DefaultBackend* main_backend = |
| 459 new net::HttpCache::DefaultBackend( | 462 new net::HttpCache::DefaultBackend( |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 const base::Closure& completion) { | 755 const base::Closure& completion) { |
| 753 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 756 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 754 DCHECK(initialized()); | 757 DCHECK(initialized()); |
| 755 | 758 |
| 756 DCHECK(transport_security_state()); | 759 DCHECK(transport_security_state()); |
| 757 // Completes synchronously. | 760 // Completes synchronously. |
| 758 transport_security_state()->DeleteAllDynamicDataSince(time); | 761 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 759 DCHECK(http_server_properties_manager_); | 762 DCHECK(http_server_properties_manager_); |
| 760 http_server_properties_manager_->Clear(completion); | 763 http_server_properties_manager_->Clear(completion); |
| 761 } | 764 } |
| OLD | NEW |