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

Unified Diff: base/file_util_proxy.cc

Issue 8311012: base::Bind: Convert FileUtilProxy::EnsureFileExistsCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pipelining. 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 | « base/file_util_proxy.h ('k') | webkit/fileapi/file_system_file_util_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_proxy.cc
diff --git a/base/file_util_proxy.cc b/base/file_util_proxy.cc
index 2d4db8f9ec6c67e497c4727039cf5bc36560aee7..8d90e381170e1ba532f7d9b7bec6f6422bd4b584 100644
--- a/base/file_util_proxy.cc
+++ b/base/file_util_proxy.cc
@@ -255,12 +255,12 @@ class RelayEnsureFileExists : public MessageLoopRelay {
RelayEnsureFileExists(
scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
- base::FileUtilProxy::EnsureFileExistsCallback* callback)
+ const base::FileUtilProxy::EnsureFileExistsCallback& callback)
: message_loop_proxy_(message_loop_proxy),
file_path_(file_path),
callback_(callback),
created_(false) {
- DCHECK(callback);
+ DCHECK_EQ(false, callback.is_null());
}
protected:
@@ -288,14 +288,13 @@ class RelayEnsureFileExists : public MessageLoopRelay {
}
virtual void RunCallback() {
- callback_->Run(error_code(), created_);
- delete callback_;
+ callback_.Run(error_code(), created_);
}
private:
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
FilePath file_path_;
- base::FileUtilProxy::EnsureFileExistsCallback* callback_;
+ base::FileUtilProxy::EnsureFileExistsCallback callback_;
bool created_;
};
@@ -765,7 +764,7 @@ bool FileUtilProxy::Close(scoped_refptr<MessageLoopProxy> message_loop_proxy,
bool FileUtilProxy::EnsureFileExists(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
- EnsureFileExistsCallback* callback) {
+ const EnsureFileExistsCallback& callback) {
return Start(FROM_HERE, message_loop_proxy, new RelayEnsureFileExists(
message_loop_proxy, file_path, callback));
}
« no previous file with comments | « base/file_util_proxy.h ('k') | webkit/fileapi/file_system_file_util_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698