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

Unified Diff: base/file_util_win.cc

Issue 3845002: Convert LOG(INFO) to VLOG(1) - base/. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 2 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
« no previous file with comments | « base/event_trace_controller_win_unittest.cc ('k') | base/i18n/char_iterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
===================================================================
--- base/file_util_win.cc (revision 62784)
+++ base/file_util_win.cc (working copy)
@@ -561,8 +561,7 @@
FilePath path_to_create;
srand(static_cast<uint32>(time(NULL)));
- int count = 0;
- while (count < 50) {
+ for (int count = 0; count < 50; ++count) {
// Try create a new temporary directory with random generated name. If
// the one exists, keep trying another path name until we reach some limit.
path_to_create = base_dir;
@@ -572,17 +571,13 @@
new_dir_name.append(base::IntToString16(rand() % kint16max));
path_to_create = path_to_create.Append(new_dir_name);
- if (::CreateDirectory(path_to_create.value().c_str(), NULL))
- break;
- count++;
+ if (::CreateDirectory(path_to_create.value().c_str(), NULL)) {
+ *new_dir = path_to_create;
+ return true;
+ }
}
- if (count == 50) {
- return false;
- }
-
- *new_dir = path_to_create;
- return true;
+ return false;
}
bool CreateNewTempDirectory(const FilePath::StringType& prefix,
@@ -600,14 +595,13 @@
DWORD fileattr = ::GetFileAttributes(full_path_str);
if (fileattr != INVALID_FILE_ATTRIBUTES) {
if ((fileattr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
- DLOG(INFO) << "CreateDirectory(" << full_path_str << "), "
- << "directory already exists.";
+ DVLOG(1) << "CreateDirectory(" << full_path_str << "), "
+ << "directory already exists.";
return true;
- } else {
- LOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
- << "conflicts with existing file.";
- return false;
}
+ LOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
+ << "conflicts with existing file.";
+ return false;
}
// Invariant: Path does not exist as file or directory.
« no previous file with comments | « base/event_trace_controller_win_unittest.cc ('k') | base/i18n/char_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698