1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:05:06 +00:00

AK: Fix URL's operator<<() and use it

This commit is contained in:
Linus Groh 2020-05-16 18:35:39 +01:00 committed by Andreas Kling
parent b299c75d45
commit ad3871b64e
3 changed files with 6 additions and 8 deletions

View file

@ -89,11 +89,9 @@ private:
String m_data_payload;
};
}
using AK::URL;
inline const LogStream& operator<<(const LogStream& stream, const URL& value)
{
return stream << value.to_string();
}
}

View file

@ -78,7 +78,7 @@ void HTMLScriptElement::inserted_into(Node& new_parent)
URL src_url = document().complete_url(src);
if (src_url.protocol() == "file" && document().url().protocol() != src_url.protocol()) {
dbg() << "HTMLScriptElement: Forbidden to load " << src_url.to_string() << " from " << document().url().to_string();
dbg() << "HTMLScriptElement: Forbidden to load " << src_url << " from " << document().url();
return;
}

View file

@ -433,7 +433,7 @@ static RefPtr<Document> create_document_from_mime_type(const ByteBuffer& data, c
void HtmlView::load(const URL& url)
{
dbg() << "HtmlView::load: " << url.to_string();
dbg() << "HtmlView::load: " << url;
if (!url.is_valid()) {
load_error_page(url, "Invalid URL");
@ -495,11 +495,11 @@ void HtmlView::load(const URL& url)
ResourceLoader::the().load(
favicon_url,
[this, favicon_url](auto data, auto&) {
dbg() << "Favicon downloaded, " << data.size() << " bytes from " << favicon_url.to_string();
dbg() << "Favicon downloaded, " << data.size() << " bytes from " << favicon_url;
auto decoder = Gfx::ImageDecoder::create(data.data(), data.size());
auto bitmap = decoder->bitmap();
if (!bitmap) {
dbg() << "Could not decode favicon " << favicon_url.to_string();
dbg() << "Could not decode favicon " << favicon_url;
return;
}
dbg() << "Decoded favicon, " << bitmap->size();