Index: net/url_request/url_request_context_builder.cc |
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc |
index 540dfc1082bd81c127f69468b7666235c5f60891..dce8214dc858bf20515b73938a1aba051d7b6064 100644 |
--- a/net/url_request/url_request_context_builder.cc |
+++ b/net/url_request/url_request_context_builder.cc |
@@ -156,6 +156,11 @@ class BasicURLRequestContext : public URLRequestContext { |
return file_thread_.message_loop(); |
} |
+ scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy() { |
+ DCHECK(file_thread_.IsRunning()); |
+ return file_thread_.message_loop_proxy(); |
+ } |
+ |
protected: |
virtual ~BasicURLRequestContext() {} |
@@ -190,7 +195,9 @@ URLRequestContextBuilder::URLRequestContextBuilder() |
#if !defined(DISABLE_FTP_SUPPORT) |
ftp_enabled_(false), |
#endif |
- http_cache_enabled_(true) {} |
+ http_cache_enabled_(true) { |
+} |
+ |
URLRequestContextBuilder::~URLRequestContextBuilder() {} |
#if defined(OS_LINUX) || defined(OS_ANDROID) |
@@ -301,7 +308,8 @@ URLRequestContext* URLRequestContextBuilder::Build() { |
if (data_enabled_) |
job_factory->SetProtocolHandler("data", new DataProtocolHandler); |
if (file_enabled_) |
- job_factory->SetProtocolHandler("file", new FileProtocolHandler); |
+ job_factory->SetProtocolHandler( |
+ "file", new FileProtocolHandler(context->file_message_loop_proxy())); |
#if !defined(DISABLE_FTP_SUPPORT) |
if (ftp_enabled_) { |
ftp_transaction_factory_.reset( |