| 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/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 "'sha384', or 'sha512', followed by a '-' " | 374 "'sha384', or 'sha512', followed by a '-' " |
| 375 "character.", | 375 "character.", |
| 376 *execution_context); | 376 *execution_context); |
| 377 UseCounter::Count( | 377 UseCounter::Count( |
| 378 execution_context, | 378 execution_context, |
| 379 UseCounter::kSRIElementWithUnparsableIntegrityAttribute); | 379 UseCounter::kSRIElementWithUnparsableIntegrityAttribute); |
| 380 } | 380 } |
| 381 continue; | 381 continue; |
| 382 } | 382 } |
| 383 | 383 |
| 384 ASSERT(parse_result == kAlgorithmValid); | 384 DCHECK_EQ(parse_result, kAlgorithmValid); |
| 385 | 385 |
| 386 if (!ParseDigest(position, current_integrity_end, digest)) { | 386 if (!ParseDigest(position, current_integrity_end, digest)) { |
| 387 error = true; | 387 error = true; |
| 388 skipUntil<UChar, IsASCIISpace>(position, end); | 388 skipUntil<UChar, IsASCIISpace>(position, end); |
| 389 if (execution_context) { | 389 if (execution_context) { |
| 390 LogErrorToConsole( | 390 LogErrorToConsole( |
| 391 "Error parsing 'integrity' attribute ('" + attribute + | 391 "Error parsing 'integrity' attribute ('" + attribute + |
| 392 "'). The digest must be a valid, base64-encoded value.", | 392 "'). The digest must be a valid, base64-encoded value.", |
| 393 *execution_context); | 393 *execution_context); |
| 394 UseCounter::Count( | 394 UseCounter::Count( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 417 metadata_set.insert(integrity_metadata.ToPair()); | 417 metadata_set.insert(integrity_metadata.ToPair()); |
| 418 } | 418 } |
| 419 | 419 |
| 420 if (metadata_set.size() == 0 && error) | 420 if (metadata_set.size() == 0 && error) |
| 421 return kIntegrityParseNoValidResult; | 421 return kIntegrityParseNoValidResult; |
| 422 | 422 |
| 423 return kIntegrityParseValidResult; | 423 return kIntegrityParseValidResult; |
| 424 } | 424 } |
| 425 | 425 |
| 426 } // namespace blink | 426 } // namespace blink |
| OLD | NEW |