Title: [211001] trunk/Source/WebCore
Revision
211001
Author
[email protected]
Date
2017-01-20 16:44:48 -0800 (Fri, 20 Jan 2017)

Log Message

Add debugging code to compare URLParser with URL::parse
https://bugs.webkit.org/show_bug.cgi?id=167267

Reviewed by Brady Eidson.

* platform/URLParser.cpp:
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (211000 => 211001)


--- trunk/Source/WebCore/ChangeLog	2017-01-21 00:35:51 UTC (rev 211000)
+++ trunk/Source/WebCore/ChangeLog	2017-01-21 00:44:48 UTC (rev 211001)
@@ -1,3 +1,14 @@
+2017-01-20  Alex Christensen  <[email protected]>
+
+        Add debugging code to compare URLParser with URL::parse
+        https://bugs.webkit.org/show_bug.cgi?id=167267
+
+        Reviewed by Brady Eidson.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::URLParser):
+        (WebCore::URLParser::parse):
+
 2017-01-20  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r210778.

Modified: trunk/Source/WebCore/platform/URLParser.cpp (211000 => 211001)


--- trunk/Source/WebCore/platform/URLParser.cpp	2017-01-21 00:35:51 UTC (rev 211000)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2017-01-21 00:44:48 UTC (rev 211001)
@@ -36,7 +36,8 @@
 namespace WebCore {
 
 #define URL_PARSER_DEBUGGING 0
-    
+#define COMPARE_URLPARSERS 0
+
 #if URL_PARSER_DEBUGGING
 #define URL_PARSER_LOG(...) LOG(URLParser, __VA_ARGS__)
 #else
@@ -1116,6 +1117,17 @@
             ASSERT(allValuesEqual(parser.result(), m_url));
     }
 #endif
+
+#if COMPARE_URLPARSERS
+    ASSERT(URLParser::enabled());
+    URLParser::setEnabled(false);
+    URL parsedWithOldParser = URL(base, input, encoding);
+    if (parsedWithOldParser != m_url)
+        WTFLogAlways("URLParser Differs: Input <%s> Base <%s> Encoding <%s>", input.utf8().data(), base.string().utf8().data(), encoding.name());
+    else
+        WTFLogAlways("URLParser Same: Input <%s> Base <%s> Encoding <%s>", input.utf8().data(), base.string().utf8().data(), encoding.name());
+    URLParser::setEnabled(true);
+#endif
 }
 
 template<typename CharacterType>
@@ -1833,7 +1845,6 @@
         LOG_FINAL_STATE("SpecialAuthorityIgnoreSlashes");
         failure();
         return;
-        break;
     case State::AuthorityOrHost:
         LOG_FINAL_STATE("AuthorityOrHost");
         m_url.m_userEnd = currentPosition(authorityOrHostBegin);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to