1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:37:35 +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

@ -474,7 +474,7 @@
[submenu addItem:[NSMenuItem separatorItem]];
auto* spoof_user_agent_menu = [[NSMenu alloc] init];
auto add_user_agent = [spoof_user_agent_menu](DeprecatedString name) {
auto add_user_agent = [spoof_user_agent_menu](ByteString name) {
[spoof_user_agent_menu addItem:[[NSMenuItem alloc] initWithTitle:Ladybird::string_to_ns_string(name)
action:@selector(setUserAgentSpoof:)
keyEquivalent:@""]];

View file

@ -27,7 +27,7 @@
- (void)onLoadStart:(URL const&)url isRedirect:(BOOL)is_redirect;
- (void)onLoadFinish:(URL const&)url;
- (void)onTitleChange:(DeprecatedString const&)title;
- (void)onTitleChange:(ByteString const&)title;
- (void)onFaviconChange:(Gfx::Bitmap const&)bitmap;
- (void)onNavigateBack;
@ -58,7 +58,7 @@
- (void)resetZoom;
- (float)zoomLevel;
- (void)debugRequest:(DeprecatedString const&)request argument:(DeprecatedString const&)argument;
- (void)debugRequest:(ByteString const&)request argument:(ByteString const&)argument;
- (void)viewSource;

View file

@ -180,7 +180,7 @@ struct HideCursor {
m_web_view_bridge->set_preferred_color_scheme(color_scheme);
}
- (void)debugRequest:(DeprecatedString const&)request argument:(DeprecatedString const&)argument
- (void)debugRequest:(ByteString const&)request argument:(ByteString const&)argument
{
m_web_view_bridge->debug_request(request, argument);
}
@ -634,7 +634,7 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
return [delegate cookieJar].get_named_cookie(url, name);
};
m_web_view_bridge->on_get_cookie = [](auto const& url, auto source) -> DeprecatedString {
m_web_view_bridge->on_get_cookie = [](auto const& url, auto source) -> ByteString {
auto* delegate = (ApplicationDelegate*)[NSApp delegate];
return [delegate cookieJar].get_cookie(url, source);
};

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/DeprecatedString.h>
#include <AK/ByteString.h>
#include <Ladybird/Utilities.h>
#include <LibCore/Resource.h>
#include <LibGfx/Palette.h>
@ -33,7 +33,7 @@ Core::AnonymousBuffer create_system_palette()
auto theme_file = is_dark ? "Dark"sv : "Default"sv;
auto theme_ini = MUST(Core::Resource::load_from_uri(MUST(String::formatted("resource://themes/{}.ini", theme_file))));
auto theme = Gfx::load_system_theme(theme_ini->filesystem_path().to_deprecated_string()).release_value_but_fixme_should_propagate_errors();
auto theme = Gfx::load_system_theme(theme_ini->filesystem_path().to_byte_string()).release_value_but_fixme_should_propagate_errors();
auto palette_impl = Gfx::PaletteImpl::create_with_anonymous_buffer(theme);
auto palette = Gfx::Palette(move(palette_impl));

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/DeprecatedString.h>
#include <AK/ByteString.h>
#include <AK/String.h>
#include <AK/URL.h>
#include <Ladybird/Utilities.h>
@ -247,7 +247,7 @@ static constexpr CGFloat const WINDOW_HEIGHT = 800;
}
}
- (void)onTitleChange:(DeprecatedString const&)title
- (void)onTitleChange:(ByteString const&)title
{
[[self tabController] onTitleChange:title];

View file

@ -16,7 +16,7 @@ struct TabSettings {
BOOL scripting_enabled { YES };
BOOL block_popups { YES };
BOOL same_origin_policy_enabled { NO };
DeprecatedString user_agent_name { "Disabled"sv };
ByteString user_agent_name { "Disabled"sv };
};
@interface TabController : NSWindowController <NSWindowDelegate>
@ -27,14 +27,14 @@ struct TabSettings {
- (void)loadHTML:(StringView)html url:(URL const&)url;
- (void)onLoadStart:(URL const&)url isRedirect:(BOOL)isRedirect;
- (void)onTitleChange:(DeprecatedString const&)title;
- (void)onTitleChange:(ByteString const&)title;
- (void)navigateBack:(id)sender;
- (void)navigateForward:(id)sender;
- (void)reload:(id)sender;
- (void)clearHistory;
- (void)debugRequest:(DeprecatedString const&)request argument:(DeprecatedString const&)argument;
- (void)debugRequest:(ByteString const&)request argument:(ByteString const&)argument;
- (void)focusLocationToolbarItem;

View file

@ -54,7 +54,7 @@ enum class IsHistoryNavigation {
@interface TabController () <NSToolbarDelegate, NSSearchFieldDelegate>
{
DeprecatedString m_title;
ByteString m_title;
WebView::History m_history;
IsHistoryNavigation m_is_history_navigation;
@ -133,7 +133,7 @@ enum class IsHistoryNavigation {
[self updateNavigationButtonStates];
}
- (void)onTitleChange:(DeprecatedString const&)title
- (void)onTitleChange:(ByteString const&)title
{
m_title = title;
m_history.update_title(m_title);
@ -201,7 +201,7 @@ enum class IsHistoryNavigation {
[self updateNavigationButtonStates];
}
- (void)debugRequest:(DeprecatedString const&)request argument:(DeprecatedString const&)argument
- (void)debugRequest:(ByteString const&)request argument:(ByteString const&)argument
{
if (request == "dump-history") {
m_history.dump();
@ -390,8 +390,8 @@ enum class IsHistoryNavigation {
- (void)setUserAgentSpoof:(NSMenuItem*)sender
{
DeprecatedString const user_agent_name = [[sender title] UTF8String];
DeprecatedString user_agent = "";
ByteString const user_agent_name = [[sender title] UTF8String];
ByteString user_agent = "";
if (user_agent_name == "Disabled"sv) {
user_agent = Web::default_user_agent;
} else {