From ada3c9ca466b95d81d4f5c8fe7e26466aca99828 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 4 Jul 2020 23:19:12 +0200 Subject: WebContent: Put some debug spam behind an #ifdef --- Demos/WebView/WebContentClient.cpp | 10 +++++++++- Demos/WebView/WebContentView.cpp | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'Demos/WebView') 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, i32 shbuf_ update(); } -void WebContentView::notify_server_did_invalidate_content_rect(Badge, const Gfx::IntRect& content_rect) +void WebContentView::notify_server_did_invalidate_content_rect(Badge, [[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(); } -- cgit v1.2.3