diff --git a/accessible/jsat/AccessFu.jsm b/accessible/jsat/AccessFu.jsm index 4cfbfc2fa3..e0d8ecb493 100644 --- a/accessible/jsat/AccessFu.jsm +++ b/accessible/jsat/AccessFu.jsm @@ -340,9 +340,9 @@ this.AccessFu = { // jshint ignore:line case 'remote-browser-shown': case 'inprocess-browser-shown': { - // Ignore notifications that aren't from a BrowserOrApp + // Ignore notifications that aren't from a Browser let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader); - if (!frameLoader.ownerIsMozBrowserOrAppFrame) { + if (!frameLoader.ownerIsMozBrowserFrame) { return; } this._handleMessageManager(frameLoader.messageManager); diff --git a/caps/BasePrincipal.cpp b/caps/BasePrincipal.cpp index ade5b4e2e0..78b09bb249 100644 --- a/caps/BasePrincipal.cpp +++ b/caps/BasePrincipal.cpp @@ -624,13 +624,8 @@ BasePrincipal::GetOriginSuffix(nsACString& aOriginAttributes) NS_IMETHODIMP BasePrincipal::GetAppStatus(uint16_t* aAppStatus) { - if (AppId() == nsIScriptSecurityManager::UNKNOWN_APP_ID) { - NS_WARNING("Asking for app status on a principal with an unknown app id"); - *aAppStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED; - return NS_OK; - } - - *aAppStatus = nsScriptSecurityManager::AppStatusForPrincipal(this); + // TODO: Remove GetAppStatus. + *aAppStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED; return NS_OK; } diff --git a/caps/nsIPrincipal.idl b/caps/nsIPrincipal.idl index 03f293f7b2..f197021caa 100644 --- a/caps/nsIPrincipal.idl +++ b/caps/nsIPrincipal.idl @@ -303,15 +303,6 @@ interface nsIPrincipal : nsISerializable */ [infallible] readonly attribute unsigned long privateBrowsingId; - /** - * Returns true iff the principal is inside an isolated mozbrowser element. - * \n' + - '\n' + - ''; - - var iframes = document.getElementsByTagName("iframe"); - var promises = [] - for (var i = 0; i < promises.length; ++i) { - promises.push(new Promise(resolve => { - iframes[i].addEventListener("load", resolve); - })); - } - - return Promise.all(promises); -}); - -var prefs = new Promise(resolve => { - SpecialPowers.pushPrefEnv( - { set: [[ "dom.mozBrowserFramesEnabled", true ], - [ "dom.ipc.browser_frames.oop_by_default", false ]] }, - resolve); -}); - - -
-
-
- - diff --git a/devtools/server/actors/webconsole.js b/devtools/server/actors/webconsole.js index 106b0e4e04..45414326ef 100644 --- a/devtools/server/actors/webconsole.js +++ b/devtools/server/actors/webconsole.js @@ -569,11 +569,9 @@ WebConsoleActor.prototype = let startedListeners = []; let window = !this.parentActor.isRootActor ? this.window : null; - let appId = null; let messageManager = null; if (this._parentIsContentActor) { - appId = this.parentActor.docShell.appId; messageManager = this.parentActor.messageManager; } @@ -604,16 +602,16 @@ WebConsoleActor.prototype = // Create a StackTraceCollector that's going to be shared both by the // NetworkMonitorChild (getting messages about requests from parent) and // by the NetworkMonitor that directly watches service workers requests. - this.stackTraceCollector = new StackTraceCollector({ window, appId }); + this.stackTraceCollector = new StackTraceCollector({ window }); this.stackTraceCollector.init(); let processBoundary = Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; - if ((appId || messageManager) && processBoundary) { + if (messageManager && processBoundary) { // Start a network monitor in the parent process to listen to // most requests than happen in parent this.networkMonitor = - new NetworkMonitorChild(appId, this.parentActor.outerWindowID, + new NetworkMonitorChild(this.parentActor.outerWindowID, messageManager, this.conn, this); this.networkMonitor.init(); // Spawn also one in the child to listen to service workers diff --git a/devtools/shared/layout/utils.js b/devtools/shared/layout/utils.js index bbe6df4c85..c6b996bebf 100644 --- a/devtools/shared/layout/utils.js +++ b/devtools/shared/layout/utils.js @@ -37,12 +37,12 @@ function getTopWindow(win) { .getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIDocShell); - if (!docShell.isMozBrowserOrApp) { + if (!docShell.isMozBrowser) { return win.top; } let topDocShell = - docShell.getSameTypeRootTreeItemIgnoreBrowserAndAppBoundaries(); + docShell.getSameTypeRootTreeItemIgnoreBrowserBoundaries(); return topDocShell ? topDocShell.contentViewer.DOMDocument.defaultView @@ -98,12 +98,12 @@ function getParentWindow(win) { .getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIDocShell); - if (!docShell.isMozBrowserOrApp) { + if (!docShell.isMozBrowser) { return win.parent; } let parentDocShell = - docShell.getSameTypeParentIgnoreBrowserAndAppBoundaries(); + docShell.getSameTypeParentIgnoreBrowserBoundaries(); return parentDocShell ? parentDocShell.contentViewer.DOMDocument.defaultView diff --git a/devtools/shared/webconsole/network-monitor.js b/devtools/shared/webconsole/network-monitor.js index 8e61f4fc7c..505859c157 100644 --- a/devtools/shared/webconsole/network-monitor.js +++ b/devtools/shared/webconsole/network-monitor.js @@ -1551,8 +1551,6 @@ NetworkMonitor.prototype = { * data to the WebConsoleActor or to a NetworkEventActor. * * @constructor - * @param number appId - * The web appId of the child process. * @param number outerWindowID * The outerWindowID of the TabActor's main window. * @param nsIMessageManager messageManager @@ -1562,8 +1560,7 @@ NetworkMonitor.prototype = { * @param object owner * The WebConsoleActor that is listening for the network requests. */ -function NetworkMonitorChild(appId, outerWindowID, messageManager, conn, owner) { - this.appId = appId; +function NetworkMonitorChild(outerWindowID, messageManager, conn, owner) { this.outerWindowID = outerWindowID; this.conn = conn; this.owner = owner; @@ -1577,7 +1574,6 @@ function NetworkMonitorChild(appId, outerWindowID, messageManager, conn, owner) exports.NetworkMonitorChild = NetworkMonitorChild; NetworkMonitorChild.prototype = { - appId: null, owner: null, _netEvents: null, _saveRequestAndResponseBodies: true, @@ -1623,7 +1619,6 @@ NetworkMonitorChild.prototype = { mm.addMessageListener(`${this._msgName}:newEvent`, this._onNewEvent); mm.addMessageListener(`${this._msgName}:updateEvent`, this._onUpdateEvent); mm.sendAsyncMessage(this._msgName, { - appId: this.appId, outerWindowID: this.outerWindowID, action: "start", }); diff --git a/docshell/base/LoadContext.cpp b/docshell/base/LoadContext.cpp index 4c265e4246..db750ead9c 100644 --- a/docshell/base/LoadContext.cpp +++ b/docshell/base/LoadContext.cpp @@ -157,28 +157,6 @@ LoadContext::SetRemoteTabs(bool aUseRemoteTabs) return NS_ERROR_UNEXPECTED; } -NS_IMETHODIMP -LoadContext::GetIsInIsolatedMozBrowserElement(bool* aIsInIsolatedMozBrowserElement) -{ - MOZ_ASSERT(mIsNotNull); - - NS_ENSURE_ARG_POINTER(aIsInIsolatedMozBrowserElement); - - *aIsInIsolatedMozBrowserElement = mOriginAttributes.mInIsolatedMozBrowser; - return NS_OK; -} - -NS_IMETHODIMP -LoadContext::GetAppId(uint32_t* aAppId) -{ - MOZ_ASSERT(mIsNotNull); - - NS_ENSURE_ARG_POINTER(aAppId); - - *aAppId = mOriginAttributes.mAppId; - return NS_OK; -} - NS_IMETHODIMP LoadContext::GetOriginAttributes(JS::MutableHandleValue aAttrs) { diff --git a/docshell/base/LoadContext.h b/docshell/base/LoadContext.h index 90a6a600b8..9714128d8d 100644 --- a/docshell/base/LoadContext.h +++ b/docshell/base/LoadContext.h @@ -38,8 +38,6 @@ public: NS_DECL_NSILOADCONTEXT NS_DECL_NSIINTERFACEREQUESTOR - // appId/inIsolatedMozBrowser arguments override those in SerializedLoadContext - // provided by child process. LoadContext(const IPC::SerializedLoadContext& aToCopy, dom::Element* aTopFrameElement, DocShellOriginAttributes& aAttrs) @@ -54,8 +52,6 @@ public: { } - // appId/inIsolatedMozBrowser arguments override those in SerializedLoadContext - // provided by child process. LoadContext(const IPC::SerializedLoadContext& aToCopy, uint64_t aNestedFrameId, DocShellOriginAttributes& aAttrs) diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index 7aa3a5d14d..30213a9833 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -334,7 +334,7 @@ nsDSURIContentListener::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel, curDocShellItem->GetParent(getter_AddRefs(parentDocShellItem))) && parentDocShellItem) { nsCOMPtr curDocShell = do_QueryInterface(curDocShellItem); - if (curDocShell && curDocShell->GetIsMozBrowserOrApp()) { + if (curDocShell && curDocShell->GetIsMozBrowser()) { break; } @@ -427,6 +427,7 @@ ShouldIgnoreFrameOptions(nsIChannel* aChannel, nsIPrincipal* aPrincipal) return false; } +#ifdef DEBUG // log warning to console that xfo is ignored because of CSP nsCOMPtr loadInfo = aChannel->GetLoadInfo(); uint64_t innerWindowID = loadInfo ? loadInfo->GetInnerWindowID() : 0; @@ -440,7 +441,7 @@ ShouldIgnoreFrameOptions(nsIChannel* aChannel, nsIPrincipal* aPrincipal) 0, // no columnnumber nsIScriptError::warningFlag, "CSP", innerWindowID); - +#endif return true; } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 7ad4be98da..770eb43119 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -193,7 +193,6 @@ #include "nsSandboxFlags.h" #include "nsXULAppAPI.h" #include "nsDOMNavigationTiming.h" -#include "nsIAppsService.h" #include "nsDSURIContentListener.h" #include "nsDocShellLoadTypes.h" #include "nsDocShellTransferableHooks.h" @@ -2569,7 +2568,7 @@ nsDocShell::GetFullscreenAllowed(bool* aFullscreenAllowed) NS_IMETHODIMP nsDocShell::SetFullscreenAllowed(bool aFullscreenAllowed) { - if (!nsIDocShell::GetIsMozBrowserOrApp()) { + if (!nsIDocShell::GetIsMozBrowser()) { // Only allow setting of fullscreenAllowed on content/process boundaries. // At non-boundaries the fullscreenAllowed attribute is calculated based on // whether all enclosing frames have the "mozFullscreenAllowed" attribute @@ -3401,7 +3400,7 @@ nsDocShell::GetSameTypeParent(nsIDocShellTreeItem** aParent) NS_ENSURE_ARG_POINTER(aParent); *aParent = nullptr; - if (nsIDocShell::GetIsMozBrowserOrApp()) { + if (nsIDocShell::GetIsMozBrowser()) { return NS_OK; } @@ -3418,7 +3417,7 @@ nsDocShell::GetSameTypeParent(nsIDocShellTreeItem** aParent) } NS_IMETHODIMP -nsDocShell::GetSameTypeParentIgnoreBrowserAndAppBoundaries(nsIDocShell** aParent) +nsDocShell::GetSameTypeParentIgnoreBrowserBoundaries(nsIDocShell** aParent) { NS_ENSURE_ARG_POINTER(aParent); *aParent = nullptr; @@ -3472,18 +3471,18 @@ nsDocShell::GetSameTypeRootTreeItem(nsIDocShellTreeItem** aRootTreeItem) } NS_IMETHODIMP -nsDocShell::GetSameTypeRootTreeItemIgnoreBrowserAndAppBoundaries(nsIDocShell ** aRootTreeItem) +nsDocShell::GetSameTypeRootTreeItemIgnoreBrowserBoundaries(nsIDocShell ** aRootTreeItem) { NS_ENSURE_ARG_POINTER(aRootTreeItem); *aRootTreeItem = static_cast(this); nsCOMPtr parent; - NS_ENSURE_SUCCESS(GetSameTypeParentIgnoreBrowserAndAppBoundaries(getter_AddRefs(parent)), + NS_ENSURE_SUCCESS(GetSameTypeParentIgnoreBrowserBoundaries(getter_AddRefs(parent)), NS_ERROR_FAILURE); while (parent) { *aRootTreeItem = parent; NS_ENSURE_SUCCESS((*aRootTreeItem)-> - GetSameTypeParentIgnoreBrowserAndAppBoundaries(getter_AddRefs(parent)), + GetSameTypeParentIgnoreBrowserBoundaries(getter_AddRefs(parent)), NS_ERROR_FAILURE); } NS_ADDREF(*aRootTreeItem); @@ -3537,12 +3536,6 @@ nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem, return false; } - if (targetDS->GetIsInIsolatedMozBrowserElement() != - accessingDS->GetIsInIsolatedMozBrowserElement() || - targetDS->GetAppId() != accessingDS->GetAppId()) { - return false; - } - nsCOMPtr accessingRoot; aAccessingItem->GetSameTypeRootTreeItem(getter_AddRefs(accessingRoot)); nsCOMPtr accessingRootDS = do_QueryInterface(accessingRoot); @@ -3563,7 +3556,7 @@ nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem, if (OriginAttributes::IsFirstPartyEnabled()) { if (accessingDS == accessingRootDS && aAccessingItem->ItemType() == nsIDocShellTreeItem::typeContent && - !accessingDS->GetIsMozBrowserOrApp()) { + !accessingDS->GetIsMozBrowser()) { nsCOMPtr accessingDoc = aAccessingItem->GetDocument(); @@ -3577,7 +3570,7 @@ nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem, if (targetDS == targetRootDS && aTargetItem->ItemType() == nsIDocShellTreeItem::typeContent && - !targetDS->GetIsMozBrowserOrApp()) { + !targetDS->GetIsMozBrowser()) { nsCOMPtr targetDoc = aAccessingItem->GetDocument(); @@ -3774,7 +3767,7 @@ nsDocShell::DoFindItemWithName(const nsAString& aName, // If we have a same-type parent, respecting browser and app boundaries. // NOTE: Could use GetSameTypeParent if the issues described in bug 1310344 are fixed. - if (!GetIsMozBrowserOrApp() && parentAsTreeItem->ItemType() == mItemType) { + if (!GetIsMozBrowser() && parentAsTreeItem->ItemType() == mItemType) { return parentAsTreeItem->FindItemWithName( aName, static_cast(this), @@ -5312,16 +5305,6 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL, errorPageUrl.AppendLiteral("&f="); errorPageUrl.AppendASCII(frameType.get()); - // Append the manifest URL if the error comes from an app. - nsString manifestURL; - nsresult rv = GetAppManifestURL(manifestURL); - if (manifestURL.Length() > 0) { - nsCString manifestParam; - SAFE_ESCAPE(manifestParam, NS_ConvertUTF16toUTF8(manifestURL), url_Path); - errorPageUrl.AppendLiteral("&m="); - errorPageUrl.AppendASCII(manifestParam.get()); - } - nsCOMPtr cps = do_GetService(NS_CAPTIVEPORTAL_CID); int32_t cpsState; if (cps && NS_SUCCEEDED(cps->GetState(&cpsState)) && @@ -5335,7 +5318,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL, errorPageUrl.AppendASCII(escapedDescription.get()); nsCOMPtr errorPageURI; - rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl); + nsresult rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl); NS_ENSURE_SUCCESS(rv, rv); return InternalLoad(errorPageURI, nullptr, false, false, @@ -6222,9 +6205,7 @@ nsDocShell::SetIsActive(bool aIsActive) mScriptGlobal->SetIsBackground(!aIsActive); if (nsCOMPtr doc = mScriptGlobal->GetExtantDoc()) { // Update orientation when the top-level browsing context becomes active. - // We make an exception for apps because they currently rely on - // orientation locks persisting across browsing contexts. - if (aIsActive && !GetIsApp()) { + if (aIsActive) { nsCOMPtr parent; GetSameTypeParent(getter_AddRefs(parent)); if (!parent) { @@ -6261,7 +6242,7 @@ nsDocShell::SetIsActive(bool aIsActive) continue; } - if (!docshell->GetIsMozBrowserOrApp()) { + if (!docshell->GetIsMozBrowser()) { docshell->SetIsActive(aIsActive); } } @@ -10636,9 +10617,7 @@ nsDocShell::InternalLoad(nsIURI* aURI, // lock the orientation of the document to the document's default // orientation. We don't explicitly check for a top-level browsing context // here because orientation is only set on top-level browsing contexts. - // We make an exception for apps because they currently rely on - // orientation locks persisting across browsing contexts. - if (OrientationLock() != eScreenOrientation_None && !GetIsApp()) { + if (OrientationLock() != eScreenOrientation_None) { #ifdef DEBUG nsCOMPtr parent; GetSameTypeParent(getter_AddRefs(parent)); @@ -11023,7 +11002,7 @@ nsDocShell::DoURILoad(nsIURI* aURI, NeckoOriginAttributes neckoAttrs; bool isTopLevelDoc = aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT && mItemType == typeContent && - !GetIsMozBrowserOrApp(); + !GetIsMozBrowser(); neckoAttrs.InheritFromDocShellToNecko(GetOriginAttributes(), isTopLevelDoc, aURI); rv = loadInfo->SetOriginAttributes(neckoAttrs); if (NS_WARN_IF(NS_FAILED(rv))) { @@ -14480,16 +14459,9 @@ nsDocShell::GetFrameType(uint32_t* aFrameType) } /* [infallible] */ NS_IMETHODIMP -nsDocShell::GetIsApp(bool* aIsApp) +nsDocShell::GetIsMozBrowser(bool* aIsMozBrowser) { - *aIsApp = (mFrameType == FRAME_TYPE_APP); - return NS_OK; -} - -/* [infallible] */ NS_IMETHODIMP -nsDocShell::GetIsMozBrowserOrApp(bool* aIsMozBrowserOrApp) -{ - *aIsMozBrowserOrApp = (mFrameType != FRAME_TYPE_REGULAR); + *aIsMozBrowser = (mFrameType == FRAME_TYPE_BROWSER); return NS_OK; } @@ -14512,30 +14484,9 @@ nsDocShell::GetInheritedFrameType() } /* [infallible] */ NS_IMETHODIMP -nsDocShell::GetIsIsolatedMozBrowserElement(bool* aIsIsolatedMozBrowserElement) +nsDocShell::GetIsInMozBrowser(bool* aIsInMozBrowser) { - bool result = mFrameType == FRAME_TYPE_BROWSER && - mOriginAttributes.mInIsolatedMozBrowser; - *aIsIsolatedMozBrowserElement = result; - return NS_OK; -} - -/* [infallible] */ NS_IMETHODIMP -nsDocShell::GetIsInIsolatedMozBrowserElement(bool* aIsInIsolatedMozBrowserElement) -{ - MOZ_ASSERT(!mOriginAttributes.mInIsolatedMozBrowser || - (GetInheritedFrameType() == FRAME_TYPE_BROWSER), - "Isolated mozbrowser should only be true inside browser frames"); - bool result = (GetInheritedFrameType() == FRAME_TYPE_BROWSER) && - mOriginAttributes.mInIsolatedMozBrowser; - *aIsInIsolatedMozBrowserElement = result; - return NS_OK; -} - -/* [infallible] */ NS_IMETHODIMP -nsDocShell::GetIsInMozBrowserOrApp(bool* aIsInMozBrowserOrApp) -{ - *aIsInMozBrowserOrApp = (GetInheritedFrameType() != FRAME_TYPE_REGULAR); + *aIsInMozBrowser = (GetInheritedFrameType() == FRAME_TYPE_BROWSER); return NS_OK; } @@ -14553,25 +14504,6 @@ nsDocShell::GetIsTopLevelContentDocShell(bool* aIsTopLevelContentDocShell) return NS_OK; } -/* [infallible] */ NS_IMETHODIMP -nsDocShell::GetAppId(uint32_t* aAppId) -{ - if (mOriginAttributes.mAppId != nsIScriptSecurityManager::UNKNOWN_APP_ID) { - *aAppId = mOriginAttributes.mAppId; - return NS_OK; - } - - nsCOMPtr parent; - GetSameTypeParentIgnoreBrowserAndAppBoundaries(getter_AddRefs(parent)); - - if (!parent) { - *aAppId = nsIScriptSecurityManager::NO_APP_ID; - return NS_OK; - } - - return parent->GetAppId(aAppId); -} - // Implements nsILoadContext.originAttributes NS_IMETHODIMP nsDocShell::GetOriginAttributes(JS::MutableHandle aVal) @@ -14680,23 +14612,6 @@ nsDocShell::SetOriginAttributes(JS::Handle aOriginAttributes, return SetOriginAttributes(attrs); } -NS_IMETHODIMP -nsDocShell::GetAppManifestURL(nsAString& aAppManifestURL) -{ - uint32_t appId = nsIDocShell::GetAppId(); - if (appId != nsIScriptSecurityManager::NO_APP_ID && - appId != nsIScriptSecurityManager::UNKNOWN_APP_ID) { - nsCOMPtr appsService = - do_GetService(APPS_SERVICE_CONTRACTID); - NS_ASSERTION(appsService, "No AppsService available"); - appsService->GetManifestURLByLocalId(appId, aAppManifestURL); - } else { - aAppManifestURL.SetLength(0); - } - - return NS_OK; -} - NS_IMETHODIMP nsDocShell::GetAsyncPanZoomEnabled(bool* aOut) { diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 396996ea74..2bb71911b9 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -789,8 +789,6 @@ protected: static const nsCString FrameTypeToString(uint32_t aFrameType) { switch (aFrameType) { - case FRAME_TYPE_APP: - return NS_LITERAL_CSTRING("app"); case FRAME_TYPE_BROWSER: return NS_LITERAL_CSTRING("browser"); case FRAME_TYPE_REGULAR: diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl index d2812bd9c9..516d3981c4 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -826,109 +826,50 @@ interface nsIDocShell : nsIDocShellTreeItem */ [noscript] void notifyScrollObservers(); - /** - * Returns true iff the docshell corresponds to an