| 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" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "content/browser/appcache/chrome_appcache_service.h" | 45 #include "content/browser/appcache/chrome_appcache_service.h" |
| 46 #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" | 47 #include "content/browser/download/download_id_factory.h" |
| 48 #include "content/browser/host_zoom_map.h" | 48 #include "content/browser/host_zoom_map.h" |
| 49 #include "content/browser/renderer_host/media/media_stream_manager.h" | 49 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 50 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 50 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 51 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 51 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 52 #include "content/browser/resource_context.h" | 52 #include "content/browser/resource_context.h" |
| 53 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
| 54 #include "content/public/browser/notification_service.h" | 54 #include "content/public/browser/notification_service.h" |
| 55 #include "media/audio/audio_manager.h" |
| 55 #include "net/base/origin_bound_cert_service.h" | 56 #include "net/base/origin_bound_cert_service.h" |
| 56 #include "net/http/http_transaction_factory.h" | 57 #include "net/http/http_transaction_factory.h" |
| 57 #include "net/http/http_util.h" | 58 #include "net/http/http_util.h" |
| 58 #include "net/proxy/proxy_config_service_fixed.h" | 59 #include "net/proxy/proxy_config_service_fixed.h" |
| 59 #include "net/proxy/proxy_script_fetcher_impl.h" | 60 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 60 #include "net/proxy/proxy_service.h" | 61 #include "net/proxy/proxy_service.h" |
| 61 #include "net/url_request/url_request.h" | 62 #include "net/url_request/url_request.h" |
| 62 #include "webkit/blob/blob_data.h" | 63 #include "webkit/blob/blob_data.h" |
| 63 #include "webkit/blob/blob_url_request_job_factory.h" | 64 #include "webkit/blob/blob_url_request_job_factory.h" |
| 64 #include "webkit/database/database_tracker.h" | 65 #include "webkit/database/database_tracker.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // At the moment, it'll remain 'undeterministic' when a user | 217 // At the moment, it'll remain 'undeterministic' when a user |
| 217 // types a URL in the omnibar or click on a download link in a page. | 218 // types a URL in the omnibar or click on a download link in a page. |
| 218 // For the latter, we need a change on the webkit-side. | 219 // For the latter, we need a change on the webkit-side. |
| 219 // We initialize it to the default charset here and a user will | 220 // We initialize it to the default charset here and a user will |
| 220 // have an *arguably* better default charset for interpreting a raw 8bit | 221 // have an *arguably* better default charset for interpreting a raw 8bit |
| 221 // C-D header field. It means the native OS codepage fallback in | 222 // C-D header field. It means the native OS codepage fallback in |
| 222 // net_util::GetSuggestedFilename is unlikely to be taken. | 223 // net_util::GetSuggestedFilename is unlikely to be taken. |
| 223 params->referrer_charset = default_charset; | 224 params->referrer_charset = default_charset; |
| 224 | 225 |
| 225 params->io_thread = g_browser_process->io_thread(); | 226 params->io_thread = g_browser_process->io_thread(); |
| 227 params->audio_manager = g_browser_process->audio_manager(); |
| 226 | 228 |
| 227 params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 229 params->host_content_settings_map = profile->GetHostContentSettingsMap(); |
| 228 params->cookie_settings = CookieSettings::GetForProfile(profile); | 230 params->cookie_settings = CookieSettings::GetForProfile(profile); |
| 229 params->host_zoom_map = profile->GetHostZoomMap(); | 231 params->host_zoom_map = profile->GetHostZoomMap(); |
| 230 params->ssl_config_service = profile->GetSSLConfigService(); | 232 params->ssl_config_service = profile->GetSSLConfigService(); |
| 231 base::Callback<Profile*(void)> profile_getter = | 233 base::Callback<Profile*(void)> profile_getter = |
| 232 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), | 234 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), |
| 233 profile); | 235 profile); |
| 234 params->cookie_monster_delegate = | 236 params->cookie_monster_delegate = |
| 235 new ChromeCookieMonsterDelegate(profile_getter); | 237 new ChromeCookieMonsterDelegate(profile_getter); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 491 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 490 DCHECK(set_protocol); | 492 DCHECK(set_protocol); |
| 491 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 493 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
| 492 // Install the GView request interceptor that will redirect requests | 494 // Install the GView request interceptor that will redirect requests |
| 493 // of compatible documents (PDF, etc) to the GView document viewer. | 495 // of compatible documents (PDF, etc) to the GView document viewer. |
| 494 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 496 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 495 if (parsed_command_line.HasSwitch(switches::kEnableGView)) | 497 if (parsed_command_line.HasSwitch(switches::kEnableGView)) |
| 496 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); | 498 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); |
| 497 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 499 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
| 498 | 500 |
| 499 media_stream_manager_.reset(new media_stream::MediaStreamManager); | 501 media_stream_manager_.reset( |
| 502 new media_stream::MediaStreamManager(profile_params_->audio_manager)); |
| 500 | 503 |
| 501 // Take ownership over these parameters. | 504 // Take ownership over these parameters. |
| 502 database_tracker_ = profile_params_->database_tracker; | 505 database_tracker_ = profile_params_->database_tracker; |
| 503 appcache_service_ = profile_params_->appcache_service; | 506 appcache_service_ = profile_params_->appcache_service; |
| 504 blob_storage_context_ = profile_params_->blob_storage_context; | 507 blob_storage_context_ = profile_params_->blob_storage_context; |
| 505 file_system_context_ = profile_params_->file_system_context; | 508 file_system_context_ = profile_params_->file_system_context; |
| 506 quota_manager_ = profile_params_->quota_manager; | 509 quota_manager_ = profile_params_->quota_manager; |
| 507 host_zoom_map_ = profile_params_->host_zoom_map; | 510 host_zoom_map_ = profile_params_->host_zoom_map; |
| 508 host_content_settings_map_ = profile_params_->host_content_settings_map; | 511 host_content_settings_map_ = profile_params_->host_content_settings_map; |
| 509 cookie_settings_ = profile_params_->cookie_settings; | 512 cookie_settings_ = profile_params_->cookie_settings; |
| 510 notification_service_ = profile_params_->notification_service; | 513 notification_service_ = profile_params_->notification_service; |
| 511 extension_info_map_ = profile_params_->extension_info_map; | 514 extension_info_map_ = profile_params_->extension_info_map; |
| 512 | 515 |
| 513 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); | 516 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); |
| 514 resource_context_.set_request_context(main_request_context_); | 517 resource_context_.set_request_context(main_request_context_); |
| 515 resource_context_.set_database_tracker(database_tracker_); | 518 resource_context_.set_database_tracker(database_tracker_); |
| 516 resource_context_.set_appcache_service(appcache_service_); | 519 resource_context_.set_appcache_service(appcache_service_); |
| 517 resource_context_.set_blob_storage_context(blob_storage_context_); | 520 resource_context_.set_blob_storage_context(blob_storage_context_); |
| 518 resource_context_.set_file_system_context(file_system_context_); | 521 resource_context_.set_file_system_context(file_system_context_); |
| 519 resource_context_.set_quota_manager(quota_manager_); | 522 resource_context_.set_quota_manager(quota_manager_); |
| 520 resource_context_.set_host_zoom_map(host_zoom_map_); | 523 resource_context_.set_host_zoom_map(host_zoom_map_); |
| 521 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this)); | 524 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this)); |
| 522 resource_context_.set_media_observer( | 525 resource_context_.set_media_observer( |
| 523 io_thread_globals->media.media_internals.get()); | 526 io_thread_globals->media.media_internals.get()); |
| 524 resource_context_.set_download_id_factory(download_id_factory_); | 527 resource_context_.set_download_id_factory(download_id_factory_); |
| 525 resource_context_.set_media_stream_manager(media_stream_manager_.get()); | 528 resource_context_.set_media_stream_manager(media_stream_manager_.get()); |
| 529 resource_context_.set_audio_manager(profile_params_->audio_manager); |
| 526 | 530 |
| 527 LazyInitializeInternal(profile_params_.get()); | 531 LazyInitializeInternal(profile_params_.get()); |
| 528 | 532 |
| 529 profile_params_.reset(); | 533 profile_params_.reset(); |
| 530 initialized_ = true; | 534 initialized_ = true; |
| 531 } | 535 } |
| 532 | 536 |
| 533 void ProfileIOData::ApplyProfileParamsToContext( | 537 void ProfileIOData::ApplyProfileParamsToContext( |
| 534 ChromeURLRequestContext* context) const { | 538 ChromeURLRequestContext* context) const { |
| 535 context->set_is_incognito(profile_params_->is_incognito); | 539 context->set_is_incognito(profile_params_->is_incognito); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 557 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 561 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 558 new DeleteTask<ProfileIOData>(this)); | 562 new DeleteTask<ProfileIOData>(this)); |
| 559 if (!posted) | 563 if (!posted) |
| 560 delete this; | 564 delete this; |
| 561 } | 565 } |
| 562 | 566 |
| 563 void ProfileIOData::set_origin_bound_cert_service( | 567 void ProfileIOData::set_origin_bound_cert_service( |
| 564 net::OriginBoundCertService* origin_bound_cert_service) const { | 568 net::OriginBoundCertService* origin_bound_cert_service) const { |
| 565 origin_bound_cert_service_.reset(origin_bound_cert_service); | 569 origin_bound_cert_service_.reset(origin_bound_cert_service); |
| 566 } | 570 } |
| OLD | NEW |