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

Unified Diff: webkit/fileapi/file_system_file_util_proxy.cc

Issue 8322009: base::Bind: Convert FileUtilProxy::ReadDirectoryCallback. (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
« no previous file with comments | « webkit/fileapi/file_system_file_util_proxy.h ('k') | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_file_util_proxy.cc
diff --git a/webkit/fileapi/file_system_file_util_proxy.cc b/webkit/fileapi/file_system_file_util_proxy.cc
index 629943ac07665119b2168133dee9642e3d720148..40b598079fff0136f8ca8994b14615d512cf5ac3 100644
--- a/webkit/fileapi/file_system_file_util_proxy.cc
+++ b/webkit/fileapi/file_system_file_util_proxy.cc
@@ -253,10 +253,10 @@ class RelayReadDirectory : public MessageLoopRelay {
RelayReadDirectory(
const fileapi::FileSystemOperationContext& context,
const FilePath& file_path,
- fileapi::FileSystemFileUtilProxy::ReadDirectoryCallback* callback)
+ const fileapi::FileSystemFileUtilProxy::ReadDirectoryCallback& callback)
: MessageLoopRelay(context),
callback_(callback), file_path_(file_path) {
- DCHECK(callback);
+ DCHECK_EQ(false, callback.is_null());
}
protected:
@@ -267,12 +267,11 @@ class RelayReadDirectory : public MessageLoopRelay {
}
virtual void RunCallback() {
- callback_->Run(error_code(), entries_);
- delete callback_;
+ callback_.Run(error_code(), entries_);
}
private:
- fileapi::FileSystemFileUtilProxy::ReadDirectoryCallback* callback_;
+ fileapi::FileSystemFileUtilProxy::ReadDirectoryCallback callback_;
FilePath file_path_;
std::vector<base::FileUtilProxy::Entry> entries_;
};
@@ -479,7 +478,7 @@ bool FileSystemFileUtilProxy::ReadDirectory(
const FileSystemOperationContext& context,
scoped_refptr<MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
- ReadDirectoryCallback* callback) {
+ const ReadDirectoryCallback& callback) {
return Start(FROM_HERE, message_loop_proxy, new RelayReadDirectory(context,
file_path, callback));
}
« no previous file with comments | « webkit/fileapi/file_system_file_util_proxy.h ('k') | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698