diff --git a/Ladybird/AndroidPlatform.cpp b/Ladybird/AndroidPlatform.cpp index 0287b36ba2..c88a4dce3d 100644 --- a/Ladybird/AndroidPlatform.cpp +++ b/Ladybird/AndroidPlatform.cpp @@ -6,10 +6,10 @@ #define AK_DONT_REPLACE_STD +#include #include #include #include -#include #include #include #include @@ -31,11 +31,11 @@ // nor include it in libladybird_.so #include // NOLINT(bugprone-suspicious-include) -extern String s_serenity_resource_root; +extern DeprecatedString s_serenity_resource_root; void android_platform_init(); static void extract_ladybird_resources(); -static ErrorOr extract_tar_archive(String archive_file, String output_directory); +static ErrorOr extract_tar_archive(DeprecatedString archive_file, DeprecatedString output_directory); void android_platform_init() { @@ -53,24 +53,24 @@ void android_platform_init() void extract_ladybird_resources() { qDebug() << "serenity resource root is " << s_serenity_resource_root.characters(); - auto file_or_error = Core::System::open(String::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root), O_RDONLY); + auto file_or_error = Core::System::open(DeprecatedString::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root), O_RDONLY); if (file_or_error.is_error()) { qDebug() << "Unable to open test file file as expected, extracting asssets..."; - MUST(extract_tar_archive(String::formatted("{}/ladybird-assets.tar", s_serenity_resource_root), s_serenity_resource_root)); + MUST(extract_tar_archive(DeprecatedString::formatted("{}/ladybird-assets.tar", s_serenity_resource_root), s_serenity_resource_root)); } else { qDebug() << "Opened app-browser.png test file, good to go!"; qDebug() << "Hopefully no developer changed the asset files and expected them to be re-extracted!"; } } -ErrorOr extract_tar_archive(String archive_file, String output_directory) +ErrorOr extract_tar_archive(DeprecatedString archive_file, DeprecatedString output_directory) { constexpr size_t buffer_size = 4096; auto file = TRY(Core::File::open(archive_file, Core::OpenMode::ReadOnly)); - String old_pwd = TRY(Core::System::getcwd()); + DeprecatedString old_pwd = TRY(Core::System::getcwd()); TRY(Core::System::chdir(output_directory)); ScopeGuard go_back = [&old_pwd] { MUST(Core::System::chdir(old_pwd)); }; @@ -83,16 +83,16 @@ ErrorOr extract_tar_archive(String archive_file, String output_directory) return Error::from_errno(EINVAL); } - HashMap global_overrides; - HashMap local_overrides; + HashMap global_overrides; + HashMap local_overrides; - auto get_override = [&](StringView key) -> Optional { - Optional maybe_local = local_overrides.get(key); + auto get_override = [&](StringView key) -> Optional { + Optional maybe_local = local_overrides.get(key); if (maybe_local.has_value()) return maybe_local; - Optional maybe_global = global_overrides.get(key); + Optional maybe_global = global_overrides.get(key); if (maybe_global.has_value()) return maybe_global; @@ -142,7 +142,7 @@ ErrorOr extract_tar_archive(String archive_file, String output_directory) while ((bytes_read = file_stream.read(buffer)) > 0) long_name.append(reinterpret_cast(buffer.data()), bytes_read); - local_overrides.set("path", long_name.to_string()); + local_overrides.set("path", long_name.to_deprecated_string()); continue; } default: @@ -153,9 +153,9 @@ ErrorOr extract_tar_archive(String archive_file, String output_directory) LexicalPath path = LexicalPath(header.filename()); if (!header.prefix().is_empty()) path = path.prepend(header.prefix()); - String filename = get_override("path"sv).value_or(path.string()); + DeprecatedString filename = get_override("path"sv).value_or(path.string()); - String absolute_path = Core::File::absolute_path(filename); + DeprecatedString absolute_path = Core::File::absolute_path(filename); auto parent_path = LexicalPath(absolute_path).parent(); switch (header.type_flag()) { diff --git a/Ladybird/BrowserWindow.cpp b/Ladybird/BrowserWindow.cpp index 3c37f884b2..afd3980ced 100644 --- a/Ladybird/BrowserWindow.cpp +++ b/Ladybird/BrowserWindow.cpp @@ -18,7 +18,7 @@ #include #include -extern String s_serenity_resource_root; +extern DeprecatedString s_serenity_resource_root; extern Browser::Settings* s_settings; BrowserWindow::BrowserWindow(int webdriver_fd_passing_socket) @@ -230,7 +230,7 @@ BrowserWindow::BrowserWindow(int webdriver_fd_passing_socket) QObject::connect(custom_user_agent_action, &QAction::triggered, this, [this, disable_spoofing] { auto user_agent = QInputDialog::getText(this, "Custom User Agent", "Enter User Agent:"); if (!user_agent.isEmpty()) { - debug_request("spoof-user-agent", akstring_from_qstring(user_agent)); + debug_request("spoof-user-agent", ak_deprecated_string_from_qstring(user_agent)); debug_request("clear-cache"); // clear the cache to ensure requests are re-done with the new user agent } else { disable_spoofing->activate(QAction::Trigger); @@ -283,7 +283,7 @@ BrowserWindow::BrowserWindow(int webdriver_fd_passing_socket) setCentralWidget(m_tabs_container); } -void BrowserWindow::debug_request(String const& request, String const& argument) +void BrowserWindow::debug_request(DeprecatedString const& request, DeprecatedString const& argument) { if (!m_current_tab) return; @@ -314,7 +314,7 @@ void BrowserWindow::new_tab() return m_cookie_jar.get_named_cookie(url, name); }; - tab_ptr->view().on_get_cookie = [this](auto& url, auto source) -> String { + tab_ptr->view().on_get_cookie = [this](auto& url, auto source) -> DeprecatedString { return m_cookie_jar.get_cookie(url, source); }; diff --git a/Ladybird/BrowserWindow.h b/Ladybird/BrowserWindow.h index 252f58ec94..b796b00461 100644 --- a/Ladybird/BrowserWindow.h +++ b/Ladybird/BrowserWindow.h @@ -41,7 +41,7 @@ public slots: void enable_dark_color_scheme(); private: - void debug_request(String const& request, String const& argument = ""); + void debug_request(DeprecatedString const& request, DeprecatedString const& argument = ""); QTabWidget* m_tabs_container { nullptr }; NonnullOwnPtrVector m_tabs; diff --git a/Ladybird/ConsoleClient.cpp b/Ladybird/ConsoleClient.cpp index fe5d8620de..e7cb384643 100644 --- a/Ladybird/ConsoleClient.cpp +++ b/Ladybird/ConsoleClient.cpp @@ -40,7 +40,7 @@ ConsoleClient::ConsoleClient(JS::Console& console, JS::Realm& realm, SimpleWebVi m_console_global_object = JS::make_handle(console_global_object); } -void ConsoleClient::handle_input(String const& js_source) +void ConsoleClient::handle_input(DeprecatedString const& js_source) { if (!m_realm) return; @@ -69,7 +69,7 @@ void ConsoleClient::handle_input(String const& js_source) print_html(JS::MarkupGenerator::html_from_value(*result.value())); } -void ConsoleClient::print_html(String const& line) +void ConsoleClient::print_html(DeprecatedString const& line) { m_message_log.append({ .type = ConsoleOutput::Type::HTML, .data = line }); m_view.did_output_js_console_message(m_message_log.size() - 1); @@ -81,7 +81,7 @@ void ConsoleClient::clear_output() m_view.did_output_js_console_message(m_message_log.size() - 1); } -void ConsoleClient::begin_group(String const& label, bool start_expanded) +void ConsoleClient::begin_group(DeprecatedString const& label, bool start_expanded) { m_message_log.append({ .type = start_expanded ? ConsoleOutput::Type::BeginGroup : ConsoleOutput::Type::BeginGroupCollapsed, .data = label }); m_view.did_output_js_console_message(m_message_log.size() - 1); @@ -105,8 +105,8 @@ void ConsoleClient::send_messages(i32 start_index) } // FIXME: Replace with a single Vector of message structs - Vector message_types; - Vector messages; + Vector message_types; + Vector messages; message_types.ensure_capacity(messages_to_send); messages.ensure_capacity(messages_to_send); @@ -164,11 +164,11 @@ JS::ThrowCompletionOr ConsoleClient::printer(JS::Console::LogLevel lo if (log_level == JS::Console::LogLevel::Group || log_level == JS::Console::LogLevel::GroupCollapsed) { auto group = arguments.get(); - begin_group(String::formatted("{}", styling, escape_html_entities(group.label)), log_level == JS::Console::LogLevel::Group); + begin_group(DeprecatedString::formatted("{}", styling, escape_html_entities(group.label)), log_level == JS::Console::LogLevel::Group); return JS::js_undefined(); } - auto output = String::join(' ', arguments.get>()); + auto output = DeprecatedString::join(' ', arguments.get>()); m_console.output_debug_message(log_level, output); StringBuilder html; diff --git a/Ladybird/ConsoleClient.h b/Ladybird/ConsoleClient.h index 1ffd386409..01c60faadc 100644 --- a/Ladybird/ConsoleClient.h +++ b/Ladybird/ConsoleClient.h @@ -25,7 +25,7 @@ class ConsoleClient final : public JS::ConsoleClient { public: ConsoleClient(JS::Console&, JS::Realm&, SimpleWebView&); - void handle_input(String const& js_source); + void handle_input(DeprecatedString const& js_source); void send_messages(i32 start_index); private: @@ -44,8 +44,8 @@ private: JS::Handle m_console_global_object; void clear_output(); - void print_html(String const& line); - void begin_group(String const& label, bool start_expanded); + void print_html(DeprecatedString const& line); + void begin_group(DeprecatedString const& label, bool start_expanded); virtual void end_group() override; struct ConsoleOutput { @@ -57,7 +57,7 @@ private: EndGroup, }; Type type; - String data; + DeprecatedString data; }; Vector m_message_log; diff --git a/Ladybird/ConsoleWidget.cpp b/Ladybird/ConsoleWidget.cpp index aab3585bb8..30ecc060dc 100644 --- a/Ladybird/ConsoleWidget.cpp +++ b/Ladybird/ConsoleWidget.cpp @@ -40,7 +40,7 @@ ConsoleWidget::ConsoleWidget() bottom_container->layout()->addWidget(m_input); QObject::connect(m_input, &QLineEdit::returnPressed, [this] { - auto js_source = akstring_from_qstring(m_input->text()); + auto js_source = ak_deprecated_string_from_qstring(m_input->text()); if (js_source.is_whitespace()) return; @@ -91,7 +91,7 @@ void ConsoleWidget::notify_about_new_console_message(i32 message_index) request_console_messages(); } -void ConsoleWidget::handle_console_messages(i32 start_index, Vector const& message_types, Vector const& messages) +void ConsoleWidget::handle_console_messages(i32 start_index, Vector const& message_types, Vector const& messages) { i32 end_index = start_index + message_types.size() - 1; if (end_index <= m_highest_received_message_index) { diff --git a/Ladybird/ConsoleWidget.h b/Ladybird/ConsoleWidget.h index 7b2d0fb591..6928db9d6a 100644 --- a/Ladybird/ConsoleWidget.h +++ b/Ladybird/ConsoleWidget.h @@ -9,8 +9,8 @@ #pragma once +#include #include -#include #include #include @@ -26,12 +26,12 @@ public: virtual ~ConsoleWidget() = default; void notify_about_new_console_message(i32 message_index); - void handle_console_messages(i32 start_index, Vector const& message_types, Vector const& messages); + void handle_console_messages(i32 start_index, Vector const& message_types, Vector const& messages); void print_source_line(StringView); void print_html(StringView); void reset(); - Function on_js_input; + Function on_js_input; Function on_request_messages; private: diff --git a/Ladybird/FontPluginQt.cpp b/Ladybird/FontPluginQt.cpp index 6127d5cf4f..da45b3198a 100644 --- a/Ladybird/FontPluginQt.cpp +++ b/Ladybird/FontPluginQt.cpp @@ -7,19 +7,19 @@ #define AK_DONT_REPLACE_STD #include "FontPluginQt.h" -#include +#include #include #include #include -extern String s_serenity_resource_root; +extern DeprecatedString s_serenity_resource_root; namespace Ladybird { FontPluginQt::FontPluginQt() { // Load the default SerenityOS fonts... - Gfx::FontDatabase::set_default_fonts_lookup_path(String::formatted("{}/res/fonts", s_serenity_resource_root)); + Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/res/fonts", s_serenity_resource_root)); // ...and also anything we can find in /usr/share/fonts Gfx::FontDatabase::the().load_all_fonts_from_path("/usr/share/fonts"); @@ -63,7 +63,7 @@ void FontPluginQt::update_generic_fonts() m_generic_font_names.resize(static_cast(Web::Platform::GenericFont::__Count)); - auto update_mapping = [&](Web::Platform::GenericFont generic_font, QFont::StyleHint qfont_style_hint, Vector fallbacks = {}) { + auto update_mapping = [&](Web::Platform::GenericFont generic_font, QFont::StyleHint qfont_style_hint, Vector fallbacks = {}) { QFont qt_font; qt_font.setStyleHint(qfont_style_hint); QFontInfo qt_info(qt_font); @@ -90,11 +90,11 @@ void FontPluginQt::update_generic_fonts() // Fallback fonts to look for if Gfx::Font can't load the font suggested by Qt. // The lists are basically arbitrary, taken from https://www.w3.org/Style/Examples/007/fonts.en.html - Vector cursive_fallbacks { "Comic Sans MS", "Comic Sans", "Apple Chancery", "Bradley Hand", "Brush Script MT", "Snell Roundhand", "URW Chancery L" }; - Vector fantasy_fallbacks { "Impact", "Luminari", "Chalkduster", "Jazz LET", "Blippo", "Stencil Std", "Marker Felt", "Trattatello" }; - Vector monospace_fallbacks { "Andale Mono", "Courier New", "Courier", "FreeMono", "OCR A Std", "DejaVu Sans Mono", "Liberation Mono", "Csilla" }; - Vector sans_serif_fallbacks { "Arial", "Helvetica", "Verdana", "Trebuchet MS", "Gill Sans", "Noto Sans", "Avantgarde", "Optima", "Arial Narrow", "Liberation Sans", "Katica" }; - Vector serif_fallbacks { "Times", "Times New Roman", "Didot", "Georgia", "Palatino", "Bookman", "New Century Schoolbook", "American Typewriter", "Liberation Serif", "Roman" }; + Vector cursive_fallbacks { "Comic Sans MS", "Comic Sans", "Apple Chancery", "Bradley Hand", "Brush Script MT", "Snell Roundhand", "URW Chancery L" }; + Vector fantasy_fallbacks { "Impact", "Luminari", "Chalkduster", "Jazz LET", "Blippo", "Stencil Std", "Marker Felt", "Trattatello" }; + Vector monospace_fallbacks { "Andale Mono", "Courier New", "Courier", "FreeMono", "OCR A Std", "DejaVu Sans Mono", "Liberation Mono", "Csilla" }; + Vector sans_serif_fallbacks { "Arial", "Helvetica", "Verdana", "Trebuchet MS", "Gill Sans", "Noto Sans", "Avantgarde", "Optima", "Arial Narrow", "Liberation Sans", "Katica" }; + Vector serif_fallbacks { "Times", "Times New Roman", "Didot", "Georgia", "Palatino", "Bookman", "New Century Schoolbook", "American Typewriter", "Liberation Serif", "Roman" }; update_mapping(Web::Platform::GenericFont::Cursive, QFont::StyleHint::Cursive, cursive_fallbacks); update_mapping(Web::Platform::GenericFont::Fantasy, QFont::StyleHint::Fantasy, fantasy_fallbacks); @@ -107,7 +107,7 @@ void FontPluginQt::update_generic_fonts() update_mapping(Web::Platform::GenericFont::UiSerif, QFont::StyleHint::Serif, serif_fallbacks); } -String FontPluginQt::generic_font_name(Web::Platform::GenericFont generic_font) +DeprecatedString FontPluginQt::generic_font_name(Web::Platform::GenericFont generic_font) { return m_generic_font_names[static_cast(generic_font)]; } diff --git a/Ladybird/FontPluginQt.h b/Ladybird/FontPluginQt.h index 94cb011ef2..35a577aed3 100644 --- a/Ladybird/FontPluginQt.h +++ b/Ladybird/FontPluginQt.h @@ -19,12 +19,12 @@ public: virtual Gfx::Font& default_font() override; virtual Gfx::Font& default_fixed_width_font() override; - virtual String generic_font_name(Web::Platform::GenericFont) override; + virtual DeprecatedString generic_font_name(Web::Platform::GenericFont) override; void update_generic_fonts(); private: - Vector m_generic_font_names; + Vector m_generic_font_names; RefPtr m_default_font; RefPtr m_default_fixed_width_font; }; diff --git a/Ladybird/ModelTranslator.cpp b/Ladybird/ModelTranslator.cpp index b3c83858fc..aab80990c3 100644 --- a/Ladybird/ModelTranslator.cpp +++ b/Ladybird/ModelTranslator.cpp @@ -32,7 +32,7 @@ int ModelTranslator::rowCount(QModelIndex const& parent) const static QVariant convert_variant(GUI::Variant const& value) { if (value.is_string()) - return qstring_from_akstring(value.as_string()); + return qstring_from_ak_deprecated_string(value.as_string()); if (value.is_icon()) { auto const& gui_icon = value.as_icon(); auto bitmap = gui_icon.bitmap_for_size(16); diff --git a/Ladybird/RequestManagerQt.cpp b/Ladybird/RequestManagerQt.cpp index dca26f2758..fe0f2016a1 100644 --- a/Ladybird/RequestManagerQt.cpp +++ b/Ladybird/RequestManagerQt.cpp @@ -22,7 +22,7 @@ void RequestManagerQt::reply_finished(QNetworkReply* reply) request->did_finish(); } -RefPtr RequestManagerQt::start_request(String const& method, AK::URL const& url, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const& proxy) +RefPtr RequestManagerQt::start_request(DeprecatedString const& method, AK::URL const& url, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const& proxy) { if (!url.scheme().is_one_of_ignoring_case("http"sv, "https"sv)) { return nullptr; @@ -36,9 +36,9 @@ RefPtr RequestManagerQt::start_request(Stri return request; } -ErrorOr> RequestManagerQt::Request::create(QNetworkAccessManager& qnam, String const& method, AK::URL const& url, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&) +ErrorOr> RequestManagerQt::Request::create(QNetworkAccessManager& qnam, DeprecatedString const& method, AK::URL const& url, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&) { - QNetworkRequest request { QString(url.to_string().characters()) }; + QNetworkRequest request { QString(url.to_deprecated_string().characters()) }; request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::ManualRedirectPolicy); request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); @@ -79,11 +79,11 @@ void RequestManagerQt::Request::did_finish() bool success = m_reply.error() == QNetworkReply::NetworkError::NoError; auto buffer = m_reply.readAll(); auto http_status_code = m_reply.attribute(QNetworkRequest::Attribute::HttpStatusCodeAttribute).toInt(); - HashMap response_headers; - Vector set_cookie_headers; + HashMap response_headers; + Vector set_cookie_headers; for (auto& it : m_reply.rawHeaderPairs()) { - auto name = String(it.first.data(), it.first.length()); - auto value = String(it.second.data(), it.second.length()); + auto name = DeprecatedString(it.first.data(), it.first.length()); + auto value = DeprecatedString(it.second.data(), it.second.length()); if (name.equals_ignoring_case("set-cookie"sv)) { // NOTE: Qt may have bundled multiple Set-Cookie headers into a single one. // We have to extract the full list of cookies via QNetworkReply::header(). @@ -96,7 +96,7 @@ void RequestManagerQt::Request::did_finish() } } if (!set_cookie_headers.is_empty()) { - response_headers.set("set-cookie"sv, JsonArray { set_cookie_headers }.to_string()); + response_headers.set("set-cookie"sv, JsonArray { set_cookie_headers }.to_deprecated_string()); } on_buffered_request_finish(success, buffer.length(), response_headers, http_status_code, ReadonlyBytes { buffer.data(), (size_t)buffer.size() }); } diff --git a/Ladybird/RequestManagerQt.h b/Ladybird/RequestManagerQt.h index 3882b4e057..5789e8a0ca 100644 --- a/Ladybird/RequestManagerQt.h +++ b/Ladybird/RequestManagerQt.h @@ -27,7 +27,7 @@ public: virtual void prefetch_dns(AK::URL const&) override { } virtual void preconnect(AK::URL const&) override { } - virtual RefPtr start_request(String const& method, AK::URL const&, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&) override; + virtual RefPtr start_request(DeprecatedString const& method, AK::URL const&, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&) override; private slots: void reply_finished(QNetworkReply*); @@ -38,7 +38,7 @@ private: class Request : public Web::ResourceLoaderConnectorRequest { public: - static ErrorOr> create(QNetworkAccessManager& qnam, String const& method, AK::URL const& url, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&); + static ErrorOr> create(QNetworkAccessManager& qnam, DeprecatedString const& method, AK::URL const& url, HashMap const& request_headers, ReadonlyBytes request_body, Core::ProxyData const&); virtual ~Request() override; diff --git a/Ladybird/Settings.h b/Ladybird/Settings.h index 95608e4c67..dad9f1b9be 100644 --- a/Ladybird/Settings.h +++ b/Ladybird/Settings.h @@ -8,7 +8,7 @@ #define AK_DONT_REPLACE_STD -#include +#include #include namespace Browser { diff --git a/Ladybird/Tab.cpp b/Ladybird/Tab.cpp index 7e1434768d..3f38f9a7ff 100644 --- a/Ladybird/Tab.cpp +++ b/Ladybird/Tab.cpp @@ -17,7 +17,7 @@ #include #include -extern String s_serenity_resource_root; +extern DeprecatedString s_serenity_resource_root; extern Browser::Settings* s_settings; Tab::Tab(BrowserWindow* window, int webdriver_fd_passing_socket) @@ -88,7 +88,7 @@ Tab::Tab(BrowserWindow* window, int webdriver_fd_passing_socket) m_history.replace_current(url, m_title.toUtf8().data()); } - m_location_edit->setText(url.to_string().characters()); + m_location_edit->setText(url.to_deprecated_string().characters()); // Don't add to history if back or forward is pressed if (!m_is_history_navigation) { @@ -167,7 +167,7 @@ void Tab::navigate(QString url) { if (!url.startsWith("http://", Qt::CaseInsensitive) && !url.startsWith("https://", Qt::CaseInsensitive) && !url.startsWith("file://", Qt::CaseInsensitive)) url = "http://" + url; - view().load(akstring_from_qstring(url)); + view().load(ak_deprecated_string_from_qstring(url)); } void Tab::back() @@ -177,7 +177,7 @@ void Tab::back() m_is_history_navigation = true; m_history.go_back(); - view().load(m_history.current().url.to_string()); + view().load(m_history.current().url.to_deprecated_string()); } void Tab::forward() @@ -187,7 +187,7 @@ void Tab::forward() m_is_history_navigation = true; m_history.go_forward(); - view().load(m_history.current().url.to_string()); + view().load(m_history.current().url.to_deprecated_string()); } void Tab::home() @@ -198,7 +198,7 @@ void Tab::home() void Tab::reload() { m_is_history_navigation = true; - view().load(m_history.current().url.to_string()); + view().load(m_history.current().url.to_deprecated_string()); } void Tab::location_edit_return_pressed() @@ -209,7 +209,7 @@ void Tab::location_edit_return_pressed() void Tab::page_title_changed(QString title) { m_title = title; - m_history.update_title(akstring_from_qstring(m_title)); + m_history.update_title(ak_deprecated_string_from_qstring(m_title)); emit title_changed(tab_index(), std::move(title)); } @@ -223,7 +223,7 @@ int Tab::tab_index() return m_window->tab_index(this); } -void Tab::debug_request(String const& request, String const& argument) +void Tab::debug_request(DeprecatedString const& request, DeprecatedString const& argument) { if (request == "dump-history") m_history.dump(); diff --git a/Ladybird/Tab.h b/Ladybird/Tab.h index 838e669e75..77ab896c7f 100644 --- a/Ladybird/Tab.h +++ b/Ladybird/Tab.h @@ -28,7 +28,7 @@ public: void navigate(QString); - void debug_request(String const& request, String const& argument); + void debug_request(DeprecatedString const& request, DeprecatedString const& argument); public slots: void focus_location_editor(); diff --git a/Ladybird/Utilities.cpp b/Ladybird/Utilities.cpp index 93bd83e279..ec2ba8ba2b 100644 --- a/Ladybird/Utilities.cpp +++ b/Ladybird/Utilities.cpp @@ -12,16 +12,16 @@ #include #include -String s_serenity_resource_root; +DeprecatedString s_serenity_resource_root; -AK::String akstring_from_qstring(QString const& qstring) +AK::DeprecatedString ak_deprecated_string_from_qstring(QString const& qstring) { - return AK::String(qstring.toUtf8().data()); + return AK::DeprecatedString(qstring.toUtf8().data()); } -QString qstring_from_akstring(AK::String const& akstring) +QString qstring_from_ak_deprecated_string(AK::DeprecatedString const& ak_deprecated_string) { - return QString::fromUtf8(akstring.characters(), akstring.length()); + return QString::fromUtf8(ak_deprecated_string.characters(), ak_deprecated_string.length()); } void platform_init() @@ -33,14 +33,14 @@ void platform_init() s_serenity_resource_root = [] { auto const* source_dir = getenv("SERENITY_SOURCE_DIR"); if (source_dir) { - return String::formatted("{}/Base", source_dir); + return DeprecatedString::formatted("{}/Base", source_dir); } auto* home = getenv("XDG_CONFIG_HOME") ?: getenv("HOME"); VERIFY(home); - auto home_lagom = String::formatted("{}/.lagom", home); + auto home_lagom = DeprecatedString::formatted("{}/.lagom", home); if (Core::File::is_directory(home_lagom)) return home_lagom; - auto app_dir = akstring_from_qstring(QCoreApplication::applicationDirPath()); + auto app_dir = ak_deprecated_string_from_qstring(QCoreApplication::applicationDirPath()); return LexicalPath(app_dir).parent().append("share"sv).string(); }(); #endif diff --git a/Ladybird/Utilities.h b/Ladybird/Utilities.h index 60132304c7..2638fc6733 100644 --- a/Ladybird/Utilities.h +++ b/Ladybird/Utilities.h @@ -6,11 +6,11 @@ #pragma once -#include +#include #include -AK::String akstring_from_qstring(QString const&); -QString qstring_from_akstring(AK::String const&); +AK::DeprecatedString ak_deprecated_string_from_qstring(QString const&); +QString qstring_from_ak_deprecated_string(AK::DeprecatedString const&); void platform_init(); -extern String s_serenity_resource_root; +extern DeprecatedString s_serenity_resource_root; diff --git a/Ladybird/WebContent/main.cpp b/Ladybird/WebContent/main.cpp index bff51dca8c..505e143021 100644 --- a/Ladybird/WebContent/main.cpp +++ b/Ladybird/WebContent/main.cpp @@ -34,7 +34,7 @@ static ErrorOr load_content_filters(); -extern String s_serenity_resource_root; +extern DeprecatedString s_serenity_resource_root; struct DeferredInvokerQt final : IPC::DeferredInvoker { virtual ~DeferredInvokerQt() = default; @@ -80,11 +80,11 @@ ErrorOr serenity_main(Main::Arguments arguments) Web::ResourceLoader::initialize(RequestManagerQt::create()); Web::WebSockets::WebSocketClientManager::initialize(Ladybird::WebSocketClientManagerLadybird::create()); - Web::FrameLoader::set_default_favicon_path(String::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root)); + Web::FrameLoader::set_default_favicon_path(DeprecatedString::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root)); Web::Platform::FontPlugin::install(*new Ladybird::FontPluginQt); - Web::FrameLoader::set_error_page_url(String::formatted("file://{}/res/html/error.html", s_serenity_resource_root)); + Web::FrameLoader::set_error_page_url(DeprecatedString::formatted("file://{}/res/html/error.html", s_serenity_resource_root)); auto maybe_content_filter_error = load_content_filters(); if (maybe_content_filter_error.is_error()) @@ -111,9 +111,9 @@ ErrorOr serenity_main(Main::Arguments arguments) static ErrorOr load_content_filters() { - auto file_or_error = Core::Stream::File::open(String::formatted("{}/home/anon/.config/BrowserContentFilters.txt", s_serenity_resource_root), Core::Stream::OpenMode::Read); + auto file_or_error = Core::Stream::File::open(DeprecatedString::formatted("{}/home/anon/.config/BrowserContentFilters.txt", s_serenity_resource_root), Core::Stream::OpenMode::Read); if (file_or_error.is_error()) - file_or_error = Core::Stream::File::open(String::formatted("{}/res/ladybird/BrowserContentFilters.txt", s_serenity_resource_root), Core::Stream::OpenMode::Read); + file_or_error = Core::Stream::File::open(DeprecatedString::formatted("{}/res/ladybird/BrowserContentFilters.txt", s_serenity_resource_root), Core::Stream::OpenMode::Read); if (file_or_error.is_error()) return file_or_error.release_error(); auto file = file_or_error.release_value(); diff --git a/Ladybird/WebContentView.cpp b/Ladybird/WebContentView.cpp index f2b483601b..b59a524ac6 100644 --- a/Ladybird/WebContentView.cpp +++ b/Ladybird/WebContentView.cpp @@ -457,12 +457,12 @@ void WebContentView::update_viewport_rect() request_repaint(); } -void WebContentView::debug_request(String const& request, String const& argument) +void WebContentView::debug_request(DeprecatedString const& request, DeprecatedString const& argument) { client().async_debug_request(request, argument); } -void WebContentView::run_javascript(String const& js_source) +void WebContentView::run_javascript(DeprecatedString const& js_source) { client().async_run_javascript(js_source); } @@ -473,7 +473,7 @@ void WebContentView::did_output_js_console_message(i32 message_index) m_console_widget->notify_about_new_console_message(message_index); } -void WebContentView::did_get_js_console_messages(i32 start_index, Vector message_types, Vector messages) +void WebContentView::did_get_js_console_messages(i32 start_index, Vector message_types, Vector messages) { if (m_console_widget) m_console_widget->handle_console_messages(start_index, message_types, messages); @@ -588,15 +588,15 @@ void WebContentView::create_client() MUST(Core::System::close(ui_fd_passing_fd)); MUST(Core::System::close(ui_fd)); - String takeover_string; + DeprecatedString takeover_string; if (auto* socket_takeover = getenv("SOCKET_TAKEOVER")) - takeover_string = String::formatted("{} WebContent:{}", socket_takeover, wc_fd); + takeover_string = DeprecatedString::formatted("{} WebContent:{}", socket_takeover, wc_fd); else - takeover_string = String::formatted("WebContent:{}", wc_fd); + takeover_string = DeprecatedString::formatted("WebContent:{}", wc_fd); MUST(Core::System::setenv("SOCKET_TAKEOVER"sv, takeover_string, true)); - auto webcontent_fd_passing_socket_string = String::number(wc_fd_passing_fd); - auto webdriver_fd_passing_socket_string = String::number(m_webdriver_fd_passing_socket); + auto webcontent_fd_passing_socket_string = DeprecatedString::number(wc_fd_passing_fd); + auto webdriver_fd_passing_socket_string = DeprecatedString::number(m_webdriver_fd_passing_socket); char const* argv[] = { "WebContent", @@ -647,7 +647,7 @@ void WebContentView::create_client() }); }; - client().async_update_system_theme(Gfx::load_system_theme(String::formatted("{}/res/themes/Default.ini", s_serenity_resource_root))); + client().async_update_system_theme(Gfx::load_system_theme(DeprecatedString::formatted("{}/res/themes/Default.ini", s_serenity_resource_root))); client().async_update_system_fonts(Gfx::FontDatabase::default_font_query(), Gfx::FontDatabase::fixed_width_font_query(), Gfx::FontDatabase::window_title_font_query()); // FIXME: Get the screen rect. @@ -666,17 +666,17 @@ void WebContentView::handle_web_content_process_crash() handle_resize(); StringBuilder builder; builder.append("Crashed: "sv); - builder.append(escape_html_entities(m_url.to_string())); + builder.append(escape_html_entities(m_url.to_deprecated_string())); builder.append(""sv); builder.append("

