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

Unified Diff: net/url_request/url_request_file_job.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/url_request_file_job.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_file_job.cc
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 437f962393ec843d2eeb9cefae9b71f2a4e08dbf..053a22ed2331f3d9516a9d643d694c55be163157 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -26,8 +26,8 @@
#include "base/platform_file.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
+#include "base/task_runner.h"
#include "base/threading/thread_restrictions.h"
-#include "base/threading/worker_pool.h"
#include "build/build_config.h"
#include "net/base/file_stream.h"
#include "net/base/io_buffer.h"
@@ -53,26 +53,27 @@ URLRequestFileJob::FileMetaInfo::FileMetaInfo()
is_directory(false) {
}
-URLRequestFileJob::URLRequestFileJob(URLRequest* request,
- NetworkDelegate* network_delegate,
- const base::FilePath& file_path)
+URLRequestFileJob::URLRequestFileJob(
+ URLRequest* request,
+ NetworkDelegate* network_delegate,
+ const base::FilePath& file_path,
+ const scoped_refptr<base::TaskRunner>& file_task_runner)
: URLRequestJob(request, network_delegate),
file_path_(file_path),
- stream_(new FileStream(NULL)),
+ stream_(new FileStream(NULL, file_task_runner)),
+ file_task_runner_(file_task_runner),
remaining_bytes_(0),
- weak_ptr_factory_(this) {
-}
+ weak_ptr_factory_(this) {}
void URLRequestFileJob::Start() {
FileMetaInfo* meta_info = new FileMetaInfo();
- base::WorkerPool::PostTaskAndReply(
+ file_task_runner_->PostTaskAndReply(
FROM_HERE,
base::Bind(&URLRequestFileJob::FetchMetaInfo, file_path_,
base::Unretained(meta_info)),
base::Bind(&URLRequestFileJob::DidFetchMetaInfo,
weak_ptr_factory_.GetWeakPtr(),
- base::Owned(meta_info)),
- true);
+ base::Owned(meta_info)));
}
void URLRequestFileJob::Kill() {
« no previous file with comments | « net/url_request/url_request_file_job.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698