summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 23:57:51 +0000
committerdpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 23:57:51 +0000
commitd6c611340223170e19ccc2544e9510367749722b (patch)
treeebf83f8c0c6b3bdd0b0f85bd9f9fc8df7a0cb981 /base
parent28588ac648c6eae2f5fa485ae4d64651ee1a3399 (diff)
downloadchromium_src-d6c611340223170e19ccc2544e9510367749722b.zip
chromium_src-d6c611340223170e19ccc2544e9510367749722b.tar.gz
chromium_src-d6c611340223170e19ccc2544e9510367749722b.tar.bz2
Change CreateTemporaryDirInDir to be "more unique"
This change includes a process id in the synthesized temp dir names, so that created directories will be more unique across the system when you're running a bunch of base-using processes at once (e.g., in the layout tests). BUG=125678 R=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/10264026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_util_win.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index e9f9def..922e34a 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);