| Index: chrome/browser/profiles/profile_io_data.cc
|
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
|
| index c69bdb39be3be449278ae4ef10e3c680b6647f8f..b7de713eaa30d1b12dc33f8f259038a10be4e1e3 100644
|
| --- a/chrome/browser/profiles/profile_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_io_data.cc
|
| @@ -225,6 +225,20 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
|
| BrowserContext::EnsureResourceContextInitialized(profile);
|
| }
|
|
|
| +ProfileIOData::MediaRequestContext::MediaRequestContext(
|
| + chrome_browser_net::LoadTimeStats* load_time_stats)
|
| + : ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MEDIA,
|
| + load_time_stats) {
|
| +}
|
| +
|
| +void ProfileIOData::MediaRequestContext::SetHttpTransactionFactory(
|
| + net::HttpTransactionFactory* http_factory) {
|
| + http_factory_.reset(http_factory);
|
| + set_http_transaction_factory(http_factory);
|
| +}
|
| +
|
| +ProfileIOData::MediaRequestContext::~MediaRequestContext() {}
|
| +
|
| ProfileIOData::AppRequestContext::AppRequestContext(
|
| chrome_browser_net::LoadTimeStats* load_time_stats)
|
| : ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_APP,
|
| @@ -272,11 +286,17 @@ ProfileIOData::~ProfileIOData() {
|
| main_request_context_->AssertNoURLRequests();
|
| if (extensions_request_context_.get())
|
| extensions_request_context_->AssertNoURLRequests();
|
| - for (AppRequestContextMap::iterator it = app_request_context_map_.begin();
|
| + for (URLRequestContextMap::iterator it = app_request_context_map_.begin();
|
| it != app_request_context_map_.end(); ++it) {
|
| it->second->AssertNoURLRequests();
|
| delete it->second;
|
| }
|
| + for (URLRequestContextMap::iterator it =
|
| + isolated_media_request_context_map_.begin();
|
| + it != isolated_media_request_context_map_.end(); ++it) {
|
| + it->second->AssertNoURLRequests();
|
| + delete it->second;
|
| + }
|
| }
|
|
|
| // static
|
| @@ -352,7 +372,7 @@ ProfileIOData::GetIsolatedAppRequestContext(
|
| ChromeURLRequestContext* main_context,
|
| const std::string& app_id) const {
|
| LazyInitialize();
|
| - ChromeURLRequestContext* context;
|
| + ChromeURLRequestContext* context = NULL;
|
| if (ContainsKey(app_request_context_map_, app_id)) {
|
| context = app_request_context_map_[app_id];
|
| } else {
|
| @@ -363,6 +383,26 @@ ProfileIOData::GetIsolatedAppRequestContext(
|
| return context;
|
| }
|
|
|
| +ChromeURLRequestContext*
|
| +ProfileIOData::GetIsolatedMediaRequestContext(
|
| + ChromeURLRequestContext* main_context,
|
| + const std::string& app_id) const {
|
| + LazyInitialize();
|
| + ChromeURLRequestContext* context = NULL;
|
| + if (ContainsKey(isolated_media_request_context_map_, app_id)) {
|
| + context = isolated_media_request_context_map_[app_id];
|
| + } else {
|
| + // Get the app context as the starting point for the media context,
|
| + // so that it uses the app's cookie store.
|
| + ChromeURLRequestContext* app_context = GetIsolatedAppRequestContext(
|
| + main_context, app_id);
|
| + context = AcquireIsolatedMediaRequestContext(app_context, app_id);
|
| + isolated_media_request_context_map_[app_id] = context;
|
| + }
|
| + DCHECK(context);
|
| + return context;
|
| +}
|
| +
|
| ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const {
|
| DCHECK(extension_info_map_) << "ExtensionSystem not initialized";
|
| return extension_info_map_;
|
|
|