OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <fnmatch.h> | 10 #include <fnmatch.h> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 return false; | 133 return false; |
134 } | 134 } |
135 | 135 |
136 return true; | 136 return true; |
137 } | 137 } |
138 | 138 |
139 } // namespace | 139 } // namespace |
140 | 140 |
141 static std::string TempFileName() { | 141 static std::string TempFileName() { |
142 #if defined(OS_MACOSX) | 142 #if defined(OS_MACOSX) |
143 return StringPrintf(".%s.XXXXXX", base::mac::BaseBundleID()); | 143 return base::StringPrintf(".%s.XXXXXX", base::mac::BaseBundleID()); |
144 #endif | 144 #endif |
145 | 145 |
146 #if defined(GOOGLE_CHROME_BUILD) | 146 #if defined(GOOGLE_CHROME_BUILD) |
147 return std::string(".com.google.Chrome.XXXXXX"); | 147 return std::string(".com.google.Chrome.XXXXXX"); |
148 #else | 148 #else |
149 return std::string(".org.chromium.Chromium.XXXXXX"); | 149 return std::string(".org.chromium.Chromium.XXXXXX"); |
150 #endif | 150 #endif |
151 } | 151 } |
152 | 152 |
153 bool AbsolutePath(FilePath* path) { | 153 bool AbsolutePath(FilePath* path) { |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 kFileSystemRoot, path, kRootUid, allowed_group_ids); | 1091 kFileSystemRoot, path, kRootUid, allowed_group_ids); |
1092 } | 1092 } |
1093 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 1093 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
1094 | 1094 |
1095 int GetMaximumPathComponentLength(const FilePath& path) { | 1095 int GetMaximumPathComponentLength(const FilePath& path) { |
1096 base::ThreadRestrictions::AssertIOAllowed(); | 1096 base::ThreadRestrictions::AssertIOAllowed(); |
1097 return pathconf(path.value().c_str(), _PC_NAME_MAX); | 1097 return pathconf(path.value().c_str(), _PC_NAME_MAX); |
1098 } | 1098 } |
1099 | 1099 |
1100 } // namespace file_util | 1100 } // namespace file_util |
OLD | NEW |