From 82579c5c6c4395123f265cca7a04a8464052055d Mon Sep 17 00:00:00 2001 From: Kate McKinley Date: Thu, 7 Jan 2016 10:51:04 -0800 Subject: [PATCH] Bug 1195881 - Pass userContext through NeckoParent and TabChild. r=tanvi, r=sicking --- dom/ipc/TabChild.cpp | 5 ++++- netwerk/ipc/NeckoParent.cpp | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 323b3685daef..0c8f855b3e7c 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -835,7 +835,10 @@ TabChild::NotifyTabContextUpdated() } else { docShell->SetIsApp(OwnAppId()); } - docShell->SetIsSignedPackage(OriginAttributesRef().mSignedPkg); + + OriginAttributes attrs = OriginAttributesRef(); + docShell->SetIsSignedPackage(attrs.mSignedPkg); + docShell->SetUserContextId(attrs.mUserContextId); } } diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp index 796e78f82c17..8e1c53d9e6d6 100644 --- a/netwerk/ipc/NeckoParent.cpp +++ b/netwerk/ipc/NeckoParent.cpp @@ -145,12 +145,20 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized, continue; } } + if (!aSerialized.mOriginAttributes.mSignedPkg.IsEmpty() && aSerialized.mOriginAttributes.mSignedPkg != tabContext.OriginAttributesRef().mSignedPkg) { continue; } - aAttrs = DocShellOriginAttributes(appId, inBrowserElement); - aAttrs.mSignedPkg = tabContext.OriginAttributesRef().mSignedPkg; + if (aSerialized.mOriginAttributes.mUserContextId != tabContext.OriginAttributesRef().mUserContextId) { + continue; + } + aAttrs = DocShellOriginAttributes(); + aAttrs.mAppId = appId; + aAttrs.mInBrowser = inBrowserElement; + aAttrs.mSignedPkg = aSerialized.mOriginAttributes.mSignedPkg; + aAttrs.mUserContextId = aSerialized.mOriginAttributes.mUserContextId; + return nullptr; }