Bug 1589754 - Rename nsGlobalWindowInner::GetTopLevelPrincipal r=Ehsan

Differential Revision: https://phabricator.services.mozilla.com/D50068

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Wu 2019-10-23 18:14:44 +00:00
Родитель fcb704f351
Коммит bcccc1d738
5 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -5618,7 +5618,7 @@ nsPIDOMWindowOuter* nsGlobalWindowInner::GetInProcessParentInternal() {
return outer->GetInProcessParentInternal();
}
nsIPrincipal* nsGlobalWindowInner::GetTopLevelPrincipal() {
nsIPrincipal* nsGlobalWindowInner::GetTopLevelAntiTrackingPrincipal() {
nsPIDOMWindowOuter* outerWindow = GetOuterWindowInternal();
if (!outerWindow) {
return nullptr;

Просмотреть файл

@ -1135,7 +1135,7 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
virtual already_AddRefed<nsPIWindowRoot> GetTopWindowRoot() override;
// Get the toplevel principal, returns null if this is a toplevel window.
nsIPrincipal* GetTopLevelPrincipal();
nsIPrincipal* GetTopLevelAntiTrackingPrincipal();
// Get the parent principal, returns null if this or the parent are not a
// toplevel window. This is mainly used to determine the anti-tracking storage

Просмотреть файл

@ -89,7 +89,7 @@ nsresult PermissionDelegateHandler::GetPermissionForPermissionsAPI(
nsPIDOMWindowInner* window = mDocument->GetInnerWindow();
nsGlobalWindowInner* innerWindow = nsGlobalWindowInner::Cast(window);
nsIPrincipal* topPrincipal = innerWindow->GetTopLevelPrincipal();
nsIPrincipal* topPrincipal = innerWindow->GetTopLevelAntiTrackingPrincipal();
// Permission is delegated in same origin
if (principal->Subsumes(topPrincipal)) {

Просмотреть файл

@ -177,7 +177,7 @@ LoadInfo::LoadInfo(
nsGlobalWindowInner* innerWindow =
nsGlobalWindowInner::Cast(contextOuter->GetCurrentInnerWindow());
if (innerWindow) {
mTopLevelPrincipal = innerWindow->GetTopLevelPrincipal();
mTopLevelPrincipal = innerWindow->GetTopLevelAntiTrackingPrincipal();
// The top-level-storage-area-principal is not null only for the first
// level of iframes (null for top-level contexts, and null for
@ -388,7 +388,7 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* aOuterWindow,
nsGlobalWindowInner* innerWindow =
nsGlobalWindowInner::Cast(aOuterWindow->GetCurrentInnerWindow());
if (innerWindow) {
mTopLevelPrincipal = innerWindow->GetTopLevelPrincipal();
mTopLevelPrincipal = innerWindow->GetTopLevelAntiTrackingPrincipal();
// mTopLevelStorageAreaPrincipal is always null for top-level document
// loading.
}

Просмотреть файл

@ -90,7 +90,7 @@ bool GetParentPrincipalAndTrackingOrigin(
// mode only.
(aBehavior == nsICookieService::BEHAVIOR_REJECT_TRACKER)
? a3rdPartyTrackingWindow->GetTopLevelStorageAreaPrincipal()
: a3rdPartyTrackingWindow->GetTopLevelPrincipal();
: a3rdPartyTrackingWindow->GetTopLevelAntiTrackingPrincipal();
if (!topLevelStoragePrincipal) {
LOG(("No top-level storage area principal at hand"));
return false;