diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-17 18:40:30 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-17 18:40:30 +0000 |
commit | 30c1eea51e20355f11cc37b1bf82ac11644ab2b8 (patch) | |
tree | b031284a67e6d1618427301c83cd2ff6106b645e /base/file_util_proxy.cc | |
parent | 35d5280876154e0dab2f472314e49dce2ced217b (diff) | |
download | chromium_src-30c1eea51e20355f11cc37b1bf82ac11644ab2b8.zip chromium_src-30c1eea51e20355f11cc37b1bf82ac11644ab2b8.tar.gz chromium_src-30c1eea51e20355f11cc37b1bf82ac11644ab2b8.tar.bz2 |
base::Bind: Convert FileUtilProxy::CreateOrOpenCallback.
BUG=none
TEST=none
R=csilv@chromium.org
Review URL: http://codereview.chromium.org/8311010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_proxy.cc')
-rw-r--r-- | base/file_util_proxy.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/base/file_util_proxy.cc b/base/file_util_proxy.cc index 7757c42..bd9807b 100644 --- a/base/file_util_proxy.cc +++ b/base/file_util_proxy.cc @@ -120,14 +120,14 @@ class RelayCreateOrOpen : public MessageLoopRelay { scoped_refptr<base::MessageLoopProxy> message_loop_proxy, const FilePath& file_path, int file_flags, - base::FileUtilProxy::CreateOrOpenCallback* callback) + const base::FileUtilProxy::CreateOrOpenCallback& callback) : message_loop_proxy_(message_loop_proxy), file_path_(file_path), file_flags_(file_flags), callback_(callback), file_handle_(base::kInvalidPlatformFileValue), created_(false) { - DCHECK(callback); + DCHECK_EQ(false, callback.is_null()); } protected: @@ -149,16 +149,15 @@ class RelayCreateOrOpen : public MessageLoopRelay { } virtual void RunCallback() { - callback_->Run(error_code(), base::PassPlatformFile(&file_handle_), - created_); - delete callback_; + callback_.Run(error_code(), base::PassPlatformFile(&file_handle_), + created_); } private: scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; FilePath file_path_; int file_flags_; - base::FileUtilProxy::CreateOrOpenCallback* callback_; + base::FileUtilProxy::CreateOrOpenCallback callback_; base::PlatformFile file_handle_; bool created_; }; @@ -739,7 +738,7 @@ namespace base { bool FileUtilProxy::CreateOrOpen( scoped_refptr<MessageLoopProxy> message_loop_proxy, const FilePath& file_path, int file_flags, - CreateOrOpenCallback* callback) { + const CreateOrOpenCallback& callback) { return Start(FROM_HERE, message_loop_proxy, new RelayCreateOrOpen( message_loop_proxy, file_path, file_flags, callback)); } |