Title: [186715] trunk/Source/WebCore
Revision
186715
Author
[email protected]
Date
2015-07-11 13:35:45 -0700 (Sat, 11 Jul 2015)

Log Message

Fix CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
https://bugs.webkit.org/show_bug.cgi?id=146879

Reviewed by Andreas Kling.

Some of my recent changes broke CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING :(

* contentextensions/CombinedURLFilters.cpp:
(WebCore::ContentExtensions::prefixTreeVertexToString):
(WebCore::ContentExtensions::recursivePrint):
(WebCore::ContentExtensions::CombinedURLFilters::print):
* contentextensions/ContentExtensionsDebugging.h:
* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::DFA::debugPrintDot):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (186714 => 186715)


--- trunk/Source/WebCore/ChangeLog	2015-07-11 20:15:39 UTC (rev 186714)
+++ trunk/Source/WebCore/ChangeLog	2015-07-11 20:35:45 UTC (rev 186715)
@@ -1,3 +1,20 @@
+2015-07-11  Benjamin Poulain  <[email protected]>
+
+        Fix CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
+        https://bugs.webkit.org/show_bug.cgi?id=146879
+
+        Reviewed by Andreas Kling.
+
+        Some of my recent changes broke CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING :(
+
+        * contentextensions/CombinedURLFilters.cpp:
+        (WebCore::ContentExtensions::prefixTreeVertexToString):
+        (WebCore::ContentExtensions::recursivePrint):
+        (WebCore::ContentExtensions::CombinedURLFilters::print):
+        * contentextensions/ContentExtensionsDebugging.h:
+        * contentextensions/DFA.cpp:
+        (WebCore::ContentExtensions::DFA::debugPrintDot):
+
 2015-07-10  Simon Fraser  <[email protected]>
 
         [iOS WK2] Scrolling issues on horizontally scrollable RTL pages

Modified: trunk/Source/WebCore/contentextensions/CombinedURLFilters.cpp (186714 => 186715)


--- trunk/Source/WebCore/contentextensions/CombinedURLFilters.cpp	2015-07-11 20:15:39 UTC (rev 186714)
+++ trunk/Source/WebCore/contentextensions/CombinedURLFilters.cpp	2015-07-11 20:35:45 UTC (rev 186715)
@@ -78,16 +78,16 @@
 #endif
     
 #if CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
-static String prefixTreeVertexToString(const PrefixTreeVertex& vertex, unsigned depth)
+static String prefixTreeVertexToString(const PrefixTreeVertex& vertex, const HashMap<const PrefixTreeVertex*, ActionList>& actions, unsigned depth)
 {
     StringBuilder builder;
     while (depth--)
         builder.append("  ");
     builder.append("vertex actions: ");
 
-    auto actionsSlot = m_actions.find(&vertex);
-    if (actionsSlot != m_actions.end()) {
-        for (auto action : *actionsSlot->value) {
+    auto actionsSlot = actions.find(&vertex);
+    if (actionsSlot != actions.end()) {
+        for (uint64_t action : actionsSlot->value) {
             builder.appendNumber(action);
             builder.append(',');
         }
@@ -96,9 +96,9 @@
     return builder.toString();
 }
 
-static void recursivePrint(const PrefixTreeVertex& vertex, unsigned depth)
+static void recursivePrint(const PrefixTreeVertex& vertex, const HashMap<const PrefixTreeVertex*, ActionList>& actions, unsigned depth)
 {
-    dataLogF("%s", prefixTreeVertexToString(vertex, depth).utf8().data());
+    dataLogF("%s", prefixTreeVertexToString(vertex, actions, depth).utf8().data());
     for (const auto& edge : vertex.edges) {
         StringBuilder builder;
         for (unsigned i = 0; i < depth * 2; ++i)
@@ -108,13 +108,13 @@
         builder.append('\n');
         dataLogF("%s", builder.toString().utf8().data());
         ASSERT(edge.child);
-        recursivePrint(*edge.child.get(), depth + 1);
+        recursivePrint(*edge.child.get(), actions, depth + 1);
     }
 }
 
 void CombinedURLFilters::print() const
 {
-    recursivePrint(*m_prefixTreeRoot.get(), 0);
+    recursivePrint(*m_prefixTreeRoot.get(), m_actions, 0);
 }
 #endif
 

Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsDebugging.h (186714 => 186715)


--- trunk/Source/WebCore/contentextensions/ContentExtensionsDebugging.h	2015-07-11 20:15:39 UTC (rev 186714)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsDebugging.h	2015-07-11 20:35:45 UTC (rev 186715)
@@ -38,7 +38,7 @@
 #define CONTENT_EXTENSIONS_PAGE_SIZE 16384
 
 #if CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
-typedef CrashOnOverflow ContentExtensionsOverflowHandler;
+typedef WTF::CrashOnOverflow ContentExtensionsOverflowHandler;
 #else
 typedef UnsafeVectorOverflow ContentExtensionsOverflowHandler;
 #endif

Modified: trunk/Source/WebCore/contentextensions/DFA.cpp (186714 => 186715)


--- trunk/Source/WebCore/contentextensions/DFA.cpp	2015-07-11 20:15:39 UTC (rev 186714)
+++ trunk/Source/WebCore/contentextensions/DFA.cpp	2015-07-11 20:35:45 UTC (rev 186715)
@@ -147,6 +147,7 @@
                 dataLogF("%llu", actions[actionIndex]);
             }
         }
+        dataLogF("]");
 
         if (!actions.isEmpty())
             dataLogF(" [shape=doublecircle]");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to