summaryrefslogtreecommitdiff
path: root/Demos/WebView
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-04 23:19:12 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-04 23:19:12 +0200
commitada3c9ca466b95d81d4f5c8fe7e26466aca99828 (patch)
treefb80fc21b85329e24d8ad4017b38b4515f4ca5dc /Demos/WebView
parent3005c0af695a1abc2347e3a7be65242567f23c27 (diff)
downloadserenity-ada3c9ca466b95d81d4f5c8fe7e26466aca99828.zip
WebContent: Put some debug spam behind an #ifdef
Diffstat (limited to 'Demos/WebView')
-rw-r--r--Demos/WebView/WebContentClient.cpp10
-rw-r--r--Demos/WebView/WebContentView.cpp4
2 files changed, 12 insertions, 2 deletions
diff --git a/Demos/WebView/WebContentClient.cpp b/Demos/WebView/WebContentClient.cpp
index 0906edcaa1..03a6d3497f 100644
--- a/Demos/WebView/WebContentClient.cpp
+++ b/Demos/WebView/WebContentClient.cpp
@@ -44,18 +44,24 @@ void WebContentClient::handshake()
void WebContentClient::handle(const Messages::WebContentClient::DidPaint& message)
{
+#ifdef DEBUG_SPAM
dbg() << "handle: WebContentClient::DidPaint! content_rect=" << message.content_rect() << ", shbuf_id=" << message.shbuf_id();
+#endif
m_view.notify_server_did_paint({}, message.shbuf_id());
}
-void WebContentClient::handle(const Messages::WebContentClient::DidFinishLoad& message)
+void WebContentClient::handle([[maybe_unused]] const Messages::WebContentClient::DidFinishLoad& message)
{
+#ifdef DEBUG_SPAM
dbg() << "handle: WebContentClient::DidFinishLoad! url=" << message.url();
+#endif
}
void WebContentClient::handle(const Messages::WebContentClient::DidInvalidateContentRect& message)
{
+#ifdef DEBUG_SPAM
dbg() << "handle: WebContentClient::DidInvalidateContentRect! content_rect=" << message.content_rect();
+#endif
// FIXME: Figure out a way to coalesce these messages to reduce unnecessary painting
m_view.notify_server_did_invalidate_content_rect({}, message.content_rect());
@@ -63,6 +69,8 @@ void WebContentClient::handle(const Messages::WebContentClient::DidInvalidateCon
void WebContentClient::handle(const Messages::WebContentClient::DidChangeSelection&)
{
+#ifdef DEBUG_SPAM
dbg() << "handle: WebContentClient::DidChangeSelection!";
+#endif
m_view.notify_server_did_change_selection({});
}
diff --git a/Demos/WebView/WebContentView.cpp b/Demos/WebView/WebContentView.cpp
index 0ac909865c..46a5b18e16 100644
--- a/Demos/WebView/WebContentView.cpp
+++ b/Demos/WebView/WebContentView.cpp
@@ -84,9 +84,11 @@ void WebContentView::notify_server_did_paint(Badge<WebContentClient>, i32 shbuf_
update();
}
-void WebContentView::notify_server_did_invalidate_content_rect(Badge<WebContentClient>, const Gfx::IntRect& content_rect)
+void WebContentView::notify_server_did_invalidate_content_rect(Badge<WebContentClient>, [[maybe_unused]] const Gfx::IntRect& content_rect)
{
+#ifdef DEBUG_SPAM
dbg() << "server did invalidate content_rect: " << content_rect << ", current shbuf_id=" << m_bitmap->shbuf_id();
+#endif
request_repaint();
}