| Index: net/base/filename_util_internal.cc
|
| diff --git a/net/base/filename_util_internal.cc b/net/base/filename_util_internal.cc
|
| index be9139dfff59b7ffdee0edf4849b25b0c8dddf0e..df1c99509154a532a12c2f037151a7208f0c3cc6 100644
|
| --- a/net/base/filename_util_internal.cc
|
| +++ b/net/base/filename_util_internal.cc
|
| @@ -70,8 +70,8 @@ std::string GetFileNameFromURL(const GURL& url,
|
| // encoding detection.
|
| base::string16 utf16_output;
|
| if (!referrer_charset.empty() &&
|
| - net::ConvertToUTF16(
|
| - unescaped_url_filename, referrer_charset.c_str(), &utf16_output)) {
|
| + net::ConvertToUTF16(unescaped_url_filename, referrer_charset.c_str(),
|
| + &utf16_output)) {
|
| decoded_filename = base::UTF16ToUTF8(utf16_output);
|
| } else {
|
| decoded_filename =
|
| @@ -135,9 +135,10 @@ bool IsReservedName(const base::FilePath::StringType& filename) {
|
| }
|
|
|
| static const char* const magic_names[] = {
|
| - // These file names are used by the "Customize folder" feature of the shell.
|
| - "desktop.ini",
|
| - "thumbs.db",
|
| + // These file names are used by the "Customize folder" feature of the
|
| + // shell.
|
| + "desktop.ini",
|
| + "thumbs.db",
|
| };
|
|
|
| for (size_t i = 0; i < arraysize(magic_names); ++i) {
|
| @@ -177,8 +178,7 @@ void EnsureSafeExtension(const std::string& mime_type,
|
| // If the existing extension is in the list of valid extensions for the
|
| // given type, use it. This avoids doing things like pointlessly renaming
|
| // "foo.jpg" to "foo.jpeg".
|
| - if (std::find(all_mime_extensions.begin(),
|
| - all_mime_extensions.end(),
|
| + if (std::find(all_mime_extensions.begin(), all_mime_extensions.end(),
|
| extension) != all_mime_extensions.end()) {
|
| // leave |extension| alone
|
| } else if (!preferred_mime_extension.empty()) {
|
| @@ -202,8 +202,8 @@ void EnsureSafeExtension(const std::string& mime_type,
|
|
|
| bool FilePathToString16(const base::FilePath& path, base::string16* converted) {
|
| #if defined(OS_WIN)
|
| - return base::WideToUTF16(
|
| - path.value().c_str(), path.value().size(), converted);
|
| + return base::WideToUTF16(path.value().c_str(), path.value().size(),
|
| + converted);
|
| #elif defined(OS_POSIX)
|
| std::string component8 = path.AsUTF8Unsafe();
|
| return !component8.empty() &&
|
| @@ -303,14 +303,9 @@ base::FilePath GenerateFileNameImpl(
|
| const std::string& mime_type,
|
| const std::string& default_file_name,
|
| ReplaceIllegalCharactersCallback replace_illegal_characters_callback) {
|
| - base::string16 file_name =
|
| - GetSuggestedFilenameImpl(url,
|
| - content_disposition,
|
| - referrer_charset,
|
| - suggested_name,
|
| - mime_type,
|
| - default_file_name,
|
| - replace_illegal_characters_callback);
|
| + base::string16 file_name = GetSuggestedFilenameImpl(
|
| + url, content_disposition, referrer_charset, suggested_name, mime_type,
|
| + default_file_name, replace_illegal_characters_callback);
|
|
|
| #if defined(OS_WIN)
|
| base::FilePath generated_name(file_name);
|
|
|