| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/frame/csp/CSPSourceList.h" | 6 #include "core/frame/csp/CSPSourceList.h" |
| 7 | 7 |
| 8 #include "core/frame/csp/CSPSource.h" | 8 #include "core/frame/csp/CSPSource.h" |
| 9 #include "core/frame/csp/ContentSecurityPolicy.h" | 9 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 10 #include "platform/ParsingUtilities.h" | 10 #include "platform/ParsingUtilities.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 if (position[1] == '/') { | 206 if (position[1] == '/') { |
| 207 // scheme://host || scheme:// | 207 // scheme://host || scheme:// |
| 208 // ^ ^ | 208 // ^ ^ |
| 209 if (!parseScheme(begin, position, scheme) | 209 if (!parseScheme(begin, position, scheme) |
| 210 || !skipExactly<UChar>(position, end, ':') | 210 || !skipExactly<UChar>(position, end, ':') |
| 211 || !skipExactly<UChar>(position, end, '/') | 211 || !skipExactly<UChar>(position, end, '/') |
| 212 || !skipExactly<UChar>(position, end, '/')) | 212 || !skipExactly<UChar>(position, end, '/')) |
| 213 return false; | 213 return false; |
| 214 if (position == end) | 214 if (position == end) |
| 215 return true; | 215 return false; |
| 216 beginHost = position; | 216 beginHost = position; |
| 217 skipWhile<UChar, isNotColonOrSlash>(position, end); | 217 skipWhile<UChar, isNotColonOrSlash>(position, end); |
| 218 } | 218 } |
| 219 | 219 |
| 220 if (position < end && *position == ':') { | 220 if (position < end && *position == ':') { |
| 221 // host:port || scheme://host:port | 221 // host:port || scheme://host:port |
| 222 // ^ ^ | 222 // ^ ^ |
| 223 beginPort = position; | 223 beginPort = position; |
| 224 skipUntil<UChar>(position, end, '/'); | 224 skipUntil<UChar>(position, end, '/'); |
| 225 } | 225 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 } | 476 } |
| 477 | 477 |
| 478 void CSPSourceList::addSourceHash(const ContentSecurityPolicyHashAlgorithm& algo
rithm, const DigestValue& hash) | 478 void CSPSourceList::addSourceHash(const ContentSecurityPolicyHashAlgorithm& algo
rithm, const DigestValue& hash) |
| 479 { | 479 { |
| 480 m_hashes.add(CSPHashValue(algorithm, hash)); | 480 m_hashes.add(CSPHashValue(algorithm, hash)); |
| 481 m_hashAlgorithmsUsed |= algorithm; | 481 m_hashAlgorithmsUsed |= algorithm; |
| 482 } | 482 } |
| 483 | 483 |
| 484 | 484 |
| 485 } // namespace blink | 485 } // namespace blink |
| OLD | NEW |