| Index: base/file_util_proxy.cc
|
| diff --git a/base/file_util_proxy.cc b/base/file_util_proxy.cc
|
| index 7757c420ecc1fba787799abba1ac497cac3faadf..bd9807b50867e952d13b75e5cf0d878d15b5ef52 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));
|
| }
|
|
|