Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: third_party/leveldatabase/env_chromium.cc

Issue 15812007: Make file_util::CreateDirectory return an error, not just a bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: xml file; use the new errors Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/leveldatabase/env_chromium.cc
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc
index 4d296fa6d9c8297df5348236d68dd958a5f62cb6..ac463acd55acabd6f7a59f03a7cfdd15eddbfce6 100644
--- a/third_party/leveldatabase/env_chromium.cc
+++ b/third_party/leveldatabase/env_chromium.cc
@@ -597,10 +597,15 @@ Status ChromiumEnv::DeleteFile(const std::string& fname) {
Status ChromiumEnv::CreateDir(const std::string& name) {
Status result;
- if (!::file_util::CreateDirectory(CreateFilePath(name))) {
- result = MakeIOError(name, "Could not create directory.", kCreateDir);
- RecordErrorAt(kCreateDir);
- }
+ base::PlatformFileError error = base::PLATFORM_FILE_OK;
+ Retrier retrier(kCreateDir, this);
+ do {
+ if (::file_util::CreateDirectoryAndGetError(CreateFilePath(name), &error)) {
+ return result;
+ }
jar (doing other things) 2013/06/07 23:32:49 nit: No need for curlies around this one line resu
dgrogan 2013/06/07 23:35:50 Done.
+ } while (retrier.ShouldKeepTrying(error));
+ result = MakeIOError(name, "Could not create directory.", kCreateDir);
+ RecordErrorAt(kCreateDir);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698