1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +00:00

AK+Everywhere: Replace "protocol" with "scheme" url helpers

URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
This commit is contained in:
networkException 2022-09-29 01:30:58 +02:00 committed by Linus Groh
parent 454bf1fde0
commit 4230dbbb21
61 changed files with 113 additions and 116 deletions

View file

@ -105,7 +105,7 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, HashMap<Strin
// Let's use image/x-qoi for now, which is also what our Core::MimeData uses & would guess.
if (m_mime_type == "application/octet-stream" && url().path().ends_with(".qoi"sv))
m_mime_type = "image/x-qoi";
} else if (url().protocol() == "data" && !url().data_mime_type().is_empty()) {
} else if (url().scheme() == "data" && !url().data_mime_type().is_empty()) {
dbgln_if(RESOURCE_DEBUG, "This is a data URL with mime-type _{}_", url().data_mime_type());
m_mime_type = url().data_mime_type();
} else {