Backed out changeset 24a113011b90 (
bug 1162772)
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -83,17 +83,16 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadin
// if consumers pass both, aLoadingContext and aLoadingPrincipal
// then the loadingPrincipal must be the same as the node's principal
MOZ_ASSERT(!aLoadingContext || !aLoadingPrincipal ||
aLoadingContext->NodePrincipal() == aLoadingPrincipal);
// if the load is sandboxed, we can not also inherit the principal
if (mSecurityFlags & nsILoadInfo::SEC_SANDBOXED) {
mSecurityFlags ^= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
- mSecurityFlags |= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL_WAS_DROPPED;
}
if (aLoadingContext) {
nsCOMPtr<nsPIDOMWindowOuter> contextOuter = aLoadingContext->OwnerDoc()->GetWindow();
if (contextOuter) {
ComputeIsThirdPartyContext(contextOuter);
}
@@ -190,17 +189,16 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* a
// Top-level loads are never third-party
// Grab the information we can out of the window.
MOZ_ASSERT(aOuterWindow);
MOZ_ASSERT(mTriggeringPrincipal);
// if the load is sandboxed, we can not also inherit the principal
if (mSecurityFlags & nsILoadInfo::SEC_SANDBOXED) {
mSecurityFlags ^= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
- mSecurityFlags |= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL_WAS_DROPPED;
}
// NB: Ignore the current inner window since we're navigating away from it.
mOuterWindowID = aOuterWindow->WindowID();
// TODO We can have a parent without a frame element in some cases dealing
// with the hidden window.
nsCOMPtr<nsPIDOMWindowOuter> parent = aOuterWindow->GetScriptableParent();
--- a/netwerk/base/nsILoadInfo.idl
+++ b/netwerk/base/nsILoadInfo.idl
@@ -113,20 +113,17 @@ interface nsILoadInfo : nsISupports
*
* This will happen independently of the scheme of the URI that the
* channel is loading.
*
* So if the loading document comes from "http://a.com/", and the channel
* is loading the URI "http://b.com/whatever", GetChannelResultPrincipal
* will return a principal from "http://a.com/".
*
- * This flag can not be used together with SEC_SANDBOXED. If both are passed
- * to the LoadInfo constructor then this flag will be dropped. If you need
- * to know whether this flag would have been present but was dropped due to
- * sandboxing, check for the SEC_FORCE_INHERIT_PRINCIPAL_WAS_DROPPED flag.
+ * This flag can not be used together with SEC_SANDBOXED.
*/
const unsigned long SEC_FORCE_INHERIT_PRINCIPAL = (1<<7);
/**
* Sandbox the load. The resulting resource will use a freshly created
* null principal. So GetChannelResultPrincipal will always return a
* null principal whenever this flag is set.
*
@@ -165,24 +162,16 @@ interface nsILoadInfo : nsISupports
* enforce even when a loading is not happening in the context of a document.
*
* If the flag is true, even if a document context is present,
* GetUsePrivateBrowsing will always return true.
*/
const unsigned long SEC_FORCE_PRIVATE_BROWSING = (1<<12);
/**
- * The SEC_FORCE_INHERIT_PRINCIPAL flag may be dropped when a load info
- * object is created. Specifically, it will be dropped if the SEC_SANDBOXED
- * flag is also present. This flag is set if SEC_FORCE_INHERIT_PRINCIPAL was
- * dropped.
- */
- const unsigned long SEC_FORCE_INHERIT_PRINCIPAL_WAS_DROPPED = (1<<13);
-
- /**
* The loadingPrincipal is the principal that is responsible for the load.
* It is *NOT* the principal tied to the resource/URI that this
* channel is loading, it's the principal of the resource's
* caller or requester. For example, if this channel is loading
* an image from http://b.com that is embedded in a document
* who's origin is http://a.com, the loadingPrincipal is http://a.com.
*
* The loadingPrincipal will never be null.