diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 17:55:52 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 17:55:52 +0000 |
commit | 03d9afc0b775748203170a27014a3ee3500aecc2 (patch) | |
tree | d911fe4a8ffa53ef58c25689011036399f327b16 /base | |
parent | e7a32a13a89efea50f38288ebeadbc3189d971de (diff) | |
download | chromium_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 'base')
-rw-r--r-- | base/debug/trace_event_win_unittest.cc | 2 | ||||
-rw-r--r-- | base/file_util.cc | 16 | ||||
-rw-r--r-- | base/file_util.h | 40 | ||||
-rw-r--r-- | base/file_util_posix.cc | 44 | ||||
-rw-r--r-- | base/file_util_unittest.cc | 13 | ||||
-rw-r--r-- | base/file_util_win.cc | 44 | ||||
-rw-r--r-- | base/files/file_util_proxy.cc | 2 | ||||
-rw-r--r-- | base/files/important_file_writer.cc | 2 | ||||
-rw-r--r-- | base/files/scoped_temp_dir.cc | 10 | ||||
-rw-r--r-- | base/files/scoped_temp_dir_unittest.cc | 8 | ||||
-rw-r--r-- | base/memory/shared_memory_posix.cc | 3 | ||||
-rw-r--r-- | base/test/launcher/test_launcher.cc | 2 | ||||
-rw-r--r-- | base/test/launcher/unit_test_launcher.cc | 6 | ||||
-rw-r--r-- | base/win/event_trace_controller_unittest.cc | 2 | ||||
-rw-r--r-- | base/win/shortcut_unittest.cc | 2 |
15 files changed, 95 insertions, 101 deletions
diff --git a/base/debug/trace_event_win_unittest.cc b/base/debug/trace_event_win_unittest.cc index 531c5f7..befd0cb 100644 --- a/base/debug/trace_event_win_unittest.cc +++ b/base/debug/trace_event_win_unittest.cc @@ -115,7 +115,7 @@ class TraceEventWinTest: public testing::Test { } // Create the log file. - ASSERT_TRUE(file_util::CreateTemporaryFile(&log_file_)); + ASSERT_TRUE(base::CreateTemporaryFile(&log_file_)); // Create a private log session on the file. EtwTraceProperties prop; diff --git a/base/file_util.cc b/base/file_util.cc index 1f8ba81..f6d8657 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -153,6 +153,14 @@ bool IsDirectoryEmpty(const FilePath& dir_path) { return false; } +FILE* CreateAndOpenTemporaryFile(FilePath* path) { + FilePath directory; + if (!GetTempDir(&directory)) + return NULL; + + return CreateAndOpenTemporaryFileInDir(directory, path); +} + } // namespace base // ----------------------------------------------------------------------------- @@ -163,14 +171,6 @@ using base::FileEnumerator; using base::FilePath; using base::kMaxUniqueFiles; -FILE* CreateAndOpenTemporaryFile(FilePath* path) { - FilePath directory; - if (!GetTempDir(&directory)) - return NULL; - - return CreateAndOpenTemporaryFileInDir(directory, path); -} - bool CreateDirectory(const base::FilePath& full_path) { return CreateDirectoryAndGetError(full_path, NULL); } diff --git a/base/file_util.h b/base/file_util.h index acced28..3437890 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -212,49 +212,49 @@ BASE_EXPORT bool GetShmemTempDir(bool executable, FilePath* path); BASE_EXPORT FilePath GetHomeDir(); #endif // OS_POSIX -} // namespace base - -// ----------------------------------------------------------------------------- - -namespace file_util { - // Creates a temporary file. The full path is placed in |path|, and the // function returns true if was successful in creating the file. The file will // be empty and all handles closed after this function returns. -BASE_EXPORT bool CreateTemporaryFile(base::FilePath* path); +BASE_EXPORT bool CreateTemporaryFile(FilePath* path); // Same as CreateTemporaryFile but the file is created in |dir|. -BASE_EXPORT bool CreateTemporaryFileInDir(const base::FilePath& dir, - base::FilePath* temp_file); +BASE_EXPORT bool CreateTemporaryFileInDir(const FilePath& dir, + FilePath* temp_file); // Create and open a temporary file. File is opened for read/write. // The full path is placed in |path|. // Returns a handle to the opened file or NULL if an error occurred. -BASE_EXPORT FILE* CreateAndOpenTemporaryFile(base::FilePath* path); +BASE_EXPORT FILE* CreateAndOpenTemporaryFile(FilePath* path); + // Like above but for shmem files. Only useful for POSIX. // The executable flag says the file needs to support using // mprotect with PROT_EXEC after mapping. -BASE_EXPORT FILE* CreateAndOpenTemporaryShmemFile(base::FilePath* path, +BASE_EXPORT FILE* CreateAndOpenTemporaryShmemFile(FilePath* path, bool executable); + // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. -BASE_EXPORT FILE* CreateAndOpenTemporaryFileInDir(const base::FilePath& dir, - base::FilePath* path); +BASE_EXPORT FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, + FilePath* path); // Create a new directory. If prefix is provided, the new directory name is in // the format of prefixyyyy. // NOTE: prefix is ignored in the POSIX implementation. // If success, return true and output the full path of the directory created. -BASE_EXPORT bool CreateNewTempDirectory( - const base::FilePath::StringType& prefix, - base::FilePath* new_temp_path); +BASE_EXPORT bool CreateNewTempDirectory(const FilePath::StringType& prefix, + FilePath* new_temp_path); // Create a directory within another directory. // Extra characters will be appended to |prefix| to ensure that the // new directory does not have the same name as an existing directory. -BASE_EXPORT bool CreateTemporaryDirInDir( - const base::FilePath& base_dir, - const base::FilePath::StringType& prefix, - base::FilePath* new_dir); +BASE_EXPORT bool CreateTemporaryDirInDir(const FilePath& base_dir, + const FilePath::StringType& prefix, + FilePath* new_dir); + +} // namespace base + +// ----------------------------------------------------------------------------- + +namespace file_util { // Creates a directory, as well as creating any parent directories, if they // don't exist. Returns 'true' on successful creation, or if the directory diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 0557350..bfdc9269 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -513,25 +513,8 @@ FilePath GetHomeDir() { } #endif // !defined(OS_MACOSX) -} // namespace base - -// ----------------------------------------------------------------------------- - -namespace file_util { - -using base::stat_wrapper_t; -using base::CallStat; -using base::CallLstat; -using base::CreateAndOpenFdForTemporaryFile; -using base::DirectoryExists; -using base::FileEnumerator; -using base::FilePath; -using base::MakeAbsoluteFilePath; -using base::RealPath; -using base::VerifySpecificPathControlledByUser; - bool CreateTemporaryFile(FilePath* path) { - base::ThreadRestrictions::AssertIOAllowed(); // For call to close(). + ThreadRestrictions::AssertIOAllowed(); // For call to close(). FilePath directory; if (!GetTempDir(&directory)) return false; @@ -562,7 +545,7 @@ FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) { } bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) { - base::ThreadRestrictions::AssertIOAllowed(); // For call to close(). + ThreadRestrictions::AssertIOAllowed(); // For call to close(). int fd = CreateAndOpenFdForTemporaryFile(dir, temp_file); return ((fd >= 0) && !IGNORE_EINTR(close(fd))); } @@ -570,7 +553,7 @@ bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) { static bool CreateTemporaryDirInDirImpl(const FilePath& base_dir, const FilePath::StringType& name_tmpl, FilePath* new_dir) { - base::ThreadRestrictions::AssertIOAllowed(); // For call to mkdtemp(). + ThreadRestrictions::AssertIOAllowed(); // For call to mkdtemp(). DCHECK(name_tmpl.find("XXXXXX") != FilePath::StringType::npos) << "Directory name template must contain \"XXXXXX\"."; @@ -602,10 +585,27 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix, if (!GetTempDir(&tmpdir)) return false; - return CreateTemporaryDirInDirImpl(tmpdir, base::TempFileName(), - new_temp_path); + return CreateTemporaryDirInDirImpl(tmpdir, TempFileName(), new_temp_path); } + +} // namespace base + +// ----------------------------------------------------------------------------- + +namespace file_util { + +using base::stat_wrapper_t; +using base::CallStat; +using base::CallLstat; +using base::CreateAndOpenFdForTemporaryFile; +using base::DirectoryExists; +using base::FileEnumerator; +using base::FilePath; +using base::MakeAbsoluteFilePath; +using base::RealPath; +using base::VerifySpecificPathControlledByUser; + bool CreateDirectoryAndGetError(const FilePath& full_path, base::PlatformFileError* error) { base::ThreadRestrictions::AssertIOAllowed(); // For call to mkdir(). diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc index 71169b7..2dac484 100644 --- a/base/file_util_unittest.cc +++ b/base/file_util_unittest.cc @@ -531,7 +531,7 @@ TEST_F(FileUtilTest, CreateTemporaryFileInDirLongPathTest) { ASSERT_STRNE(kLongDirName, short_test_dir.BaseName().value().c_str()); FilePath temp_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(short_test_dir, &temp_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(short_test_dir, &temp_file)); EXPECT_STREQ(kLongDirName, temp_file.DirName().BaseName().value().c_str()); EXPECT_TRUE(PathExists(temp_file)); @@ -548,7 +548,7 @@ TEST_F(FileUtilTest, CreateTemporaryFileInDirLongPathTest) { ASSERT_TRUE(file_util::MakeFileUnreadable(long_test_dir)); // Use the short form of the directory to create a temporary filename. - ASSERT_TRUE(file_util::CreateTemporaryFileInDir( + ASSERT_TRUE(base::CreateTemporaryFileInDir( short_test_dir.Append(kTestSubDirName), &temp_file)); EXPECT_TRUE(PathExists(temp_file)); EXPECT_TRUE(short_test_dir.IsParent(temp_file.DirName())); @@ -1582,7 +1582,7 @@ TEST_F(FileUtilTest, GetTempDirTest) { TEST_F(FileUtilTest, CreateTemporaryFileTest) { FilePath temp_files[3]; for (int i = 0; i < 3; i++) { - ASSERT_TRUE(file_util::CreateTemporaryFile(&(temp_files[i]))); + ASSERT_TRUE(base::CreateTemporaryFile(&(temp_files[i]))); EXPECT_TRUE(PathExists(temp_files[i])); EXPECT_FALSE(DirectoryExists(temp_files[i])); } @@ -1599,7 +1599,7 @@ TEST_F(FileUtilTest, CreateAndOpenTemporaryFileTest) { // Create; make sure they are open and exist. for (i = 0; i < 3; ++i) { - fps[i] = file_util::CreateAndOpenTemporaryFile(&(names[i])); + fps[i] = base::CreateAndOpenTemporaryFile(&(names[i])); ASSERT_TRUE(fps[i]); EXPECT_TRUE(PathExists(names[i])); } @@ -1618,15 +1618,14 @@ TEST_F(FileUtilTest, CreateAndOpenTemporaryFileTest) { TEST_F(FileUtilTest, CreateNewTempDirectoryTest) { FilePath temp_dir; - ASSERT_TRUE(file_util::CreateNewTempDirectory(FilePath::StringType(), - &temp_dir)); + ASSERT_TRUE(base::CreateNewTempDirectory(FilePath::StringType(), &temp_dir)); EXPECT_TRUE(PathExists(temp_dir)); EXPECT_TRUE(DeleteFile(temp_dir, false)); } TEST_F(FileUtilTest, CreateNewTemporaryDirInDirTest) { FilePath new_dir; - ASSERT_TRUE(file_util::CreateTemporaryDirInDir( + ASSERT_TRUE(base::CreateTemporaryDirInDir( temp_dir_.path(), FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"), &new_dir)); diff --git a/base/file_util_win.cc b/base/file_util_win.cc index b500b45..ac35c74 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -231,18 +231,8 @@ bool GetShmemTempDir(bool executable, FilePath* path) { return GetTempDir(path); } -} // namespace base - -// ----------------------------------------------------------------------------- - -namespace file_util { - -using base::DirectoryExists; -using base::FilePath; -using base::kFileShareAll; - bool CreateTemporaryFile(FilePath* path) { - base::ThreadRestrictions::AssertIOAllowed(); + ThreadRestrictions::AssertIOAllowed(); FilePath temp_file; @@ -258,7 +248,7 @@ bool CreateTemporaryFile(FilePath* path) { } FILE* CreateAndOpenTemporaryShmemFile(FilePath* path, bool executable) { - base::ThreadRestrictions::AssertIOAllowed(); + ThreadRestrictions::AssertIOAllowed(); return CreateAndOpenTemporaryFile(path); } @@ -267,24 +257,24 @@ FILE* CreateAndOpenTemporaryShmemFile(FilePath* path, bool executable) { // TODO(jrg): is there equivalent call to use on Windows instead of // going 2-step? FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) { - base::ThreadRestrictions::AssertIOAllowed(); + ThreadRestrictions::AssertIOAllowed(); if (!CreateTemporaryFileInDir(dir, path)) { return NULL; } // Open file in binary mode, to avoid problems with fwrite. On Windows // it replaces \n's with \r\n's, which may surprise you. // Reference: http://msdn.microsoft.com/en-us/library/h9t88zwz(VS.71).aspx - return OpenFile(*path, "wb+"); + return file_util::OpenFile(*path, "wb+"); } -bool CreateTemporaryFileInDir(const FilePath& dir, - FilePath* temp_file) { - base::ThreadRestrictions::AssertIOAllowed(); +bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) { + ThreadRestrictions::AssertIOAllowed(); wchar_t temp_name[MAX_PATH + 1]; if (!GetTempFileName(dir.value().c_str(), L"", 0, temp_name)) { - DPLOG(WARNING) << "Failed to get temporary file name in " << dir.value(); + DPLOG(WARNING) << "Failed to get temporary file name in " + << UTF16ToUTF8(dir.value()); return false; } @@ -305,7 +295,7 @@ bool CreateTemporaryFileInDir(const FilePath& dir, bool CreateTemporaryDirInDir(const FilePath& base_dir, const FilePath::StringType& prefix, FilePath* new_dir) { - base::ThreadRestrictions::AssertIOAllowed(); + ThreadRestrictions::AssertIOAllowed(); FilePath path_to_create; @@ -314,9 +304,9 @@ 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.append(IntToString16(GetCurrentProcId())); new_dir_name.push_back('_'); - new_dir_name.append(base::IntToString16(base::RandInt(0, kint16max))); + new_dir_name.append(IntToString16(RandInt(0, kint16max))); path_to_create = base_dir.Append(new_dir_name); if (::CreateDirectory(path_to_create.value().c_str(), NULL)) { @@ -330,7 +320,7 @@ bool CreateTemporaryDirInDir(const FilePath& base_dir, bool CreateNewTempDirectory(const FilePath::StringType& prefix, FilePath* new_temp_path) { - base::ThreadRestrictions::AssertIOAllowed(); + ThreadRestrictions::AssertIOAllowed(); FilePath system_temp_dir; if (!GetTempDir(&system_temp_dir)) @@ -339,6 +329,16 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix, return CreateTemporaryDirInDir(system_temp_dir, prefix, new_temp_path); } +} // namespace base + +// ----------------------------------------------------------------------------- + +namespace file_util { + +using base::DirectoryExists; +using base::FilePath; +using base::kFileShareAll; + bool CreateDirectoryAndGetError(const FilePath& full_path, base::PlatformFileError* error) { base::ThreadRestrictions::AssertIOAllowed(); diff --git a/base/files/file_util_proxy.cc b/base/files/file_util_proxy.cc index 965b489..a36328e 100644 --- a/base/files/file_util_proxy.cc +++ b/base/files/file_util_proxy.cc @@ -76,7 +76,7 @@ class CreateTemporaryHelper { void RunWork(int additional_file_flags) { // TODO(darin): file_util should have a variant of CreateTemporaryFile // that returns a FilePath and a PlatformFile. - file_util::CreateTemporaryFile(&file_path_); + base::CreateTemporaryFile(&file_path_); int file_flags = PLATFORM_FILE_WRITE | diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc index 466e95d..261c987 100644 --- a/base/files/important_file_writer.cc +++ b/base/files/important_file_writer.cc @@ -58,7 +58,7 @@ bool ImportantFileWriter::WriteFileAtomically(const FilePath& path, // as target file, so it can be moved in one step, and that the temp file // is securely created. FilePath tmp_file_path; - if (!file_util::CreateTemporaryFileInDir(path.DirName(), &tmp_file_path)) { + if (!base::CreateTemporaryFileInDir(path.DirName(), &tmp_file_path)) { LogFailure(path, FAILED_CREATING, "could not create temporary file"); return false; } diff --git a/base/files/scoped_temp_dir.cc b/base/files/scoped_temp_dir.cc index 497799e..5624a06 100644 --- a/base/files/scoped_temp_dir.cc +++ b/base/files/scoped_temp_dir.cc @@ -23,8 +23,7 @@ bool ScopedTempDir::CreateUniqueTempDir() { // This "scoped_dir" prefix is only used on Windows and serves as a template // for the unique name. - if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_dir"), - &path_)) + if (!base::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_dir"), &path_)) return false; return true; @@ -39,10 +38,9 @@ bool ScopedTempDir::CreateUniqueTempDirUnderPath(const FilePath& base_path) { return false; // Create a new, uniquely named directory under |base_path|. - if (!file_util::CreateTemporaryDirInDir( - base_path, - FILE_PATH_LITERAL("scoped_dir_"), - &path_)) + if (!base::CreateTemporaryDirInDir(base_path, + FILE_PATH_LITERAL("scoped_dir_"), + &path_)) return false; return true; diff --git a/base/files/scoped_temp_dir_unittest.cc b/base/files/scoped_temp_dir_unittest.cc index 02b910c..fe243ce 100644 --- a/base/files/scoped_temp_dir_unittest.cc +++ b/base/files/scoped_temp_dir_unittest.cc @@ -13,8 +13,8 @@ namespace base { TEST(ScopedTempDir, FullPath) { FilePath test_path; - file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_temp_dir"), - &test_path); + base::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_temp_dir"), + &test_path); // Against an existing dir, it should get destroyed when leaving scope. EXPECT_TRUE(DirectoryExists(test_path)); @@ -64,8 +64,8 @@ TEST(ScopedTempDir, TempDir) { TEST(ScopedTempDir, UniqueTempDirUnderPath) { // Create a path which will contain a unique temp path. FilePath base_path; - ASSERT_TRUE(file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("base_dir"), - &base_path)); + ASSERT_TRUE(base::CreateNewTempDirectory(FILE_PATH_LITERAL("base_dir"), + &base_path)); FilePath test_path; { diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc index 8bc7da8..4620247 100644 --- a/base/memory/shared_memory_posix.cc +++ b/base/memory/shared_memory_posix.cc @@ -141,8 +141,7 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) { DCHECK(!options.open_existing); // Q: Why not use the shm_open() etc. APIs? // A: Because they're limited to 4mb on OS X. FFFFFFFUUUUUUUUUUU - fp.reset( - file_util::CreateAndOpenTemporaryShmemFile(&path, options.executable)); + fp.reset(base::CreateAndOpenTemporaryShmemFile(&path, options.executable)); if (fp) { // Also open as readonly so that we can ShareReadOnlyToProcess. diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc index e5387be..0b32c84 100644 --- a/base/test/launcher/test_launcher.cc +++ b/base/test/launcher/test_launcher.cc @@ -248,7 +248,7 @@ void DoLaunchChildTestProcess( // Redirect child process output to a file. base::FilePath output_file; - CHECK(file_util::CreateTemporaryFile(&output_file)); + CHECK(base::CreateTemporaryFile(&output_file)); LaunchOptions options; #if defined(OS_WIN) diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc index a265f02..c9924ef 100644 --- a/base/test/launcher/unit_test_launcher.cc +++ b/base/test/launcher/unit_test_launcher.cc @@ -157,8 +157,7 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate { // per run to ensure clean state and make it possible to launch multiple // processes in parallel. base::FilePath output_file; - CHECK(file_util::CreateNewTempDirectory(FilePath::StringType(), - &output_file)); + CHECK(CreateNewTempDirectory(FilePath::StringType(), &output_file)); output_file = output_file.AppendASCII("test_results.xml"); std::vector<std::string> current_test_names; @@ -192,8 +191,7 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate { // per run to ensure clean state and make it possible to launch multiple // processes in parallel. base::FilePath output_file; - CHECK(file_util::CreateNewTempDirectory(FilePath::StringType(), - &output_file)); + CHECK(CreateNewTempDirectory(FilePath::StringType(), &output_file)); output_file = output_file.AppendASCII("test_results.xml"); CommandLine cmd_line( diff --git a/base/win/event_trace_controller_unittest.cc b/base/win/event_trace_controller_unittest.cc index 16bf1e1..4d23edd 100644 --- a/base/win/event_trace_controller_unittest.cc +++ b/base/win/event_trace_controller_unittest.cc @@ -164,7 +164,7 @@ TEST_F(EtwTraceControllerTest, StartFileSession) { ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); FilePath temp; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &temp)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &temp)); EtwTraceController controller; HRESULT hr = controller.StartFileSession(session_name_.c_str(), diff --git a/base/win/shortcut_unittest.cc b/base/win/shortcut_unittest.cc index b3247b6..6db5741 100644 --- a/base/win/shortcut_unittest.cc +++ b/base/win/shortcut_unittest.cc @@ -52,7 +52,7 @@ class ShortcutTest : public testing::Test { arraysize(kFileContents2)); FilePath icon_path_2; - file_util::CreateTemporaryFileInDir(temp_dir_.path(), &icon_path_2); + base::CreateTemporaryFileInDir(temp_dir_.path(), &icon_path_2); link_properties_2_.set_target(target_file_2); link_properties_2_.set_working_dir(temp_dir_2_.path()); |