Chromium Code Reviews| Index: Source/core/frame/SubresourceIntegrity.h |
| diff --git a/Source/core/frame/SubresourceIntegrity.h b/Source/core/frame/SubresourceIntegrity.h |
| index 6fdf17f710bd508b859e721140a8709bc3d6e6f6..d81363ec729f37202f01586963c3188bd2926f1d 100644 |
| --- a/Source/core/frame/SubresourceIntegrity.h |
| +++ b/Source/core/frame/SubresourceIntegrity.h |
| @@ -34,6 +34,7 @@ private: |
| friend class SubresourceIntegrityTest; |
| friend class SubresourceIntegrityTest_Parsing_Test; |
| friend class SubresourceIntegrityTest_ParseAlgorithm_Test; |
| + friend class SubresourceIntegrityTest_Prioritization_Test; |
| enum AlgorithmParseResult { |
| AlgorithmValid, |
| @@ -41,11 +42,18 @@ private: |
| AlgorithmUnknown |
| }; |
| + enum PrioritizationResult { |
| + SameStrength, |
| + FirstAlgorithmIsStronger, |
| + SecondAlgorithmIsStronger |
| + }; |
| + |
| struct IntegrityMetadata { |
| WTF::String digest; |
| HashAlgorithm algorithm; |
| }; |
| + static PrioritizationResult getPrioritizedHashFunction(HashAlgorithm, HashAlgorithm); |
|
Mike West
2015/06/03 09:13:33
Why not return the stronger `HashAlgorithm`? The "
jww
2015/06/03 19:26:56
See other comments for details, but I've changed i
|
| static AlgorithmParseResult parseAlgorithm(const UChar*& begin, const UChar* end, HashAlgorithm&); |
| static bool parseDigest(const UChar*& begin, const UChar* end, String& digest); |