Bug 1535913 - Part 2: Hold a keepalive for extension BCGs in WebExtensionPolicy, r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D114889
This commit is contained in:
Nika Layzell
2021-05-19 17:17:35 +00:00
parent 74a720dfe6
commit 1af647666c
4 changed files with 45 additions and 9 deletions

View File

@@ -272,6 +272,11 @@ void BrowsingContextGroup::RemoveKeepAlive() {
MaybeDestroy();
}
auto BrowsingContextGroup::MakeKeepAlivePtr() -> KeepAlivePtr {
AddKeepAlive();
return KeepAlivePtr{do_AddRef(this).take()};
}
void BrowsingContextGroup::MaybeDestroy() {
// Once there are no synced contexts referencing a `BrowsingContextGroup`, we
// can clear subscribers and destroy this group. We only do this in the parent