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

Unified Diff: base/file_util_proxy.cc

Issue 8315011: base::Bind: Convert FileUtilProxy::CreateTemporaryCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Newfangled 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') | content/browser/renderer_host/redirect_to_file_resource_handler.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 bd9807b50867e952d13b75e5cf0d878d15b5ef52..2d4db8f9ec6c67e497c4727039cf5bc36560aee7 100644
--- a/base/file_util_proxy.cc
+++ b/base/file_util_proxy.cc
@@ -167,12 +167,12 @@ class RelayCreateTemporary : public MessageLoopRelay {
RelayCreateTemporary(
scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
int additional_file_flags,
- base::FileUtilProxy::CreateTemporaryCallback* callback)
+ const base::FileUtilProxy::CreateTemporaryCallback& callback)
: message_loop_proxy_(message_loop_proxy),
additional_file_flags_(additional_file_flags),
callback_(callback),
file_handle_(base::kInvalidPlatformFileValue) {
- DCHECK(callback);
+ DCHECK_EQ(false, callback.is_null());
}
protected:
@@ -199,15 +199,14 @@ class RelayCreateTemporary : public MessageLoopRelay {
}
virtual void RunCallback() {
- callback_->Run(error_code(), base::PassPlatformFile(&file_handle_),
- file_path_);
- delete callback_;
+ callback_.Run(error_code(), base::PassPlatformFile(&file_handle_),
+ file_path_);
}
private:
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
int additional_file_flags_;
- base::FileUtilProxy::CreateTemporaryCallback* callback_;
+ base::FileUtilProxy::CreateTemporaryCallback callback_;
base::PlatformFile file_handle_;
FilePath file_path_;
};
@@ -747,7 +746,7 @@ bool FileUtilProxy::CreateOrOpen(
bool FileUtilProxy::CreateTemporary(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
int additional_file_flags,
- CreateTemporaryCallback* callback) {
+ const CreateTemporaryCallback& callback) {
return Start(FROM_HERE, message_loop_proxy,
new RelayCreateTemporary(message_loop_proxy,
additional_file_flags,
« no previous file with comments | « base/file_util_proxy.h ('k') | content/browser/renderer_host/redirect_to_file_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698