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

Unified Diff: webkit/blob/local_file_reader.cc

Issue 10197007: Change webkit/{fileapi,quota} code to use TaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixesz Created 8 years, 8 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: webkit/blob/local_file_reader.cc
diff --git a/webkit/blob/local_file_reader.cc b/webkit/blob/local_file_reader.cc
index 068ad13dc83728f2968ff2ed6ae7de627a5dcc71..b46e275d9eefb255660dfb81267865931f7cd568 100644
--- a/webkit/blob/local_file_reader.cc
+++ b/webkit/blob/local_file_reader.cc
@@ -8,8 +8,8 @@
#include "base/file_util_proxy.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/message_loop_proxy.h"
#include "base/platform_file.h"
+#include "base/task_runner.h"
#include "net/base/file_stream.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -83,13 +83,13 @@ int LocalFileReader::PlatformFileErrorToNetError(
// A helper class to open, verify and seek a file stream for a given path.
class LocalFileReader::OpenFileStreamHelper {
public:
- explicit OpenFileStreamHelper(base::MessageLoopProxy* file_thread_proxy)
- : file_thread_proxy_(file_thread_proxy),
+ explicit OpenFileStreamHelper(base::TaskRunner* task_runner)
+ : task_runner_(task_runner),
file_handle_(base::kInvalidPlatformFileValue),
result_(net::OK) {}
~OpenFileStreamHelper() {
if (file_handle_ != base::kInvalidPlatformFileValue) {
- file_thread_proxy_->PostTask(
+ task_runner_->PostTask(
FROM_HERE,
base::Bind(base::IgnoreResult(&base::ClosePlatformFile),
file_handle_));
@@ -138,18 +138,18 @@ class LocalFileReader::OpenFileStreamHelper {
}
private:
- scoped_refptr<base::MessageLoopProxy> file_thread_proxy_;
+ scoped_refptr<base::TaskRunner> task_runner_;
base::PlatformFile file_handle_;
int result_;
DISALLOW_COPY_AND_ASSIGN(OpenFileStreamHelper);
};
LocalFileReader::LocalFileReader(
- base::MessageLoopProxy* file_thread_proxy,
+ base::TaskRunner* task_runner,
const FilePath& file_path,
int64 initial_offset,
const base::Time& expected_modification_time)
- : file_thread_proxy_(file_thread_proxy),
+ : task_runner_(task_runner),
file_path_(file_path),
initial_offset_(initial_offset),
expected_modification_time_(expected_modification_time),
@@ -173,7 +173,7 @@ int LocalFileReader::Read(net::IOBuffer* buf, int buf_len,
int LocalFileReader::GetLength(const net::Int64CompletionCallback& callback) {
const bool posted = base::FileUtilProxy::GetFileInfo(
- file_thread_proxy_, file_path_,
+ task_runner_, file_path_,
base::Bind(&DidGetFileInfoForGetLength, callback,
expected_modification_time_));
DCHECK(posted);
@@ -184,8 +184,8 @@ int LocalFileReader::Open(const OpenFileStreamCallback& callback) {
DCHECK(!has_pending_open_);
DCHECK(!stream_impl_.get());
has_pending_open_ = true;
- OpenFileStreamHelper* helper = new OpenFileStreamHelper(file_thread_proxy_);
- const bool posted = file_thread_proxy_->PostTaskAndReply(
+ OpenFileStreamHelper* helper = new OpenFileStreamHelper(task_runner_);
+ const bool posted = task_runner_->PostTaskAndReply(
FROM_HERE,
base::Bind(&OpenFileStreamHelper::OpenAndVerifyOnFileThread,
base::Unretained(helper), file_path_,

Powered by Google App Engine
This is Rietveld 408576698