| 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 "core/frame/SubresourceIntegrity.h" | 5 #include "core/frame/SubresourceIntegrity.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/fetch/Resource.h" | 10 #include "core/fetch/Resource.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 position = begin; | 280 position = begin; |
| 281 return AlgorithmUnparsable; | 281 return AlgorithmUnparsable; |
| 282 } | 282 } |
| 283 | 283 |
| 284 // Before: | 284 // Before: |
| 285 // | 285 // |
| 286 // [algorithm]-[hash] OR [algorithm]-[hash]?[options] | 286 // [algorithm]-[hash] OR [algorithm]-[hash]?[options] |
| 287 // ^ ^ ^ ^ | 287 // ^ ^ ^ ^ |
| 288 // position end position end | 288 // position end position end |
| 289 // | 289 // |
| 290 // After (if successful: if the method returns false, we make no promises and th
e caller should exit early): | 290 // After (if successful: if the method returns false, we make no promises and |
| 291 // the caller should exit early): |
| 291 // | 292 // |
| 292 // [algorithm]-[hash] OR [algorithm]-[hash]?[options] | 293 // [algorithm]-[hash] OR [algorithm]-[hash]?[options] |
| 293 // ^ ^ ^ | 294 // ^ ^ ^ |
| 294 // position/end position end | 295 // position/end position end |
| 295 bool SubresourceIntegrity::parseDigest(const UChar*& position, | 296 bool SubresourceIntegrity::parseDigest(const UChar*& position, |
| 296 const UChar* end, | 297 const UChar* end, |
| 297 String& digest) { | 298 String& digest) { |
| 298 const UChar* begin = position; | 299 const UChar* begin = position; |
| 299 skipWhile<UChar, isIntegrityCharacter>(position, end); | 300 skipWhile<UChar, isIntegrityCharacter>(position, end); |
| 300 | 301 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 metadataSet.add(integrityMetadata.toPair()); | 411 metadataSet.add(integrityMetadata.toPair()); |
| 411 } | 412 } |
| 412 | 413 |
| 413 if (metadataSet.size() == 0 && error) | 414 if (metadataSet.size() == 0 && error) |
| 414 return IntegrityParseNoValidResult; | 415 return IntegrityParseNoValidResult; |
| 415 | 416 |
| 416 return IntegrityParseValidResult; | 417 return IntegrityParseValidResult; |
| 417 } | 418 } |
| 418 | 419 |
| 419 } // namespace blink | 420 } // namespace blink |
| OLD | NEW |