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" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 17 #include "base/string_util.h" |
17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/content_settings/cookie_settings.h" | 19 #include "chrome/browser/content_settings/cookie_settings.h" |
19 #include "chrome/browser/content_settings/host_content_settings_map.h" | 20 #include "chrome/browser/content_settings/host_content_settings_map.h" |
20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
21 #include "chrome/browser/download/download_service.h" | 22 #include "chrome/browser/download/download_service.h" |
22 #include "chrome/browser/download/download_service_factory.h" | 23 #include "chrome/browser/download/download_service_factory.h" |
23 #include "chrome/browser/extensions/extension_info_map.h" | 24 #include "chrome/browser/extensions/extension_info_map.h" |
24 #include "chrome/browser/extensions/extension_protocols.h" | 25 #include "chrome/browser/extensions/extension_protocols.h" |
25 #include "chrome/browser/io_thread.h" | 26 #include "chrome/browser/io_thread.h" |
26 #include "chrome/browser/media/media_internals.h" | 27 #include "chrome/browser/media/media_internals.h" |
27 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 28 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
28 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 29 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
29 #include "chrome/browser/net/chrome_net_log.h" | 30 #include "chrome/browser/net/chrome_net_log.h" |
30 #include "chrome/browser/net/chrome_network_delegate.h" | 31 #include "chrome/browser/net/chrome_network_delegate.h" |
31 #include "chrome/browser/net/proxy_service_factory.h" | 32 #include "chrome/browser/net/proxy_service_factory.h" |
32 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 33 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
33 #include "chrome/browser/policy/url_blacklist_manager.h" | 34 #include "chrome/browser/policy/url_blacklist_manager.h" |
34 #include "chrome/browser/prefs/pref_service.h" | 35 #include "chrome/browser/prefs/pref_service.h" |
35 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
36 #include "chrome/browser/profiles/profile_manager.h" | 37 #include "chrome/browser/profiles/profile_manager.h" |
37 #include "chrome/browser/transport_security_persister.h" | 38 #include "chrome/browser/transport_security_persister.h" |
38 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 39 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
39 #include "chrome/common/chrome_notification_types.h" | 40 #include "chrome/common/chrome_notification_types.h" |
40 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
41 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
42 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
43 #include "content/browser/appcache/chrome_appcache_service.h" | |
44 #include "content/browser/chrome_blob_storage_context.h" | |
45 #include "content/browser/in_process_webkit/webkit_context.h" | 44 #include "content/browser/in_process_webkit/webkit_context.h" |
46 #include "content/browser/renderer_host/media/media_stream_manager.h" | 45 #include "content/browser/renderer_host/media/media_stream_manager.h" |
47 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 46 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
48 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 47 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
49 #include "content/public/browser/browser_thread.h" | 48 #include "content/public/browser/browser_thread.h" |
50 #include "content/public/browser/host_zoom_map.h" | 49 #include "content/public/browser/host_zoom_map.h" |
51 #include "content/public/browser/notification_service.h" | 50 #include "content/public/browser/notification_service.h" |
52 #include "content/public/browser/resource_context.h" | 51 #include "content/public/browser/resource_context.h" |
53 #include "media/audio/audio_manager.h" | 52 #include "media/audio/audio_manager.h" |
54 #include "net/base/origin_bound_cert_service.h" | 53 #include "net/base/origin_bound_cert_service.h" |
55 #include "net/http/http_transaction_factory.h" | 54 #include "net/http/http_transaction_factory.h" |
56 #include "net/http/http_util.h" | 55 #include "net/http/http_util.h" |
57 #include "net/proxy/proxy_config_service_fixed.h" | 56 #include "net/proxy/proxy_config_service_fixed.h" |
58 #include "net/proxy/proxy_script_fetcher_impl.h" | 57 #include "net/proxy/proxy_script_fetcher_impl.h" |
59 #include "net/proxy/proxy_service.h" | 58 #include "net/proxy/proxy_service.h" |
60 #include "net/url_request/url_request.h" | 59 #include "net/url_request/url_request.h" |
61 #include "webkit/blob/blob_data.h" | 60 #include "webkit/blob/blob_data.h" |
62 #include "webkit/blob/blob_url_request_job_factory.h" | 61 #include "webkit/blob/blob_url_request_job_factory.h" |
63 #include "webkit/database/database_tracker.h" | |
64 #include "webkit/fileapi/file_system_context.h" | |
65 #include "webkit/fileapi/file_system_url_request_job_factory.h" | 62 #include "webkit/fileapi/file_system_url_request_job_factory.h" |
66 #include "webkit/quota/quota_manager.h" | |
67 | 63 |
68 #if defined(OS_CHROMEOS) | 64 #if defined(OS_CHROMEOS) |
69 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 65 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
70 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 66 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
71 #endif // defined(OS_CHROMEOS) | 67 #endif // defined(OS_CHROMEOS) |
72 | 68 |
73 using content::BrowserContext; | 69 using content::BrowserContext; |
74 using content::BrowserThread; | 70 using content::BrowserThread; |
| 71 using content::ResourceContext; |
75 | 72 |
76 namespace { | 73 namespace { |
77 | 74 |
78 // ---------------------------------------------------------------------------- | 75 // ---------------------------------------------------------------------------- |
79 // CookieMonster::Delegate implementation | 76 // CookieMonster::Delegate implementation |
80 // ---------------------------------------------------------------------------- | 77 // ---------------------------------------------------------------------------- |
81 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 78 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
82 public: | 79 public: |
83 explicit ChromeCookieMonsterDelegate( | 80 explicit ChromeCookieMonsterDelegate( |
84 const base::Callback<Profile*(void)>& profile_getter) | 81 const base::Callback<Profile*(void)>& profile_getter) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 186 void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 187 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
191 PrefService* pref_service = profile->GetPrefs(); | 188 PrefService* pref_service = profile->GetPrefs(); |
192 | 189 |
193 scoped_ptr<ProfileParams> params(new ProfileParams); | 190 scoped_ptr<ProfileParams> params(new ProfileParams); |
194 params->path = profile->GetPath(); | 191 params->path = profile->GetPath(); |
195 params->is_incognito = profile->IsOffTheRecord(); | 192 params->is_incognito = profile->IsOffTheRecord(); |
196 params->clear_local_state_on_exit = | 193 params->clear_local_state_on_exit = |
197 pref_service->GetBoolean(prefs::kClearSiteDataOnExit); | 194 pref_service->GetBoolean(prefs::kClearSiteDataOnExit); |
198 | 195 |
199 params->appcache_service = BrowserContext::GetAppCacheService(profile); | |
200 | |
201 // Set up Accept-Language and Accept-Charset header values | 196 // Set up Accept-Language and Accept-Charset header values |
202 params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader( | 197 params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader( |
203 pref_service->GetString(prefs::kAcceptLanguages)); | 198 pref_service->GetString(prefs::kAcceptLanguages)); |
204 std::string default_charset = | 199 std::string default_charset = |
205 pref_service->GetString(prefs::kGlobalDefaultCharset); | 200 pref_service->GetString(prefs::kGlobalDefaultCharset); |
206 params->accept_charset = | 201 params->accept_charset = |
207 net::HttpUtil::GenerateAcceptCharsetHeader(default_charset); | 202 net::HttpUtil::GenerateAcceptCharsetHeader(default_charset); |
208 | 203 |
209 // At this point, we don't know the charset of the referring page | 204 // At this point, we don't know the charset of the referring page |
210 // where a url request originates from. This is used to get a suggested | 205 // where a url request originates from. This is used to get a suggested |
(...skipping 14 matching lines...) Expand all Loading... |
225 | 220 |
226 params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 221 params->host_content_settings_map = profile->GetHostContentSettingsMap(); |
227 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); | 222 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); |
228 params->host_zoom_map = profile->GetHostZoomMap(); | 223 params->host_zoom_map = profile->GetHostZoomMap(); |
229 params->ssl_config_service = profile->GetSSLConfigService(); | 224 params->ssl_config_service = profile->GetSSLConfigService(); |
230 base::Callback<Profile*(void)> profile_getter = | 225 base::Callback<Profile*(void)> profile_getter = |
231 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), | 226 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), |
232 profile); | 227 profile); |
233 params->cookie_monster_delegate = | 228 params->cookie_monster_delegate = |
234 new ChromeCookieMonsterDelegate(profile_getter); | 229 new ChromeCookieMonsterDelegate(profile_getter); |
235 params->database_tracker = BrowserContext::GetDatabaseTracker(profile); | |
236 params->appcache_service = BrowserContext::GetAppCacheService(profile); | |
237 params->blob_storage_context = BrowserContext::GetBlobStorageContext(profile); | |
238 params->file_system_context = BrowserContext::GetFileSystemContext(profile); | |
239 params->webkit_context = BrowserContext::GetWebKitContext(profile); | |
240 params->quota_manager = BrowserContext::GetQuotaManager(profile); | |
241 params->extension_info_map = profile->GetExtensionInfoMap(); | 230 params->extension_info_map = profile->GetExtensionInfoMap(); |
242 params->notification_service = | 231 params->notification_service = |
243 DesktopNotificationServiceFactory::GetForProfile(profile); | 232 DesktopNotificationServiceFactory::GetForProfile(profile); |
244 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 233 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); |
245 | 234 |
246 ChromeProxyConfigService* proxy_config_service = | 235 ChromeProxyConfigService* proxy_config_service = |
247 ProxyServiceFactory::CreateProxyConfigService(true); | 236 ProxyServiceFactory::CreateProxyConfigService(true); |
248 params->proxy_config_service.reset(proxy_config_service); | 237 params->proxy_config_service.reset(proxy_config_service); |
249 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 238 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( |
250 proxy_config_service); | 239 proxy_config_service); |
251 params->profile = profile; | 240 params->profile = profile; |
252 profile_params_.reset(params.release()); | 241 profile_params_.reset(params.release()); |
253 | 242 |
254 // The URLBlacklistManager has to be created on the UI thread to register | 243 // The URLBlacklistManager has to be created on the UI thread to register |
255 // observers of |pref_service|, and it also has to clean up on | 244 // observers of |pref_service|, and it also has to clean up on |
256 // ShutdownOnUIThread to release these observers on the right thread. | 245 // ShutdownOnUIThread to release these observers on the right thread. |
257 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, | 246 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, |
258 // in particular when this ProfileIOData isn't |initialized_| during deletion. | 247 // in particular when this ProfileIOData isn't |initialized_| during deletion. |
259 #if defined(ENABLE_CONFIGURATION_POLICY) | 248 #if defined(ENABLE_CONFIGURATION_POLICY) |
260 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); | 249 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); |
261 #endif | 250 #endif |
262 | 251 |
263 initialized_on_UI_thread_ = true; | 252 initialized_on_UI_thread_ = true; |
| 253 |
| 254 // We need to create these structs now so that ResourceContext can be updated |
| 255 // because this callstack can be used to post an IO thread task which uses it. |
| 256 BrowserContext::EnsureResourceContextInitialized(profile); |
264 } | 257 } |
265 | 258 |
266 ProfileIOData::AppRequestContext::AppRequestContext() {} | 259 ProfileIOData::AppRequestContext::AppRequestContext() {} |
267 ProfileIOData::AppRequestContext::~AppRequestContext() {} | 260 ProfileIOData::AppRequestContext::~AppRequestContext() {} |
268 | 261 |
269 void ProfileIOData::AppRequestContext::SetCookieStore( | 262 void ProfileIOData::AppRequestContext::SetCookieStore( |
270 net::CookieStore* cookie_store) { | 263 net::CookieStore* cookie_store) { |
271 cookie_store_ = cookie_store; | 264 cookie_store_ = cookie_store; |
272 set_cookie_store(cookie_store); | 265 set_cookie_store(cookie_store); |
273 } | 266 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 EnsureInitialized(); | 405 EnsureInitialized(); |
413 return host_resolver_; | 406 return host_resolver_; |
414 } | 407 } |
415 | 408 |
416 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { | 409 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { |
417 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 410 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
418 EnsureInitialized(); | 411 EnsureInitialized(); |
419 return request_context_; | 412 return request_context_; |
420 } | 413 } |
421 | 414 |
422 ChromeAppCacheService* ProfileIOData::ResourceContext::GetAppCacheService() { | |
423 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
424 EnsureInitialized(); | |
425 return appcache_service_; | |
426 } | |
427 | |
428 webkit_database::DatabaseTracker* | |
429 ProfileIOData::ResourceContext::GetDatabaseTracker() { | |
430 EnsureInitialized(); | |
431 return database_tracker_; | |
432 } | |
433 | |
434 fileapi::FileSystemContext* | |
435 ProfileIOData::ResourceContext::GetFileSystemContext() { | |
436 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
437 EnsureInitialized(); | |
438 return file_system_context_; | |
439 } | |
440 | |
441 WebKitContext* ProfileIOData::ResourceContext::GetWebKitContext() { | |
442 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
443 EnsureInitialized(); | |
444 return webkit_context_; | |
445 } | |
446 | |
447 ChromeBlobStorageContext* | |
448 ProfileIOData::ResourceContext::GetBlobStorageContext() { | |
449 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
450 EnsureInitialized(); | |
451 return blob_storage_context_; | |
452 } | |
453 | |
454 quota::QuotaManager* ProfileIOData::ResourceContext::GetQuotaManager() { | |
455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
456 EnsureInitialized(); | |
457 return quota_manager_; | |
458 } | |
459 | |
460 content::HostZoomMap* ProfileIOData::ResourceContext::GetHostZoomMap() { | 415 content::HostZoomMap* ProfileIOData::ResourceContext::GetHostZoomMap() { |
461 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 416 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
462 EnsureInitialized(); | 417 EnsureInitialized(); |
463 return host_zoom_map_; | 418 return host_zoom_map_; |
464 } | 419 } |
465 | 420 |
466 MediaObserver* ProfileIOData::ResourceContext::GetMediaObserver() { | 421 MediaObserver* ProfileIOData::ResourceContext::GetMediaObserver() { |
467 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 422 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
468 EnsureInitialized(); | 423 EnsureInitialized(); |
469 return media_observer_; | 424 return media_observer_; |
(...skipping 24 matching lines...) Expand all Loading... |
494 CHECK(profile_params_.get()); | 449 CHECK(profile_params_.get()); |
495 | 450 |
496 IOThread* const io_thread = profile_params_->io_thread; | 451 IOThread* const io_thread = profile_params_->io_thread; |
497 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 452 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
498 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 453 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
499 | 454 |
500 // Create the common request contexts. | 455 // Create the common request contexts. |
501 main_request_context_ = new ChromeURLRequestContext; | 456 main_request_context_ = new ChromeURLRequestContext; |
502 extensions_request_context_ = new ChromeURLRequestContext; | 457 extensions_request_context_ = new ChromeURLRequestContext; |
503 | 458 |
504 profile_params_->appcache_service->set_request_context(main_request_context_); | |
505 | |
506 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); | 459 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); |
507 | 460 |
508 network_delegate_.reset(new ChromeNetworkDelegate( | 461 network_delegate_.reset(new ChromeNetworkDelegate( |
509 io_thread_globals->extension_event_router_forwarder.get(), | 462 io_thread_globals->extension_event_router_forwarder.get(), |
510 profile_params_->extension_info_map, | 463 profile_params_->extension_info_map, |
511 url_blacklist_manager_.get(), | 464 url_blacklist_manager_.get(), |
512 profile_params_->profile, | 465 profile_params_->profile, |
513 &enable_referrers_)); | 466 &enable_referrers_)); |
514 | 467 |
515 fraudulent_certificate_reporter_.reset( | 468 fraudulent_certificate_reporter_.reset( |
(...skipping 24 matching lines...) Expand all Loading... |
540 } | 493 } |
541 bool set_protocol = job_factory_->SetProtocolHandler( | 494 bool set_protocol = job_factory_->SetProtocolHandler( |
542 chrome::kExtensionScheme, | 495 chrome::kExtensionScheme, |
543 CreateExtensionProtocolHandler(profile_params_->is_incognito, | 496 CreateExtensionProtocolHandler(profile_params_->is_incognito, |
544 profile_params_->extension_info_map)); | 497 profile_params_->extension_info_map)); |
545 DCHECK(set_protocol); | 498 DCHECK(set_protocol); |
546 set_protocol = job_factory_->SetProtocolHandler( | 499 set_protocol = job_factory_->SetProtocolHandler( |
547 chrome::kChromeUIScheme, | 500 chrome::kChromeUIScheme, |
548 ChromeURLDataManagerBackend::CreateProtocolHandler( | 501 ChromeURLDataManagerBackend::CreateProtocolHandler( |
549 chrome_url_data_manager_backend_.get(), | 502 chrome_url_data_manager_backend_.get(), |
550 profile_params_->appcache_service, | 503 ResourceContext::GetAppCacheService(&resource_context_), |
551 profile_params_->blob_storage_context->controller())); | 504 ResourceContext::GetBlobStorageController(&resource_context_))); |
552 DCHECK(set_protocol); | 505 DCHECK(set_protocol); |
553 set_protocol = job_factory_->SetProtocolHandler( | 506 set_protocol = job_factory_->SetProtocolHandler( |
554 chrome::kChromeDevToolsScheme, | 507 chrome::kChromeDevToolsScheme, |
555 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend_.get())); | 508 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend_.get())); |
556 DCHECK(set_protocol); | 509 DCHECK(set_protocol); |
557 set_protocol = job_factory_->SetProtocolHandler( | 510 set_protocol = job_factory_->SetProtocolHandler( |
558 chrome::kBlobScheme, | 511 chrome::kBlobScheme, |
559 new ChromeBlobProtocolHandler( | 512 new ChromeBlobProtocolHandler( |
560 profile_params_->blob_storage_context->controller(), | 513 ResourceContext::GetBlobStorageController(&resource_context_), |
561 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 514 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
562 DCHECK(set_protocol); | 515 DCHECK(set_protocol); |
563 set_protocol = job_factory_->SetProtocolHandler( | 516 set_protocol = job_factory_->SetProtocolHandler( |
564 chrome::kFileSystemScheme, | 517 chrome::kFileSystemScheme, |
565 CreateFileSystemProtocolHandler( | 518 CreateFileSystemProtocolHandler( |
566 profile_params_->file_system_context, | 519 ResourceContext::GetFileSystemContext(&resource_context_), |
567 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 520 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
568 DCHECK(set_protocol); | 521 DCHECK(set_protocol); |
569 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 522 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
570 // Install the GView request interceptor that will redirect requests | 523 // Install the GView request interceptor that will redirect requests |
571 // of compatible documents (PDF, etc) to the GView document viewer. | 524 // of compatible documents (PDF, etc) to the GView document viewer. |
572 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 525 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
573 if (parsed_command_line.HasSwitch(switches::kEnableGView)) | 526 if (parsed_command_line.HasSwitch(switches::kEnableGView)) |
574 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); | 527 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); |
575 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 528 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
576 | 529 |
577 media_stream_manager_.reset( | 530 media_stream_manager_.reset( |
578 new media_stream::MediaStreamManager(profile_params_->audio_manager)); | 531 new media_stream::MediaStreamManager(profile_params_->audio_manager)); |
579 | 532 |
580 // Take ownership over these parameters. | 533 // Take ownership over these parameters. |
581 database_tracker_ = profile_params_->database_tracker; | |
582 appcache_service_ = profile_params_->appcache_service; | |
583 blob_storage_context_ = profile_params_->blob_storage_context; | |
584 file_system_context_ = profile_params_->file_system_context; | |
585 webkit_context_ = profile_params_->webkit_context; | |
586 quota_manager_ = profile_params_->quota_manager; | |
587 host_zoom_map_ = profile_params_->host_zoom_map; | 534 host_zoom_map_ = profile_params_->host_zoom_map; |
588 host_content_settings_map_ = profile_params_->host_content_settings_map; | 535 host_content_settings_map_ = profile_params_->host_content_settings_map; |
589 cookie_settings_ = profile_params_->cookie_settings; | 536 cookie_settings_ = profile_params_->cookie_settings; |
590 notification_service_ = profile_params_->notification_service; | 537 notification_service_ = profile_params_->notification_service; |
591 extension_info_map_ = profile_params_->extension_info_map; | 538 extension_info_map_ = profile_params_->extension_info_map; |
592 | 539 |
593 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get(); | 540 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get(); |
594 resource_context_.request_context_ = main_request_context_; | 541 resource_context_.request_context_ = main_request_context_; |
595 resource_context_.database_tracker_ = database_tracker_; | |
596 resource_context_.appcache_service_ = appcache_service_; | |
597 resource_context_.blob_storage_context_ = blob_storage_context_; | |
598 resource_context_.file_system_context_ = file_system_context_; | |
599 resource_context_.webkit_context_ = webkit_context_; | |
600 resource_context_.quota_manager_ = quota_manager_; | |
601 resource_context_.host_zoom_map_ = host_zoom_map_; | 542 resource_context_.host_zoom_map_ = host_zoom_map_; |
602 resource_context_.media_observer_ = | 543 resource_context_.media_observer_ = |
603 io_thread_globals->media.media_internals.get(); | 544 io_thread_globals->media.media_internals.get(); |
604 resource_context_.media_stream_manager_ = media_stream_manager_.get(); | 545 resource_context_.media_stream_manager_ = media_stream_manager_.get(); |
605 resource_context_.audio_manager_ = profile_params_->audio_manager; | 546 resource_context_.audio_manager_ = profile_params_->audio_manager; |
606 | 547 |
607 LazyInitializeInternal(profile_params_.get()); | 548 LazyInitializeInternal(profile_params_.get()); |
608 | 549 |
609 profile_params_.reset(); | 550 profile_params_.reset(); |
610 initialized_ = true; | 551 initialized_ = true; |
(...skipping 26 matching lines...) Expand all Loading... |
637 &resource_context_)); | 578 &resource_context_)); |
638 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 579 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
639 if (!posted) | 580 if (!posted) |
640 delete this; | 581 delete this; |
641 } | 582 } |
642 | 583 |
643 void ProfileIOData::set_origin_bound_cert_service( | 584 void ProfileIOData::set_origin_bound_cert_service( |
644 net::OriginBoundCertService* origin_bound_cert_service) const { | 585 net::OriginBoundCertService* origin_bound_cert_service) const { |
645 origin_bound_cert_service_.reset(origin_bound_cert_service); | 586 origin_bound_cert_service_.reset(origin_bound_cert_service); |
646 } | 587 } |
OLD | NEW |