зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
2edc8a2488
Коммит
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);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче