summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 17:55:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 17:55:52 +0000
commit03d9afc0b775748203170a27014a3ee3500aecc2 (patch)
treed911fe4a8ffa53ef58c25689011036399f327b16 /chrome/installer
parente7a32a13a89efea50f38288ebeadbc3189d971de (diff)
downloadchromium_src-03d9afc0b775748203170a27014a3ee3500aecc2.zip
chromium_src-03d9afc0b775748203170a27014a3ee3500aecc2.tar.gz
chromium_src-03d9afc0b775748203170a27014a3ee3500aecc2.tar.bz2
Move temp file functions to base namespace.
BUG= Review URL: https://codereview.chromium.org/99923002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/setup/install_unittest.cc12
-rw-r--r--chrome/installer/setup/setup_main.cc6
-rw-r--r--chrome/installer/setup/setup_util_unittest.cc2
-rw-r--r--chrome/installer/setup/uninstall.cc4
-rw-r--r--chrome/installer/test/alternate_version_generator.cc2
-rw-r--r--chrome/installer/test/upgrade_test.cc2
-rw-r--r--chrome/installer/util/delete_after_reboot_helper_unittest.cc7
-rw-r--r--chrome/installer/util/installer_state_unittest.cc2
-rw-r--r--chrome/installer/util/master_preferences_unittest.cc4
-rw-r--r--chrome/installer/util/shell_util_unittest.cc2
10 files changed, 19 insertions, 24 deletions
diff --git a/chrome/installer/setup/install_unittest.cc b/chrome/installer/setup/install_unittest.cc
index 5f90105..7259256 100644
--- a/chrome/installer/setup/install_unittest.cc
+++ b/chrome/installer/setup/install_unittest.cc
@@ -318,8 +318,7 @@ TEST_F(InstallShortcutTest, CreateAllShortcutsButQuickLaunchShortcut) {
TEST_F(InstallShortcutTest, ReplaceAll) {
base::win::ShortcutProperties dummy_properties;
base::FilePath dummy_target;
- ASSERT_TRUE(
- file_util::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
dummy_properties.set_target(dummy_target);
dummy_properties.set_working_dir(fake_user_desktop_.path());
dummy_properties.set_arguments(L"--dummy --args");
@@ -349,8 +348,7 @@ TEST_F(InstallShortcutTest, ReplaceAll) {
TEST_F(InstallShortcutTest, ReplaceExisting) {
base::win::ShortcutProperties dummy_properties;
base::FilePath dummy_target;
- ASSERT_TRUE(
- file_util::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
dummy_properties.set_target(dummy_target);
dummy_properties.set_working_dir(fake_user_desktop_.path());
dummy_properties.set_arguments(L"--dummy --args");
@@ -372,8 +370,7 @@ TEST_F(InstallShortcutTest, ReplaceExisting) {
TEST_F(InstallShortcutTest, CreateIfNoSystemLevelAllSystemShortcutsExist) {
base::win::ShortcutProperties dummy_properties;
base::FilePath dummy_target;
- ASSERT_TRUE(
- file_util::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
dummy_properties.set_target(dummy_target);
ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
@@ -410,8 +407,7 @@ TEST_F(InstallShortcutTest, CreateIfNoSystemLevelNoSystemShortcutsExist) {
TEST_F(InstallShortcutTest, CreateIfNoSystemLevelSomeSystemShortcutsExist) {
base::win::ShortcutProperties dummy_properties;
base::FilePath dummy_target;
- ASSERT_TRUE(
- file_util::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
dummy_properties.set_target(dummy_target);
ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index dc2bec6c..2789f31 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -691,9 +691,9 @@ bool CreateTemporaryAndUnpackDirectories(
}
VLOG(1) << "Created path " << temp_path->path().value();
- if (!file_util::CreateTemporaryDirInDir(temp_path->path(),
- installer::kInstallSourceDir,
- unpack_path)) {
+ if (!base::CreateTemporaryDirInDir(temp_path->path(),
+ installer::kInstallSourceDir,
+ unpack_path)) {
PLOG(ERROR) << "Could not create temporary path for unpacked archive.";
return false;
}
diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc
index 389cc1e..3a02f28 100644
--- a/chrome/installer/setup/setup_util_unittest.cc
+++ b/chrome/installer/setup/setup_util_unittest.cc
@@ -135,7 +135,7 @@ TEST_F(SetupUtilTestWithDir, GetMaxVersionFromArchiveDirTest) {
TEST_F(SetupUtilTestWithDir, DeleteFileFromTempProcess) {
base::FilePath test_file;
- file_util::CreateTemporaryFileInDir(test_dir_.path(), &test_file);
+ base::CreateTemporaryFileInDir(test_dir_.path(), &test_file);
ASSERT_TRUE(base::PathExists(test_file));
file_util::WriteFile(test_file, "foo", 3);
EXPECT_TRUE(installer::DeleteFileFromTempProcess(test_file, 0));
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index de4f3f7..c713834 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -477,7 +477,7 @@ base::FilePath BackupLocalStateFile(
local_state_folder.Append(chrome::kLocalStateFilename));
if (!base::PathExists(state_file))
continue;
- if (!file_util::CreateTemporaryFile(&backup))
+ if (!base::CreateTemporaryFile(&backup))
LOG(ERROR) << "Failed to create temporary file for Local State.";
else
base::CopyFile(state_file, backup);
@@ -535,7 +535,7 @@ bool MoveSetupOutOfInstallFolder(const InstallerState& installer_state,
base::FilePath temp_file;
if (!PathService::Get(base::DIR_TEMP, &tmp_dir)) {
NOTREACHED();
- } else if (!file_util::CreateTemporaryFileInDir(tmp_dir, &temp_file)) {
+ } else if (!base::CreateTemporaryFileInDir(tmp_dir, &temp_file)) {
LOG(ERROR) << "Failed to create temporary file for setup.exe.";
} else {
VLOG(1) << "Changing current directory to: " << tmp_dir.value();
diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc
index d00da4f..6b65aa1 100644
--- a/chrome/installer/test/alternate_version_generator.cc
+++ b/chrome/installer/test/alternate_version_generator.cc
@@ -84,7 +84,7 @@ class ScopedTempDirectory {
// Creates a temporary directory.
bool Initialize() {
DCHECK(directory_.empty());
- if (!file_util::CreateNewTempDirectory(&kTempDirPrefix[0], &directory_)) {
+ if (!base::CreateNewTempDirectory(&kTempDirPrefix[0], &directory_)) {
LOG(DFATAL) << "Failed creating temporary directory.";
return false;
}
diff --git a/chrome/installer/test/upgrade_test.cc b/chrome/installer/test/upgrade_test.cc
index cca9359..d50089f 100644
--- a/chrome/installer/test/upgrade_test.cc
+++ b/chrome/installer/test/upgrade_test.cc
@@ -22,7 +22,7 @@ class UpgradeTest : public testing::Test {
static void SetUpTestCase() {
base::FilePath dir_exe;
ASSERT_TRUE(PathService::Get(base::DIR_EXE, &dir_exe));
- ASSERT_TRUE(file_util::CreateTemporaryFile(&next_mini_installer_path_));
+ ASSERT_TRUE(base::CreateTemporaryFile(&next_mini_installer_path_));
ASSERT_TRUE(
upgrade_test::GenerateAlternateVersion(
dir_exe.Append(&kMiniInstallerExe[0]),
diff --git a/chrome/installer/util/delete_after_reboot_helper_unittest.cc b/chrome/installer/util/delete_after_reboot_helper_unittest.cc
index c97cecd..d5a65812 100644
--- a/chrome/installer/util/delete_after_reboot_helper_unittest.cc
+++ b/chrome/installer/util/delete_after_reboot_helper_unittest.cc
@@ -24,13 +24,12 @@ class DeleteAfterRebootHelperTest : public testing::Test {
protected:
virtual void SetUp() {
// Create a temporary directory for testing and fill it with some files.
- std::wstring no_prefix;
- file_util::CreateNewTempDirectory(no_prefix, &temp_dir_);
- file_util::CreateTemporaryFileInDir(temp_dir_, &temp_file_);
+ base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_dir_);
+ base::CreateTemporaryFileInDir(temp_dir_, &temp_file_);
temp_subdir_ = temp_dir_.Append(L"subdir");
file_util::CreateDirectory(temp_subdir_);
- file_util::CreateTemporaryFileInDir(temp_subdir_, &temp_subdir_file_);
+ base::CreateTemporaryFileInDir(temp_subdir_, &temp_subdir_file_);
// Copy the current pending moves and then clear it if we can:
if (IsUserAnAdmin()) {
diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc
index 45497d56..a085817 100644
--- a/chrome/installer/util/installer_state_unittest.cc
+++ b/chrome/installer/util/installer_state_unittest.cc
@@ -474,7 +474,7 @@ TEST_F(InstallerStateTest, IsFileInUse) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
base::FilePath temp_file;
- ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &temp_file));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &temp_file));
EXPECT_FALSE(MockInstallerState::IsFileInUse(temp_file));
diff --git a/chrome/installer/util/master_preferences_unittest.cc b/chrome/installer/util/master_preferences_unittest.cc
index 0ed209d..f1e38ed 100644
--- a/chrome/installer/util/master_preferences_unittest.cc
+++ b/chrome/installer/util/master_preferences_unittest.cc
@@ -20,7 +20,7 @@ namespace {
class MasterPreferencesTest : public testing::Test {
protected:
virtual void SetUp() {
- ASSERT_TRUE(file_util::CreateTemporaryFile(&prefs_file_));
+ ASSERT_TRUE(base::CreateTemporaryFile(&prefs_file_));
}
virtual void TearDown() {
@@ -241,7 +241,7 @@ TEST(MasterPrefsExtension, ValidateExtensionJSON) {
TEST_F(MasterPreferencesTest, GetInstallPreferencesTest) {
// Create a temporary prefs file.
base::FilePath prefs_file;
- ASSERT_TRUE(file_util::CreateTemporaryFile(&prefs_file));
+ ASSERT_TRUE(base::CreateTemporaryFile(&prefs_file));
const char text[] =
"{ \n"
" \"distribution\": { \n"
diff --git a/chrome/installer/util/shell_util_unittest.cc b/chrome/installer/util/shell_util_unittest.cc
index b7303e8..6b9ce72 100644
--- a/chrome/installer/util/shell_util_unittest.cc
+++ b/chrome/installer/util/shell_util_unittest.cc
@@ -73,7 +73,7 @@ class ShellUtilShortcutTest : public testing::Test {
fake_common_start_menu_.path()));
base::FilePath icon_path;
- file_util::CreateTemporaryFileInDir(temp_dir_.path(), &icon_path);
+ base::CreateTemporaryFileInDir(temp_dir_.path(), &icon_path);
test_properties_.set_target(chrome_exe_);
test_properties_.set_arguments(L"--test --chrome");
test_properties_.set_description(L"Makes polar bears dance.");