Bug 1238160 - Set frame type on TabContext. r=billm,mayhemer

This change renames TabContext::IsBrowserElement to IsIsolatedMozBrowserElement.
Other methods that pass these values around also have name changes.

Adds TabContext::IsMozBrowserElement which is set by the frame loader for all
browser frames.  This is in contrast to its previous implementation, which has
since been renamed IsIsolatedMozBrowserElement, since it checks isolated state
in OriginAttributes.

TabContext methods related to browser elements (and their callers) are updated
to use IsIsolatedMozBrowserElement when check isolation / origins and
IsMozBrowserElement when checking frame types.

MozReview-Commit-ID: DDMZTkSn5yd
This commit is contained in:
J. Ryan Stinnett 2016-02-17 22:35:45 -06:00
parent 6cde63d471
commit 3872b5e0b0
17 changed files with 123 additions and 76 deletions

View File

@ -3118,7 +3118,11 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
}
bool tabContextUpdated =
aTabContext->SetTabContext(ownApp, containingApp, attrs, signedPkgOrigin);
aTabContext->SetTabContext(OwnerIsMozBrowserFrame(),
ownApp,
containingApp,
attrs,
signedPkgOrigin);
NS_ENSURE_STATE(tabContextUpdated);
return NS_OK;

View File

@ -806,7 +806,7 @@ ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
PopupIPCTabContext context;
openerTabId = aTabOpener->GetTabId();
context.opener() = openerTabId;
context.isBrowserElement() = aTabOpener->IsBrowserElement();
context.isMozBrowserElement() = aTabOpener->IsMozBrowserElement();
ipcContext = new IPCTabContext(context);
} else {
// It's possible to not have a TabChild opener in the case

View File

@ -1122,11 +1122,11 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
openerTabId = TabParent::GetTabIdFrom(docShell);
}
if (aContext.IsBrowserElement() || !aContext.HasOwnApp()) {
if (aContext.IsMozBrowserElement() || !aContext.HasOwnApp()) {
RefPtr<TabParent> tp;
RefPtr<nsIContentParent> constructorSender;
if (isInContentProcess) {
MOZ_ASSERT(aContext.IsBrowserElement());
MOZ_ASSERT(aContext.IsMozBrowserElement());
constructorSender = CreateContentBridgeParent(aContext, initialPriority,
openerTabId, &tabId);
} else {
@ -1134,7 +1134,7 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
constructorSender = aOpenerContentParent;
} else {
constructorSender =
GetNewOrUsedBrowserProcess(aContext.IsBrowserElement(),
GetNewOrUsedBrowserProcess(aContext.IsMozBrowserElement(),
initialPriority);
if (!constructorSender) {
return nullptr;
@ -5334,7 +5334,7 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab,
thisTabParent = TabParent::GetFrom(aThisTab);
}
if (NS_WARN_IF(thisTabParent && thisTabParent->IsBrowserOrApp())) {
if (NS_WARN_IF(thisTabParent && thisTabParent->IsMozBrowserOrApp())) {
return false;
}

View File

@ -13,20 +13,21 @@ namespace dom {
// An IPCTabContext which corresponds to a PBrowser opened by a child when it
// receives window.open().
//
// If isBrowserElement is false, this PopupIPCTabContext corresponds to an app
// frame, and the frame's app-id and app-frame-owner-app-id will be equal to the
// opener's values.
// If isMozBrowserElement is false, this PopupIPCTabContext is either a
// <xul:browser> or an app frame. The frame's app-id and app-frame-owner-app-id
// will be equal to the opener's values. For a <xul:browser>, those app IDs
// will be NO_APP_ID.
//
// If isBrowserElement is true, the frame's browserFrameOwnerAppId will be equal
// to the opener's app-id.
// If isMozBrowserElement is true, the frame's browserFrameOwnerAppId will be
// equal to the opener's app-id.
//
// It's an error to set isBrowserElement == false if opener is a browser
// It's an error to set isMozBrowserElement == false if opener is a mozbrowser
// element. Such a PopupIPCTabContext should be rejected by code which receives
// it.
struct PopupIPCTabContext
{
PBrowserOrId opener;
bool isBrowserElement;
bool isMozBrowserElement;
};
// An IPCTabContext which corresponds to an app, browser, or normal frame.
@ -42,6 +43,10 @@ struct FrameIPCTabContext
// This value would be empty if the TabContext doesn't own a signed
// package.
nsCString signedPkgOriginNoSuffix;
// Whether this is a mozbrowser frame. <iframe mozbrowser mozapp> and
// <xul:browser> are not considered to be mozbrowser frames.
bool isMozBrowserElement;
};
// XXXcatalinb: This is only used by ServiceWorkerClients::OpenWindow.

View File

@ -549,7 +549,7 @@ TabChild::Create(nsIContentChild* aManager,
{
if (sPreallocatedTab &&
sPreallocatedTab->mChromeFlags == aChromeFlags &&
aContext.IsBrowserOrApp()) {
aContext.IsMozBrowserOrApp()) {
RefPtr<TabChild> child = sPreallocatedTab.get();
sPreallocatedTab = nullptr;
@ -865,11 +865,9 @@ TabChild::NotifyTabContextUpdated()
if (docShell) {
// nsDocShell will do the right thing if we pass NO_APP_ID or
// UNKNOWN_APP_ID for aOwnOrContainingAppId.
if (IsBrowserElement()) {
if (IsMozBrowserElement()) {
docShell->SetIsBrowserInsideApp(BrowserOwnerAppId());
// TODO: Wants to call TabContext::IsIsolatedMozBrowserElement() based
// on isolation in principal, which is added in a later patch.
docShell->SetIsInIsolatedMozBrowserElement(IsBrowserElement());
docShell->SetIsInIsolatedMozBrowserElement(IsIsolatedMozBrowserElement());
} else {
docShell->SetIsApp(OwnAppId());
}
@ -1506,7 +1504,7 @@ TabChild::ApplyShowInfo(const ShowInfo& aInfo)
nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
if (docShell) {
nsCOMPtr<nsIDocShellTreeItem> item = do_GetInterface(docShell);
if (IsBrowserOrApp()) {
if (IsMozBrowserOrApp()) {
// B2G allows window.name to be set by changing the name attribute on the
// <iframe mozbrowser> element. window.open calls cause this attribute to
// be set to the correct value. A normal <xul:browser> element has no such
@ -1543,7 +1541,7 @@ TabChild::MaybeRequestPreinitCamera()
{
// Check if this tab is an app (not a browser frame) and will use the
// `camera` permission,
if (IsBrowserElement()) {
if (IsIsolatedMozBrowserElement()) {
return;
}
@ -2528,7 +2526,7 @@ TabChild::InitTabChildGlobal(FrameScriptLoading aScriptLoading)
mTriedBrowserInit = true;
// Initialize the child side of the browser element machinery,
// if appropriate.
if (IsBrowserOrApp()) {
if (IsMozBrowserOrApp()) {
RecvLoadRemoteScript(BROWSER_ELEMENT_CHILD_SCRIPT, true);
}
}

View File

@ -22,21 +22,28 @@ namespace dom {
TabContext::TabContext()
: mInitialized(false)
, mIsMozBrowserElement(false)
, mContainingAppId(NO_APP_ID)
, mOriginAttributes()
{
}
bool
TabContext::IsBrowserElement() const
TabContext::IsMozBrowserElement() const
{
return mIsMozBrowserElement;
}
bool
TabContext::IsIsolatedMozBrowserElement() const
{
return mOriginAttributes.mInIsolatedMozBrowser;
}
bool
TabContext::IsBrowserOrApp() const
TabContext::IsMozBrowserOrApp() const
{
return HasOwnApp() || IsBrowserElement();
return HasOwnApp() || IsMozBrowserElement();
}
uint32_t
@ -62,7 +69,7 @@ TabContext::HasOwnApp() const
uint32_t
TabContext::BrowserOwnerAppId() const
{
if (IsBrowserElement()) {
if (IsMozBrowserElement()) {
return mContainingAppId;
}
return NO_APP_ID;
@ -72,7 +79,7 @@ already_AddRefed<mozIApplication>
TabContext::GetBrowserOwnerApp() const
{
nsCOMPtr<mozIApplication> ownerApp;
if (IsBrowserElement()) {
if (IsMozBrowserElement()) {
ownerApp = mContainingApp;
}
return ownerApp.forget();
@ -165,7 +172,8 @@ TabContext::SignedPkgOriginNoSuffix() const
}
bool
TabContext::SetTabContext(mozIApplication* aOwnApp,
TabContext::SetTabContext(bool aIsMozBrowserElement,
mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
const DocShellOriginAttributes& aOriginAttributes,
const nsACString& aSignedPkgOriginNoSuffix)
@ -194,6 +202,7 @@ TabContext::SetTabContext(mozIApplication* aOwnApp,
aOriginAttributes.mAppId == NO_APP_ID);
mInitialized = true;
mIsMozBrowserElement = aIsMozBrowserElement;
mOriginAttributes = aOriginAttributes;
mContainingAppId = containingAppId;
mOwnApp = aOwnApp;
@ -209,7 +218,8 @@ TabContext::AsIPCTabContext() const
mOriginAttributes.CreateSuffix(originSuffix);
return IPCTabContext(FrameIPCTabContext(originSuffix,
mContainingAppId,
mSignedPkgOriginNoSuffix));
mSignedPkgOriginNoSuffix,
mIsMozBrowserElement));
}
static already_AddRefed<mozIApplication>
@ -227,6 +237,7 @@ GetAppForId(uint32_t aAppId)
MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
: mInvalidReason(nullptr)
{
bool isMozBrowserElement = false;
uint32_t containingAppId = NO_APP_ID;
DocShellOriginAttributes originAttributes;
nsAutoCString originSuffix;
@ -239,7 +250,8 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
TabContext *context;
if (ipcContext.opener().type() == PBrowserOrId::TPBrowserParent) {
context = TabParent::GetFrom(ipcContext.opener().get_PBrowserParent());
if (context->IsBrowserElement() && !ipcContext.isBrowserElement()) {
if (context->IsMozBrowserElement() &&
!ipcContext.isMozBrowserElement()) {
// If the TabParent corresponds to a browser element, then it can only
// open other browser elements, for security reasons. We should have
// checked this before calling the TabContext constructor, so this is
@ -269,8 +281,9 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
//
// Otherwise, we're a new app window and we inherit from our
// opener app.
isMozBrowserElement = ipcContext.isMozBrowserElement();
originAttributes = context->mOriginAttributes;
if (ipcContext.isBrowserElement()) {
if (isMozBrowserElement) {
containingAppId = context->OwnOrContainingAppId();
} else {
containingAppId = context->mContainingAppId;
@ -281,6 +294,7 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
const FrameIPCTabContext &ipcContext =
aParams.get_FrameIPCTabContext();
isMozBrowserElement = ipcContext.isMozBrowserElement();
containingAppId = ipcContext.frameOwnerAppId();
signedPkgOriginNoSuffix = ipcContext.signedPkgOriginNoSuffix();
originSuffix = ipcContext.originSuffix();
@ -310,8 +324,8 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
}
nsCOMPtr<mozIApplication> ownApp;
if (!originAttributes.mInIsolatedMozBrowser) {
// mAppId corresponds to OwnOrContainingAppId; if mInIsolatedMozBrowser is
if (!isMozBrowserElement) {
// mAppId corresponds to OwnOrContainingAppId; if isMozBrowserElement is
// false then it's ownApp otherwise it's containingApp
ownApp = GetAppForId(originAttributes.mAppId);
if ((ownApp == nullptr) != (originAttributes.mAppId == NO_APP_ID)) {
@ -327,7 +341,8 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
}
bool rv;
rv = mTabContext.SetTabContext(ownApp,
rv = mTabContext.SetTabContext(isMozBrowserElement,
ownApp,
containingApp,
originAttributes,
signedPkgOriginNoSuffix);

View File

@ -42,29 +42,43 @@ public:
IPCTabContext AsIPCTabContext() const;
/**
* Does this TabContext correspond to a mozbrowser? (<iframe mozbrowser
* mozapp> is not a browser.)
* Does this TabContext correspond to a mozbrowser?
*
* If IsBrowserElement() is true, HasOwnApp() and HasAppOwnerApp() are
* <iframe mozbrowser mozapp> and <xul:browser> are not considered to be
* mozbrowser elements.
*
* If IsMozBrowserElement() is true, HasOwnApp() and HasAppOwnerApp() are
* guaranteed to be false.
*
* If IsBrowserElement() is false, HasBrowserOwnerApp() is guaranteed to be
* If IsMozBrowserElement() is false, HasBrowserOwnerApp() is guaranteed to be
* false.
*/
bool IsBrowserElement() const;
bool IsMozBrowserElement() const;
/**
* Does this TabContext correspond to an isolated mozbrowser?
*
* <iframe mozbrowser mozapp> and <xul:browser> are not considered to be
* mozbrowser elements. <iframe mozbrowser noisolation> does not count as
* isolated since isolation is disabled. Isolation can only be disabled by
* chrome pages.
*/
bool IsIsolatedMozBrowserElement() const;
/**
* Does this TabContext correspond to a mozbrowser or mozapp? This is
* equivalent to IsBrowserElement() || HasOwnApp().
* equivalent to IsMozBrowserElement() || HasOwnApp(). Returns false for
* <xul:browser>, which is neither a mozbrowser nor a mozapp.
*/
bool IsBrowserOrApp() const;
bool IsMozBrowserOrApp() const;
/**
* OwnAppId() returns the id of the app which directly corresponds to this
* context's frame. GetOwnApp() returns the corresponding app object, and
* HasOwnApp() returns true iff GetOwnApp() would return a non-null value.
*
* If HasOwnApp() is true, IsBrowserElement() is guaranteed to be false.
* If HasOwnApp() is true, IsMozBrowserElement() is guaranteed to be
* false.
*/
uint32_t OwnAppId() const;
already_AddRefed<mozIApplication> GetOwnApp() const;
@ -72,7 +86,7 @@ public:
/**
* BrowserOwnerAppId() gets the ID of the app which contains this browser
* frame. If this is not a browser frame (i.e., if !IsBrowserElement()), then
* frame. If this is not a mozbrowser frame (if !IsMozBrowserElement()), then
* BrowserOwnerAppId() is guaranteed to return NO_APP_ID.
*
* Even if we are a browser frame, BrowserOwnerAppId() may still return
@ -140,7 +154,8 @@ protected:
* - a browser frame inside the given owner app (which may be null).
* - a non-browser, non-app frame. Both own app and owner app should be null.
*/
bool SetTabContext(mozIApplication* aOwnApp,
bool SetTabContext(bool aIsMozBrowserElement,
mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
const DocShellOriginAttributes& aOriginAttributes,
const nsACString& aSignedPkgOriginNoSuffix);
@ -151,16 +166,24 @@ private:
*/
bool mInitialized;
/**
* Whether this TabContext corresponds to a mozbrowser.
*
* <iframe mozbrowser mozapp> and <xul:browser> are not considered to be
* mozbrowser elements.
*/
bool mIsMozBrowserElement;
/**
* This TabContext's own app. If this is non-null, then this
* TabContext corresponds to an app, and mIsBrowser must be false.
* TabContext corresponds to an app, and mIsMozBrowserElement must be false.
*/
nsCOMPtr<mozIApplication> mOwnApp;
/**
* This TabContext's containing app. If mIsBrowser, this corresponds to the
* app which contains the browser frame; otherwise, this corresponds to the
* app which contains the app frame.
* This TabContext's containing app. If mIsMozBrowserElement, this
* corresponds to the app which contains the browser frame; otherwise, this
* corresponds to the app which contains the app frame.
*/
nsCOMPtr<mozIApplication> mContainingApp;
@ -197,12 +220,14 @@ public:
}
bool
SetTabContext(mozIApplication* aOwnApp,
SetTabContext(bool aIsMozBrowserElement,
mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
const DocShellOriginAttributes& aOriginAttributes,
const nsACString& aSignedPkgOriginNoSuffix = EmptyCString())
{
return TabContext::SetTabContext(aOwnApp,
return TabContext::SetTabContext(aIsMozBrowserElement,
aOwnApp,
aAppFrameOwnerApp,
aOriginAttributes,
aSignedPkgOriginNoSuffix);

View File

@ -94,10 +94,10 @@ nsIContentParent::CanOpenBrowser(const IPCTabContext& aContext)
return false;
}
// Popup windows of isBrowser frames must be isBrowser if the parent
// isBrowser. Allocating a !isBrowser frame with same app ID would allow
// the content to access data it's not supposed to.
if (!popupContext.isBrowserElement() && opener->IsBrowserElement()) {
// Popup windows of isMozBrowserElement frames must be isMozBrowserElement if
// the parent isMozBrowserElement. Allocating a !isMozBrowserElement frame with
// same app ID would allow the content to access data it's not supposed to.
if (!popupContext.isMozBrowserElement() && opener->IsMozBrowserElement()) {
ASSERT_UNLESS_FUZZING("Child trying to escalate privileges! Aborting AllocPBrowserParent.");
return false;
}

View File

@ -148,7 +148,7 @@ TCPServerSocket::OnSocketAccepted(nsIServerSocket* aServer, nsISocketTransport*
RefPtr<TCPSocket> socket = TCPSocket::CreateAcceptedSocket(global, aTransport, mUseArrayBuffers);
if (mServerBridgeParent) {
socket->SetAppIdAndBrowser(mServerBridgeParent->GetAppId(),
mServerBridgeParent->GetInBrowser());
mServerBridgeParent->GetInIsolatedMozBrowser());
}
FireEvent(NS_LITERAL_STRING("connect"), socket);
return NS_OK;

View File

@ -75,12 +75,12 @@ TCPServerSocketParent::GetAppId()
}
bool
TCPServerSocketParent::GetInBrowser()
TCPServerSocketParent::GetInIsolatedMozBrowser()
{
const PContentParent *content = Manager()->Manager();
if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
TabParent *tab = TabParent::GetFrom(browser);
return tab->IsBrowserElement();
return tab->IsIsolatedMozBrowserElement();
} else {
return false;
}
@ -150,7 +150,7 @@ void
TCPServerSocketParent::OnConnect(TCPServerSocketEvent* event)
{
RefPtr<TCPSocket> socket = event->Socket();
socket->SetAppIdAndBrowser(GetAppId(), GetInBrowser());
socket->SetAppIdAndBrowser(GetAppId(), GetInIsolatedMozBrowser());
RefPtr<TCPSocketParent> socketParent = new TCPSocketParent();
socketParent->SetSocket(socket);

View File

@ -35,7 +35,7 @@ public:
virtual bool RecvRequestDelete() override;
uint32_t GetAppId();
bool GetInBrowser();
bool GetInIsolatedMozBrowser();
void AddIPDLReference();
void ReleaseIPDLReference();

View File

@ -166,7 +166,7 @@ TCPSocket::TCPSocket(nsIGlobalObject* aGlobal, const nsAString& aHost, uint16_t
, mTxBytes(0)
, mRxBytes(0)
, mAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID)
, mInBrowser(false)
, mInIsolatedMozBrowser(false)
#endif
{
if (aGlobal) {
@ -1100,11 +1100,11 @@ TCPSocket::SetSocketBridgeParent(TCPSocketParent* aBridgeParent)
}
void
TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInBrowser)
TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInIsolatedMozBrowser)
{
#ifdef MOZ_WIDGET_GONK
mAppId = aAppId;
mInBrowser = aInBrowser;
mInIsolatedMozBrowser = aInIsolatedMozBrowser;
#endif
}
@ -1155,8 +1155,8 @@ TCPSocket::SaveNetworkStats(bool aEnforce)
return;
}
nssProxy->SaveAppStats(mAppId, mInBrowser, mActiveNetworkInfo, PR_Now(),
mRxBytes, mTxBytes, false, nullptr);
nssProxy->SaveAppStats(mAppId, mInIsolatedMozBrowser, mActiveNetworkInfo,
PR_Now(), mRxBytes, mTxBytes, false, nullptr);
// Reset the counters once the statistics is saved to NetworkStatsServiceProxy.
mTxBytes = mRxBytes = 0;

View File

@ -242,8 +242,8 @@ private:
uint32_t mRxBytes;
// The app that owns this socket.
uint32_t mAppId;
// Was this socket created inside of a mozbrowser frame?
bool mInBrowser;
// Was this socket created inside of an isolated browser frame?
bool mInIsolatedMozBrowser;
// The name of the active network used by this socket.
nsCOMPtr<nsINetworkInfo> mActiveNetworkInfo;
#endif

View File

@ -77,12 +77,12 @@ TCPSocketParent::GetAppId()
};
bool
TCPSocketParent::GetInBrowser()
TCPSocketParent::GetInIsolatedMozBrowser()
{
const PContentParent *content = Manager()->Manager();
if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
TabParent *tab = TabParent::GetFrom(browser);
return tab->IsBrowserElement();
return tab->IsIsolatedMozBrowserElement();
} else {
return false;
}
@ -155,7 +155,7 @@ TCPSocketParent::RecvOpen(const nsString& aHost, const uint16_t& aPort, const bo
// Obtain App ID
uint32_t appId = GetAppId();
bool inBrowser = GetInBrowser();
bool inIsolatedMozBrowser = GetInIsolatedMozBrowser();
if (NS_IsAppOffline(appId)) {
NS_ERROR("Can't open socket because app is offline");
@ -164,7 +164,7 @@ TCPSocketParent::RecvOpen(const nsString& aHost, const uint16_t& aPort, const bo
}
mSocket = new TCPSocket(nullptr, aHost, aPort, aUseSSL, aUseArrayBuffers);
mSocket->SetAppIdAndBrowser(appId, inBrowser);
mSocket->SetAppIdAndBrowser(appId, inIsolatedMozBrowser);
mSocket->SetSocketBridgeParent(this);
NS_ENSURE_SUCCESS(mSocket->Init(), true);
return true;
@ -221,18 +221,18 @@ TCPSocketParent::RecvOpenBind(const nsCString& aRemoteHost,
// Obtain App ID
uint32_t appId = nsIScriptSecurityManager::NO_APP_ID;
bool inBrowser = false;
bool inIsolatedMozBrowser = false;
const PContentParent *content = Manager()->Manager();
if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
// appId's are for B2G only currently, where managees.Count() == 1
// This is not guaranteed currently in Desktop, so skip this there.
TabParent *tab = TabParent::GetFrom(browser);
appId = tab->OwnAppId();
inBrowser = tab->IsBrowserElement();
inIsolatedMozBrowser = tab->IsIsolatedMozBrowserElement();
}
mSocket = new TCPSocket(nullptr, NS_ConvertUTF8toUTF16(aRemoteHost), aRemotePort, aUseSSL, aUseArrayBuffers);
mSocket->SetAppIdAndBrowser(appId, inBrowser);
mSocket->SetAppIdAndBrowser(appId, inIsolatedMozBrowser);
mSocket->SetSocketBridgeParent(this);
rv = mSocket->InitWithUnconnectedTransport(socketTransport);
NS_ENSURE_SUCCESS(rv, true);

View File

@ -68,7 +68,7 @@ public:
virtual bool RecvRequestDelete() override;
virtual nsresult OfflineNotification(nsISupports *) override;
virtual uint32_t GetAppId() override;
bool GetInBrowser();
bool GetInIsolatedMozBrowser();
void FireErrorEvent(const nsAString& aName, const nsAString& aType, TCPReadyState aReadyState);
void FireEvent(const nsAString& aType, TCPReadyState aReadyState);

View File

@ -68,7 +68,7 @@ public:
// to be killed.
for (uint32_t j = 0; j < contextArray.Length(); ++j) {
if ((contextArray[j].OwnOrContainingAppId() == mOriginAttributes.mAppId) &&
(contextArray[j].IsBrowserElement() == mOriginAttributes.mInIsolatedMozBrowser)) {
(contextArray[j].IsIsolatedMozBrowserElement() == mOriginAttributes.mInIsolatedMozBrowser)) {
continue;
}
// Array entries with no mParent won't receive any notification.

View File

@ -128,7 +128,7 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
uint32_t appId = tabContext.OwnOrContainingAppId();
bool inBrowserElement = aSerialized.IsNotNull() ?
aSerialized.mOriginAttributes.mInIsolatedMozBrowser :
tabContext.IsBrowserElement();
tabContext.IsIsolatedMozBrowserElement();
if (appId == NECKO_UNKNOWN_APP_ID) {
continue;
@ -138,7 +138,7 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
if (tabContext.HasOwnApp()) {
continue;
}
if (UsingNeckoIPCSecurity() && tabContext.IsBrowserElement()) {
if (UsingNeckoIPCSecurity() && tabContext.IsIsolatedMozBrowserElement()) {
// <iframe mozbrowser> which doesn't have an <iframe mozapp> above it.
// This is not supported now, and we'll need to do a code audit to make
// sure we can handle it (i.e don't short-circuit using separate