diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-05-01 21:10:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-01 21:25:06 +0200 |
commit | 6cf59b6ae96aeeb8c0da957a07f913c4fa38467f (patch) | |
tree | b3f1691b59c3280993d4a8c2866f821ae15c1875 /Userland/Libraries/LibWeb/Loader | |
parent | 4e6f03a860595f9eb2628e12ddbd333e26b0622f (diff) | |
download | serenity-6cf59b6ae96aeeb8c0da957a07f913c4fa38467f.zip |
Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr
Diffstat (limited to 'Userland/Libraries/LibWeb/Loader')
-rw-r--r-- | Userland/Libraries/LibWeb/Loader/FrameLoader.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Loader/Resource.cpp | 8 |
2 files changed, 4 insertions, 10 deletions
diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 8c1f6dd4c4..726bfead74 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -101,10 +101,8 @@ static bool build_gemini_document(DOM::Document& document, const ByteBuffer& dat auto gemini_document = Gemini::Document::parse(gemini_data, document.url()); String html_data = gemini_document->render_to_html(); -#if GEMINI_DEBUG - dbgln("Gemini data:\n\"\"\"{}\"\"\"", gemini_data); - dbgln("Converted to HTML:\n\"\"\"{}\"\"\"", html_data); -#endif + dbgln_if(GEMINI_DEBUG, "Gemini data:\n\"\"\"{}\"\"\"", gemini_data); + dbgln_if(GEMINI_DEBUG, "Converted to HTML:\n\"\"\"{}\"\"\"", html_data); HTML::HTMLDocumentParser parser(document, html_data, "utf-8"); parser.run(document.url()); diff --git a/Userland/Libraries/LibWeb/Loader/Resource.cpp b/Userland/Libraries/LibWeb/Loader/Resource.cpp index 9223145f96..9231ec341e 100644 --- a/Userland/Libraries/LibWeb/Loader/Resource.cpp +++ b/Userland/Libraries/LibWeb/Loader/Resource.cpp @@ -75,9 +75,7 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, const HashMap auto content_type = headers.get("Content-Type"); if (content_type.has_value()) { -#if RESOURCE_DEBUG - dbgln("Content-Type header: '{}'", content_type.value()); -#endif + dbgln_if(RESOURCE_DEBUG, "Content-Type header: '{}'", content_type.value()); m_encoding = encoding_from_content_type(content_type.value()); m_mime_type = mime_type_from_content_type(content_type.value()); } else if (url().protocol() == "data" && !url().data_mime_type().is_empty()) { @@ -85,9 +83,7 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, const HashMap m_encoding = "utf-8"; // FIXME: This doesn't seem nice. m_mime_type = url().data_mime_type(); } else { -#if RESOURCE_DEBUG - dbgln("No Content-Type header to go on! Guessing based on filename..."); -#endif + dbgln_if(RESOURCE_DEBUG, "No Content-Type header to go on! Guessing based on filename..."); m_encoding = "utf-8"; // FIXME: This doesn't seem nice. m_mime_type = Core::guess_mime_type_based_on_filename(url().path()); } |