| 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/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/prefs/public/pref_member.h" | 11 #include "base/prefs/public/pref_member.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
| 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 15 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 15 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 16 #include "chrome/browser/io_thread.h" | 16 #include "chrome/browser/io_thread.h" |
| 17 #include "chrome/browser/net/chrome_net_log.h" | 17 #include "chrome/browser/net/chrome_net_log.h" |
| 18 #include "chrome/browser/net/chrome_network_delegate.h" | 18 #include "chrome/browser/net/chrome_network_delegate.h" |
| 19 #include "chrome/browser/net/clear_on_exit_policy.h" | 19 #include "chrome/browser/net/clear_on_exit_policy.h" |
| 20 #include "chrome/browser/net/connect_interceptor.h" | 20 #include "chrome/browser/net/connect_interceptor.h" |
| 21 #include "chrome/browser/net/http_server_properties_manager.h" | 21 #include "chrome/browser/net/http_server_properties_manager.h" |
| 22 #include "chrome/browser/net/predictor.h" | 22 #include "chrome/browser/net/predictor.h" |
| 23 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" | 23 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| 24 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" | 24 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" |
| 25 #include "chrome/browser/prefs/pref_service.h" | 25 #include "chrome/browser/prefs/pref_service.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | |
| 28 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
| 29 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
| 30 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 32 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 33 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 34 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 35 #include "content/public/browser/resource_context.h" | 34 #include "content/public/browser/resource_context.h" |
| 36 #include "content/public/browser/storage_partition.h" | 35 #include "content/public/browser/storage_partition.h" |
| 37 #include "extensions/common/constants.h" | 36 #include "extensions/common/constants.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 profile_, io_data_); | 112 profile_, io_data_); |
| 114 } | 113 } |
| 115 io_data_->predictor_->InitNetworkPredictor(profile_->GetPrefs(), | 114 io_data_->predictor_->InitNetworkPredictor(profile_->GetPrefs(), |
| 116 local_state, | 115 local_state, |
| 117 io_thread, | 116 io_thread, |
| 118 main_request_context_getter_); | 117 main_request_context_getter_); |
| 119 | 118 |
| 120 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 119 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
| 121 } | 120 } |
| 122 | 121 |
| 123 base::Callback<ChromeURLDataManagerBackend*(void)> | |
| 124 ProfileImplIOData::Handle::GetChromeURLDataManagerBackendGetter() const { | |
| 125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 126 LazyInitialize(); | |
| 127 return base::Bind(&ProfileIOData::GetChromeURLDataManagerBackend, | |
| 128 base::Unretained(io_data_)); | |
| 129 } | |
| 130 | |
| 131 content::ResourceContext* | 122 content::ResourceContext* |
| 132 ProfileImplIOData::Handle::GetResourceContext() const { | 123 ProfileImplIOData::Handle::GetResourceContext() const { |
| 133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 124 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 134 LazyInitialize(); | 125 LazyInitialize(); |
| 135 return GetResourceContextNoInit(); | 126 return GetResourceContextNoInit(); |
| 136 } | 127 } |
| 137 | 128 |
| 138 content::ResourceContext* | 129 content::ResourceContext* |
| 139 ProfileImplIOData::Handle::GetResourceContextNoInit() const { | 130 ProfileImplIOData::Handle::GetResourceContextNoInit() const { |
| 140 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 131 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 base::Time time, | 656 base::Time time, |
| 666 const base::Closure& completion) { | 657 const base::Closure& completion) { |
| 667 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 658 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 668 LazyInitialize(); | 659 LazyInitialize(); |
| 669 | 660 |
| 670 DCHECK(transport_security_state()); | 661 DCHECK(transport_security_state()); |
| 671 transport_security_state()->DeleteSince(time); // Completes synchronously. | 662 transport_security_state()->DeleteSince(time); // Completes synchronously. |
| 672 DCHECK(http_server_properties_manager_); | 663 DCHECK(http_server_properties_manager_); |
| 673 http_server_properties_manager_->Clear(completion); | 664 http_server_properties_manager_->Clear(completion); |
| 674 } | 665 } |
| OLD | NEW |