Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 is_incognito_(is_incognito) { 389 is_incognito_(is_incognito) {
390 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 390 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
391 } 391 }
392 392
393 ProfileIOData::~ProfileIOData() { 393 ProfileIOData::~ProfileIOData() {
394 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) 394 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO))
395 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 395 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
396 396
397 if (main_request_context_.get()) 397 if (main_request_context_.get())
398 main_request_context_->AssertNoURLRequests(); 398 main_request_context_->AssertNoURLRequests();
399 if (extensions_request_context_.get())
400 extensions_request_context_->AssertNoURLRequests();
401 for (URLRequestContextMap::iterator it = app_request_context_map_.begin(); 399 for (URLRequestContextMap::iterator it = app_request_context_map_.begin();
402 it != app_request_context_map_.end(); ++it) { 400 it != app_request_context_map_.end(); ++it) {
403 it->second->AssertNoURLRequests(); 401 it->second->AssertNoURLRequests();
404 delete it->second; 402 delete it->second;
405 } 403 }
406 for (URLRequestContextMap::iterator it = 404 for (URLRequestContextMap::iterator it =
407 isolated_media_request_context_map_.begin(); 405 isolated_media_request_context_map_.begin();
408 it != isolated_media_request_context_map_.end(); ++it) { 406 it != isolated_media_request_context_map_.end(); ++it) {
409 it->second->AssertNoURLRequests(); 407 it->second->AssertNoURLRequests();
410 delete it->second; 408 delete it->second;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 return main_request_context_.get(); 455 return main_request_context_.get();
458 } 456 }
459 457
460 ChromeURLRequestContext* ProfileIOData::GetMediaRequestContext() const { 458 ChromeURLRequestContext* ProfileIOData::GetMediaRequestContext() const {
461 DCHECK(initialized_); 459 DCHECK(initialized_);
462 ChromeURLRequestContext* context = AcquireMediaRequestContext(); 460 ChromeURLRequestContext* context = AcquireMediaRequestContext();
463 DCHECK(context); 461 DCHECK(context);
464 return context; 462 return context;
465 } 463 }
466 464
467 ChromeURLRequestContext* ProfileIOData::GetExtensionsRequestContext() const { 465 net::CookieStore* ProfileIOData::GetExtensionsCookieStore() const {
468 DCHECK(initialized_); 466 DCHECK(initialized_);
469 return extensions_request_context_.get(); 467 return extension_cookie_store_.get();
470 } 468 }
471 469
472 ChromeURLRequestContext* ProfileIOData::GetIsolatedAppRequestContext( 470 ChromeURLRequestContext* ProfileIOData::GetIsolatedAppRequestContext(
473 ChromeURLRequestContext* main_context, 471 ChromeURLRequestContext* main_context,
474 const StoragePartitionDescriptor& partition_descriptor, 472 const StoragePartitionDescriptor& partition_descriptor,
475 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 473 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
476 protocol_handler_interceptor, 474 protocol_handler_interceptor,
477 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 475 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
478 blob_protocol_handler, 476 blob_protocol_handler,
479 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 477 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 629
632 IOThread* const io_thread = profile_params_->io_thread; 630 IOThread* const io_thread = profile_params_->io_thread;
633 IOThread::Globals* const io_thread_globals = io_thread->globals(); 631 IOThread::Globals* const io_thread_globals = io_thread->globals();
634 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 632 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
635 load_time_stats_ = GetLoadTimeStats(io_thread_globals); 633 load_time_stats_ = GetLoadTimeStats(io_thread_globals);
636 634
637 // Create the common request contexts. 635 // Create the common request contexts.
638 main_request_context_.reset( 636 main_request_context_.reset(
639 new ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MAIN, 637 new ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MAIN,
640 load_time_stats_)); 638 load_time_stats_));
641 extensions_request_context_.reset(
642 new ChromeURLRequestContext(
643 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS,
644 load_time_stats_));
645 639
646 ChromeNetworkDelegate* network_delegate = 640 ChromeNetworkDelegate* network_delegate =
647 new ChromeNetworkDelegate( 641 new ChromeNetworkDelegate(
648 io_thread_globals->extension_event_router_forwarder.get(), 642 io_thread_globals->extension_event_router_forwarder.get(),
649 &enable_referrers_); 643 &enable_referrers_);
650 network_delegate->set_extension_info_map(profile_params_->extension_info_map); 644 network_delegate->set_extension_info_map(profile_params_->extension_info_map);
651 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); 645 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get());
652 network_delegate->set_profile(profile_params_->profile); 646 network_delegate->set_profile(profile_params_->profile);
653 network_delegate->set_cookie_settings(profile_params_->cookie_settings); 647 network_delegate->set_cookie_settings(profile_params_->cookie_settings);
654 network_delegate->set_enable_do_not_track(&enable_do_not_track_); 648 network_delegate->set_enable_do_not_track(&enable_do_not_track_);
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 void ProfileIOData::SetCookieSettingsForTesting( 836 void ProfileIOData::SetCookieSettingsForTesting(
843 CookieSettings* cookie_settings) { 837 CookieSettings* cookie_settings) {
844 DCHECK(!cookie_settings_.get()); 838 DCHECK(!cookie_settings_.get());
845 cookie_settings_ = cookie_settings; 839 cookie_settings_ = cookie_settings;
846 } 840 }
847 841
848 void ProfileIOData::set_signin_names_for_testing( 842 void ProfileIOData::set_signin_names_for_testing(
849 SigninNamesOnIOThread* signin_names) { 843 SigninNamesOnIOThread* signin_names) {
850 signin_names_.reset(signin_names); 844 signin_names_.reset(signin_names);
851 } 845 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698