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

Unified Diff: content/shell/shell_url_request_context_getter.cc

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eliminate OffTheRecordProfileIOData::Handle::GetMainRequestContextGetter Created 7 years, 11 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/shell/shell_url_request_context_getter.cc
diff --git a/content/shell/shell_url_request_context_getter.cc b/content/shell/shell_url_request_context_getter.cc
index 3c4cb1290fc86261bbc3b110c8646ba438a29609..fe78aa08e4343f37e9610b24324fb6c0020b8e2f 100644
--- a/content/shell/shell_url_request_context_getter.cc
+++ b/content/shell/shell_url_request_context_getter.cc
@@ -12,6 +12,7 @@
#include "base/threading/worker_pool.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/url_constants.h"
#include "content/shell/shell_network_delegate.h"
#include "net/base/cert_verifier.h"
#include "net/base/default_server_bound_cert_store.h"
@@ -36,11 +37,20 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter(
bool ignore_certificate_errors,
const FilePath& base_path,
MessageLoop* io_loop,
- MessageLoop* file_loop)
+ MessageLoop* file_loop,
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
+ blob_protocol_handler,
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
+ file_system_protocol_handler,
+ scoped_ptr<net::URLRequestJobFactory::Interceptor>
+ developer_protocol_handler)
: ignore_certificate_errors_(ignore_certificate_errors),
base_path_(base_path),
io_loop_(io_loop),
- file_loop_(file_loop) {
+ file_loop_(file_loop),
+ blob_protocol_handler_(blob_protocol_handler.Pass()),
+ file_system_protocol_handler_(file_system_protocol_handler.Pass()),
+ developer_protocol_handler_(developer_protocol_handler.Pass()) {
// Must first be created on the UI thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -144,7 +154,14 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
network_session_params, main_backend);
storage_->set_http_transaction_factory(main_cache);
- storage_->set_job_factory(new net::URLRequestJobFactoryImpl);
+ scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
+ new net::URLRequestJobFactoryImpl());
+ job_factory->SetProtocolHandler(
+ chrome::kBlobScheme, blob_protocol_handler_.release());
+ job_factory->SetProtocolHandler(
+ chrome::kFileSystemScheme, file_system_protocol_handler_.release());
+ job_factory->AddInterceptor(developer_protocol_handler_.release());
+ storage_->set_job_factory(job_factory.release());
}
return url_request_context_.get();

Powered by Google App Engine
This is Rietveld 408576698