OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/task.h" | 16 #include "base/task.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/content_settings/cookie_settings.h" | 18 #include "chrome/browser/content_settings/cookie_settings.h" |
19 #include "chrome/browser/content_settings/host_content_settings_map.h" | 19 #include "chrome/browser/content_settings/host_content_settings_map.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/download/download_service.h" |
| 22 #include "chrome/browser/download/download_service_factory.h" |
21 #include "chrome/browser/extensions/extension_info_map.h" | 23 #include "chrome/browser/extensions/extension_info_map.h" |
22 #include "chrome/browser/extensions/extension_protocols.h" | 24 #include "chrome/browser/extensions/extension_protocols.h" |
23 #include "chrome/browser/io_thread.h" | 25 #include "chrome/browser/io_thread.h" |
24 #include "chrome/browser/media/media_internals.h" | 26 #include "chrome/browser/media/media_internals.h" |
25 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 27 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
26 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" | 28 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" |
27 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 29 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
28 #include "chrome/browser/net/chrome_net_log.h" | 30 #include "chrome/browser/net/chrome_net_log.h" |
29 #include "chrome/browser/net/chrome_network_delegate.h" | 31 #include "chrome/browser/net/chrome_network_delegate.h" |
30 #include "chrome/browser/net/pref_proxy_config_service.h" | 32 #include "chrome/browser/net/pref_proxy_config_service.h" |
31 #include "chrome/browser/net/proxy_service_factory.h" | 33 #include "chrome/browser/net/proxy_service_factory.h" |
32 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 34 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
33 #include "chrome/browser/policy/url_blacklist_manager.h" | 35 #include "chrome/browser/policy/url_blacklist_manager.h" |
34 #include "chrome/browser/prefs/pref_service.h" | 36 #include "chrome/browser/prefs/pref_service.h" |
35 #include "chrome/browser/profiles/profile.h" | 37 #include "chrome/browser/profiles/profile.h" |
36 #include "chrome/browser/profiles/profile_manager.h" | 38 #include "chrome/browser/profiles/profile_manager.h" |
37 #include "chrome/browser/transport_security_persister.h" | 39 #include "chrome/browser/transport_security_persister.h" |
38 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 40 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
39 #include "chrome/common/chrome_notification_types.h" | 41 #include "chrome/common/chrome_notification_types.h" |
40 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
41 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
42 #include "chrome/common/url_constants.h" | 44 #include "chrome/common/url_constants.h" |
43 #include "content/browser/appcache/chrome_appcache_service.h" | 45 #include "content/browser/appcache/chrome_appcache_service.h" |
44 #include "content/browser/chrome_blob_storage_context.h" | 46 #include "content/browser/chrome_blob_storage_context.h" |
| 47 #include "content/browser/download/download_id_factory.h" |
45 #include "content/browser/host_zoom_map.h" | 48 #include "content/browser/host_zoom_map.h" |
46 #include "content/browser/renderer_host/media/media_stream_manager.h" | 49 #include "content/browser/renderer_host/media/media_stream_manager.h" |
47 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 50 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
48 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 51 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
49 #include "content/browser/resource_context.h" | 52 #include "content/browser/resource_context.h" |
50 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
51 #include "content/public/browser/notification_service.h" | 54 #include "content/public/browser/notification_service.h" |
52 #include "net/base/origin_bound_cert_service.h" | 55 #include "net/base/origin_bound_cert_service.h" |
53 #include "net/http/http_transaction_factory.h" | 56 #include "net/http/http_transaction_factory.h" |
54 #include "net/http/http_util.h" | 57 #include "net/http/http_util.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 return profile; | 183 return profile; |
181 return NULL; | 184 return NULL; |
182 } | 185 } |
183 | 186 |
184 } // namespace | 187 } // namespace |
185 | 188 |
186 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 189 void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
187 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
188 PrefService* pref_service = profile->GetPrefs(); | 191 PrefService* pref_service = profile->GetPrefs(); |
189 | 192 |
190 next_download_id_thunk_ = profile->GetDownloadManager()->GetNextIdThunk(); | 193 download_id_factory_ = DownloadServiceFactory::GetForProfile(profile)-> |
| 194 GetDownloadIdFactory(); |
191 | 195 |
192 scoped_ptr<ProfileParams> params(new ProfileParams); | 196 scoped_ptr<ProfileParams> params(new ProfileParams); |
193 params->path = profile->GetPath(); | 197 params->path = profile->GetPath(); |
194 params->is_incognito = profile->IsOffTheRecord(); | 198 params->is_incognito = profile->IsOffTheRecord(); |
195 params->clear_local_state_on_exit = | 199 params->clear_local_state_on_exit = |
196 pref_service->GetBoolean(prefs::kClearSiteDataOnExit); | 200 pref_service->GetBoolean(prefs::kClearSiteDataOnExit); |
197 | 201 |
198 params->appcache_service = profile->GetAppCacheService(); | 202 params->appcache_service = profile->GetAppCacheService(); |
199 | 203 |
200 // Set up Accept-Language and Accept-Charset header values | 204 // Set up Accept-Language and Accept-Charset header values |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 resource_context_.set_request_context(main_request_context_); | 512 resource_context_.set_request_context(main_request_context_); |
509 resource_context_.set_database_tracker(database_tracker_); | 513 resource_context_.set_database_tracker(database_tracker_); |
510 resource_context_.set_appcache_service(appcache_service_); | 514 resource_context_.set_appcache_service(appcache_service_); |
511 resource_context_.set_blob_storage_context(blob_storage_context_); | 515 resource_context_.set_blob_storage_context(blob_storage_context_); |
512 resource_context_.set_file_system_context(file_system_context_); | 516 resource_context_.set_file_system_context(file_system_context_); |
513 resource_context_.set_quota_manager(quota_manager_); | 517 resource_context_.set_quota_manager(quota_manager_); |
514 resource_context_.set_host_zoom_map(host_zoom_map_); | 518 resource_context_.set_host_zoom_map(host_zoom_map_); |
515 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this)); | 519 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this)); |
516 resource_context_.set_media_observer( | 520 resource_context_.set_media_observer( |
517 io_thread_globals->media.media_internals.get()); | 521 io_thread_globals->media.media_internals.get()); |
518 resource_context_.set_next_download_id_thunk(next_download_id_thunk_); | 522 resource_context_.set_download_id_factory(download_id_factory_); |
519 resource_context_.set_media_stream_manager(media_stream_manager_.get()); | 523 resource_context_.set_media_stream_manager(media_stream_manager_.get()); |
520 | 524 |
521 LazyInitializeInternal(profile_params_.get()); | 525 LazyInitializeInternal(profile_params_.get()); |
522 | 526 |
523 profile_params_.reset(); | 527 profile_params_.reset(); |
524 initialized_ = true; | 528 initialized_ = true; |
525 } | 529 } |
526 | 530 |
527 void ProfileIOData::ApplyProfileParamsToContext( | 531 void ProfileIOData::ApplyProfileParamsToContext( |
528 ChromeURLRequestContext* context) const { | 532 ChromeURLRequestContext* context) const { |
(...skipping 22 matching lines...) Expand all Loading... |
551 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 555 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
552 new DeleteTask<ProfileIOData>(this)); | 556 new DeleteTask<ProfileIOData>(this)); |
553 if (!posted) | 557 if (!posted) |
554 delete this; | 558 delete this; |
555 } | 559 } |
556 | 560 |
557 void ProfileIOData::set_origin_bound_cert_service( | 561 void ProfileIOData::set_origin_bound_cert_service( |
558 net::OriginBoundCertService* origin_bound_cert_service) const { | 562 net::OriginBoundCertService* origin_bound_cert_service) const { |
559 origin_bound_cert_service_.reset(origin_bound_cert_service); | 563 origin_bound_cert_service_.reset(origin_bound_cert_service); |
560 } | 564 } |
OLD | NEW |