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 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/profiles/profile_manager.h" | 35 #include "chrome/browser/profiles/profile_manager.h" |
36 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 36 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
37 #include "chrome/common/chrome_notification_types.h" | 37 #include "chrome/common/chrome_notification_types.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
41 #include "content/browser/appcache/chrome_appcache_service.h" | 41 #include "content/browser/appcache/chrome_appcache_service.h" |
42 #include "content/browser/browser_thread.h" | 42 #include "content/browser/browser_thread.h" |
43 #include "content/browser/chrome_blob_storage_context.h" | 43 #include "content/browser/chrome_blob_storage_context.h" |
44 #include "content/browser/host_zoom_map.h" | 44 #include "content/browser/host_zoom_map.h" |
| 45 #include "content/browser/renderer_host/media/media_stream_manager.h" |
45 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 46 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
46 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 47 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
47 #include "content/browser/resource_context.h" | 48 #include "content/browser/resource_context.h" |
48 #include "content/common/notification_service.h" | 49 #include "content/common/notification_service.h" |
49 #include "net/base/origin_bound_cert_service.h" | 50 #include "net/base/origin_bound_cert_service.h" |
50 #include "net/http/http_transaction_factory.h" | 51 #include "net/http/http_transaction_factory.h" |
51 #include "net/http/http_util.h" | 52 #include "net/http/http_util.h" |
52 #include "net/proxy/proxy_config_service_fixed.h" | 53 #include "net/proxy/proxy_config_service_fixed.h" |
53 #include "net/proxy/proxy_script_fetcher_impl.h" | 54 #include "net/proxy/proxy_script_fetcher_impl.h" |
54 #include "net/proxy/proxy_service.h" | 55 #include "net/proxy/proxy_service.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 467 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
467 DCHECK(set_protocol); | 468 DCHECK(set_protocol); |
468 #if defined(OS_CHROMEOS) | 469 #if defined(OS_CHROMEOS) |
469 // Install the GView request interceptor that will redirect requests | 470 // Install the GView request interceptor that will redirect requests |
470 // of compatible documents (PDF, etc) to the GView document viewer. | 471 // of compatible documents (PDF, etc) to the GView document viewer. |
471 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 472 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
472 if (parsed_command_line.HasSwitch(switches::kEnableGView)) | 473 if (parsed_command_line.HasSwitch(switches::kEnableGView)) |
473 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); | 474 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); |
474 #endif // defined(OS_CHROMEOS) | 475 #endif // defined(OS_CHROMEOS) |
475 | 476 |
| 477 media_stream_manager_.reset(new media_stream::MediaStreamManager); |
| 478 |
476 // Take ownership over these parameters. | 479 // Take ownership over these parameters. |
477 database_tracker_ = profile_params_->database_tracker; | 480 database_tracker_ = profile_params_->database_tracker; |
478 appcache_service_ = profile_params_->appcache_service; | 481 appcache_service_ = profile_params_->appcache_service; |
479 blob_storage_context_ = profile_params_->blob_storage_context; | 482 blob_storage_context_ = profile_params_->blob_storage_context; |
480 file_system_context_ = profile_params_->file_system_context; | 483 file_system_context_ = profile_params_->file_system_context; |
481 quota_manager_ = profile_params_->quota_manager; | 484 quota_manager_ = profile_params_->quota_manager; |
482 host_zoom_map_ = profile_params_->host_zoom_map; | 485 host_zoom_map_ = profile_params_->host_zoom_map; |
483 host_content_settings_map_ = profile_params_->host_content_settings_map; | 486 host_content_settings_map_ = profile_params_->host_content_settings_map; |
484 notification_service_ = profile_params_->notification_service; | 487 notification_service_ = profile_params_->notification_service; |
485 extension_info_map_ = profile_params_->extension_info_map; | 488 extension_info_map_ = profile_params_->extension_info_map; |
486 prerender_manager_getter_ = profile_params_->prerender_manager_getter; | 489 prerender_manager_getter_ = profile_params_->prerender_manager_getter; |
487 | 490 |
488 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); | 491 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); |
489 resource_context_.set_request_context(main_request_context_); | 492 resource_context_.set_request_context(main_request_context_); |
490 resource_context_.set_database_tracker(database_tracker_); | 493 resource_context_.set_database_tracker(database_tracker_); |
491 resource_context_.set_appcache_service(appcache_service_); | 494 resource_context_.set_appcache_service(appcache_service_); |
492 resource_context_.set_blob_storage_context(blob_storage_context_); | 495 resource_context_.set_blob_storage_context(blob_storage_context_); |
493 resource_context_.set_file_system_context(file_system_context_); | 496 resource_context_.set_file_system_context(file_system_context_); |
494 resource_context_.set_quota_manager(quota_manager_); | 497 resource_context_.set_quota_manager(quota_manager_); |
495 resource_context_.set_host_zoom_map(host_zoom_map_); | 498 resource_context_.set_host_zoom_map(host_zoom_map_); |
496 resource_context_.set_prerender_manager_getter(prerender_manager_getter_); | 499 resource_context_.set_prerender_manager_getter(prerender_manager_getter_); |
497 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this)); | 500 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this)); |
498 resource_context_.set_media_observer( | 501 resource_context_.set_media_observer( |
499 io_thread_globals->media.media_internals.get()); | 502 io_thread_globals->media.media_internals.get()); |
| 503 resource_context_.set_media_stream_manager(media_stream_manager_.get()); |
500 | 504 |
501 LazyInitializeInternal(profile_params_.get()); | 505 LazyInitializeInternal(profile_params_.get()); |
502 | 506 |
503 profile_params_.reset(); | 507 profile_params_.reset(); |
504 initialized_ = true; | 508 initialized_ = true; |
505 } | 509 } |
506 | 510 |
507 void ProfileIOData::ApplyProfileParamsToContext( | 511 void ProfileIOData::ApplyProfileParamsToContext( |
508 ChromeURLRequestContext* context) const { | 512 ChromeURLRequestContext* context) const { |
509 context->set_is_incognito(profile_params_->is_incognito); | 513 context->set_is_incognito(profile_params_->is_incognito); |
(...skipping 23 matching lines...) Expand all Loading... |
533 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 537 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
534 new DeleteTask<ProfileIOData>(this)); | 538 new DeleteTask<ProfileIOData>(this)); |
535 if (!posted) | 539 if (!posted) |
536 delete this; | 540 delete this; |
537 } | 541 } |
538 | 542 |
539 void ProfileIOData::set_origin_bound_cert_service( | 543 void ProfileIOData::set_origin_bound_cert_service( |
540 net::OriginBoundCertService* origin_bound_cert_service) const { | 544 net::OriginBoundCertService* origin_bound_cert_service) const { |
541 origin_bound_cert_service_.reset(origin_bound_cert_service); | 545 origin_bound_cert_service_.reset(origin_bound_cert_service); |
542 } | 546 } |
OLD | NEW |