diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/base_paths_mac.mm | 12 | ||||
-rw-r--r-- | base/file_path.h | 9 | ||||
-rw-r--r-- | base/file_util_android.cc | 2 | ||||
-rw-r--r-- | base/file_util_mac.mm | 7 | ||||
-rw-r--r-- | base/file_version_info_mac.mm | 2 | ||||
-rw-r--r-- | base/i18n/file_util_icu_unittest.cc | 7 | ||||
-rw-r--r-- | base/native_library_mac.mm | 2 | ||||
-rw-r--r-- | base/process_linux.cc | 12 |
8 files changed, 31 insertions, 22 deletions
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm index 630f742..39a5814 100644 --- a/base/base_paths_mac.mm +++ b/base/base_paths_mac.mm @@ -21,7 +21,7 @@ namespace { -void GetNSExecutablePath(FilePath* path) { +void GetNSExecutablePath(base::FilePath* path) { DCHECK(path); // Executable path can have relative references ("..") depending on // how the app was launched. @@ -32,19 +32,19 @@ void GetNSExecutablePath(FilePath* path) { int rv = _NSGetExecutablePath(WriteInto(&executable_path, executable_length), &executable_length); DCHECK_EQ(rv, 0); - *path = FilePath(executable_path); + *path = base::FilePath(executable_path); } // Returns true if the module for |address| is found. |path| will contain // the path to the module. Note that |path| may not be absolute. -bool GetModulePathForAddress(FilePath* path, +bool GetModulePathForAddress(base::FilePath* path, const void* address) WARN_UNUSED_RESULT; -bool GetModulePathForAddress(FilePath* path, const void* address) { +bool GetModulePathForAddress(base::FilePath* path, const void* address) { Dl_info info; if (dladdr(address, &info) == 0) return false; - *path = FilePath(info.dli_fname); + *path = base::FilePath(info.dli_fname); return true; } @@ -52,7 +52,7 @@ bool GetModulePathForAddress(FilePath* path, const void* address) { namespace base { -bool PathProviderMac(int key, FilePath* result) { +bool PathProviderMac(int key, base::FilePath* result) { switch (key) { case base::FILE_EXE: GetNSExecutablePath(result); diff --git a/base/file_path.h b/base/file_path.h index e5c4b84..c01da94 100644 --- a/base/file_path.h +++ b/base/file_path.h @@ -402,8 +402,15 @@ class BASE_EXPORT FilePath { } // namespace base -// TODO(brettw) remove this once callers properly use the base namespace. +// Temporarily have non-Linux platforms use a "using" so we can convert those +// over one-at-a-time. +// +// http://crosbug.com/39008 MTPD has a circular dependency on base and uses the +// old non-namespaced FilePath. +#if defined(MTPD_DEVICE_MANAGER_H_) || defined(OS_CHROMEOS) || \ + !defined(OS_LINUX) using base::FilePath; +#endif // This is required by googletest to print a readable output on test failures. BASE_EXPORT extern void PrintTo(const base::FilePath& path, std::ostream* out); diff --git a/base/file_util_android.cc b/base/file_util_android.cc index 79db279..615ffe6 100644 --- a/base/file_util_android.cc +++ b/base/file_util_android.cc @@ -9,7 +9,7 @@ namespace file_util { -bool GetShmemTempDir(FilePath* path, bool executable) { +bool GetShmemTempDir(base::FilePath* path, bool executable) { return PathService::Get(base::DIR_CACHE, path); } diff --git a/base/file_util_mac.mm b/base/file_util_mac.mm index 2499f44..0de3786 100644 --- a/base/file_util_mac.mm +++ b/base/file_util_mac.mm @@ -15,7 +15,7 @@ namespace file_util { -bool GetTempDir(FilePath* path) { +bool GetTempDir(base::FilePath* path) { NSString* tmp = NSTemporaryDirectory(); if (tmp == nil) return false; @@ -23,11 +23,12 @@ bool GetTempDir(FilePath* path) { return true; } -bool GetShmemTempDir(FilePath* path, bool executable) { +bool GetShmemTempDir(base::FilePath* path, bool executable) { return GetTempDir(path); } -bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) { +bool CopyFileUnsafe(const base::FilePath& from_path, + const base::FilePath& to_path) { base::ThreadRestrictions::AssertIOAllowed(); return (copyfile(from_path.value().c_str(), to_path.value().c_str(), NULL, COPYFILE_ALL) == 0); diff --git a/base/file_version_info_mac.mm b/base/file_version_info_mac.mm index c989443..54af633 100644 --- a/base/file_version_info_mac.mm +++ b/base/file_version_info_mac.mm @@ -25,7 +25,7 @@ FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() { // static FileVersionInfo* FileVersionInfo::CreateFileVersionInfo( - const FilePath& file_path) { + const base::FilePath& file_path) { NSString* path = base::SysUTF8ToNSString(file_path.value()); NSBundle* bundle = [NSBundle bundleWithPath:path]; return new FileVersionInfoMac(bundle); diff --git a/base/i18n/file_util_icu_unittest.cc b/base/i18n/file_util_icu_unittest.cc index dfc4943..f49ac5a 100644 --- a/base/i18n/file_util_icu_unittest.cc +++ b/base/i18n/file_util_icu_unittest.cc @@ -96,10 +96,11 @@ static const struct normalize_name_encoding_test_cases { TEST_F(FileUtilICUTest, NormalizeFileNameEncoding) { for (size_t i = 0; i < arraysize(kNormalizeFileNameEncodingTestCases); i++) { - FilePath path(kNormalizeFileNameEncodingTestCases[i].original_path); + base::FilePath path(kNormalizeFileNameEncodingTestCases[i].original_path); file_util::NormalizeFileNameEncoding(&path); - EXPECT_EQ(FilePath(kNormalizeFileNameEncodingTestCases[i].normalized_path), - path); + EXPECT_EQ( + base::FilePath(kNormalizeFileNameEncodingTestCases[i].normalized_path), + path); } } diff --git a/base/native_library_mac.mm b/base/native_library_mac.mm index 9f7a967..daaaeb0 100644 --- a/base/native_library_mac.mm +++ b/base/native_library_mac.mm @@ -16,7 +16,7 @@ namespace base { // static -NativeLibrary LoadNativeLibrary(const FilePath& library_path, +NativeLibrary LoadNativeLibrary(const base::FilePath& library_path, std::string* error) { // dlopen() etc. open the file off disk. if (library_path.Extension() == "dylib" || diff --git a/base/process_linux.cc b/base/process_linux.cc index 09fb9eb..83d9649 100644 --- a/base/process_linux.cc +++ b/base/process_linux.cc @@ -38,12 +38,12 @@ struct CGroups { // all background renderers. This allows us to limit the impact of background // renderers on foreground ones to a greater level than simple renicing. bool enabled; - FilePath foreground_file; - FilePath background_file; + base::FilePath foreground_file; + base::FilePath background_file; CGroups() { - foreground_file = FilePath(StringPrintf(kControlPath, kForeground)); - background_file = FilePath(StringPrintf(kControlPath, kBackground)); + foreground_file = base::FilePath(StringPrintf(kControlPath, kForeground)); + background_file = base::FilePath(StringPrintf(kControlPath, kBackground)); file_util::FileSystemType foreground_type; file_util::FileSystemType background_type; enabled = @@ -69,7 +69,7 @@ bool Process::IsProcessBackgrounded() const { if (cgroups.Get().enabled) { std::string proc; if (file_util::ReadFileToString( - FilePath(StringPrintf(kProcPath, process_)), + base::FilePath(StringPrintf(kProcPath, process_)), &proc)) { std::vector<std::string> proc_parts; base::SplitString(proc, ':', &proc_parts); @@ -90,7 +90,7 @@ bool Process::SetProcessBackgrounded(bool background) { #if defined(OS_CHROMEOS) if (cgroups.Get().enabled) { std::string pid = StringPrintf("%d", process_); - const FilePath file = + const base::FilePath file = background ? cgroups.Get().background_file : cgroups.Get().foreground_file; return file_util::WriteFile(file, pid.c_str(), pid.size()) > 0; |