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(); |