summaryrefslogtreecommitdiffstats
path: root/base/file_util_proxy.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 20:12:05 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 20:12:05 +0000
commit0f695a70c914d3acb1c2ec08e4f07f4e4eebccdd (patch)
tree5bbfca2ef2591f78302c3d29245f85ac20eed942 /base/file_util_proxy.cc
parentb6a4ac2bccf88f27be2c2017dddeddf2aac1ff3b (diff)
downloadchromium_src-0f695a70c914d3acb1c2ec08e4f07f4e4eebccdd.zip
chromium_src-0f695a70c914d3acb1c2ec08e4f07f4e4eebccdd.tar.gz
chromium_src-0f695a70c914d3acb1c2ec08e4f07f4e4eebccdd.tar.bz2
base::Bind: Convert FileUtilProxy::GetFileInfoCallback.
BUG=none TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/8315012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_proxy.cc')
-rw-r--r--base/file_util_proxy.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/base/file_util_proxy.cc b/base/file_util_proxy.cc
index 8d90e38..3a51b60 100644
--- a/base/file_util_proxy.cc
+++ b/base/file_util_proxy.cc
@@ -469,10 +469,10 @@ class RelayReadDirectory : public MessageLoopRelay {
class RelayGetFileInfo : public MessageLoopRelay {
public:
RelayGetFileInfo(const FilePath& file_path,
- base::FileUtilProxy::GetFileInfoCallback* callback)
+ const base::FileUtilProxy::GetFileInfoCallback& callback)
: callback_(callback),
file_path_(file_path) {
- DCHECK(callback);
+ DCHECK_EQ(false, callback.is_null());
}
protected:
@@ -486,12 +486,11 @@ class RelayGetFileInfo : public MessageLoopRelay {
}
virtual void RunCallback() {
- callback_->Run(error_code(), file_info_);
- delete callback_;
+ callback_.Run(error_code(), file_info_);
}
private:
- base::FileUtilProxy::GetFileInfoCallback* callback_;
+ base::FileUtilProxy::GetFileInfoCallback callback_;
FilePath file_path_;
base::PlatformFileInfo file_info_;
};
@@ -500,10 +499,10 @@ class RelayGetFileInfoFromPlatformFile : public MessageLoopRelay {
public:
RelayGetFileInfoFromPlatformFile(
base::PlatformFile file,
- base::FileUtilProxy::GetFileInfoCallback* callback)
+ const base::FileUtilProxy::GetFileInfoCallback& callback)
: callback_(callback),
file_(file) {
- DCHECK(callback);
+ DCHECK_EQ(false, callback.is_null());
}
protected:
@@ -513,12 +512,11 @@ class RelayGetFileInfoFromPlatformFile : public MessageLoopRelay {
}
virtual void RunCallback() {
- callback_->Run(error_code(), file_info_);
- delete callback_;
+ callback_.Run(error_code(), file_info_);
}
private:
- base::FileUtilProxy::GetFileInfoCallback* callback_;
+ base::FileUtilProxy::GetFileInfoCallback callback_;
base::PlatformFile file_;
base::PlatformFileInfo file_info_;
};
@@ -774,7 +772,7 @@ bool FileUtilProxy::EnsureFileExists(
bool FileUtilProxy::GetFileInfo(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
- GetFileInfoCallback* callback) {
+ const GetFileInfoCallback& callback) {
return Start(FROM_HERE, message_loop_proxy, new RelayGetFileInfo(
file_path, callback));
}
@@ -783,7 +781,7 @@ bool FileUtilProxy::GetFileInfo(
bool FileUtilProxy::GetFileInfoFromPlatformFile(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
PlatformFile file,
- GetFileInfoCallback* callback) {
+ const GetFileInfoCallback& callback) {
return Start(FROM_HERE, message_loop_proxy,
new RelayGetFileInfoFromPlatformFile(file, callback));
}