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

Unified Diff: base/file_util_win.cc

Issue 10264026: Change CreateTemporaryDirInDir to be "more unique" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use push_back() instead of append() Created 8 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index e9f9defa8797be949e2854b05dac76fcafcd5b54..922e34a34ba3df13ee7819dab225fb0644103840 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -17,6 +17,7 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
+#include "base/process_util.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/threading/thread_restrictions.h"
@@ -559,6 +560,8 @@ bool CreateTemporaryDirInDir(const FilePath& base_dir,
// the one exists, keep trying another path name until we reach some limit.
string16 new_dir_name;
new_dir_name.assign(prefix);
+ new_dir_name.append(base::IntToString16(::base::GetCurrentProcId()));
+ new_dir_name.push_back('_');
new_dir_name.append(base::IntToString16(rand() % kint16max));
path_to_create = base_dir.Append(new_dir_name);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698