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

Unified Diff: content/common/plugin_list_mac.mm

Issue 1220653002: Fix some case-insensitive cases for StartsWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt's review comments, Mac fix Created 5 years, 6 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 | « content/browser/loader/resource_dispatcher_host_browsertest.cc ('k') | extensions/common/extension_urls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/plugin_list_mac.mm
diff --git a/content/common/plugin_list_mac.mm b/content/common/plugin_list_mac.mm
index d32f1713eaf7a6d03be222a8dc298fa907870691..b3d726c0d70b94b0ba3dfd2d9ac45262b42d8f71 100644
--- a/content/common/plugin_list_mac.mm
+++ b/content/common/plugin_list_mac.mm
@@ -47,20 +47,22 @@ bool IsBlacklistedPlugin(const WebPluginInfo& info) {
// its name. Be careful about adding any more plugins to this list though,
// since it's easy to accidentally blacklist plugins that support lots of
// MIME types.
- for (std::vector<WebPluginMimeType>::const_iterator i =
- info.mime_types.begin(); i != info.mime_types.end(); ++i) {
+ for (const WebPluginMimeType& mime : info.mime_types) {
// The Gears plugin is Safari-specific, so don't load it.
- if (i->mime_type == "application/x-googlegears")
+ if (mime.mime_type == "application/x-googlegears")
return true;
}
// Versions of Flip4Mac 2.3 before 2.3.6 often hang the renderer, so don't
// load them.
- if (base::StartsWith(info.name, base::ASCIIToUTF16("Flip4Mac Windows Media"),
- false) &&
- base::StartsWith(info.version, base::ASCIIToUTF16("2.3"), false)) {
- std::vector<base::string16> components;
- base::SplitString(info.version, '.', &components);
+ if (base::StartsWith(info.name,
+ base::ASCIIToUTF16("Flip4Mac Windows Media"),
+ base::CompareCase::INSENSITIVE_ASCII) &&
+ base::StartsWith(info.version, base::ASCIIToUTF16("2.3"),
+ base::CompareCase::SENSITIVE)) {
+ std::vector<base::StringPiece16> components = base::SplitStringPiece(
+ info.version, base::ASCIIToUTF16("."), base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
int bugfix_version = 0;
return (components.size() >= 3 &&
base::StringToInt(components[2], &bugfix_version) &&
@@ -144,8 +146,8 @@ bool ReadPlistPluginInfo(const base::FilePath& filename, CFBundleRef bundle,
// Remove PDF from the list of types handled by QuickTime, since it provides
// a worse experience than just downloading the PDF.
if (mime.mime_type == "application/pdf" &&
- base::StartsWithASCII(filename.BaseName().value(), "QuickTime",
- false)) {
+ base::StartsWith(filename.BaseName().value(), "QuickTime",
+ base::CompareCase::INSENSITIVE_ASCII)) {
continue;
}
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_browsertest.cc ('k') | extensions/common/extension_urls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698