Chromium Code Reviews| Index: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| diff --git a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| index 42cb15491abe7a347e9791b167daa21ecb74de20..2c42b51c1d3e04ff9f7cddf9a9bd8e9f71ada56a 100644 |
| --- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| +++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| @@ -34,6 +34,7 @@ |
| #include "core/frame/Navigator.h" |
| #include "core/page/Page.h" |
| #include "wtf/HashSet.h" |
| +#include "wtf/text/StringBuilder.h" |
| namespace WebCore { |
| @@ -97,7 +98,18 @@ static bool isProtocolWhitelisted(const String& scheme) |
| { |
| if (!protocolWhitelist) |
| initProtocolHandlerWhitelist(); |
| - return protocolWhitelist->contains(scheme); |
| + |
| + StringBuilder builder; |
| + unsigned length = scheme.length(); |
| + for (unsigned i = 0; i < length; ++i) { |
| + UChar character = scheme[i]; |
| + if (isASCIIUpper(character)) |
| + builder.append(toASCIILower(character)); |
| + else |
| + builder.append(character); |
|
haraken
2014/06/07 02:19:23
Do we need this branch? I guess builder.append(toA
gyuyoung-inactive
2014/06/07 06:28:51
Doesn't this operation always call toASCIILower()
haraken
2014/06/07 06:36:49
I mean, you can remove line 106 - 109 and just use
gyuyoung-inactive
2014/06/07 06:51:01
Ah...yes. we can avoid to call isASCIIUpper() when
|
| + } |
| + |
| + return protocolWhitelist->contains(builder.toString()); |
| } |
| static bool verifyProtocolHandlerScheme(const String& scheme, const String& method, ExceptionState& exceptionState) |