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

Unified Diff: content/browser/storage_partition_impl_map.cc

Issue 10969017: Create a new URLRequestJobFactory for isolated request contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/storage_partition_impl_map.cc
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc
index 742242faa9c7407471766d43fe7ae205dc3565d3..d7711e3a4e57a134ffc13a373aab02cc0c08b43b 100644
--- a/content/browser/storage_partition_impl_map.cc
+++ b/content/browser/storage_partition_impl_map.cc
@@ -144,11 +144,19 @@ void InitializeURLRequestContext(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!context_getter)
return; // tests.
+
+ // Currently this just modifies the URLRequestJobFactory on the context
Charlie Reis 2012/09/20 17:47:03 "Currently this just" makes it sound like there's
awong 2012/09/20 22:11:00 Kinda...I'll reword it slightly.
+ // to handle blob: URLs, filesystem: URLs, and to let AppCache intercept
+ // the appropriate requests.
net::URLRequestContext* context = context_getter->GetURLRequestContext();
net::URLRequestJobFactory* job_factory =
const_cast<net::URLRequestJobFactory*>(context->job_factory());
+
+ // Note: if this is called twice with 2 request contexts that share one job
+ // factory (as is the case with a media request context and its related
+ // normal request context) then this will early exit.
if (job_factory->IsHandledProtocol(chrome::kBlobScheme))
- return; // Already initialized this RequestContext.
+ return; // Already initialized this JobFactory.
bool set_protocol = job_factory->SetProtocolHandler(
chrome::kBlobScheme,
@@ -253,15 +261,6 @@ void StoragePartitionImplMap::PostCreateInitialization(
make_scoped_refptr(partition->GetFileSystemContext()),
make_scoped_refptr(
ChromeBlobStorageContext::GetFor(browser_context_))));
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(
- &InitializeURLRequestContext,
- make_scoped_refptr(partition->GetMediaURLRequestContext()),
Charlie Reis 2012/09/20 17:47:03 Why isn't this needed anymore? The comment you ad
awong 2012/09/20 22:11:00 Done.
- make_scoped_refptr(partition->GetAppCacheService()),
- make_scoped_refptr(partition->GetFileSystemContext()),
- make_scoped_refptr(
- ChromeBlobStorageContext::GetFor(browser_context_))));
}
}

Powered by Google App Engine
This is Rietveld 408576698