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

Unified Diff: components/plugins/renderer/mobile_youtube_plugin.cc

Issue 1279123004: Replace ToLower calls to the new format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « components/os_crypt/ie7_password_win.cc ('k') | components/policy/core/common/preg_parser_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/mobile_youtube_plugin.cc
diff --git a/components/plugins/renderer/mobile_youtube_plugin.cc b/components/plugins/renderer/mobile_youtube_plugin.cc
index 7b576df01c78790795018c69c16c25fe723965d1..563ec264a724424108d62fbe3f379a1950c764e5 100644
--- a/components/plugins/renderer/mobile_youtube_plugin.cc
+++ b/components/plugins/renderer/mobile_youtube_plugin.cc
@@ -49,15 +49,16 @@ bool IsValidYouTubeVideo(const std::string& path) {
if (path.length() <= len)
return false;
- std::string str = base::StringToLowerASCII(path);
// Youtube flash url can start with /v/ or /e/.
- if (strncmp(str.data(), kSlashVSlash, len) != 0 &&
- strncmp(str.data(), kSlashESlash, len) != 0)
+ if (!base::StartsWith(path, kSlashVSlash,
+ base::CompareCase::INSENSITIVE_ASCII) ||
+ !base::StartsWith(path, kSlashESlash,
+ base::CompareCase::INSENSITIVE_ASCII))
return false;
// Start after /v/
for (unsigned i = len; i < path.length(); i++) {
- char c = str[i];
+ char c = path[i];
if (isalpha(c) || isdigit(c) || c == '_' || c == '-')
continue;
// The url can have more parameters such as &hl=en after the video id.
« no previous file with comments | « components/os_crypt/ie7_password_win.cc ('k') | components/policy/core/common/preg_parser_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698