mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 944854 - Avoid triggering harmless assertion on PeerConnectionObserver weakref. r=abr
This commit is contained in:
parent
c4fd8f4be2
commit
06185186a7
@ -992,15 +992,18 @@ PeerConnectionImpl::CreateDataChannel(const nsAString& aLabel,
|
||||
// Without it, each weak-ref call in this file would look like this:
|
||||
//
|
||||
// nsCOMPtr<nsISupportsWeakReference> tmp = do_QueryReferent(mPCObserver);
|
||||
// nsRefPtr<nsSupportsWeakReference> tmp2 = do_QueryObject(tmp);
|
||||
// nsRefPtr<PeerConnectionObserver> pco = static_cast<PeerConnectionObserver*>(&*tmp2);
|
||||
// if (!pco) {
|
||||
// if (!tmp) {
|
||||
// return;
|
||||
// }
|
||||
// nsRefPtr<nsSupportsWeakReference> tmp2 = do_QueryObject(tmp);
|
||||
// nsRefPtr<PeerConnectionObserver> pco = static_cast<PeerConnectionObserver*>(&*tmp2);
|
||||
|
||||
static already_AddRefed<PeerConnectionObserver>
|
||||
do_QueryObjectReferent(nsIWeakReference* aRawPtr) {
|
||||
nsCOMPtr<nsISupportsWeakReference> tmp = do_QueryReferent(aRawPtr);
|
||||
if (!tmp) {
|
||||
return nullptr;
|
||||
}
|
||||
nsRefPtr<nsSupportsWeakReference> tmp2 = do_QueryObject(tmp);
|
||||
nsRefPtr<PeerConnectionObserver> tmp3 = static_cast<PeerConnectionObserver*>(&*tmp2);
|
||||
return tmp3.forget();
|
||||
|
Loading…
Reference in New Issue
Block a user