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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 22795006: Remove WorkerPool dependency from URLRequestFileJob. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 7 years, 4 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
« no previous file with comments | « net/url_request/file_protocol_handler.cc ('k') | net/url_request/url_request_file_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « net/url_request/file_protocol_handler.cc ('k') | net/url_request/url_request_file_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698