Minor RemoteLayerTree logging cleanup
https://bugs.webkit.org/show_bug.cgi?id=204865

Reviewed by Tim Horton.

Have the ::description() methods return Strings like everything else does.
Use LOG_WITH_STREAM() so we don't call description() unless the log channel is on.

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::dump const):
(WebKit::RemoteLayerTreeTransaction::description const):
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::description const):
(WebKit::RemoteScrollingCoordinatorTransaction::dump const):
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index db97b71..acb814c 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -191,6 +191,27 @@
         purposes. The equals methods allow the return vectors to use
         appendIfNotContains.
 
+2019-12-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Minor RemoteLayerTree logging cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=204865
+
+        Reviewed by Tim Horton.
+
+        Have the ::description() methods return Strings like everything else does.
+        Use LOG_WITH_STREAM() so we don't call description() unless the log channel is on.
+
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::dump const):
+        (WebKit::RemoteLayerTreeTransaction::description const):
+        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+        (WebKit::RemoteScrollingCoordinatorTransaction::description const):
+        (WebKit::RemoteScrollingCoordinatorTransaction::dump const):
+        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+
 2019-12-04  Louie Livon-Bemel  <llivonbemel@apple.com>
 
         Add exclusion rule for text manipulation SPI to exclude based on element class
diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
index a0fd706..58a0535 100644
--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
@@ -193,7 +193,7 @@
     void setLayerIDsWithNewlyUnreachableBackingStore(Vector<WebCore::GraphicsLayer::PlatformLayerID>);
 
 #if !defined(NDEBUG) || !LOG_DISABLED
-    WTF::CString description() const;
+    String description() const;
     void dump() const;
 #endif
 
diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
index 0d227ff..6fc1144 100644
--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
@@ -893,10 +893,10 @@
 
 void RemoteLayerTreeTransaction::dump() const
 {
-    fprintf(stderr, "%s", description().data());
+    fprintf(stderr, "%s", description().utf8().data());
 }
 
-CString RemoteLayerTreeTransaction::description() const
+String RemoteLayerTreeTransaction::description() const
 {
     TextStream ts;
 
@@ -964,7 +964,7 @@
 
     ts.endGroup();
 
-    return ts.release().utf8();
+    return ts.release();
 }
 
 #endif // !defined(NDEBUG) || !LOG_DISABLED
diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp b/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
index e826a30..d7b1e19 100644
--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
@@ -768,7 +768,7 @@
         recursiveDumpNodes(ts, *stateTree.rootStateNode(), changedPropertiesOnly);
 }
 
-WTF::CString RemoteScrollingCoordinatorTransaction::description() const
+String RemoteScrollingCoordinatorTransaction::description() const
 {
     TextStream ts;
 
@@ -785,12 +785,12 @@
 
     ts.endGroup();
 
-    return ts.release().utf8();
+    return ts.release();
 }
 
 void RemoteScrollingCoordinatorTransaction::dump() const
 {
-    fprintf(stderr, "%s", description().data());
+    fprintf(stderr, "%s", description().utf8().data());
 }
 #endif
 
diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h b/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h
index ffafd0a..6de92e7 100644
--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h
+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h
@@ -45,7 +45,7 @@
     static bool decode(IPC::Decoder&, RemoteScrollingCoordinatorTransaction&);
 
 #if !defined(NDEBUG) || !LOG_DISABLED
-    WTF::CString description() const;
+    String description() const;
     void dump() const;
 #endif
 
diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
index b7b0469..380f124 100644
--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
@@ -192,8 +192,8 @@
 {
     TraceScope tracingScope(CommitLayerTreeStart, CommitLayerTreeEnd);
 
-    LOG(RemoteLayerTree, "%s", layerTreeTransaction.description().data());
-    LOG(RemoteLayerTree, "%s", scrollingTreeTransaction.description().data());
+    LOG_WITH_STREAM(RemoteLayerTree, stream << "RemoteLayerTreeDrawingAreaProxy::commitLayerTree transaction:" << layerTreeTransaction.description());
+    LOG_WITH_STREAM(RemoteLayerTree, stream << "RemoteLayerTreeDrawingAreaProxy::commitLayerTree scrolling tree:" << scrollingTreeTransaction.description());
 
     ASSERT(layerTreeTransaction.transactionID() == m_lastVisibleTransactionID.next());
     m_transactionIDForPendingCACommit = layerTreeTransaction.transactionID();