mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1373675 - Add hasListenerFor to nsIWebSocketEventService. r=mcmanus
This makes it possible to check if a Window has 'active' WebSockets.
This commit is contained in:
parent
2edc8a2488
commit
a288a87eba
@ -440,6 +440,17 @@ WebSocketEventService::RemoveListener(uint64_t aInnerWindowID,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebSocketEventService::HasListenerFor(uint64_t aInnerWindowID,
|
||||
bool* aResult)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
*aResult = mWindows.Get(aInnerWindowID);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebSocketEventService::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
const char16_t* aData)
|
||||
|
@ -76,4 +76,6 @@ interface nsIWebSocketEventService : nsISupports
|
||||
|
||||
[must_use] void removeListener(in unsigned long long aInnerWindowID,
|
||||
in nsIWebSocketEventListener aListener);
|
||||
|
||||
[must_use] bool hasListenerFor(in unsigned long long aInnerWindowID);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user