Web page crashed"sv); if (!m_url.host().is_empty()) { builder.appendff(" on {}", escape_html_entities(m_url.host())); } builder.append("

"sv); - auto escaped_url = escape_html_entities(m_url.to_string()); + auto escaped_url = escape_html_entities(m_url.to_deprecated_string()); builder.appendff("The web page {} has crashed.

You can reload the page to try again.", escaped_url, escaped_url); builder.append(""sv); - load_html(builder.to_string(), m_url); + load_html(builder.to_deprecated_string(), m_url); } void WebContentView::notify_server_did_paint(Badge, i32 bitmap_id) @@ -732,9 +732,9 @@ void WebContentView::notify_server_did_layout(Badge, Gfx::IntS horizontalScrollBar()->setPageStep(m_viewport_rect.width()); } -void WebContentView::notify_server_did_change_title(Badge, String const& title) +void WebContentView::notify_server_did_change_title(Badge, DeprecatedString const& title) { - emit title_changed(qstring_from_akstring(title)); + emit title_changed(qstring_from_ak_deprecated_string(title)); } void WebContentView::notify_server_did_request_scroll(Badge, i32 x_delta, i32 y_delta) @@ -761,12 +761,12 @@ void WebContentView::notify_server_did_request_scroll_into_view(Badge, Gfx::IntPoint const& content_position, String const& tooltip) +void WebContentView::notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint const& content_position, DeprecatedString const& tooltip) { auto widget_position = to_widget(content_position); QToolTip::showText( mapToGlobal(QPoint(widget_position.x(), widget_position.y())), - qstring_from_akstring(tooltip), + qstring_from_ak_deprecated_string(tooltip), this); } @@ -777,7 +777,7 @@ void WebContentView::notify_server_did_leave_tooltip_area(Badge, AK::URL const& url) { - emit link_hovered(qstring_from_akstring(url.to_string())); + emit link_hovered(qstring_from_ak_deprecated_string(url.to_deprecated_string())); } void WebContentView::notify_server_did_unhover_link(Badge) @@ -785,7 +785,7 @@ void WebContentView::notify_server_did_unhover_link(Badge) emit link_unhovered(); } -void WebContentView::notify_server_did_click_link(Badge, AK::URL const& url, String const& target, unsigned int modifiers) +void WebContentView::notify_server_did_click_link(Badge, AK::URL const& url, DeprecatedString const& target, unsigned int modifiers) { // FIXME (void)url; @@ -795,7 +795,7 @@ void WebContentView::notify_server_did_click_link(Badge, AK::U // on_link_click(url, target, modifiers); } -void WebContentView::notify_server_did_middle_click_link(Badge, AK::URL const& url, String const& target, unsigned int modifiers) +void WebContentView::notify_server_did_middle_click_link(Badge, AK::URL const& url, DeprecatedString const& target, unsigned int modifiers) { (void)url; (void)target; @@ -834,14 +834,14 @@ void WebContentView::notify_server_did_request_context_menu(Badge, Gfx::IntPoint const& content_position, AK::URL const& url, String const&, unsigned) +void WebContentView::notify_server_did_request_link_context_menu(Badge, Gfx::IntPoint const& content_position, AK::URL const& url, DeprecatedString const&, unsigned) { // FIXME (void)content_position; (void)url; } -void WebContentView::notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint const& content_position, AK::URL const& url, String const&, unsigned, Gfx::ShareableBitmap const& bitmap) +void WebContentView::notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint const& content_position, AK::URL const& url, DeprecatedString const&, unsigned, Gfx::ShareableBitmap const& bitmap) { // FIXME (void)content_position; @@ -849,45 +849,45 @@ void WebContentView::notify_server_did_request_image_context_menu(Badge, String const& message) +void WebContentView::notify_server_did_request_alert(Badge, DeprecatedString const& message) { - m_dialog = new QMessageBox(QMessageBox::Icon::Warning, "Ladybird", qstring_from_akstring(message), QMessageBox::StandardButton::Ok, this); + m_dialog = new QMessageBox(QMessageBox::Icon::Warning, "Ladybird", qstring_from_ak_deprecated_string(message), QMessageBox::StandardButton::Ok, this); m_dialog->exec(); client().async_alert_closed(); m_dialog = nullptr; } -void WebContentView::notify_server_did_request_confirm(Badge, String const& message) +void WebContentView::notify_server_did_request_confirm(Badge, DeprecatedString const& message) { - m_dialog = new QMessageBox(QMessageBox::Icon::Question, "Ladybird", qstring_from_akstring(message), QMessageBox::StandardButton::Ok | QMessageBox::StandardButton::Cancel, this); + m_dialog = new QMessageBox(QMessageBox::Icon::Question, "Ladybird", qstring_from_ak_deprecated_string(message), QMessageBox::StandardButton::Ok | QMessageBox::StandardButton::Cancel, this); auto result = m_dialog->exec(); client().async_confirm_closed(result == QMessageBox::StandardButton::Ok || result == QDialog::Accepted); m_dialog = nullptr; } -void WebContentView::notify_server_did_request_prompt(Badge, String const& message, String const& default_) +void WebContentView::notify_server_did_request_prompt(Badge, DeprecatedString const& message, DeprecatedString const& default_) { m_dialog = new QInputDialog(this); auto& dialog = static_cast(*m_dialog); dialog.setWindowTitle("Ladybird"); - dialog.setLabelText(qstring_from_akstring(message)); - dialog.setTextValue(qstring_from_akstring(default_)); + dialog.setLabelText(qstring_from_ak_deprecated_string(message)); + dialog.setTextValue(qstring_from_ak_deprecated_string(default_)); if (dialog.exec() == QDialog::Accepted) - client().async_prompt_closed(akstring_from_qstring(dialog.textValue())); + client().async_prompt_closed(ak_deprecated_string_from_qstring(dialog.textValue())); else client().async_prompt_closed({}); m_dialog = nullptr; } -void WebContentView::notify_server_did_request_set_prompt_text(Badge, String const& message) +void WebContentView::notify_server_did_request_set_prompt_text(Badge, DeprecatedString const& message) { if (m_dialog && is(*m_dialog)) - static_cast(*m_dialog).setTextValue(qstring_from_akstring(message)); + static_cast(*m_dialog).setTextValue(qstring_from_ak_deprecated_string(message)); } void WebContentView::notify_server_did_request_accept_dialog(Badge) @@ -907,18 +907,18 @@ void WebContentView::get_source() client().async_get_source(); } -void WebContentView::notify_server_did_get_source(AK::URL const& url, String const& source) +void WebContentView::notify_server_did_get_source(AK::URL const& url, DeprecatedString const& source) { - emit got_source(url, qstring_from_akstring(source)); + emit got_source(url, qstring_from_ak_deprecated_string(source)); } -void WebContentView::notify_server_did_get_dom_tree(String const& dom_tree) +void WebContentView::notify_server_did_get_dom_tree(DeprecatedString const& dom_tree) { if (on_get_dom_tree) on_get_dom_tree(dom_tree); } -void WebContentView::notify_server_did_get_dom_node_properties(i32 node_id, String const& specified_style, String const& computed_style, String const& custom_properties, String const& node_box_sizing) +void WebContentView::notify_server_did_get_dom_node_properties(i32 node_id, DeprecatedString const& specified_style, DeprecatedString const& computed_style, DeprecatedString const& custom_properties, DeprecatedString const& node_box_sizing) { if (on_get_dom_node_properties) on_get_dom_node_properties(node_id, specified_style, computed_style, custom_properties, node_box_sizing); @@ -930,7 +930,7 @@ void WebContentView::notify_server_did_output_js_console_message(i32 message_ind m_console_widget->notify_about_new_console_message(message_index); } -void WebContentView::notify_server_did_get_js_console_messages(i32 start_index, Vector const& message_types, Vector const& messages) +void WebContentView::notify_server_did_get_js_console_messages(i32 start_index, Vector const& message_types, Vector const& messages) { if (m_console_widget) m_console_widget->handle_console_messages(start_index, message_types, messages); @@ -954,14 +954,14 @@ Vector WebContentView::notify_server_did_request_all_cookie return {}; } -Optional WebContentView::notify_server_did_request_named_cookie(Badge, AK::URL const& url, String const& name) +Optional WebContentView::notify_server_did_request_named_cookie(Badge, AK::URL const& url, DeprecatedString const& name) { if (on_get_named_cookie) return on_get_named_cookie(url, name); return {}; } -String WebContentView::notify_server_did_request_cookie(Badge, AK::URL const& url, Web::Cookie::Source source) +DeprecatedString WebContentView::notify_server_did_request_cookie(Badge, AK::URL const& url, Web::Cookie::Source source) { if (on_get_cookie) return on_get_cookie(url, source); @@ -1016,7 +1016,7 @@ Gfx::IntRect WebContentView::notify_server_did_request_fullscreen_window() return emit fullscreen_window(); } -void WebContentView::notify_server_did_request_file(Badge, String const& path, i32 request_id) +void WebContentView::notify_server_did_request_file(Badge, DeprecatedString const& path, i32 request_id) { auto file = Core::File::open(path, Core::OpenMode::ReadOnly); if (file.is_error()) diff --git a/Ladybird/WebContentView.h b/Ladybird/WebContentView.h index 6f820e05d3..0af125af10 100644 --- a/Ladybird/WebContentView.h +++ b/Ladybird/WebContentView.h @@ -8,10 +8,10 @@ #define AK_DONT_REPLACE_STD +#include #include #include #include -#include #include #include #include @@ -55,25 +55,25 @@ public: void load_html(StringView html, AK::URL const&); Function on_context_menu_request; - Function on_link_click; + Function on_link_click; Function on_link_context_menu_request; Function on_image_context_menu_request; - Function on_link_middle_click; + Function on_link_middle_click; Function on_link_hover; - Function on_title_change; + Function on_title_change; Function on_load_start; Function on_load_finish; Function on_favicon_change; Function on_url_drop; Function on_set_document; - Function on_get_source; - Function on_get_dom_tree; - Function on_get_dom_node_properties; + Function on_get_source; + Function on_get_dom_tree; + Function on_get_dom_node_properties; Function on_js_console_new_message; - Function const& message_types, Vector const& messages)> on_get_js_console_messages; + Function const& message_types, Vector const& messages)> on_get_js_console_messages; Function(AK::URL const& url)> on_get_all_cookies; - Function(AK::URL const& url, String const& name)> on_get_named_cookie; - Function on_get_cookie; + Function(AK::URL const& url, DeprecatedString const& name)> on_get_named_cookie; + Function on_get_cookie; Function on_set_cookie; Function on_update_cookie; Function on_resource_status_change; @@ -91,14 +91,14 @@ public: virtual void focusOutEvent(QFocusEvent*) override; virtual bool event(QEvent*) override; - void debug_request(String const& request, String const& argument); + void debug_request(DeprecatedString const& request, DeprecatedString const& argument); void get_source(); - void run_javascript(String const& js_source); + void run_javascript(DeprecatedString const& js_source); void did_output_js_console_message(i32 message_index); - void did_get_js_console_messages(i32 start_index, Vector message_types, Vector messages); + void did_get_js_console_messages(i32 start_index, Vector message_types, Vector messages); void show_js_console(); void show_inspector(); @@ -113,39 +113,39 @@ public: virtual void notify_server_did_invalidate_content_rect(Badge, Gfx::IntRect const&) override; virtual void notify_server_did_change_selection(Badge) override; virtual void notify_server_did_request_cursor_change(Badge, Gfx::StandardCursor cursor) override; - virtual void notify_server_did_change_title(Badge, String const&) override; + virtual void notify_server_did_change_title(Badge, DeprecatedString const&) override; virtual void notify_server_did_request_scroll(Badge, i32, i32) override; virtual void notify_server_did_request_scroll_to(Badge, Gfx::IntPoint const&) override; virtual void notify_server_did_request_scroll_into_view(Badge, Gfx::IntRect const&) override; - virtual void notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint const&, String const&) override; + virtual void notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint const&, DeprecatedString const&) override; virtual void notify_server_did_leave_tooltip_area(Badge) override; virtual void notify_server_did_hover_link(Badge, const AK::URL&) override; virtual void notify_server_did_unhover_link(Badge) override; - virtual void notify_server_did_click_link(Badge, const AK::URL&, String const& target, unsigned modifiers) override; - virtual void notify_server_did_middle_click_link(Badge, const AK::URL&, String const& target, unsigned modifiers) override; + virtual void notify_server_did_click_link(Badge, const AK::URL&, DeprecatedString const& target, unsigned modifiers) override; + virtual void notify_server_did_middle_click_link(Badge, const AK::URL&, DeprecatedString const& target, unsigned modifiers) override; virtual void notify_server_did_start_loading(Badge, const AK::URL&, bool) override; virtual void notify_server_did_finish_loading(Badge, const AK::URL&) override; virtual void notify_server_did_request_navigate_back(Badge) override; virtual void notify_server_did_request_navigate_forward(Badge) override; virtual void notify_server_did_request_refresh(Badge) override; virtual void notify_server_did_request_context_menu(Badge, Gfx::IntPoint const&) override; - virtual void notify_server_did_request_link_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, String const& target, unsigned modifiers) override; - virtual void notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, String const& target, unsigned modifiers, Gfx::ShareableBitmap const&) override; - virtual void notify_server_did_request_alert(Badge, String const& message) override; - virtual void notify_server_did_request_confirm(Badge, String const& message) override; - virtual void notify_server_did_request_prompt(Badge, String const& message, String const& default_) override; - virtual void notify_server_did_request_set_prompt_text(Badge, String const& message) override; + virtual void notify_server_did_request_link_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers) override; + virtual void notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) override; + virtual void notify_server_did_request_alert(Badge, DeprecatedString const& message) override; + virtual void notify_server_did_request_confirm(Badge, DeprecatedString const& message) override; + virtual void notify_server_did_request_prompt(Badge, DeprecatedString const& message, DeprecatedString const& default_) override; + virtual void notify_server_did_request_set_prompt_text(Badge, DeprecatedString const& message) override; virtual void notify_server_did_request_accept_dialog(Badge) override; virtual void notify_server_did_request_dismiss_dialog(Badge) override; - virtual void notify_server_did_get_source(const AK::URL& url, String const& source) override; - virtual void notify_server_did_get_dom_tree(String const& dom_tree) override; - virtual void notify_server_did_get_dom_node_properties(i32 node_id, String const& specified_style, String const& computed_style, String const& custom_properties, String const& node_box_sizing) override; + virtual void notify_server_did_get_source(const AK::URL& url, DeprecatedString const& source) override; + virtual void notify_server_did_get_dom_tree(DeprecatedString const& dom_tree) override; + virtual void notify_server_did_get_dom_node_properties(i32 node_id, DeprecatedString const& specified_style, DeprecatedString const& computed_style, DeprecatedString const& custom_properties, DeprecatedString const& node_box_sizing) override; virtual void notify_server_did_output_js_console_message(i32 message_index) override; - virtual void notify_server_did_get_js_console_messages(i32 start_index, Vector const& message_types, Vector const& messages) override; + virtual void notify_server_did_get_js_console_messages(i32 start_index, Vector const& message_types, Vector const& messages) override; virtual void notify_server_did_change_favicon(Gfx::Bitmap const& favicon) override; virtual Vector notify_server_did_request_all_cookies(Badge, AK::URL const& url) override; - virtual Optional notify_server_did_request_named_cookie(Badge, AK::URL const& url, String const& name) override; - virtual String notify_server_did_request_cookie(Badge, const AK::URL& url, Web::Cookie::Source source) override; + virtual Optional notify_server_did_request_named_cookie(Badge, AK::URL const& url, DeprecatedString const& name) override; + virtual DeprecatedString notify_server_did_request_cookie(Badge, const AK::URL& url, Web::Cookie::Source source) override; virtual void notify_server_did_set_cookie(Badge, const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source) override; virtual void notify_server_did_update_cookie(Badge, AK::URL const& url, Web::Cookie::Cookie const& cookie) override; virtual void notify_server_did_update_resource_count(i32 count_waiting) override; @@ -155,7 +155,7 @@ public: virtual Gfx::IntRect notify_server_did_request_maximize_window() override; virtual Gfx::IntRect notify_server_did_request_minimize_window() override; virtual Gfx::IntRect notify_server_did_request_fullscreen_window() override; - virtual void notify_server_did_request_file(Badge, String const& path, i32) override; + virtual void notify_server_did_request_file(Badge, DeprecatedString const& path, i32) override; virtual void notify_server_did_finish_handling_input_event(bool event_was_accepted) override; signals: diff --git a/Ladybird/WebDriver/Session.cpp b/Ladybird/WebDriver/Session.cpp index bbd3274901..2b3216d591 100644 --- a/Ladybird/WebDriver/Session.cpp +++ b/Ladybird/WebDriver/Session.cpp @@ -48,15 +48,15 @@ ErrorOr Session::start() TRY(Core::System::close(webdriver_fd_passing_fd)); TRY(Core::System::close(webdriver_fd)); - auto takeover_string = String::formatted("WebDriver:{}", webcontent_fd); + auto takeover_string = DeprecatedString::formatted("WebDriver:{}", webcontent_fd); TRY(Core::System::setenv("SOCKET_TAKEOVER"sv, takeover_string, true)); - auto fd_passing_socket_string = String::number(webcontent_fd_passing_fd); + auto fd_passing_socket_string = DeprecatedString::number(webcontent_fd_passing_fd); if (m_options.headless) { - auto resouces = String::formatted("{}/res", s_serenity_resource_root); - auto error_page = String::formatted("{}/res/html/error.html", s_serenity_resource_root); - auto certs = String::formatted("{}/etc/ca_certs.ini", s_serenity_resource_root); + auto resouces = DeprecatedString::formatted("{}/res", s_serenity_resource_root); + auto error_page = DeprecatedString::formatted("{}/res/html/error.html", s_serenity_resource_root); + auto certs = DeprecatedString::formatted("{}/etc/ca_certs.ini", s_serenity_resource_root); char const* argv[] = { "headless-browser", diff --git a/Ladybird/WebDriver/main.cpp b/Ladybird/WebDriver/main.cpp index 11f68d1dce..7a88e4fd6e 100644 --- a/Ladybird/WebDriver/main.cpp +++ b/Ladybird/WebDriver/main.cpp @@ -14,7 +14,7 @@ #include #include -extern String s_serenity_resource_root; +extern DeprecatedString s_serenity_resource_root; ErrorOr serenity_main(Main::Arguments arguments) { diff --git a/Ladybird/WebSocketClientManagerLadybird.cpp b/Ladybird/WebSocketClientManagerLadybird.cpp index 1a086dfcf6..2cbbd1413b 100644 --- a/Ladybird/WebSocketClientManagerLadybird.cpp +++ b/Ladybird/WebSocketClientManagerLadybird.cpp @@ -19,7 +19,7 @@ NonnullRefPtr WebSocketClientManagerLadybird::cr WebSocketClientManagerLadybird::WebSocketClientManagerLadybird() = default; WebSocketClientManagerLadybird::~WebSocketClientManagerLadybird() = default; -RefPtr WebSocketClientManagerLadybird::connect(AK::URL const& url, String const& origin) +RefPtr WebSocketClientManagerLadybird::connect(AK::URL const& url, DeprecatedString const& origin) { WebSocket::ConnectionInfo connection_info(url); connection_info.set_origin(origin); diff --git a/Ladybird/WebSocketClientManagerLadybird.h b/Ladybird/WebSocketClientManagerLadybird.h index 58723e3571..cad676bdab 100644 --- a/Ladybird/WebSocketClientManagerLadybird.h +++ b/Ladybird/WebSocketClientManagerLadybird.h @@ -19,7 +19,7 @@ public: static NonnullRefPtr create(); virtual ~WebSocketClientManagerLadybird() override; - virtual RefPtr connect(AK::URL const&, String const& origin) override; + virtual RefPtr connect(AK::URL const&, DeprecatedString const& origin) override; private: WebSocketClientManagerLadybird(); diff --git a/Ladybird/WebSocketImplQt.cpp b/Ladybird/WebSocketImplQt.cpp index d3ffa956d6..81a30ee78a 100644 --- a/Ladybird/WebSocketImplQt.cpp +++ b/Ladybird/WebSocketImplQt.cpp @@ -55,7 +55,7 @@ void WebSocketImplQt::connect(WebSocket::ConnectionInfo const& connection_info) if (connection_info.is_secure()) { auto ssl_socket = make(); ssl_socket->connectToHostEncrypted( - qstring_from_akstring(connection_info.url().host()), + qstring_from_ak_deprecated_string(connection_info.url().host()), connection_info.url().port_or_default()); QObject::connect(ssl_socket.ptr(), &QSslSocket::alertReceived, [this](QSsl::AlertLevel level, QSsl::AlertType, QString const&) { if (level == QSsl::AlertLevel::Fatal) @@ -65,7 +65,7 @@ void WebSocketImplQt::connect(WebSocket::ConnectionInfo const& connection_info) } else { m_socket = make(); m_socket->connectToHost( - qstring_from_akstring(connection_info.url().host()), + qstring_from_ak_deprecated_string(connection_info.url().host()), connection_info.url().port_or_default()); } @@ -87,13 +87,13 @@ ErrorOr WebSocketImplQt::read(int max_size) return buffer.slice(0, bytes_read); } -ErrorOr WebSocketImplQt::read_line(size_t size) +ErrorOr WebSocketImplQt::read_line(size_t size) { auto buffer = TRY(ByteBuffer::create_uninitialized(size)); auto bytes_read = m_socket->readLine(reinterpret_cast(buffer.data()), buffer.size()); if (bytes_read == -1) return Error::from_string_literal("WebSocketImplQt::read_line(): Error reading from socket"); - return String::copy(buffer.span().slice(0, bytes_read)); + return DeprecatedString::copy(buffer.span().slice(0, bytes_read)); } } diff --git a/Ladybird/WebSocketImplQt.h b/Ladybird/WebSocketImplQt.h index ff0b508cd3..6285d53f46 100644 --- a/Ladybird/WebSocketImplQt.h +++ b/Ladybird/WebSocketImplQt.h @@ -22,7 +22,7 @@ public: virtual void connect(WebSocket::ConnectionInfo const&) override; virtual bool can_read_line() override; - virtual ErrorOr read_line(size_t) override; + virtual ErrorOr read_line(size_t) override; virtual ErrorOr read(int max_size) override; virtual bool send(ReadonlyBytes) override; virtual bool eof() override; diff --git a/Ladybird/WebSocketLadybird.cpp b/Ladybird/WebSocketLadybird.cpp index 4ace8b15c1..afadf2b463 100644 --- a/Ladybird/WebSocketLadybird.cpp +++ b/Ladybird/WebSocketLadybird.cpp @@ -50,7 +50,7 @@ WebSocketLadybird::WebSocketLadybird(NonnullRefPtr underly } } }; - m_websocket->on_close = [weak_this = make_weak_ptr()](u16 code, String reason, bool was_clean) { + m_websocket->on_close = [weak_this = make_weak_ptr()](u16 code, DeprecatedString reason, bool was_clean) { if (auto strong_this = weak_this.strong_ref()) if (strong_this->on_close) strong_this->on_close(code, move(reason), was_clean); @@ -84,7 +84,7 @@ void WebSocketLadybird::send(StringView message) m_websocket->send(WebSocket::Message(message)); } -void WebSocketLadybird::close(u16 code, String reason) +void WebSocketLadybird::close(u16 code, DeprecatedString reason) { m_websocket->close(code, reason); } diff --git a/Ladybird/WebSocketLadybird.h b/Ladybird/WebSocketLadybird.h index 879f0eb2ed..5e7eee75f0 100644 --- a/Ladybird/WebSocketLadybird.h +++ b/Ladybird/WebSocketLadybird.h @@ -23,7 +23,7 @@ public: virtual Web::WebSockets::WebSocket::ReadyState ready_state() override; virtual void send(ByteBuffer binary_or_text_message, bool is_text) override; virtual void send(StringView message) override; - virtual void close(u16 code, String reason) override; + virtual void close(u16 code, DeprecatedString reason) override; private: explicit WebSocketLadybird(NonnullRefPtr); diff --git a/Ladybird/main.cpp b/Ladybird/main.cpp index 188d555fd1..7aff00a074 100644 --- a/Ladybird/main.cpp +++ b/Ladybird/main.cpp @@ -79,7 +79,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (Core::File::exists(raw_url)) url = URL::create_with_file_scheme(Core::File::real_path_for(raw_url)); else if (!url.is_valid()) - url = String::formatted("http://{}", raw_url); + url = DeprecatedString::formatted("http://{}", raw_url); if (url.is_valid()) window.view().load(url);