Changeset 170511 in webkit


Ignore:
Timestamp:
Jun 26, 2014 5:27:05 PM (10 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

Rearrange conditions to find invalid protocol in NavigatorContentUtils::verifyProtocolHandlerScheme()
https://bugs.webkit.org/show_bug.cgi?id=134289

Reviewed by Darin Adler.

If we do early return when there is invalid protocol, we're able to avoid unnecessary call flow.

No new tests, covered by existing tests.

  • Modules/navigatorcontentutils/NavigatorContentUtils.cpp:

(WebCore::verifyProtocolHandlerScheme):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r170506 r170511  
     12014-06-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Rearrange conditions to find invalid protocol in NavigatorContentUtils::verifyProtocolHandlerScheme()
     4        https://bugs.webkit.org/show_bug.cgi?id=134289
     5
     6        Reviewed by Darin Adler.
     7
     8        If we do early return when there is invalid protocol, we're able to avoid unnecessary call flow.
     9
     10        No new tests, covered by existing tests.
     11
     12        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
     13        (WebCore::verifyProtocolHandlerScheme):
     14
    1152014-06-26  Benjamin Poulain  <bpoulain@apple.com>
    216
  • trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp

    r169670 r170511  
    104104static bool verifyProtocolHandlerScheme(const String& scheme, ExceptionCode& ec)
    105105{
     106    if (isProtocolWhitelisted(scheme))
     107        return true;
     108
    106109    if (scheme.startsWith("web+")) {
    107110        // The specification requires that the length of scheme is at least five characters (including 'web+' prefix).
    108111        if (scheme.length() >= 5 && isValidProtocol(scheme))
    109112            return true;
    110         ec = SECURITY_ERR;
    111         return false;
    112     }
    113 
    114     if (isProtocolWhitelisted(scheme))
    115         return true;
     113    }
    116114
    117115    ec = SECURITY_ERR;
Note: See TracChangeset for help on using the changeset viewer.