diff options
author | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 14:54:50 +0000 |
---|---|---|
committer | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 14:54:50 +0000 |
commit | bdddb676d97056742f83d280843ff099768b07f3 (patch) | |
tree | 42b9dc58c818226653c2388d7716ec729e3836cf /base | |
parent | 7e91c5937f1f9587acda5a0a732d07bed8cafe46 (diff) | |
download | chromium_src-bdddb676d97056742f83d280843ff099768b07f3.zip chromium_src-bdddb676d97056742f83d280843ff099768b07f3.tar.gz chromium_src-bdddb676d97056742f83d280843ff099768b07f3.tar.bz2 |
Temp dir cleanup:
- use ScopedTempDir in work items that need backup space for rollback
- all work items that need backup space take a parent dir in which they create temp dirs
- use ScopedTempDir in a few other places
- renamed some parameters in certain functions so that the same name is used everywhere
While I was at it, I couldn't help but replace Append(UTF8ToWide(version.GetString())) with the more pleasing AppendASCII(version.GetString())
BUG=70368
TEST=existing tests in installer_util_unittests cover the changes
Review URL: http://codereview.chromium.org/6538025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_util_win.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc index 51bcb4e..ab1dc94 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -606,13 +606,11 @@ bool CreateTemporaryDirInDir(const FilePath& base_dir, 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; - string16 new_dir_name; new_dir_name.assign(prefix); new_dir_name.append(base::IntToString16(rand() % kint16max)); - path_to_create = path_to_create.Append(new_dir_name); + path_to_create = base_dir.Append(new_dir_name); if (::CreateDirectory(path_to_create.value().c_str(), NULL)) { *new_dir = path_to_create; return true; |