Backed out changeset 82c89f573e53 (bug 1191460)

--HG--
extra : rebase_source : 3940f457bfda06bbc7d9236b57403e431a9a5957
This commit is contained in:
Carsten "Tomcat" Book 2015-11-26 12:02:59 +01:00
parent 3d36e0d95d
commit 23302026c1
4 changed files with 15 additions and 62 deletions

View File

@ -13744,13 +13744,6 @@ nsDocShell::SetIsSignedPackage(const nsAString& aSignedPkg)
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::SetUserContextId(uint32_t aUserContextId)
{
mUserContextId = aUserContextId;
return NS_OK;
}
/* [infallible] */ NS_IMETHODIMP
nsDocShell::GetIsBrowserElement(bool* aIsBrowser)
{
@ -13854,8 +13847,6 @@ nsDocShell::GetOriginAttributes()
attrs.mAppId = mOwnOrContainingAppId;
}
attrs.mUserContextId = mUserContextId;
if (mFrameType == eFrameTypeBrowser) {
attrs.mInBrowser = true;
}
@ -14072,7 +14063,8 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
}
if (aIsNonSubresourceRequest) {
*aShouldIntercept = swm->IsAvailable(GetOriginAttributes(), aURI);
OriginAttributes attrs(GetAppId(), GetIsInBrowserElement());
*aShouldIntercept = swm->IsAvailable(attrs, aURI);
return NS_OK;
}
@ -14162,9 +14154,11 @@ nsDocShell::ChannelIntercepted(nsIInterceptedChannel* aChannel,
bool isReload = mLoadType & LOAD_CMD_RELOAD;
OriginAttributes attrs(GetAppId(), GetIsInBrowserElement());
ErrorResult error;
nsCOMPtr<nsIRunnable> runnable =
swm->PrepareFetchEvent(GetOriginAttributes(), doc, aChannel, isReload, isSubresourceLoad, error);
swm->PrepareFetchEvent(attrs, doc, aChannel, isReload, isSubresourceLoad, error);
if (NS_WARN_IF(error.Failed())) {
return error.StealNSResult();
}

View File

@ -232,7 +232,6 @@ public:
NS_IMETHOD GetUseRemoteTabs(bool*) override;
NS_IMETHOD SetRemoteTabs(bool) override;
NS_IMETHOD GetOriginAttributes(JS::MutableHandle<JS::Value>) override;
NS_IMETHOD SetUserContextId(uint32_t);
// Restores a cached presentation from history (mLSHE).
// This method swaps out the content viewer and simulates loads for
@ -1003,9 +1002,6 @@ protected:
// find it by walking up the docshell hierarchy.)
uint32_t mOwnOrContainingAppId;
// userContextId signifying which container we are in
uint32_t mUserContextId;
nsString mPaymentRequestId;
nsString GetInheritedPaymentRequestId();

View File

@ -236,7 +236,7 @@ nsFrameLoader::LoadFrame()
if (NS_SUCCEEDED(rv)) {
rv = LoadURI(uri);
}
if (NS_FAILED(rv)) {
FireErrorEvent();
@ -327,7 +327,7 @@ nsFrameLoader::ReallyStartLoading()
if (NS_FAILED(rv)) {
FireErrorEvent();
}
return rv;
}
@ -347,7 +347,7 @@ nsFrameLoader::ReallyStartLoadingInternal()
// FIXME get error codes from child
mRemoteBrowser->LoadURL(mURIToLoad);
if (!mRemoteBrowserShown && !ShowRemoteFrame(ScreenIntSize(0, 0))) {
NS_WARNING("[nsFrameLoader] ReallyStartLoadingInternal tried but couldn't show remote browser.\n");
}
@ -380,7 +380,7 @@ nsFrameLoader::ReallyStartLoadingInternal()
loadInfo->SetOwner(mOwnerContent->NodePrincipal());
nsCOMPtr<nsIURI> referrer;
nsAutoString srcdoc;
bool isSrcdoc = mOwnerContent->IsHTMLElement(nsGkAtoms::iframe) &&
mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::srcdoc,
@ -554,7 +554,7 @@ nsFrameLoader::AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
{
NS_PRECONDITION(aItem, "Must have docshell treeitem");
NS_PRECONDITION(mOwnerContent, "Must have owning content");
nsAutoString value;
bool isContent = false;
mOwnerContent->GetAttr(kNameSpaceID_None, TypeAttrName(), value);
@ -1135,7 +1135,7 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
!AllDescendantsOfType(otherDocshell, otherType))) {
return NS_ERROR_NOT_IMPLEMENTED;
}
// Save off the tree owners, frame elements, chrome event handlers, and
// docshell and document parents before doing anything else.
nsCOMPtr<nsIDocShellTreeOwner> ourOwner, otherOwner;
@ -1245,7 +1245,7 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
ourOwner->ContentShellRemoved(ourDocshell);
otherOwner->ContentShellRemoved(otherDocshell);
}
ourParentItem->AddChild(otherDocshell);
otherParentItem->AddChild(ourDocshell);
@ -1796,23 +1796,6 @@ nsFrameLoader::MaybeCreateDocShell()
mDocShell->SetName(frameName);
}
//Grab the userContextId from owner if XUL
nsAutoString userContextIdStr;
if (namespaceID == kNameSpaceID_XUL) {
if (mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::usercontextid)) {
mOwnerContent->GetAttr(kNameSpaceID_None,
nsGkAtoms::usercontextid,
userContextIdStr);
}
}
if (!userContextIdStr.IsEmpty()) {
nsresult err;
nsDocShell * ds = nsDocShell::Cast(mDocShell);
ds->SetUserContextId(userContextIdStr.ToInteger(&err));
NS_ENSURE_SUCCESS(err, err);
}
// Inform our docShell that it has a new child.
// Note: This logic duplicates a lot of logic in
// nsSubDocumentFrame::AttributeChanged. We should fix that.
@ -1986,7 +1969,7 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
NS_WARN_IF_FALSE(treeOwner,
"Trying to load a new url to a docshell without owner!");
NS_ENSURE_STATE(treeOwner);
if (mDocShell->ItemType() != nsIDocShellTreeItem::typeContent) {
// No need to do recursion-protection here XXXbz why not?? Do we really
// trust people not to screw up with non-content docshells?
@ -2000,7 +1983,7 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
int32_t depth = 0;
while (parentAsItem) {
++depth;
if (depth >= MAX_DEPTH_CONTENT_FRAMES) {
mDepthTooGreat = true;
NS_WARNING("Too many nested content frames so giving up");
@ -2041,7 +2024,7 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
bool equal;
rv = aURI->EqualsExceptRef(parentURI, &equal);
NS_ENSURE_SUCCESS(rv, rv);
if (equal) {
matchCount++;
if (matchCount >= MAX_SAME_URL_CONTENT_FRAMES) {
@ -3082,23 +3065,6 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
// Populate packageId to signedPkg.
attrs.mSignedPkg = NS_ConvertUTF8toUTF16(aPackageId);
// set the userContextId on the attrs before we pass them into
// the tab context
if (mOwnerContent) {
nsAutoString userContextIdStr;
if (mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::usercontextid)) {
mOwnerContent->GetAttr(kNameSpaceID_None,
nsGkAtoms::usercontextid,
userContextIdStr);
}
if (!userContextIdStr.IsEmpty()) {
nsresult err;
uint32_t userContextId = userContextIdStr.ToInteger(&err);
NS_ENSURE_SUCCESS(err, err);
attrs.mUserContextId = userContextId;
}
}
bool tabContextUpdated = aTabContext->SetTabContext(ownApp, containingApp,
attrs, aSignedPkgOriginNoSuffix);
NS_ENSURE_STATE(tabContextUpdated);

View File

@ -2404,6 +2404,3 @@ GK_ATOM(onboundary, "onboundary")
#endif
GK_ATOM(vr_state, "vr-state")
// Contextual Identity / Containers
GK_ATOM(usercontextid, "usercontextid")