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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } else { | 400 } else { |
401 context = AcquireIsolatedMediaRequestContext(app_context, app_id); | 401 context = AcquireIsolatedMediaRequestContext(app_context, app_id); |
402 isolated_media_request_context_map_[app_id] = context; | 402 isolated_media_request_context_map_[app_id] = context; |
403 } | 403 } |
404 DCHECK(context); | 404 DCHECK(context); |
405 return context; | 405 return context; |
406 } | 406 } |
407 | 407 |
408 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const { | 408 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const { |
409 DCHECK(extension_info_map_) << "ExtensionSystem not initialized"; | 409 DCHECK(extension_info_map_) << "ExtensionSystem not initialized"; |
410 return extension_info_map_; | 410 return extension_info_map_.get(); |
411 } | 411 } |
412 | 412 |
413 CookieSettings* ProfileIOData::GetCookieSettings() const { | 413 CookieSettings* ProfileIOData::GetCookieSettings() const { |
414 return cookie_settings_; | 414 return cookie_settings_.get(); |
415 } | 415 } |
416 | 416 |
417 #if defined(ENABLE_NOTIFICATIONS) | 417 #if defined(ENABLE_NOTIFICATIONS) |
418 DesktopNotificationService* ProfileIOData::GetNotificationService() const { | 418 DesktopNotificationService* ProfileIOData::GetNotificationService() const { |
419 return notification_service_; | 419 return notification_service_; |
420 } | 420 } |
421 #endif | 421 #endif |
422 | 422 |
423 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { | 423 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { |
424 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 424 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 load_time_stats_)); | 517 load_time_stats_)); |
518 extensions_request_context_.reset( | 518 extensions_request_context_.reset( |
519 new ChromeURLRequestContext( | 519 new ChromeURLRequestContext( |
520 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS, | 520 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS, |
521 load_time_stats_)); | 521 load_time_stats_)); |
522 | 522 |
523 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); | 523 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); |
524 | 524 |
525 network_delegate_.reset(new ChromeNetworkDelegate( | 525 network_delegate_.reset(new ChromeNetworkDelegate( |
526 io_thread_globals->extension_event_router_forwarder.get(), | 526 io_thread_globals->extension_event_router_forwarder.get(), |
527 profile_params_->extension_info_map, | 527 profile_params_->extension_info_map.get(), |
528 url_blacklist_manager_.get(), | 528 url_blacklist_manager_.get(), |
529 #if !defined(OS_ANDROID) | 529 #if !defined(OS_ANDROID) |
530 ManagedMode::GetURLFilter(), | 530 ManagedMode::GetURLFilter(), |
531 #else | 531 #else |
532 NULL, | 532 NULL, |
533 #endif | 533 #endif |
534 profile_params_->profile, | 534 profile_params_->profile, |
535 profile_params_->cookie_settings, | 535 profile_params_->cookie_settings.get(), |
536 &enable_referrers_, | 536 &enable_referrers_, |
537 &enable_do_not_track_, | 537 &enable_do_not_track_, |
538 load_time_stats_)); | 538 load_time_stats_)); |
539 | 539 |
540 fraudulent_certificate_reporter_.reset( | 540 fraudulent_certificate_reporter_.reset( |
541 new chrome_browser_net::ChromeFraudulentCertificateReporter( | 541 new chrome_browser_net::ChromeFraudulentCertificateReporter( |
542 main_request_context_.get())); | 542 main_request_context_.get())); |
543 | 543 |
544 proxy_service_.reset( | 544 proxy_service_.reset( |
545 ProxyServiceFactory::CreateProxyService( | 545 ProxyServiceFactory::CreateProxyService( |
546 io_thread->net_log(), | 546 io_thread->net_log(), |
547 io_thread_globals->proxy_script_fetcher_context.get(), | 547 io_thread_globals->proxy_script_fetcher_context.get(), |
548 profile_params_->proxy_config_service.release(), | 548 profile_params_->proxy_config_service.release(), |
(...skipping 27 matching lines...) Expand all Loading... |
576 | 576 |
577 profile_params_.reset(); | 577 profile_params_.reset(); |
578 initialized_ = true; | 578 initialized_ = true; |
579 } | 579 } |
580 | 580 |
581 void ProfileIOData::ApplyProfileParamsToContext( | 581 void ProfileIOData::ApplyProfileParamsToContext( |
582 ChromeURLRequestContext* context) const { | 582 ChromeURLRequestContext* context) const { |
583 context->set_is_incognito(is_incognito()); | 583 context->set_is_incognito(is_incognito()); |
584 context->set_accept_language(profile_params_->accept_language); | 584 context->set_accept_language(profile_params_->accept_language); |
585 context->set_accept_charset(profile_params_->accept_charset); | 585 context->set_accept_charset(profile_params_->accept_charset); |
586 context->set_ssl_config_service(profile_params_->ssl_config_service); | 586 context->set_ssl_config_service(profile_params_->ssl_config_service.get()); |
587 } | 587 } |
588 | 588 |
589 void ProfileIOData::SetUpJobFactoryDefaults( | 589 void ProfileIOData::SetUpJobFactoryDefaults( |
590 net::URLRequestJobFactoryImpl* job_factory, | 590 net::URLRequestJobFactoryImpl* job_factory, |
591 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 591 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
592 protocol_handler_interceptor, | 592 protocol_handler_interceptor, |
593 net::NetworkDelegate* network_delegate, | 593 net::NetworkDelegate* network_delegate, |
594 net::FtpTransactionFactory* ftp_transaction_factory, | 594 net::FtpTransactionFactory* ftp_transaction_factory, |
595 net::FtpAuthCache* ftp_auth_cache) const { | 595 net::FtpAuthCache* ftp_auth_cache) const { |
596 // NOTE(willchan): Keep these protocol handlers in sync with | 596 // NOTE(willchan): Keep these protocol handlers in sync with |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 params->http_pipelining_enabled = globals->http_pipelining_enabled; | 705 params->http_pipelining_enabled = globals->http_pipelining_enabled; |
706 params->testing_fixed_http_port = globals->testing_fixed_http_port; | 706 params->testing_fixed_http_port = globals->testing_fixed_http_port; |
707 params->testing_fixed_https_port = globals->testing_fixed_https_port; | 707 params->testing_fixed_https_port = globals->testing_fixed_https_port; |
708 | 708 |
709 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 709 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
710 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { | 710 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { |
711 params->trusted_spdy_proxy = command_line.GetSwitchValueASCII( | 711 params->trusted_spdy_proxy = command_line.GetSwitchValueASCII( |
712 switches::kTrustedSpdyProxy); | 712 switches::kTrustedSpdyProxy); |
713 } | 713 } |
714 } | 714 } |
OLD | NEW |