| 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_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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/profiles/profile_manager.h" | 36 #include "chrome/browser/profiles/profile_manager.h" |
| 37 #include "chrome/browser/transport_security_persister.h" | 37 #include "chrome/browser/transport_security_persister.h" |
| 38 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 38 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
| 39 #include "chrome/common/chrome_notification_types.h" | 39 #include "chrome/common/chrome_notification_types.h" |
| 40 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
| 42 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
| 43 #include "content/browser/appcache/chrome_appcache_service.h" | 43 #include "content/browser/appcache/chrome_appcache_service.h" |
| 44 #include "content/browser/chrome_blob_storage_context.h" | 44 #include "content/browser/chrome_blob_storage_context.h" |
| 45 #include "content/browser/in_process_webkit/webkit_context.h" |
| 45 #include "content/browser/renderer_host/media/media_stream_manager.h" | 46 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 46 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 47 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 47 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 48 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 48 #include "content/public/browser/browser_thread.h" | 49 #include "content/public/browser/browser_thread.h" |
| 49 #include "content/public/browser/host_zoom_map.h" | 50 #include "content/public/browser/host_zoom_map.h" |
| 50 #include "content/public/browser/notification_service.h" | 51 #include "content/public/browser/notification_service.h" |
| 51 #include "content/public/browser/resource_context.h" | 52 #include "content/public/browser/resource_context.h" |
| 52 #include "media/audio/audio_manager.h" | 53 #include "media/audio/audio_manager.h" |
| 53 #include "net/base/origin_bound_cert_service.h" | 54 #include "net/base/origin_bound_cert_service.h" |
| 54 #include "net/http/http_transaction_factory.h" | 55 #include "net/http/http_transaction_factory.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 params->ssl_config_service = profile->GetSSLConfigService(); | 228 params->ssl_config_service = profile->GetSSLConfigService(); |
| 228 base::Callback<Profile*(void)> profile_getter = | 229 base::Callback<Profile*(void)> profile_getter = |
| 229 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), | 230 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), |
| 230 profile); | 231 profile); |
| 231 params->cookie_monster_delegate = | 232 params->cookie_monster_delegate = |
| 232 new ChromeCookieMonsterDelegate(profile_getter); | 233 new ChromeCookieMonsterDelegate(profile_getter); |
| 233 params->database_tracker = profile->GetDatabaseTracker(); | 234 params->database_tracker = profile->GetDatabaseTracker(); |
| 234 params->appcache_service = profile->GetAppCacheService(); | 235 params->appcache_service = profile->GetAppCacheService(); |
| 235 params->blob_storage_context = profile->GetBlobStorageContext(); | 236 params->blob_storage_context = profile->GetBlobStorageContext(); |
| 236 params->file_system_context = profile->GetFileSystemContext(); | 237 params->file_system_context = profile->GetFileSystemContext(); |
| 238 params->webkit_context = profile->GetWebKitContext(); |
| 237 params->quota_manager = profile->GetQuotaManager(); | 239 params->quota_manager = profile->GetQuotaManager(); |
| 238 params->extension_info_map = profile->GetExtensionInfoMap(); | 240 params->extension_info_map = profile->GetExtensionInfoMap(); |
| 239 params->notification_service = | 241 params->notification_service = |
| 240 DesktopNotificationServiceFactory::GetForProfile(profile); | 242 DesktopNotificationServiceFactory::GetForProfile(profile); |
| 241 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 243 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); |
| 242 | 244 |
| 243 ChromeProxyConfigService* proxy_config_service = | 245 ChromeProxyConfigService* proxy_config_service = |
| 244 ProxyServiceFactory::CreateProxyConfigService(true); | 246 ProxyServiceFactory::CreateProxyConfigService(true); |
| 245 params->proxy_config_service.reset(proxy_config_service); | 247 params->proxy_config_service.reset(proxy_config_service); |
| 246 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 248 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 return database_tracker_; | 430 return database_tracker_; |
| 429 } | 431 } |
| 430 | 432 |
| 431 fileapi::FileSystemContext* | 433 fileapi::FileSystemContext* |
| 432 ProfileIOData::ResourceContext::GetFileSystemContext() { | 434 ProfileIOData::ResourceContext::GetFileSystemContext() { |
| 433 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 435 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 434 EnsureInitialized(); | 436 EnsureInitialized(); |
| 435 return file_system_context_; | 437 return file_system_context_; |
| 436 } | 438 } |
| 437 | 439 |
| 440 WebKitContext* ProfileIOData::ResourceContext::GetWebKitContext() { |
| 441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 442 EnsureInitialized(); |
| 443 return webkit_context_; |
| 444 } |
| 445 |
| 438 ChromeBlobStorageContext* | 446 ChromeBlobStorageContext* |
| 439 ProfileIOData::ResourceContext::GetBlobStorageContext() { | 447 ProfileIOData::ResourceContext::GetBlobStorageContext() { |
| 440 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 448 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 441 EnsureInitialized(); | 449 EnsureInitialized(); |
| 442 return blob_storage_context_; | 450 return blob_storage_context_; |
| 443 } | 451 } |
| 444 | 452 |
| 445 quota::QuotaManager* ProfileIOData::ResourceContext::GetQuotaManager() { | 453 quota::QuotaManager* ProfileIOData::ResourceContext::GetQuotaManager() { |
| 446 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 454 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 447 EnsureInitialized(); | 455 EnsureInitialized(); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 574 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
| 567 | 575 |
| 568 media_stream_manager_.reset( | 576 media_stream_manager_.reset( |
| 569 new media_stream::MediaStreamManager(profile_params_->audio_manager)); | 577 new media_stream::MediaStreamManager(profile_params_->audio_manager)); |
| 570 | 578 |
| 571 // Take ownership over these parameters. | 579 // Take ownership over these parameters. |
| 572 database_tracker_ = profile_params_->database_tracker; | 580 database_tracker_ = profile_params_->database_tracker; |
| 573 appcache_service_ = profile_params_->appcache_service; | 581 appcache_service_ = profile_params_->appcache_service; |
| 574 blob_storage_context_ = profile_params_->blob_storage_context; | 582 blob_storage_context_ = profile_params_->blob_storage_context; |
| 575 file_system_context_ = profile_params_->file_system_context; | 583 file_system_context_ = profile_params_->file_system_context; |
| 584 webkit_context_ = profile_params_->webkit_context; |
| 576 quota_manager_ = profile_params_->quota_manager; | 585 quota_manager_ = profile_params_->quota_manager; |
| 577 host_zoom_map_ = profile_params_->host_zoom_map; | 586 host_zoom_map_ = profile_params_->host_zoom_map; |
| 578 host_content_settings_map_ = profile_params_->host_content_settings_map; | 587 host_content_settings_map_ = profile_params_->host_content_settings_map; |
| 579 cookie_settings_ = profile_params_->cookie_settings; | 588 cookie_settings_ = profile_params_->cookie_settings; |
| 580 notification_service_ = profile_params_->notification_service; | 589 notification_service_ = profile_params_->notification_service; |
| 581 extension_info_map_ = profile_params_->extension_info_map; | 590 extension_info_map_ = profile_params_->extension_info_map; |
| 582 | 591 |
| 583 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get(); | 592 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get(); |
| 584 resource_context_.request_context_ = main_request_context_; | 593 resource_context_.request_context_ = main_request_context_; |
| 585 resource_context_.database_tracker_ = database_tracker_; | 594 resource_context_.database_tracker_ = database_tracker_; |
| 586 resource_context_.appcache_service_ = appcache_service_; | 595 resource_context_.appcache_service_ = appcache_service_; |
| 587 resource_context_.blob_storage_context_ = blob_storage_context_; | 596 resource_context_.blob_storage_context_ = blob_storage_context_; |
| 588 resource_context_.file_system_context_ = file_system_context_; | 597 resource_context_.file_system_context_ = file_system_context_; |
| 598 resource_context_.webkit_context_ = webkit_context_; |
| 589 resource_context_.quota_manager_ = quota_manager_; | 599 resource_context_.quota_manager_ = quota_manager_; |
| 590 resource_context_.host_zoom_map_ = host_zoom_map_; | 600 resource_context_.host_zoom_map_ = host_zoom_map_; |
| 591 resource_context_.media_observer_ = | 601 resource_context_.media_observer_ = |
| 592 io_thread_globals->media.media_internals.get(); | 602 io_thread_globals->media.media_internals.get(); |
| 593 resource_context_.media_stream_manager_ = media_stream_manager_.get(); | 603 resource_context_.media_stream_manager_ = media_stream_manager_.get(); |
| 594 resource_context_.audio_manager_ = profile_params_->audio_manager; | 604 resource_context_.audio_manager_ = profile_params_->audio_manager; |
| 595 | 605 |
| 596 LazyInitializeInternal(profile_params_.get()); | 606 LazyInitializeInternal(profile_params_.get()); |
| 597 | 607 |
| 598 profile_params_.reset(); | 608 profile_params_.reset(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 625 &resource_context_)); | 635 &resource_context_)); |
| 626 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 636 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
| 627 if (!posted) | 637 if (!posted) |
| 628 delete this; | 638 delete this; |
| 629 } | 639 } |
| 630 | 640 |
| 631 void ProfileIOData::set_origin_bound_cert_service( | 641 void ProfileIOData::set_origin_bound_cert_service( |
| 632 net::OriginBoundCertService* origin_bound_cert_service) const { | 642 net::OriginBoundCertService* origin_bound_cert_service) const { |
| 633 origin_bound_cert_service_.reset(origin_bound_cert_service); | 643 origin_bound_cert_service_.reset(origin_bound_cert_service); |
| 634 } | 644 } |
| OLD | NEW |