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

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -85,7 +85,7 @@ void WebSocket::send(Message const& message)
send_frame(WebSocket::OpCode::Binary, message.data(), true);
}
void WebSocket::close(u16 code, String const& message)
void WebSocket::close(u16 code, DeprecatedString const& message)
{
VERIFY(m_impl);
@ -316,7 +316,7 @@ void WebSocket::read_server_handshake()
if (header_name.equals_ignoring_case("Sec-WebSocket-Accept"sv)) {
// 4. |Sec-WebSocket-Accept| should be base64(SHA1(|Sec-WebSocket-Key| + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"))
auto expected_content = String::formatted("{}258EAFA5-E914-47DA-95CA-C5AB0DC85B11", m_websocket_key);
auto expected_content = DeprecatedString::formatted("{}258EAFA5-E914-47DA-95CA-C5AB0DC85B11", m_websocket_key);
Crypto::Hash::Manager hash;
hash.initialize(Crypto::Hash::HashKind::SHA1);
@ -484,7 +484,7 @@ void WebSocket::read_frame()
if (op_code == WebSocket::OpCode::ConnectionClose) {
if (payload.size() > 1) {
m_last_close_code = (((u16)(payload[0] & 0xff) << 8) | ((u16)(payload[1] & 0xff)));
m_last_close_message = String(ReadonlyBytes(payload.offset_pointer(2), payload.size() - 2));
m_last_close_message = DeprecatedString(ReadonlyBytes(payload.offset_pointer(2), payload.size() - 2));
}
m_state = WebSocket::InternalState::Closing;
return;
@ -618,7 +618,7 @@ void WebSocket::notify_open()
on_open();
}
void WebSocket::notify_close(u16 code, String reason, bool was_clean)
void WebSocket::notify_close(u16 code, DeprecatedString reason, bool was_clean)
{
if (!on_close)
return;