Fix build error with !LOG_DISABLED
authorcturner@igalia.com <cturner@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Feb 2018 13:07:41 +0000 (13:07 +0000)
committercturner@igalia.com <cturner@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Feb 2018 13:07:41 +0000 (13:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183049

Reviewed by Philippe Normand.

The following error message was being reported when doing a
release build with -DLOG_DISABLED=0:

../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229004 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/messageports/MessagePortChannel.h

index 94e8363..b187406 100644 (file)
@@ -1,3 +1,23 @@
+2018-02-26  Charlie Turner  <cturner@igalia.com>
+
+        Fix build error with !LOG_DISABLED
+        https://bugs.webkit.org/show_bug.cgi?id=183049
+
+        Reviewed by Philippe Normand.
+
+        The following error message was being reported when doing a
+        release build with -DLOG_DISABLED=0:
+
+        ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’:
+../../Source/WebCore/dom/messageports/MessagePortChannel.cpp:85:111: error: ‘logString’ was not declared in this scope
+     LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
+
+        Other uses of logString are guarded by !LOG_DISABLED rather than
+        NDEBUG, which was the cause of this issue.
+
+        * dom/messageports/MessagePortChannel.h: Guard using !LOG_DISABLED
+        rather than NDEBUG.
+
 2018-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GStreamer] User current executable name instead of g_get_prgname() for gst_init
index 9c78325..8822434 100644 (file)
@@ -60,7 +60,7 @@ public:
 
     uint64_t beingTransferredCount();
 
-#ifndef NDEBUG
+#if !LOG_DISABLED
     String logString() const { return makeString(m_ports[0].logString(), ":", m_ports[1].logString()); }
 #endif