зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1337056 - Part 5: Add support for finer-grained permission update messages to ContentParent, r=baku
MozReview-Commit-ID: 6y6eBLWPTue
This commit is contained in:
Родитель
ce8ac3bacf
Коммит
13c3e3acbe
|
@ -2055,7 +2055,6 @@ ContentParent::ContentParent(ContentParent* aOpener,
|
||||||
, mNumDestroyingTabs(0)
|
, mNumDestroyingTabs(0)
|
||||||
, mIsAvailable(true)
|
, mIsAvailable(true)
|
||||||
, mIsAlive(true)
|
, mIsAlive(true)
|
||||||
, mSendPermissionUpdates(false)
|
|
||||||
, mIsForBrowser(!mRemoteType.IsEmpty())
|
, mIsForBrowser(!mRemoteType.IsEmpty())
|
||||||
, mCalledClose(false)
|
, mCalledClose(false)
|
||||||
, mCalledKillHard(false)
|
, mCalledKillHard(false)
|
||||||
|
@ -5046,6 +5045,12 @@ ContentParent::EnsurePermissionsByKey(const nsCString& aKey)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ContentParent::NeedsPermissionsUpdate(const nsACString& aPermissionKey) const
|
||||||
|
{
|
||||||
|
return mActivePermissionKeys.Contains(aPermissionKey);
|
||||||
|
}
|
||||||
|
|
||||||
mozilla::ipc::IPCResult
|
mozilla::ipc::IPCResult
|
||||||
ContentParent::RecvAccumulateChildHistograms(
|
ContentParent::RecvAccumulateChildHistograms(
|
||||||
InfallibleTArray<Accumulation>&& aAccumulations)
|
InfallibleTArray<Accumulation>&& aAccumulations)
|
||||||
|
|
|
@ -377,10 +377,7 @@ public:
|
||||||
return mScriptableHelper;
|
return mScriptableHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NeedsPermissionsUpdate() const
|
bool NeedsPermissionsUpdate(const nsACString& aPermissionKey) const;
|
||||||
{
|
|
||||||
return mSendPermissionUpdates;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kill our subprocess and make sure it dies. Should only be used
|
* Kill our subprocess and make sure it dies. Should only be used
|
||||||
|
@ -1168,7 +1165,6 @@ private:
|
||||||
// still pass through.
|
// still pass through.
|
||||||
bool mIsAlive;
|
bool mIsAlive;
|
||||||
|
|
||||||
bool mSendPermissionUpdates;
|
|
||||||
bool mIsForBrowser;
|
bool mIsForBrowser;
|
||||||
|
|
||||||
// These variables track whether we've called Close() and KillHard() on our
|
// These variables track whether we've called Close() and KillHard() on our
|
||||||
|
|
|
@ -1568,11 +1568,14 @@ nsPermissionManager::AddInternal(nsIPrincipal* aPrincipal,
|
||||||
IPC::Permission permission(origin, aType, aPermission,
|
IPC::Permission permission(origin, aType, aPermission,
|
||||||
aExpireType, aExpireTime);
|
aExpireType, aExpireTime);
|
||||||
|
|
||||||
|
nsAutoCString permissionKey;
|
||||||
|
GetKeyForPrincipal(aPrincipal, permissionKey);
|
||||||
|
|
||||||
nsTArray<ContentParent*> cplist;
|
nsTArray<ContentParent*> cplist;
|
||||||
ContentParent::GetAll(cplist);
|
ContentParent::GetAll(cplist);
|
||||||
for (uint32_t i = 0; i < cplist.Length(); ++i) {
|
for (uint32_t i = 0; i < cplist.Length(); ++i) {
|
||||||
ContentParent* cp = cplist[i];
|
ContentParent* cp = cplist[i];
|
||||||
if (cp->NeedsPermissionsUpdate())
|
if (cp->NeedsPermissionsUpdate(permissionKey))
|
||||||
Unused << cp->SendAddPermission(permission);
|
Unused << cp->SendAddPermission(permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче