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

Unified Diff: webkit/fileapi/file_system_url_request_job.cc

Issue 8311010: base::Bind: Convert FileUtilProxy::CreateOrOpenCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/fileapi/file_system_url_request_job.cc
diff --git a/webkit/fileapi/file_system_url_request_job.cc b/webkit/fileapi/file_system_url_request_job.cc
index 8cdf9d42d3245957a884799510a54ff8610d56c1..8c28ded57f620be4f162c31c476e2b2e955ec09f 100644
--- a/webkit/fileapi/file_system_url_request_job.cc
+++ b/webkit/fileapi/file_system_url_request_job.cc
@@ -107,7 +107,7 @@ FileSystemURLRequestJob::FileSystemURLRequestJob(
file_system_context_(file_system_context),
file_thread_proxy_(file_thread_proxy),
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
- ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
stream_(NULL),
is_directory_(false),
remaining_bytes_(0) {
@@ -133,7 +133,7 @@ void FileSystemURLRequestJob::Kill() {
}
URLRequestJob::Kill();
method_factory_.RevokeAll();
- callback_factory_.RevokeAll();
+ weak_factory_.InvalidateWeakPtrs();
}
bool FileSystemURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size,
@@ -239,7 +239,8 @@ void FileSystemURLRequestJob::DidGetMetadata(
if (!is_directory_) {
base::FileUtilProxy::CreateOrOpen(
file_thread_proxy_, platform_path, kFileFlags,
- callback_factory_.NewCallback(&FileSystemURLRequestJob::DidOpen));
+ base::Bind(&FileSystemURLRequestJob::DidOpen,
+ weak_factory_.GetWeakPtr()));
} else {
NotifyHeadersComplete();
}
« no previous file with comments | « webkit/fileapi/file_system_url_request_job.h ('k') | webkit/fileapi/file_system_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698