summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-11 03:50:25 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-11 03:50:25 +0000
commitcfd23d243ac040a088c65875aaf779aea0c29125 (patch)
treed3531b3a563d802eafcbc697f294b053c38aa98e /base/file_util.h
parentb6847730de55da964055d4965199196e3e6145dc (diff)
downloadchromium_src-cfd23d243ac040a088c65875aaf779aea0c29125.zip
chromium_src-cfd23d243ac040a088c65875aaf779aea0c29125.tar.gz
chromium_src-cfd23d243ac040a088c65875aaf779aea0c29125.tar.bz2
Make CreateDirectory return an error code instead of just a bool.
Make use of the new error code in IndexedDB, where we'll histogram which errors can be recovered from by retrying and which can't. We're going to try retrying CreateDirectory because LevelDB doesn't pay attention to what env_->CreateDir returns and a frequent error on the next operation (locking the lock file) is that the directory doesn't exist. I want to find out what's causing the directories to not be created in the first place, and which errors can be considered ephemeral. BUG=225051 Review URL: https://chromiumcodereview.appspot.com/15812007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r--base/file_util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/file_util.h b/base/file_util.h
index 13190dc..b75a18d 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -269,6 +269,12 @@ BASE_EXPORT bool CreateTemporaryDirInDir(
// Creates a directory, as well as creating any parent directories, if they
// don't exist. Returns 'true' on successful creation, or if the directory
// already exists. The directory is only readable by the current user.
+// Returns true on success, leaving *error unchanged.
+// Returns false on failure and sets *error appropriately, if it is non-NULL.
+BASE_EXPORT bool CreateDirectoryAndGetError(const base::FilePath& full_path,
+ base::PlatformFileError* error);
+
+// Backward-compatible convenience method for the above.
BASE_EXPORT bool CreateDirectory(const base::FilePath& full_path);
// Returns the file size. Returns true on success.