Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: net/base/filename_util.cc

Issue 869233006: [net] Cleanup filename_util and make it portable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clang-format-filename-tests
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/filename_util.h ('k') | net/base/filename_util_icu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/filename_util.cc
diff --git a/net/base/filename_util.cc b/net/base/filename_util.cc
index 6573c2261610593dd145b071f4ad24bf54082c07..6f659c9a4662fe6c1afe0f7d4f2a8004815f056a 100644
--- a/net/base/filename_util.cc
+++ b/net/base/filename_util.cc
@@ -138,26 +138,4 @@ bool FileURLToFilePath(const GURL& url, base::FilePath* file_path) {
return !file_path_str.empty();
}
-void GenerateSafeFileName(const std::string& mime_type,
- bool ignore_extension,
- base::FilePath* file_path) {
- // Make sure we get the right file extension
- EnsureSafeExtension(mime_type, ignore_extension, file_path);
-
-#if defined(OS_WIN)
- // Prepend "_" to the file name if it's a reserved name
- base::FilePath::StringType leaf_name = file_path->BaseName().value();
- DCHECK(!leaf_name.empty());
- if (IsReservedName(leaf_name)) {
- leaf_name = base::FilePath::StringType(FILE_PATH_LITERAL("_")) + leaf_name;
- *file_path = file_path->DirName();
- if (file_path->value() == base::FilePath::kCurrentDirectory) {
- *file_path = base::FilePath(leaf_name);
- } else {
- *file_path = file_path->Append(leaf_name);
- }
- }
-#endif
-}
-
} // namespace net
« no previous file with comments | « net/base/filename_util.h ('k') | net/base/filename_util_icu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698