mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:07:34 +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:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -26,8 +26,8 @@ void ConnectionFromClient::die()
|
|||
Core::EventLoop::current().quit(0);
|
||||
}
|
||||
|
||||
Messages::WebSocketServer::ConnectResponse ConnectionFromClient::connect(URL const& url, String const& origin,
|
||||
Vector<String> const& protocols, Vector<String> const& extensions, IPC::Dictionary const& additional_request_headers)
|
||||
Messages::WebSocketServer::ConnectResponse ConnectionFromClient::connect(URL const& url, DeprecatedString const& origin,
|
||||
Vector<DeprecatedString> const& protocols, Vector<DeprecatedString> const& extensions, IPC::Dictionary const& additional_request_headers)
|
||||
{
|
||||
if (!url.is_valid()) {
|
||||
dbgln("WebSocket::Connect: Invalid URL requested: '{}'", url);
|
||||
|
@ -57,7 +57,7 @@ Messages::WebSocketServer::ConnectResponse ConnectionFromClient::connect(URL con
|
|||
connection->on_error = [this, id](auto message) {
|
||||
did_error(id, (i32)message);
|
||||
};
|
||||
connection->on_close = [this, id](u16 code, String reason, bool was_clean) {
|
||||
connection->on_close = [this, id](u16 code, DeprecatedString reason, bool was_clean) {
|
||||
did_close(id, code, move(reason), was_clean);
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ void ConnectionFromClient::send(i32 connection_id, bool is_text, ByteBuffer cons
|
|||
}
|
||||
}
|
||||
|
||||
void ConnectionFromClient::close(i32 connection_id, u16 code, String const& reason)
|
||||
void ConnectionFromClient::close(i32 connection_id, u16 code, DeprecatedString const& reason)
|
||||
{
|
||||
RefPtr<WebSocket> connection = m_connections.get(connection_id).value_or({});
|
||||
if (connection && connection->ready_state() == ReadyState::Open)
|
||||
|
@ -92,7 +92,7 @@ void ConnectionFromClient::close(i32 connection_id, u16 code, String const& reas
|
|||
}
|
||||
|
||||
Messages::WebSocketServer::SetCertificateResponse ConnectionFromClient::set_certificate(i32 connection_id,
|
||||
[[maybe_unused]] String const& certificate, [[maybe_unused]] String const& key)
|
||||
[[maybe_unused]] DeprecatedString const& certificate, [[maybe_unused]] DeprecatedString const& key)
|
||||
{
|
||||
RefPtr<WebSocket> connection = m_connections.get(connection_id).value_or({});
|
||||
bool success = false;
|
||||
|
@ -119,7 +119,7 @@ void ConnectionFromClient::did_error(i32 connection_id, i32 message)
|
|||
async_errored(connection_id, message);
|
||||
}
|
||||
|
||||
void ConnectionFromClient::did_close(i32 connection_id, u16 code, String reason, bool was_clean)
|
||||
void ConnectionFromClient::did_close(i32 connection_id, u16 code, DeprecatedString reason, bool was_clean)
|
||||
{
|
||||
async_closed(connection_id, code, reason, was_clean);
|
||||
deferred_invoke([this, connection_id] {
|
||||
|
|
|
@ -26,16 +26,16 @@ public:
|
|||
private:
|
||||
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>);
|
||||
|
||||
virtual Messages::WebSocketServer::ConnectResponse connect(URL const&, String const&, Vector<String> const&, Vector<String> const&, IPC::Dictionary const&) override;
|
||||
virtual Messages::WebSocketServer::ConnectResponse connect(URL const&, DeprecatedString const&, Vector<DeprecatedString> const&, Vector<DeprecatedString> const&, IPC::Dictionary const&) override;
|
||||
virtual Messages::WebSocketServer::ReadyStateResponse ready_state(i32) override;
|
||||
virtual void send(i32, bool, ByteBuffer const&) override;
|
||||
virtual void close(i32, u16, String const&) override;
|
||||
virtual Messages::WebSocketServer::SetCertificateResponse set_certificate(i32, String const&, String const&) override;
|
||||
virtual void close(i32, u16, DeprecatedString const&) override;
|
||||
virtual Messages::WebSocketServer::SetCertificateResponse set_certificate(i32, DeprecatedString const&, DeprecatedString const&) override;
|
||||
|
||||
void did_connect(i32);
|
||||
void did_receive_message(i32, Message);
|
||||
void did_error(i32, i32 message);
|
||||
void did_close(i32, u16 code, String reason, bool was_clean);
|
||||
void did_close(i32, u16 code, DeprecatedString reason, bool was_clean);
|
||||
void did_request_certificates(i32);
|
||||
|
||||
i32 m_connection_ids { 0 };
|
||||
|
|
|
@ -6,7 +6,7 @@ endpoint WebSocketClient
|
|||
connected(i32 connection_id) =|
|
||||
received(i32 connection_id, bool is_text, ByteBuffer data) =|
|
||||
errored(i32 connection_id, i32 message) =|
|
||||
closed(i32 connection_id, u16 code, String reason, bool clean) =|
|
||||
closed(i32 connection_id, u16 code, DeprecatedString reason, bool clean) =|
|
||||
|
||||
// Certificate requests
|
||||
certificate_requested(i32 connection_id) =|
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
endpoint WebSocketServer
|
||||
{
|
||||
// Connection API
|
||||
connect(URL url, String origin, Vector<String> protocols, Vector<String> extensions, IPC::Dictionary additional_request_headers) => (i32 connection_id)
|
||||
connect(URL url, DeprecatedString origin, Vector<DeprecatedString> protocols, Vector<DeprecatedString> extensions, IPC::Dictionary additional_request_headers) => (i32 connection_id)
|
||||
ready_state(i32 connection_id) => (u32 ready_state)
|
||||
send(i32 connection_id, bool is_text, ByteBuffer data) =|
|
||||
close(i32 connection_id, u16 code, String reason) =|
|
||||
close(i32 connection_id, u16 code, DeprecatedString reason) =|
|
||||
|
||||
set_certificate(i32 connection_id, String certificate, String key) => (bool success)
|
||||
set_certificate(i32 connection_id, DeprecatedString certificate, DeprecatedString key) => (bool success)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue