summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/WebSockets
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-22 19:00:49 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commitb345a0acca725d1b4e4d6df26fc602d69e97f073 (patch)
treec1a1b7936505373fc3be8cb7b6f0ced444d05d63 /Userland/Libraries/LibWeb/WebSockets
parente3895e6c808d4606f02b26b1eaad3a3a803bba12 (diff)
downloadserenity-b345a0acca725d1b4e4d6df26fc602d69e97f073.zip
LibJS+LibWeb: Reduce use of GlobalObject as an intermediary
- Prefer VM::current_realm() over GlobalObject::associated_realm() - Prefer VM::heap() over GlobalObject::heap() - Prefer Cell::vm() over Cell::global_object() - Prefer Wrapper::vm() over Wrapper::global_object() - Inline Realm::global_object() calls used to access intrinsics as they will later perform a direct lookup without going through the global object
Diffstat (limited to 'Userland/Libraries/LibWeb/WebSockets')
-rw-r--r--Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp
index 1d67485d1b..ca1197f25e 100644
--- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp
+++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp
@@ -213,8 +213,8 @@ void WebSocket::on_message(ByteBuffer message, bool is_text)
TODO();
} else if (m_binary_type == "arraybuffer") {
// type indicates that the data is Binary and binaryType is "arraybuffer"
- auto& global_object = wrapper()->global_object();
- auto& realm = *global_object.associated_realm();
+ auto& vm = wrapper()->vm();
+ auto& realm = *vm.current_realm();
HTML::MessageEventInit event_init;
event_init.data = JS::ArrayBuffer::create(realm, message);
event_init.origin = url();