| Index: third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| index 058f5aaaeff93b743b7214770d2e37e350a9600f..578582d2f2c8dc51e47ac5b7bc90bed7cb29a22b 100644
|
| --- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| @@ -433,6 +433,7 @@ bool SourceListDirective::parseScheme(const UChar* begin,
|
| // / "*"
|
| // host-char = ALPHA / DIGIT / "-"
|
| //
|
| +// static
|
| bool SourceListDirective::parseHost(
|
| const UChar* begin,
|
| const UChar* end,
|
| @@ -447,29 +448,34 @@ bool SourceListDirective::parseHost(
|
|
|
| const UChar* position = begin;
|
|
|
| + // Parse "*" or [ "*." ].
|
| if (skipExactly<UChar>(position, end, '*')) {
|
| hostWildcard = CSPSource::HasWildcard;
|
|
|
| - if (position == end)
|
| + if (position == end) {
|
| + // "*"
|
| return true;
|
| + }
|
|
|
| if (!skipExactly<UChar>(position, end, '.'))
|
| return false;
|
| }
|
| -
|
| const UChar* hostBegin = position;
|
|
|
| + // Parse 1*host-hcar.
|
| + if (!skipExactly<UChar, isHostCharacter>(position, end))
|
| + return false;
|
| + skipWhile<UChar, isHostCharacter>(position, end);
|
| +
|
| + // Parse *( "." 1*host-char ).
|
| while (position < end) {
|
| + if (!skipExactly<UChar>(position, end, '.'))
|
| + return false;
|
| if (!skipExactly<UChar, isHostCharacter>(position, end))
|
| return false;
|
| -
|
| skipWhile<UChar, isHostCharacter>(position, end);
|
| -
|
| - if (position < end && !skipExactly<UChar>(position, end, '.'))
|
| - return false;
|
| }
|
|
|
| - DCHECK(position == end);
|
| host = String(hostBegin, end - hostBegin);
|
| return true;
|
| }
|
|
|