Title: [206924] trunk/Source/WebCore
Revision
206924
Author
[email protected]
Date
2016-10-07 12:03:13 -0700 (Fri, 07 Oct 2016)

Log Message

Disable URLParser logs by default in all builds
https://bugs.webkit.org/show_bug.cgi?id=163135

Reviewed by Brady Eidson.

In debug builds with the URLParser enabled, some tests time out because
parameters to generate log strings are being evaluated for each character of each URL
and then not being used if URLParser logs are disabled.  Generating these unused parameters
is too slow even for debug builds.  Let's only generate them if they are to be used.

No change in behaviour.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206923 => 206924)


--- trunk/Source/WebCore/ChangeLog	2016-10-07 18:55:43 UTC (rev 206923)
+++ trunk/Source/WebCore/ChangeLog	2016-10-07 19:03:13 UTC (rev 206924)
@@ -1,3 +1,21 @@
+2016-10-07  Alex Christensen  <[email protected]>
+
+        Disable URLParser logs by default in all builds
+        https://bugs.webkit.org/show_bug.cgi?id=163135
+
+        Reviewed by Brady Eidson.
+
+        In debug builds with the URLParser enabled, some tests time out because
+        parameters to generate log strings are being evaluated for each character of each URL
+        and then not being used if URLParser logs are disabled.  Generating these unused parameters
+        is too slow even for debug builds.  Let's only generate them if they are to be used.
+
+        No change in behaviour.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::parse):
+        (WebCore::URLParser::allValuesEqual):
+
 2016-10-07  Andreas Kling  <[email protected]>
 
         [WK2] didRemoveFrameFromHierarchy callback doesn't fire for subframes when evicting from PageCache.

Modified: trunk/Source/WebCore/platform/URLParser.cpp (206923 => 206924)


--- trunk/Source/WebCore/platform/URLParser.cpp	2016-10-07 18:55:43 UTC (rev 206923)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2016-10-07 19:03:13 UTC (rev 206924)
@@ -33,6 +33,14 @@
 
 namespace WebCore {
 
+#define URL_PARSER_DEBUGGING 0
+    
+#if URL_PARSER_DEBUGGING
+#define URL_PARSER_LOG(...) LOG(URLParser, __VA_ARGS__)
+#else
+#define URL_PARSER_LOG(...)
+#endif
+    
 template<typename CharacterType>
 class CodePointIterator {
 public:
@@ -1150,7 +1158,7 @@
 template<typename CharacterType>
 void URLParser::parse(const CharacterType* input, const unsigned length, const URL& base, const TextEncoding& encoding)
 {
-    LOG(URLParser, "Parsing URL <%s> base <%s> encoding <%s>", String(input, length).utf8().data(), base.string().utf8().data(), encoding.name());
+    URL_PARSER_LOG("Parsing URL <%s> base <%s> encoding <%s>", String(input, length).utf8().data(), base.string().utf8().data(), encoding.name());
     m_url = { };
     ASSERT(m_asciiBuffer.isEmpty());
     ASSERT(m_unicodeFragmentBuffer.isEmpty());
@@ -1195,8 +1203,8 @@
         Fragment,
     };
 
-#define LOG_STATE(x) LOG(URLParser, "State %s, code point %c, parsed data <%s> size %zu", x, *c, parsedDataView(0, currentPosition(c)).utf8().data(), currentPosition(c))
-#define LOG_FINAL_STATE(x) LOG(URLParser, "Final State: %s", x)
+#define LOG_STATE(x) URL_PARSER_LOG("State %s, code point %c, parsed data <%s> size %zu", x, *c, parsedDataView(0, currentPosition(c)).utf8().data(), currentPosition(c))
+#define LOG_FINAL_STATE(x) URL_PARSER_LOG("Final State: %s", x)
 
     State state = State::SchemeStart;
     while (!c.atEnd()) {
@@ -1443,7 +1451,7 @@
                     auto lastAt = c;
                     auto findLastAt = c;
                     while (!findLastAt.atEnd()) {
-                        LOG(URLParser, "Finding last @: %c", *findLastAt);
+                        URL_PARSER_LOG("Finding last @: %c", *findLastAt);
                         if (*findLastAt == '@')
                             lastAt = findLastAt;
                         bool isSlash = *findLastAt == '/' || (m_urlIsSpecial && *findLastAt == '\\');
@@ -1805,7 +1813,7 @@
             break;
         case State::Fragment:
             do {
-                LOG(URLParser, "State Fragment");
+                URL_PARSER_LOG("State Fragment");
                 if (!m_didSeeUnicodeFragmentCodePoint && isASCII(*c))
                     appendToASCIIBuffer(*c);
                 else {
@@ -2049,7 +2057,7 @@
         m_url.m_string = String::adopt(WTFMove(buffer));
     }
     m_url.m_isValid = true;
-    LOG(URLParser, "Parsed URL <%s>", m_url.m_string.utf8().data());
+    URL_PARSER_LOG("Parsed URL <%s>", m_url.m_string.utf8().data());
 }
 
 template<typename CharacterType>
@@ -2779,7 +2787,7 @@
 {
     // FIXME: m_cannotBeABaseURL is not compared because the old URL::parse did not use it,
     // but once we get rid of URL::parse its value should be tested.
-    LOG(URLParser, "%d %d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %d %s",
+    URL_PARSER_LOG("%d %d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %d %s",
         a.m_isValid,
         a.m_protocolIsInHTTPFamily,
         a.m_schemeEnd,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to