Title: [159703] trunk/Source/WebKit2
Revision
159703
Author
[email protected]
Date
2013-11-22 11:48:03 -0800 (Fri, 22 Nov 2013)

Log Message

Debug builds unconditionally dump remote layer tree transactions to stderr.

Reviewed by Sam Weinig.

* Platform/Logging.h: Declared RemoteLayerTree logging channel.
* Shared/mac/RemoteLayerTreeTransaction.h: Declared description().
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::dump): Changed to use description().
(WebKit::RemoteLayerTreeTransaction::description): Returns a CString with the description.
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::commit): Changed to use logging instead of calling dump().

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (159702 => 159703)


--- trunk/Source/WebKit2/ChangeLog	2013-11-22 19:35:07 UTC (rev 159702)
+++ trunk/Source/WebKit2/ChangeLog	2013-11-22 19:48:03 UTC (rev 159703)
@@ -1,3 +1,17 @@
+2013-11-22  Dan Bernstein  <[email protected]>
+
+        Debug builds unconditionally dump remote layer tree transactions to stderr.
+
+        Reviewed by Sam Weinig.
+
+        * Platform/Logging.h: Declared RemoteLayerTree logging channel.
+        * Shared/mac/RemoteLayerTreeTransaction.h: Declared description().
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::dump): Changed to use description().
+        (WebKit::RemoteLayerTreeTransaction::description): Returns a CString with the description.
+        * UIProcess/mac/RemoteLayerTreeHost.mm:
+        (WebKit::RemoteLayerTreeHost::commit): Changed to use logging instead of calling dump().
+
 2013-11-21  Anders Carlsson  <[email protected]>
 
         Send out the right KVO callbacks when the page title changes

Modified: trunk/Source/WebKit2/Platform/Logging.h (159702 => 159703)


--- trunk/Source/WebKit2/Platform/Logging.h	2013-11-22 19:35:07 UTC (rev 159702)
+++ trunk/Source/WebKit2/Platform/Logging.h	2013-11-22 19:48:03 UTC (rev 159703)
@@ -45,6 +45,7 @@
     M(Network) \
     M(NetworkScheduling) \
     M(Plugins) \
+    M(RemoteLayerTree) \
     M(SessionState) \
     M(StorageAPI) \
     M(TextInput) \

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (159702 => 159703)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2013-11-22 19:35:07 UTC (rev 159702)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2013-11-22 19:48:03 UTC (rev 159703)
@@ -141,7 +141,8 @@
     void setCreatedLayers(Vector<LayerCreationProperties>);
     void setDestroyedLayerIDs(Vector<LayerID>);
 
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || !LOG_DISABLED
+    WTF::CString description() const;
     void dump() const;
 #endif
 

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (159702 => 159703)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2013-11-22 19:35:07 UTC (rev 159702)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2013-11-22 19:48:03 UTC (rev 159703)
@@ -360,7 +360,7 @@
     m_destroyedLayerIDs = std::move(destroyedLayerIDs);
 }
 
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || !LOG_DISABLED
 
 class RemoteLayerTreeTextStream : public TextStream
 {
@@ -648,6 +648,11 @@
 
 void RemoteLayerTreeTransaction::dump() const
 {
+    fprintf(stderr, "%s", description().data());
+}
+
+CString RemoteLayerTreeTransaction::description() const
+{
     RemoteLayerTreeTextStream ts;
 
     ts << "(\n";
@@ -708,9 +713,9 @@
 
     ts << ")\n";
 
-    fprintf(stderr, "%s", ts.release().utf8().data());
+    return ts.release().utf8();
 }
 
-#endif // NDEBUG
+#endif // !defined(NDEBUG) || !LOG_DISABLED
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm (159702 => 159703)


--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm	2013-11-22 19:35:07 UTC (rev 159702)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm	2013-11-22 19:48:03 UTC (rev 159703)
@@ -26,6 +26,7 @@
 #import "config.h"
 #import "RemoteLayerTreeHost.h"
 
+#import "Logging.h"
 #import "RemoteLayerTreeHostMessages.h"
 #import "RemoteLayerTreePropertyApplier.h"
 #import "RemoteLayerTreeTransaction.h"
@@ -55,9 +56,7 @@
 
 void RemoteLayerTreeHost::commit(const RemoteLayerTreeTransaction& transaction)
 {
-#if !defined(NDEBUG)
-    transaction.dump();
-#endif
+    LOG(RemoteLayerTree, "%s", transaction.description().data());
 
     for (auto createdLayer : transaction.createdLayers())
         createLayer(createdLayer);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to