1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -158,7 +158,7 @@ InspectorClient::InspectorClient(ViewImplementation& content_web_view, ViewImple
m_inspector_web_view.on_inspector_executed_console_script = [this](auto const& script) {
append_console_source(script);
m_content_web_view.js_console_input(script.to_deprecated_string());
m_content_web_view.js_console_input(script.to_byte_string());
};
load_inspector();
@ -442,7 +442,7 @@ template<typename Generator>
static void generate_tree(StringBuilder& builder, JsonObject const& node, Generator&& generator)
{
if (auto children = node.get_array("children"sv); children.has_value() && !children->is_empty()) {
auto name = node.get_deprecated_string("name"sv).value_or({});
auto name = node.get_byte_string("name"sv).value_or({});
builder.append("<details>"sv);
builder.append("<summary>"sv);
@ -466,8 +466,8 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
StringBuilder builder;
generate_tree(builder, dom_tree, [&](JsonObject const& node) {
auto type = node.get_deprecated_string("type"sv).value_or("unknown"sv);
auto name = node.get_deprecated_string("name"sv).value_or({});
auto type = node.get_byte_string("type"sv).value_or("unknown"sv);
auto name = node.get_byte_string("name"sv).value_or({});
StringBuilder data_attributes;
auto append_data_attribute = [&](auto name, auto value) {
@ -484,7 +484,7 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
}
if (type == "text"sv) {
auto deprecated_text = node.get_deprecated_string("text"sv).release_value();
auto deprecated_text = node.get_byte_string("text"sv).release_value();
deprecated_text = escape_html_entities(deprecated_text);
auto text = MUST(Web::Infra::strip_and_collapse_whitespace(deprecated_text));
@ -500,7 +500,7 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
}
if (type == "comment"sv) {
auto comment = node.get_deprecated_string("data"sv).release_value();
auto comment = node.get_byte_string("data"sv).release_value();
comment = escape_html_entities(comment);
builder.appendff("<span class=\"hoverable comment\" {}>", data_attributes.string_view());
@ -512,7 +512,7 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
}
if (type == "shadow-root"sv) {
auto mode = node.get_deprecated_string("mode"sv).release_value();
auto mode = node.get_byte_string("mode"sv).release_value();
builder.appendff("<span class=\"hoverable internal\" {}>", data_attributes.string_view());
builder.appendff("{} ({})", name, mode);
@ -559,11 +559,11 @@ String InspectorClient::generate_accessibility_tree(JsonObject const& accessibil
StringBuilder builder;
generate_tree(builder, accessibility_tree, [&](JsonObject const& node) {
auto type = node.get_deprecated_string("type"sv).value_or("unknown"sv);
auto role = node.get_deprecated_string("role"sv).value_or({});
auto type = node.get_byte_string("type"sv).value_or("unknown"sv);
auto role = node.get_byte_string("role"sv).value_or({});
if (type == "text"sv) {
auto text = node.get_deprecated_string("text"sv).release_value();
auto text = node.get_byte_string("text"sv).release_value();
text = escape_html_entities(text);
builder.appendff("<span class=\"hoverable\">");
@ -579,8 +579,8 @@ String InspectorClient::generate_accessibility_tree(JsonObject const& accessibil
return;
}
auto name = node.get_deprecated_string("name"sv).value_or({});
auto description = node.get_deprecated_string("description"sv).value_or({});
auto name = node.get_byte_string("name"sv).value_or({});
auto description = node.get_byte_string("description"sv).value_or({});
builder.appendff("<span class=\"hoverable\">");
builder.append(role.to_lowercase());
@ -616,7 +616,7 @@ void InspectorClient::handle_console_message(i32 message_index)
request_console_messages();
}
void InspectorClient::handle_console_messages(i32 start_index, ReadonlySpan<DeprecatedString> message_types, ReadonlySpan<DeprecatedString> messages)
void InspectorClient::handle_console_messages(i32 start_index, ReadonlySpan<ByteString> message_types, ReadonlySpan<ByteString> messages)
{
auto end_index = start_index + static_cast<i32>(message_types.size()) - 1;
if (end_index <= m_highest_received_message_index) {