Bug 1541085 - Web Authentication - Only reset mTransaction on cycle collection r=keeler
authorJ.C. Jones <jjones@mozilla.com>
Tue, 02 Apr 2019 17:56:47 +0000
changeset 467647 1e35279977a4b2638e9c2c5f080e99f3afaf3aac
parent 467646 b052410b667385a66f5b9916b1e91bef80f8fc09
child 467648 10a446ed2a38d6af1eaa8b6d51ad9f1333b247d8
push id35806
push userrgurzau@mozilla.com
push dateWed, 03 Apr 2019 04:07:39 +0000
treeherdermozilla-central@45808ab18609 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1541085, 1540378
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1541085 - Web Authentication - Only reset mTransaction on cycle collection r=keeler This stack is pretty clear that calling StopListeningForVisibilityEvents (via ClearTransaction) is a no-go from the cycle collector. We need to instead just do the minimum version of bug 1540378, just reset mTransaction and move on. Differential Revision: https://phabricator.services.mozilla.com/D25804
dom/u2f/U2F.cpp
dom/webauthn/WebAuthnManager.cpp
--- a/dom/u2f/U2F.cpp
+++ b/dom/u2f/U2F.cpp
@@ -50,17 +50,17 @@ NS_INTERFACE_MAP_END_INHERITING(WebAuthn
 
 NS_IMPL_ADDREF_INHERITED(U2F, WebAuthnManagerBase)
 NS_IMPL_RELEASE_INHERITED(U2F, WebAuthnManagerBase)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(U2F)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(U2F, WebAuthnManagerBase)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mTransaction)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
-  tmp->ClearTransaction();
+  tmp->mTransaction.reset();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(U2F, WebAuthnManagerBase)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTransaction)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(U2F)
 
 /***********************************************************************
  * Utility Functions
--- a/dom/webauthn/WebAuthnManager.cpp
+++ b/dom/webauthn/WebAuthnManager.cpp
@@ -38,17 +38,17 @@ static mozilla::LazyLogModule gWebAuthnM
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(WebAuthnManager,
                                                WebAuthnManagerBase)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(WebAuthnManager)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(WebAuthnManager,
                                                 WebAuthnManagerBase)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mFollowingSignal)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mTransaction)
-  tmp->ClearTransaction();
+  tmp->mTransaction.reset();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(WebAuthnManager,
                                                   WebAuthnManagerBase)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFollowingSignal)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTransaction)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 /***********************************************************************