| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "core/fetch/IntegrityMetadata.h" | |
| 6 | |
| 7 namespace blink { | |
| 8 | |
| 9 IntegrityMetadata::IntegrityMetadata(WTF::String digest, | |
| 10 HashAlgorithm algorithm) | |
| 11 : m_digest(digest), m_algorithm(algorithm) {} | |
| 12 | |
| 13 IntegrityMetadata::IntegrityMetadata(std::pair<WTF::String, HashAlgorithm> pair) | |
| 14 : m_digest(pair.first), m_algorithm(pair.second) {} | |
| 15 | |
| 16 std::pair<WTF::String, HashAlgorithm> IntegrityMetadata::toPair() const { | |
| 17 return std::pair<WTF::String, HashAlgorithm>(m_digest, m_algorithm); | |
| 18 } | |
| 19 | |
| 20 bool IntegrityMetadata::setsEqual(const IntegrityMetadataSet& set1, | |
| 21 const IntegrityMetadataSet& set2) { | |
| 22 if (set1.size() != set2.size()) | |
| 23 return false; | |
| 24 | |
| 25 for (const IntegrityMetadataPair& metadata : set1) { | |
| 26 if (!set2.contains(metadata)) | |
| 27 return false; | |
| 28 } | |
| 29 | |
| 30 return true; | |
| 31 } | |
| 32 | |
| 33 } // namespace blink | |
| OLD | NEW |