Bug 1584007 - FutureClientSourceParent should keep ClientManagerService alive r=asuth
authorPerry Jiang <perry@mozilla.com>
Tue, 24 Mar 2020 15:52:37 +0000
changeset 520469 c626a363823edf7b8ba37e7915a2c339c6f9318d
parent 520468 0d130a64b0f5c16db4995d3f27f2e6b21c656977
child 520470 52798009e73aa85ba9f2309b7d150c3eea4d7622
push id37251
push usermalexandru@mozilla.com
push dateThu, 26 Mar 2020 09:33:08 +0000
treeherdermozilla-central@3e5a7430c8d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1584007
milestone76.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 1584007 - FutureClientSourceParent should keep ClientManagerService alive r=asuth The strong reference will be dropped when FutureClientSourceParent is removed, and we guarantee that all FutureClientSourceParents will either be removed or replaced with a ClientSourceParent (or at least this is a guarantee that's supposed to be true). Depends on D66529 Differential Revision: https://phabricator.services.mozilla.com/D68041
dom/clients/manager/ClientManagerService.h
--- a/dom/clients/manager/ClientManagerService.h
+++ b/dom/clients/manager/ClientManagerService.h
@@ -59,16 +59,17 @@ class ClientManagerService final {
     void RejectPromiseIfExists(const CopyableErrorResult& aRv) {
       MOZ_ASSERT(aRv.Failed());
       mPromiseHolder.RejectIfExists(aRv, __func__);
     }
 
    private:
     const mozilla::ipc::PrincipalInfo mPrincipalInfo;
     MozPromiseHolder<SourcePromise> mPromiseHolder;
+    RefPtr<ClientManagerService> mService = ClientManagerService::GetInstance();
   };
 
   using SourceTableEntry =
       Variant<FutureClientSourceParent, ClientSourceParent*>;
 
   struct nsIDHasher {
     using Key = nsID;
     using Lookup = Key;