mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Tidy up return types of BroadcastChannel
Use GC::Ptr over a raw pointer and make the name() function const qualfied returning a reference instead of a copy.
This commit is contained in:
parent
d3ee49b092
commit
473bebc9a8
Notes:
github-actions[bot]
2024-11-23 15:45:09 +00:00
Author: https://github.com/shannonbooth
Commit: 473bebc9a8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2518
2 changed files with 14 additions and 16 deletions
|
@ -17,14 +17,19 @@ class BroadcastChannel final : public DOM::EventTarget {
|
|||
public:
|
||||
[[nodiscard]] static GC::Ref<BroadcastChannel> construct_impl(JS::Realm&, FlyString const& name);
|
||||
|
||||
FlyString name();
|
||||
// https://html.spec.whatwg.org/multipage/web-messaging.html#dom-broadcastchannel-name
|
||||
FlyString const& name() const
|
||||
{
|
||||
// The name getter steps are to return this's channel name.
|
||||
return m_channel_name;
|
||||
}
|
||||
|
||||
void close();
|
||||
|
||||
void set_onmessage(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onmessage();
|
||||
void set_onmessageerror(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onmessageerror();
|
||||
void set_onmessage(GC::Ptr<WebIDL::CallbackType>);
|
||||
GC::Ptr<WebIDL::CallbackType> onmessage();
|
||||
void set_onmessageerror(GC::Ptr<WebIDL::CallbackType>);
|
||||
GC::Ptr<WebIDL::CallbackType> onmessageerror();
|
||||
|
||||
private:
|
||||
BroadcastChannel(JS::Realm&, FlyString const& name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue