Title: [182283] trunk/Source/WebCore
Revision
182283
Author
achristen...@apple.com
Date
2015-04-02 12:46:29 -0700 (Thu, 02 Apr 2015)

Log Message

[Content Extensions] Only add unique universal action locations.
https://bugs.webkit.org/show_bug.cgi?id=143325

Reviewed by Benjamin Poulain.

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
Use a HashSet instead of a Vector for the universal action locations to remove duplicates.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (182282 => 182283)


--- trunk/Source/WebCore/ChangeLog	2015-04-02 19:41:35 UTC (rev 182282)
+++ trunk/Source/WebCore/ChangeLog	2015-04-02 19:46:29 UTC (rev 182283)
@@ -1,3 +1,14 @@
+2015-04-02  Alex Christensen  <achristen...@webkit.org>
+
+        [Content Extensions] Only add unique universal action locations.
+        https://bugs.webkit.org/show_bug.cgi?id=143325
+
+        Reviewed by Benjamin Poulain.
+
+        * contentextensions/ContentExtensionCompiler.cpp:
+        (WebCore::ContentExtensions::compileRuleList):
+        Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
+
 2015-04-01  Roger Fong  <roger_f...@apple.com>
 
         Fix slider colors for media controls on OSX.

Modified: trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp (182282 => 182283)


--- trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp	2015-04-02 19:41:35 UTC (rev 182282)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp	2015-04-02 19:46:29 UTC (rev 182283)
@@ -133,7 +133,7 @@
 
     Vector<SerializedActionByte> actions;
     Vector<unsigned> actionLocations = serializeActions(parsedRuleList, actions);
-    Vector<uint64_t> universalActionLocations;
+    HashSet<uint64_t, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> universalActionLocations;
 
     CombinedURLFilters combinedURLFilters;
     URLFilterParser urlFilterParser(combinedURLFilters);
@@ -148,10 +148,9 @@
         URLFilterParser::ParseStatus status = urlFilterParser.addPattern(trigger.urlFilter, trigger.urlFilterIsCaseSensitive, actionLocationAndFlags);
 
         if (status == URLFilterParser::MatchesEverything) {
-
             if (ignorePreviousRulesSeen)
                 return ContentExtensionError::RegexMatchesEverythingAfterIgnorePreviousRules;
-            universalActionLocations.append(actionLocationAndFlags);
+            universalActionLocations.add(actionLocationAndFlags);
         }
 
         if (status != URLFilterParser::Ok && status != URLFilterParser::MatchesEverything) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to