| 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/csp/MediaListDirective.h" | 5 #include "core/frame/csp/MediaListDirective.h" |
| 6 | 6 |
| 7 #include "core/frame/csp/ContentSecurityPolicy.h" | 7 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 8 #include "platform/network/ContentSecurityPolicyParsers.h" | 8 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 9 #include "platform/wtf/HashSet.h" | 9 #include "platform/wtf/HashSet.h" |
| 10 #include "platform/wtf/text/ParsingUtilities.h" | 10 #include "platform/wtf/text/ParsingUtilities.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // mime1/mime1 mime2/mime2 OR mime1/mime1 OR mime1/mime1/error | 73 // mime1/mime1 mime2/mime2 OR mime1/mime1 OR mime1/mime1/error |
| 74 // ^ ^ ^ | 74 // ^ ^ ^ |
| 75 if (position < end && IsNotASCIISpace(*position)) { | 75 if (position < end && IsNotASCIISpace(*position)) { |
| 76 skipWhile<UChar, IsNotASCIISpace>(position, end); | 76 skipWhile<UChar, IsNotASCIISpace>(position, end); |
| 77 Policy()->ReportInvalidPluginTypes(String(begin, position - begin)); | 77 Policy()->ReportInvalidPluginTypes(String(begin, position - begin)); |
| 78 continue; | 78 continue; |
| 79 } | 79 } |
| 80 plugin_types_.insert(String(begin, position - begin)); | 80 plugin_types_.insert(String(begin, position - begin)); |
| 81 | 81 |
| 82 ASSERT(position == end || IsASCIISpace(*position)); | 82 DCHECK(position == end || IsASCIISpace(*position)); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool MediaListDirective::Subsumes( | 86 bool MediaListDirective::Subsumes( |
| 87 const HeapVector<Member<MediaListDirective>>& other) const { | 87 const HeapVector<Member<MediaListDirective>>& other) const { |
| 88 if (!other.size()) | 88 if (!other.size()) |
| 89 return false; | 89 return false; |
| 90 | 90 |
| 91 // Find the effective set of plugins allowed by `other`. | 91 // Find the effective set of plugins allowed by `other`. |
| 92 HashSet<String> normalized_b = other[0]->plugin_types_; | 92 HashSet<String> normalized_b = other[0]->plugin_types_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 111 HashSet<String> normalized; | 111 HashSet<String> normalized; |
| 112 for (const auto& type : plugin_types_) { | 112 for (const auto& type : plugin_types_) { |
| 113 if (other.Contains(type)) | 113 if (other.Contains(type)) |
| 114 normalized.insert(type); | 114 normalized.insert(type); |
| 115 } | 115 } |
| 116 | 116 |
| 117 return normalized; | 117 return normalized; |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |