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

Unified Diff: net/base/filter.cc

Issue 3018011: POSIX: treat multiple extensions like .tar.gz as a single extension. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: more review comments Created 10 years, 5 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 | « chrome/browser/download/download_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/filter.cc
diff --git a/net/base/filter.cc b/net/base/filter.cc
index c72e00ec57a8612016925bb7d4dfc66a6c7ddf66..5e47ecbe5b4a9eff01936e2769c3400b00dc81df 100644
--- a/net/base/filter.cc
+++ b/net/base/filter.cc
@@ -108,17 +108,17 @@ void Filter::FixupEncodingTypes(
// When viewing a .svgz file, we need to uncompress it, but we don't
// want to do that when downloading.
// See Firefox's nonDecodableExtensions in nsExternalHelperAppService.cpp
- if (FILE_PATH_LITERAL(".gz" == extension) ||
- FILE_PATH_LITERAL(".tgz" == extension) ||
- FILE_PATH_LITERAL(".svgz") == extension)
+ if (EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) ||
+ LowerCaseEqualsASCII(extension, ".tgz") ||
+ LowerCaseEqualsASCII(extension, ".svgz"))
encoding_types->clear();
} else {
// When the user does not explicitly ask to download a file, if we get a
// supported mime type, then we attempt to decompress in order to view it.
// However, if it's not a supported mime type, then we will attempt to
// download it, and in that case, don't decompress .gz/.tgz files.
- if ((FILE_PATH_LITERAL(".gz" == extension) ||
- FILE_PATH_LITERAL(".tgz") == extension) &&
+ if ((EndsWith(extension, FILE_PATH_LITERAL(".gz"), false) ||
+ LowerCaseEqualsASCII(extension, ".tgz")) &&
!net::IsSupportedMimeType(mime_type))
encoding_types->clear();
}
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698