diff --git a/dom/broadcastchannel/BroadcastChannelService.cpp b/dom/broadcastchannel/BroadcastChannelService.cpp index 732e692b9c6f..2aee7da35c8b 100644 --- a/dom/broadcastchannel/BroadcastChannelService.cpp +++ b/dom/broadcastchannel/BroadcastChannelService.cpp @@ -81,9 +81,13 @@ void BroadcastChannelService::RegisterActor( AssertIsOnBackgroundThread(); MOZ_ASSERT(aParent); - const auto& parents = mAgents.LookupForAdd(aOriginChannelKey).OrInsert([]() { - return new nsTArray(); - }); + auto* const parents = + mAgents.WithEntryHandle(aOriginChannelKey, [](auto&& entry) { + return entry + .OrInsertWith( + [] { return new nsTArray(); }) + .get(); + }); MOZ_ASSERT(!parents->Contains(aParent)); parents->AppendElement(aParent);