зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1770944 - Remove `nsIMozBrowserFrame`. r=smaug
Depends on D155254 Differential Revision: https://phabricator.services.mozilla.com/D170397
This commit is contained in:
Родитель
0b0569356c
Коммит
e6a0102a3b
|
@ -90,7 +90,6 @@ class nsIDOMXULSelectControlElement;
|
|||
class nsIDOMXULSelectControlItemElement;
|
||||
class nsIFrame;
|
||||
class nsIHTMLCollection;
|
||||
class nsIMozBrowserFrame;
|
||||
class nsIPrincipal;
|
||||
class nsIScreen;
|
||||
class nsIScrollableFrame;
|
||||
|
@ -458,16 +457,6 @@ class Element : public FragmentOrElement {
|
|||
*/
|
||||
virtual bool IsInteractiveHTMLContent() const;
|
||||
|
||||
/**
|
||||
* Returns |this| as an nsIMozBrowserFrame* if the element is a frame or
|
||||
* iframe element.
|
||||
*
|
||||
* We have this method, rather than using QI, so that we can use it during
|
||||
* the servo traversal, where we can't QI DOM nodes because of non-thread-safe
|
||||
* refcounts.
|
||||
*/
|
||||
virtual nsIMozBrowserFrame* GetAsMozBrowserFrame() { return nullptr; }
|
||||
|
||||
/**
|
||||
* Is the attribute named aAttribute a mapped attribute?
|
||||
*/
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "nsFrameLoaderOwner.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/dom/ChromeMessageSender.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
|
@ -100,15 +99,6 @@ InProcessBrowserChildMessageManager::InProcessBrowserChildMessageManager(
|
|||
mOwner(aOwner),
|
||||
mChromeMessageManager(aChrome) {
|
||||
mozilla::HoldJSObjects(this);
|
||||
|
||||
// If owner corresponds to an <iframe mozbrowser>, we'll have to tweak our
|
||||
// GetEventTargetParent implementation.
|
||||
nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(mOwner);
|
||||
if (browserFrame) {
|
||||
mIsBrowserFrame = browserFrame->GetReallyIsBrowser();
|
||||
} else {
|
||||
mIsBrowserFrame = false;
|
||||
}
|
||||
}
|
||||
|
||||
InProcessBrowserChildMessageManager::~InProcessBrowserChildMessageManager() {
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "nsSubDocumentFrame.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIAppWindow.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsGlobalWindowInner.h"
|
||||
#include "nsGlobalWindowOuter.h"
|
||||
|
@ -262,13 +261,6 @@ static bool IsTopContent(BrowsingContext* aParent, Element* aOwner) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If we have a (deprecated) mozbrowser element, we want to start a new
|
||||
// BrowsingContext tree regardless of whether the parent is chrome or content.
|
||||
nsCOMPtr<nsIMozBrowserFrame> mozbrowser = aOwner->GetAsMozBrowserFrame();
|
||||
if (mozbrowser && mozbrowser->GetReallyIsBrowser()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (aParent->IsContent()) {
|
||||
// If we're already in content, we may still want to create a new
|
||||
// BrowsingContext tree if our element is a xul browser element with a
|
||||
|
@ -365,17 +357,8 @@ static bool InitialLoadIsRemote(Element* aOwner) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If we're an <iframe mozbrowser> and we don't have a "remote" attribute,
|
||||
// fall back to the default.
|
||||
nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(aOwner);
|
||||
bool isMozBrowserFrame = browserFrame && browserFrame->GetReallyIsBrowser();
|
||||
if (isMozBrowserFrame && !aOwner->HasAttr(nsGkAtoms::remote)) {
|
||||
return Preferences::GetBool("dom.ipc.browser_frames.oop_by_default", false);
|
||||
}
|
||||
|
||||
// Otherwise, we're remote if we have "remote=true" and we're either a
|
||||
// browser frame or a XUL element.
|
||||
return (isMozBrowserFrame || aOwner->GetNameSpaceID() == kNameSpaceID_XUL) &&
|
||||
// Otherwise, we're remote if we have "remote=true" and we're a XUL element.
|
||||
return (aOwner->GetNameSpaceID() == kNameSpaceID_XUL) &&
|
||||
aOwner->AttrValueIs(kNameSpaceID_None, nsGkAtoms::remote,
|
||||
nsGkAtoms::_true, eCaseMatters);
|
||||
}
|
||||
|
@ -706,12 +689,6 @@ nsresult nsFrameLoader::ReallyStartLoadingInternal() {
|
|||
|
||||
// Default flags:
|
||||
int32_t flags = nsIWebNavigation::LOAD_FLAGS_NONE;
|
||||
|
||||
// Flags for browser frame:
|
||||
if (OwnerIsMozBrowserFrame()) {
|
||||
flags = nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
|
||||
nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
||||
}
|
||||
loadState->SetLoadFlags(flags);
|
||||
|
||||
loadState->SetFirstParty(false);
|
||||
|
@ -875,14 +852,6 @@ static bool CheckDocShellType(mozilla::dom::Element* aOwnerContent,
|
|||
bool isContent = aOwnerContent->AttrValueIs(kNameSpaceID_None, aAtom,
|
||||
nsGkAtoms::content, eIgnoreCase);
|
||||
|
||||
if (!isContent) {
|
||||
nsCOMPtr<nsIMozBrowserFrame> mozbrowser =
|
||||
aOwnerContent->GetAsMozBrowserFrame();
|
||||
if (mozbrowser) {
|
||||
mozbrowser->GetMozbrowser(&isContent);
|
||||
}
|
||||
}
|
||||
|
||||
if (isContent) {
|
||||
return aDocShell->ItemType() == nsIDocShellTreeItem::typeContent;
|
||||
}
|
||||
|
@ -1156,7 +1125,6 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
|
|||
if (nsCOMPtr<nsIObserverService> os = services::GetObserverService()) {
|
||||
os->NotifyObservers(ToSupports(this), "remote-browser-shown", nullptr);
|
||||
}
|
||||
ProcessPriorityManager::RemoteBrowserFrameShown(this);
|
||||
}
|
||||
} else {
|
||||
nsIntRect dimensions;
|
||||
|
@ -1329,14 +1297,6 @@ nsresult nsFrameLoader::SwapWithOtherRemoteLoader(
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// Destroy browser frame scripts for content leaving a frame with browser API
|
||||
if (OwnerIsMozBrowserFrame() && !aOther->OwnerIsMozBrowserFrame()) {
|
||||
DestroyBrowserFrameScripts();
|
||||
}
|
||||
if (!OwnerIsMozBrowserFrame() && aOther->OwnerIsMozBrowserFrame()) {
|
||||
aOther->DestroyBrowserFrameScripts();
|
||||
}
|
||||
|
||||
otherBrowserParent->SetBrowserDOMWindow(browserDOMWindow);
|
||||
browserParent->SetBrowserDOMWindow(otherBrowserDOMWindow);
|
||||
|
||||
|
@ -1405,10 +1365,6 @@ nsresult nsFrameLoader::SwapWithOtherRemoteLoader(
|
|||
ourPresShell->BackingScaleFactorChanged();
|
||||
otherPresShell->BackingScaleFactorChanged();
|
||||
|
||||
// Initialize browser API if needed now that owner content has changed.
|
||||
InitializeBrowserAPI();
|
||||
aOther->InitializeBrowserAPI();
|
||||
|
||||
mInSwap = aOther->mInSwap = false;
|
||||
|
||||
// Send an updated tab context since owner content type may have changed.
|
||||
|
@ -1536,13 +1492,8 @@ nsresult nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
bool ourFullscreenAllowed = ourContent->IsXULElement() ||
|
||||
(OwnerIsMozBrowserFrame() &&
|
||||
ourContent->HasAttr(nsGkAtoms::allowfullscreen));
|
||||
bool otherFullscreenAllowed =
|
||||
otherContent->IsXULElement() ||
|
||||
(aOther->OwnerIsMozBrowserFrame() &&
|
||||
otherContent->HasAttr(nsGkAtoms::allowfullscreen));
|
||||
bool ourFullscreenAllowed = ourContent->IsXULElement();
|
||||
bool otherFullscreenAllowed = otherContent->IsXULElement();
|
||||
if (ourFullscreenAllowed != otherFullscreenAllowed) {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -1732,14 +1683,6 @@ nsresult nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
|
|||
return rv;
|
||||
}
|
||||
|
||||
// Destroy browser frame scripts for content leaving a frame with browser API
|
||||
if (OwnerIsMozBrowserFrame() && !aOther->OwnerIsMozBrowserFrame()) {
|
||||
DestroyBrowserFrameScripts();
|
||||
}
|
||||
if (!OwnerIsMozBrowserFrame() && aOther->OwnerIsMozBrowserFrame()) {
|
||||
aOther->DestroyBrowserFrameScripts();
|
||||
}
|
||||
|
||||
// Now move the docshells to the right docshell trees. Note that this
|
||||
// resets their treeowners to null.
|
||||
ourParentItem->RemoveChild(ourDocshell);
|
||||
|
@ -1837,10 +1780,6 @@ nsresult nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
|
|||
ourFrame->PresShell()->BackingScaleFactorChanged();
|
||||
otherFrame->PresShell()->BackingScaleFactorChanged();
|
||||
|
||||
// Initialize browser API if needed now that owner content has changed
|
||||
InitializeBrowserAPI();
|
||||
aOther->InitializeBrowserAPI();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2174,11 +2113,6 @@ void nsFrameLoader::SetOwnerContent(Element* aContent) {
|
|||
}
|
||||
}
|
||||
|
||||
bool nsFrameLoader::OwnerIsMozBrowserFrame() {
|
||||
nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(mOwnerContent);
|
||||
return browserFrame ? browserFrame->GetReallyIsBrowser() : false;
|
||||
}
|
||||
|
||||
nsIContent* nsFrameLoader::GetParentObject() const { return mOwnerContent; }
|
||||
|
||||
void nsFrameLoader::AssertSafeToInit() {
|
||||
|
@ -2338,16 +2272,7 @@ nsresult nsFrameLoader::MaybeCreateDocShell() {
|
|||
MOZ_ALWAYS_SUCCEEDS(mPendingBrowsingContext->SetInitialSandboxFlags(
|
||||
mPendingBrowsingContext->GetSandboxFlags()));
|
||||
|
||||
if (OwnerIsMozBrowserFrame()) {
|
||||
// For inproc frames, set the docshell properties.
|
||||
nsAutoString name;
|
||||
if (mOwnerContent->GetAttr(nsGkAtoms::name, name)) {
|
||||
docShell->SetName(name);
|
||||
}
|
||||
}
|
||||
|
||||
ReallyLoadFrameScripts();
|
||||
InitializeBrowserAPI();
|
||||
|
||||
// Previously we would forcibly create the initial about:blank document for
|
||||
// in-process content frames from a frame script which eagerly loaded in
|
||||
|
@ -2588,11 +2513,8 @@ bool nsFrameLoader::TryRemoteBrowserInternal() {
|
|||
// Graphics initialization code relies on having a frame for the
|
||||
// remote browser case, as we can be inside a popup, which is a different
|
||||
// widget.
|
||||
//
|
||||
// FIXME: Ideally this should be unconditional, but we skip if for <iframe
|
||||
// mozbrowser> because the old RDM ui depends on current behavior, and the
|
||||
// mozbrowser frame code is scheduled for deletion, see bug 1574886.
|
||||
if (!OwnerIsMozBrowserFrame() && !mOwnerContent->GetPrimaryFrame()) {
|
||||
|
||||
if (!mOwnerContent->GetPrimaryFrame()) {
|
||||
doc->FlushPendingNotifications(FlushType::Frames);
|
||||
}
|
||||
|
||||
|
@ -2647,12 +2569,11 @@ bool nsFrameLoader::TryRemoteBrowserInternal() {
|
|||
mPendingBrowsingContext->InitSessionHistory();
|
||||
}
|
||||
|
||||
// <iframe mozbrowser> gets to skip these checks.
|
||||
// iframes for JS plugins also get to skip these checks. We control the URL
|
||||
// that gets loaded, but the load is triggered from the document containing
|
||||
// the plugin.
|
||||
// out of process iframes also get to skip this check.
|
||||
if (!OwnerIsMozBrowserFrame() && !XRE_IsContentProcess()) {
|
||||
if (!XRE_IsContentProcess()) {
|
||||
if (parentDocShell->ItemType() != nsIDocShellTreeItem::typeChrome) {
|
||||
// Allow three exceptions to this rule :
|
||||
// - about:addons so it can load remote extension options pages
|
||||
|
@ -2817,7 +2738,6 @@ bool nsFrameLoader::TryRemoteBrowserInternal() {
|
|||
}
|
||||
|
||||
ReallyLoadFrameScripts();
|
||||
InitializeBrowserAPI();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -3053,7 +2973,7 @@ nsresult nsFrameLoader::EnsureMessageManager() {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!mIsTopLevelContent && !OwnerIsMozBrowserFrame() && !IsRemoteFrame() &&
|
||||
if (!mIsTopLevelContent && !IsRemoteFrame() &&
|
||||
!(mOwnerContent->IsXULElement() &&
|
||||
mOwnerContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::forcemessagemanager,
|
||||
|
@ -3538,36 +3458,6 @@ BrowsingContext* nsFrameLoader::GetExtantBrowsingContext() {
|
|||
return mPendingBrowsingContext;
|
||||
}
|
||||
|
||||
void nsFrameLoader::InitializeBrowserAPI() {
|
||||
if (!OwnerIsMozBrowserFrame()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv = EnsureMessageManager();
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return;
|
||||
}
|
||||
mMessageManager->LoadFrameScript(
|
||||
u"chrome://global/content/BrowserElementChild.js"_ns,
|
||||
/* allowDelayedLoad = */ true,
|
||||
/* aRunInGlobalScope */ true, IgnoreErrors());
|
||||
|
||||
nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(mOwnerContent);
|
||||
if (browserFrame) {
|
||||
browserFrame->InitializeBrowserAPI();
|
||||
}
|
||||
}
|
||||
|
||||
void nsFrameLoader::DestroyBrowserFrameScripts() {
|
||||
if (!OwnerIsMozBrowserFrame()) {
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(mOwnerContent);
|
||||
if (browserFrame) {
|
||||
browserFrame->DestroyBrowserFrameScripts();
|
||||
}
|
||||
}
|
||||
|
||||
void nsFrameLoader::StartPersistence(
|
||||
BrowsingContext* aContext, nsIWebBrowserPersistDocumentReceiver* aRecv,
|
||||
ErrorResult& aRv) {
|
||||
|
@ -3673,9 +3563,9 @@ nsresult nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
|||
|
||||
nsresult nsFrameLoader::PopulateOriginContextIdsFromAttributes(
|
||||
OriginAttributes& aAttr) {
|
||||
// Only XUL or mozbrowser frames are allowed to set context IDs
|
||||
// Only XUL are allowed to set context IDs
|
||||
uint32_t namespaceID = mOwnerContent->GetNameSpaceID();
|
||||
if (namespaceID != kNameSpaceID_XUL && !OwnerIsMozBrowserFrame()) {
|
||||
if (namespaceID != kNameSpaceID_XUL) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -3899,8 +3789,7 @@ bool nsFrameLoader::EnsureBrowsingContextAttached() {
|
|||
// Inherit the `mFirstPartyDomain` flag from our parent document's result
|
||||
// principal, if it was set.
|
||||
if (parentContext->IsContent() &&
|
||||
!parentDoc->NodePrincipal()->IsSystemPrincipal() &&
|
||||
!OwnerIsMozBrowserFrame()) {
|
||||
!parentDoc->NodePrincipal()->IsSystemPrincipal()) {
|
||||
OriginAttributes docAttrs =
|
||||
parentDoc->NodePrincipal()->OriginAttributesRef();
|
||||
// We only want to inherit firstPartyDomain here, other attributes should
|
||||
|
@ -3918,15 +3807,6 @@ bool nsFrameLoader::EnsureBrowsingContextAttached() {
|
|||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// <iframe mozbrowser> is allowed to set `mozprivatebrowsing` to
|
||||
// force-enable private browsing.
|
||||
if (OwnerIsMozBrowserFrame()) {
|
||||
if (mOwnerContent->HasAttr(nsGkAtoms::mozprivatebrowsing)) {
|
||||
attrs.SyncAttributesWithPrivateBrowsing(true);
|
||||
usePrivateBrowsing = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we've already been attached, return.
|
||||
|
|
|
@ -264,12 +264,6 @@ class nsFrameLoader final : public nsStubMutationObserver,
|
|||
|
||||
bool IsNetworkCreated() const { return mNetworkCreated; }
|
||||
|
||||
/**
|
||||
* Is this a frame loader for a bona fide <iframe mozbrowser>?
|
||||
* <xul:browser> is not a mozbrowser, so this is false for that case.
|
||||
*/
|
||||
bool OwnerIsMozBrowserFrame();
|
||||
|
||||
nsIContent* GetParentObject() const;
|
||||
|
||||
/**
|
||||
|
@ -481,9 +475,6 @@ class nsFrameLoader final : public nsStubMutationObserver,
|
|||
void AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
|
||||
nsIDocShellTreeOwner* aOwner);
|
||||
|
||||
void InitializeBrowserAPI();
|
||||
void DestroyBrowserFrameScripts();
|
||||
|
||||
nsresult GetNewTabContext(mozilla::dom::MutableTabContext* aTabContext,
|
||||
nsIURI* aURI = nullptr);
|
||||
|
||||
|
|
|
@ -122,13 +122,6 @@ interface FrameLoader {
|
|||
[Pure]
|
||||
readonly attribute unsigned long long childID;
|
||||
|
||||
/**
|
||||
* Find out whether the owner content really is a mozbrowser. <xul:browser>
|
||||
* is not considered to be a mozbrowser frame.
|
||||
*/
|
||||
[Pure]
|
||||
readonly attribute boolean ownerIsMozBrowserFrame;
|
||||
|
||||
/**
|
||||
* The last known width of the frame. Reading this property will not trigger
|
||||
* a reflow, and therefore may not reflect the current state of things. It
|
||||
|
|
|
@ -142,11 +142,6 @@ class HTMLIFrameElement final : public nsGenericHTMLFrameElement {
|
|||
Document* GetSVGDocument(nsIPrincipal& aSubjectPrincipal) {
|
||||
return GetContentDocument(aSubjectPrincipal);
|
||||
}
|
||||
bool Mozbrowser() const { return GetBoolAttr(nsGkAtoms::mozbrowser); }
|
||||
void SetMozbrowser(bool aAllow, ErrorResult& aError) {
|
||||
SetHTMLBoolAttr(nsGkAtoms::mozbrowser, aAllow, aError);
|
||||
}
|
||||
using nsGenericHTMLFrameElement::SetMozbrowser;
|
||||
// nsGenericHTMLFrameElement::GetFrameLoader is fine
|
||||
// nsGenericHTMLFrameElement::GetAppManifestURL is fine
|
||||
|
||||
|
|
|
@ -46,19 +46,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsGenericHTMLFrameElement,
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFrameLoader)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(
|
||||
nsGenericHTMLFrameElement, nsGenericHTMLElement, nsFrameLoaderOwner,
|
||||
nsIDOMMozBrowserFrame, nsIMozBrowserFrame, nsGenericHTMLFrameElement)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGenericHTMLFrameElement::GetMozbrowser(bool* aValue) {
|
||||
*aValue = GetBoolAttr(nsGkAtoms::mozbrowser);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsGenericHTMLFrameElement::SetMozbrowser(bool aValue) {
|
||||
return SetBoolAttr(nsGkAtoms::mozbrowser, aValue);
|
||||
}
|
||||
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(nsGenericHTMLFrameElement,
|
||||
nsGenericHTMLElement,
|
||||
nsFrameLoaderOwner,
|
||||
nsGenericHTMLFrameElement)
|
||||
|
||||
int32_t nsGenericHTMLFrameElement::TabIndexDefault() { return 0; }
|
||||
|
||||
|
@ -258,9 +249,6 @@ void nsGenericHTMLFrameElement::AfterSetAttr(
|
|||
child->SendScrollbarPreferenceChanged(pref);
|
||||
}
|
||||
}
|
||||
} else if (aName == nsGkAtoms::mozbrowser) {
|
||||
mReallyIsBrowser = !!aValue && XRE_IsParentProcess() &&
|
||||
NodePrincipal()->IsSystemPrincipal();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -334,26 +322,3 @@ bool nsGenericHTMLFrameElement::IsHTMLFocusable(bool aWithMouse,
|
|||
*aIsFocusable = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this frame element really is a mozbrowser. (It
|
||||
* needs to have the right attributes, and its creator must have the right
|
||||
* permissions.)
|
||||
*/
|
||||
/* [infallible] */
|
||||
nsresult nsGenericHTMLFrameElement::GetReallyIsBrowser(bool* aOut) {
|
||||
*aOut = mReallyIsBrowser;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGenericHTMLFrameElement::InitializeBrowserAPI() {
|
||||
MOZ_ASSERT(mFrameLoader);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGenericHTMLFrameElement::DestroyBrowserFrameScripts() {
|
||||
MOZ_ASSERT(mFrameLoader);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsFrameLoader.h"
|
||||
#include "nsFrameLoaderOwner.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
|
||||
namespace mozilla {
|
||||
class ErrorResult;
|
||||
|
@ -37,23 +36,17 @@ class XULFrameElement;
|
|||
* A helper class for frame elements
|
||||
*/
|
||||
class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
|
||||
public nsFrameLoaderOwner,
|
||||
public nsIMozBrowserFrame {
|
||||
public nsFrameLoaderOwner {
|
||||
public:
|
||||
nsGenericHTMLFrameElement(
|
||||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser)
|
||||
: nsGenericHTMLElement(std::move(aNodeInfo)),
|
||||
mSrcLoadHappened(false),
|
||||
mNetworkCreated(aFromParser == mozilla::dom::FROM_PARSER_NETWORK),
|
||||
mBrowserFrameListenersRegistered(false),
|
||||
mReallyIsBrowser(false) {}
|
||||
mNetworkCreated(aFromParser == mozilla::dom::FROM_PARSER_NETWORK) {}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
NS_DECL_NSIDOMMOZBROWSERFRAME
|
||||
NS_DECL_NSIMOZBROWSERFRAME
|
||||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_GENERICHTMLFRAMEELEMENT_IID)
|
||||
|
||||
// nsIContent
|
||||
|
@ -67,8 +60,6 @@ class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
|
|||
|
||||
virtual int32_t TabIndexDefault() override;
|
||||
|
||||
virtual nsIMozBrowserFrame* GetAsMozBrowserFrame() override { return this; }
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsGenericHTMLFrameElement,
|
||||
nsGenericHTMLElement)
|
||||
|
||||
|
@ -125,9 +116,6 @@ class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
|
|||
*/
|
||||
bool mNetworkCreated;
|
||||
|
||||
bool mBrowserFrameListenersRegistered;
|
||||
bool mReallyIsBrowser;
|
||||
|
||||
// This flag is only used by <iframe>. See HTMLIFrameElement::
|
||||
// FullscreenFlag() for details. It is placed here so that we
|
||||
// do not bloat any struct.
|
||||
|
|
|
@ -9,7 +9,6 @@ with Files("**"):
|
|||
|
||||
XPIDL_SOURCES += [
|
||||
"nsIDOMMozBrowserFrame.idl",
|
||||
"nsIMozBrowserFrame.idl",
|
||||
]
|
||||
|
||||
XPIDL_MODULE = "dom_html"
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMMozBrowserFrame.idl"
|
||||
|
||||
interface nsIRemoteTab;
|
||||
|
||||
[scriptable, builtinclass, uuid(0c0a862c-1a47-43c0-ae9e-d51835e3e1a6)]
|
||||
interface nsIMozBrowserFrame : nsIDOMMozBrowserFrame
|
||||
{
|
||||
/**
|
||||
* Gets whether this frame really is a browser frame.
|
||||
*
|
||||
* In order to really be a browser frame, this frame's
|
||||
* nsIDOMMozBrowserFrame::mozbrowser attribute must be true, and the frame
|
||||
* may have to pass various security checks.
|
||||
*/
|
||||
[infallible] readonly attribute boolean reallyIsBrowser;
|
||||
|
||||
/**
|
||||
* Initialize the API, and add frame message listener that supports API
|
||||
* invocations.
|
||||
*/
|
||||
[noscript] void initializeBrowserAPI();
|
||||
|
||||
/**
|
||||
* Notify frame scripts that support the API to destroy.
|
||||
*/
|
||||
[noscript] void destroyBrowserFrameScripts();
|
||||
};
|
|
@ -213,7 +213,6 @@
|
|||
#include "nsILocalStorageManager.h"
|
||||
#include "nsIMemoryInfoDumper.h"
|
||||
#include "nsIMemoryReporter.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "nsINetworkLinkService.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIParentChannel.h"
|
||||
|
|
|
@ -1042,26 +1042,4 @@ void ProcessPriorityManager::BrowserPriorityChanged(
|
|||
singleton->BrowserPriorityChanged(aBrowserParent, aPriority);
|
||||
}
|
||||
|
||||
/* static */
|
||||
void ProcessPriorityManager::RemoteBrowserFrameShown(
|
||||
nsFrameLoader* aFrameLoader) {
|
||||
ProcessPriorityManagerImpl* singleton =
|
||||
ProcessPriorityManagerImpl::GetSingleton();
|
||||
if (!singleton) {
|
||||
return;
|
||||
}
|
||||
|
||||
BrowserParent* bp = BrowserParent::GetFrom(aFrameLoader);
|
||||
NS_ENSURE_TRUE_VOID(bp);
|
||||
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
// Ignore calls that aren't from a Browser.
|
||||
if (!aFrameLoader->OwnerIsMozBrowserFrame()) {
|
||||
return;
|
||||
}
|
||||
|
||||
singleton->ResetPriority(bp->Manager());
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -80,8 +80,6 @@ class ProcessPriorityManager final {
|
|||
static void BrowserPriorityChanged(dom::BrowserParent* aBrowserParent,
|
||||
bool aPriority);
|
||||
|
||||
static void RemoteBrowserFrameShown(nsFrameLoader* aFrameLoader);
|
||||
|
||||
private:
|
||||
ProcessPriorityManager();
|
||||
ProcessPriorityManager(const ProcessPriorityManager&) = delete;
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "nsCanvasFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsSubDocumentFrame.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "MobileViewportManager.h"
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsFontMetrics.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче