diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-19 10:14:27 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-19 10:14:27 +0000 |
commit | 4c19b042ea31bd393d2265656f94339d1c3d82ff (patch) | |
tree | 7b03fe8adcd4fceae6fe507c0207c786e38f8093 /base/file_util_proxy.h | |
parent | c62e602ce28c6224b6849cadc4a998928de60fc7 (diff) | |
download | chromium_src-4c19b042ea31bd393d2265656f94339d1c3d82ff.zip chromium_src-4c19b042ea31bd393d2265656f94339d1c3d82ff.tar.gz chromium_src-4c19b042ea31bd393d2265656f94339d1c3d82ff.tar.bz2 |
Fix a small leak in FileUtilProxy
BUG=none
TEST=green mem bots
Review URL: http://codereview.chromium.org/7669046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_proxy.h')
-rw-r--r-- | base/file_util_proxy.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/base/file_util_proxy.h b/base/file_util_proxy.h index 872da44..30f051b 100644 --- a/base/file_util_proxy.h +++ b/base/file_util_proxy.h @@ -34,6 +34,8 @@ class BASE_EXPORT FileUtilProxy { // This callback is used by methods that report only an error code. It is // valid to pass NULL as the callback parameter to any function that takes a // StatusCallback, in which case the operation will complete silently. + // The ownership of |callback| is taken by the function and will always be + // deleted by the function even on failure. typedef Callback1<PlatformFileError /* error code */>::Type StatusCallback; typedef Callback3<PlatformFileError /* error code */, @@ -60,6 +62,7 @@ class BASE_EXPORT FileUtilProxy { // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create // a new file at the given |file_path| and calls back with // PLATFORM_FILE_ERROR_FILE_EXISTS if the |file_path| already exists. + // Takes ownership of |callback| and will delete it even on failure. static bool CreateOrOpen(scoped_refptr<MessageLoopProxy> message_loop_proxy, const FilePath& file_path, int file_flags, |