mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 11:55:08 +00:00
AK: Fix URL's operator<<() and use it
This commit is contained in:
parent
b299c75d45
commit
ad3871b64e
3 changed files with 6 additions and 8 deletions
6
AK/URL.h
6
AK/URL.h
|
@ -89,11 +89,9 @@ private:
|
||||||
String m_data_payload;
|
String m_data_payload;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
using AK::URL;
|
|
||||||
|
|
||||||
inline const LogStream& operator<<(const LogStream& stream, const URL& value)
|
inline const LogStream& operator<<(const LogStream& stream, const URL& value)
|
||||||
{
|
{
|
||||||
return stream << value.to_string();
|
return stream << value.to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ void HTMLScriptElement::inserted_into(Node& new_parent)
|
||||||
|
|
||||||
URL src_url = document().complete_url(src);
|
URL src_url = document().complete_url(src);
|
||||||
if (src_url.protocol() == "file" && document().url().protocol() != src_url.protocol()) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -433,7 +433,7 @@ static RefPtr<Document> create_document_from_mime_type(const ByteBuffer& data, c
|
||||||
|
|
||||||
void HtmlView::load(const URL& url)
|
void HtmlView::load(const URL& url)
|
||||||
{
|
{
|
||||||
dbg() << "HtmlView::load: " << url.to_string();
|
dbg() << "HtmlView::load: " << url;
|
||||||
|
|
||||||
if (!url.is_valid()) {
|
if (!url.is_valid()) {
|
||||||
load_error_page(url, "Invalid URL");
|
load_error_page(url, "Invalid URL");
|
||||||
|
@ -495,11 +495,11 @@ void HtmlView::load(const URL& url)
|
||||||
ResourceLoader::the().load(
|
ResourceLoader::the().load(
|
||||||
favicon_url,
|
favicon_url,
|
||||||
[this, favicon_url](auto data, auto&) {
|
[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 decoder = Gfx::ImageDecoder::create(data.data(), data.size());
|
||||||
auto bitmap = decoder->bitmap();
|
auto bitmap = decoder->bitmap();
|
||||||
if (!bitmap) {
|
if (!bitmap) {
|
||||||
dbg() << "Could not decode favicon " << favicon_url.to_string();
|
dbg() << "Could not decode favicon " << favicon_url;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dbg() << "Decoded favicon, " << bitmap->size();
|
dbg() << "Decoded favicon, " << bitmap->size();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue