summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authoradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 01:48:16 +0000
committeradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 01:48:16 +0000
commitd37b9c13c0431d7b45e903081087afe5f848c89d (patch)
treec2e4acdbd992079f32baedae4009d14d17477863 /webkit
parent1a9dfc9d86144fa01164da3c42afa81098193e9e (diff)
downloadchromium_src-d37b9c13c0431d7b45e903081087afe5f848c89d.zip
chromium_src-d37b9c13c0431d7b45e903081087afe5f848c89d.tar.gz
chromium_src-d37b9c13c0431d7b45e903081087afe5f848c89d.tar.bz2
Remove redundant MessageLoopProxy from LocalFilePathCallbackDispatcher.
From what I can see, callbacks from FileSystemOperation will always happen on the calling thread, which is already the IO thread. Thus, the io_loop_ member isn't needed, and the callbacks can be called directly. This change is in preparation for a further refactoring of the FileSystem URLRequestJobs. R=ericu@chromium.org Review URL: http://codereview.chromium.org/7017034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/fileapi/file_system_url_request_job_base.cc31
-rw-r--r--webkit/fileapi/file_system_url_request_job_base.h1
2 files changed, 9 insertions, 23 deletions
diff --git a/webkit/fileapi/file_system_url_request_job_base.cc b/webkit/fileapi/file_system_url_request_job_base.cc
index 697cb59..d99de84 100644
--- a/webkit/fileapi/file_system_url_request_job_base.cc
+++ b/webkit/fileapi/file_system_url_request_job_base.cc
@@ -15,11 +15,9 @@ namespace fileapi {
class LocalPathCallbackDispatcher : public FileSystemCallbackDispatcher {
public:
- explicit LocalPathCallbackDispatcher(
- FileSystemURLRequestJobBase* request)
- : request_(request),
- io_loop_(base::MessageLoopProxy::CreateForCurrentThread()) {
- DCHECK(request_);
+ explicit LocalPathCallbackDispatcher(FileSystemURLRequestJobBase* job)
+ : job_(job) {
+ DCHECK(job_);
}
// fileapi::FileSystemCallbackDispatcher overrides.
@@ -28,10 +26,7 @@ class LocalPathCallbackDispatcher : public FileSystemCallbackDispatcher {
}
virtual void DidGetLocalPath(const FilePath& local_path) {
- io_loop_->PostTask(FROM_HERE,
- NewRunnableMethod(request_,
- &FileSystemURLRequestJobBase::OnGetLocalPath,
- local_path));
+ job_->OnGetLocalPath(local_path);
}
virtual void DidReadMetadata(const base::PlatformFileInfo& info,
@@ -55,15 +50,14 @@ class LocalPathCallbackDispatcher : public FileSystemCallbackDispatcher {
}
virtual void DidFail(base::PlatformFileError error_code) OVERRIDE {
- io_loop_->PostTask(FROM_HERE,
- NewRunnableMethod(request_,
- &FileSystemURLRequestJobBase::RespondFailedOnIOThread,
- error_code));
+ int rv = net::ERR_FILE_NOT_FOUND;
+ if (error_code == base::PLATFORM_FILE_ERROR_INVALID_URL)
+ rv = net::ERR_INVALID_URL;
+ job_->NotifyFailed(rv);
}
private:
- FileSystemURLRequestJobBase* request_;
- scoped_refptr<base::MessageLoopProxy> io_loop_;
+ FileSystemURLRequestJobBase* job_;
DISALLOW_COPY_AND_ASSIGN(LocalPathCallbackDispatcher);
};
@@ -93,13 +87,6 @@ void FileSystemURLRequestJobBase::StartAsync() {
GetNewOperation()->GetLocalPath(request_->url());
}
-void FileSystemURLRequestJobBase::RespondFailedOnIOThread(int error_code) {
- int rv = net::ERR_FILE_NOT_FOUND;
- if (error_code == base::PLATFORM_FILE_ERROR_INVALID_URL)
- rv = net::ERR_INVALID_URL;
- NotifyFailed(rv);
-}
-
void FileSystemURLRequestJobBase::NotifyFailed(int rv) {
NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
}
diff --git a/webkit/fileapi/file_system_url_request_job_base.h b/webkit/fileapi/file_system_url_request_job_base.h
index 10549fe..91edc26 100644
--- a/webkit/fileapi/file_system_url_request_job_base.h
+++ b/webkit/fileapi/file_system_url_request_job_base.h
@@ -31,7 +31,6 @@ class FileSystemURLRequestJobBase : public net::URLRequestJob {
virtual void DidGetLocalPath(const FilePath& local_path) = 0 ;
void NotifyFailed(int rv);
- void RespondFailedOnIOThread(int error_code);
FileSystemOperation* GetNewOperation();
FilePath relative_file_path_;