Skip to content

Commit

Permalink
Backed out changeset fa8487b94a38 due to a=BUSTAGE on comm-central
Browse files Browse the repository at this point in the history
  • Loading branch information
qdot committed Oct 29, 2018
1 parent fc26d6a commit ee8ccac
Show file tree
Hide file tree
Showing 27 changed files with 823 additions and 1,022 deletions.
15 changes: 5 additions & 10 deletions caps/NullPrincipal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,19 @@ NS_IMPL_CI_INTERFACE_GETTER(NullPrincipal,
/* static */ already_AddRefed<NullPrincipal>
NullPrincipal::CreateWithInheritedAttributes(nsIPrincipal* aInheritFrom)
{
MOZ_ASSERT(aInheritFrom);
return CreateWithInheritedAttributes(Cast(aInheritFrom)->OriginAttributesRef(), false);
RefPtr<NullPrincipal> nullPrin = new NullPrincipal();
nsresult rv = nullPrin->Init(Cast(aInheritFrom)->OriginAttributesRef());
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
return nullPrin.forget();
}

/* static */ already_AddRefed<NullPrincipal>
NullPrincipal::CreateWithInheritedAttributes(nsIDocShell* aDocShell, bool aIsFirstParty)
{
MOZ_ASSERT(aDocShell);

OriginAttributes attrs = nsDocShell::Cast(aDocShell)->GetOriginAttributes();
return CreateWithInheritedAttributes(attrs, aIsFirstParty);
}

/* static */ already_AddRefed<NullPrincipal>
NullPrincipal::CreateWithInheritedAttributes(const OriginAttributes& aOriginAttributes, bool aIsFirstParty)
{
RefPtr<NullPrincipal> nullPrin = new NullPrincipal();
nsresult rv = nullPrin->Init(aOriginAttributes, aIsFirstParty);
nsresult rv = nullPrin->Init(attrs, aIsFirstParty);
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
return nullPrin.forget();
}
Expand Down
12 changes: 3 additions & 9 deletions caps/NullPrincipal.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,14 @@ class NullPrincipal final : public BasePrincipal
NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) override;
NS_IMETHOD GetAddonId(nsAString& aAddonId) override;

static already_AddRefed<NullPrincipal>
CreateWithInheritedAttributes(nsIPrincipal* aInheritFrom);
static already_AddRefed<NullPrincipal> CreateWithInheritedAttributes(nsIPrincipal* aInheritFrom);

// Create NullPrincipal with origin attributes from docshell.
// If aIsFirstParty is true, and the pref 'privacy.firstparty.isolate' is also
// enabled, the mFirstPartyDomain value of the origin attributes will be set
// to an unique value.
static already_AddRefed<NullPrincipal>
CreateWithInheritedAttributes(nsIDocShell* aDocShell,
bool aIsFirstParty = false);
static already_AddRefed<NullPrincipal>
CreateWithInheritedAttributes(const OriginAttributes& aOriginAttributes,
bool aIsFirstParty = false);
CreateWithInheritedAttributes(nsIDocShell* aDocShell, bool aIsFirstParty = false);

static already_AddRefed<NullPrincipal>
Create(const OriginAttributes& aOriginAttributes,
Expand All @@ -90,8 +85,7 @@ class NullPrincipal final : public BasePrincipal
protected:
virtual ~NullPrincipal() = default;

bool SubsumesInternal(nsIPrincipal* aOther,
DocumentDomainConsideration aConsideration) override
bool SubsumesInternal(nsIPrincipal* aOther, DocumentDomainConsideration aConsideration) override
{
return aOther == this;
}
Expand Down
4 changes: 2 additions & 2 deletions docshell/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ XPIDL_MODULE = 'docshell'
EXPORTS += [
'nsCTooltipTextProvider.h',
'nsDocShell.h',
'nsDocShellLoadState.h',
'nsDocShellLoadInfo.h',
'nsDocShellLoadTypes.h',
'nsDocShellTreeOwner.h',
'nsILinkHandler.h',
Expand All @@ -88,7 +88,7 @@ UNIFIED_SOURCES += [
'nsDocShell.cpp',
'nsDocShellEditorData.cpp',
'nsDocShellEnumerator.cpp',
'nsDocShellLoadState.cpp',
'nsDocShellLoadInfo.cpp',
'nsDocShellTreeOwner.cpp',
'nsDSURIContentListener.cpp',
'nsPingListener.cpp',
Expand Down
Loading

0 comments on commit ee8ccac

Please sign in to comment.