mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 20:25:44 +00:00
Bug 1525208 - Part 5: Avoid using SameCOMIdentity to compare windows inside ThirdPartyUtil::IsThirdPartyWindow(); r=baku
Depends on D18646 Differential Revision: https://phabricator.services.mozilla.com/D18647 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
4eb46262c5
commit
d7f642dba2
@ -164,7 +164,12 @@ ThirdPartyUtil::IsThirdPartyWindow(mozIDOMWindowProxy* aWindow, nsIURI* aURI,
|
||||
// We use GetScriptableParent rather than GetParent because we consider
|
||||
// <iframe mozbrowser> to be a top-level frame.
|
||||
parent = current->GetScriptableParent();
|
||||
if (SameCOMIdentity(parent, current)) {
|
||||
// We don't use SameCOMIdentity here since we know that nsPIDOMWindowOuter
|
||||
// is only implemented by nsGlobalWindowOuter, so different objects of that
|
||||
// type will not have different nsISupports COM identities, and checking the
|
||||
// actual COM identity using SameCOMIdentity is expensive due to the virtual
|
||||
// calls involved.
|
||||
if (parent == current) {
|
||||
// We're at the topmost content window. We already know the answer.
|
||||
*aResult = false;
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user