Chromium Code Reviews| Index: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| diff --git a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| index 9e7be6809d34fedd8bc9ff27eedcd7c969133cf2..b8d4566f9d92df208a7995b034f0ad7f3f251308 100644 |
| --- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| +++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| @@ -109,21 +109,17 @@ static bool isProtocolWhitelisted(const String& scheme) |
| static bool verifyProtocolHandlerScheme(const String& scheme, const String& method, ExceptionState& exceptionState) |
| { |
| + if (!isValidProtocol(scheme)) { |
| + exceptionState.throwDOMException(SyntaxError, "The scheme '" + scheme + "' is not valid protocol"); |
|
haraken
2014/06/23 13:47:16
Shouldn't this be a SecurityError instead of a DOM
gyuyoung-inactive
2014/06/24 05:09:56
Yes, SecurityError looks proper in this exception.
|
| + return false; |
| + } |
| + |
| if (scheme.startsWith("web+")) { |
| // The specification requires that the length of scheme is at least five characteres (including 'web+' prefix). |
| - if (scheme.length() >= 5 && isValidProtocol(scheme)) |
| + if (scheme.length() >= 5) |
| return true; |
| - if (!isValidProtocol(scheme)) |
| - exceptionState.throwSecurityError("The scheme '" + scheme + "' is not a valid protocol."); |
| - else |
| - exceptionState.throwSecurityError("The scheme '" + scheme + "' is less than five characters long."); |
| - return false; |
| - } |
| - // The specification requires that schemes don't contain colons. |
| - size_t index = scheme.find(':'); |
| - if (index != kNotFound) { |
| - exceptionState.throwDOMException(SyntaxError, "The scheme '" + scheme + "' contains colon."); |
|
haraken
2014/06/23 13:47:16
After this CL, this exception is merged with the S
gyuyoung-inactive
2014/06/24 05:09:56
Yes, I already added a test for this in r175104. I
|
| + exceptionState.throwSecurityError("The scheme '" + scheme + "' is less than five characters long."); |
| return false; |
| } |