Bug 1525720, part 3 - Remove method to createRemoteFrameLoader from nsIMozBrowserFrame interface. r=farre

This appears unused and adds unneeded surface area for these API's to support.

Differential Revision: https://phabricator.services.mozilla.com/D31431

--HG--
extra : rebase_source : 7886ce8abf398d13432fa9e2ef61cedac41f52b4
extra : histedit_source : dc5404d058bac24d47459bd89d261a506a2a891b
This commit is contained in:
Ryan Hunt 2019-04-24 23:25:56 -05:00
Родитель e084a16216
Коммит 5592e0d298
5 изменённых файлов: 47 добавлений и 48 удалений

Просмотреть файл

@ -3043,10 +3043,10 @@ already_AddRefed<Element> nsFrameLoader::GetOwnerElement() {
return do_AddRef(mOwnerContent); return do_AddRef(mOwnerContent);
} }
void nsFrameLoader::SetRemoteBrowser(nsIRemoteTab* aBrowserParent) { void nsFrameLoader::InitializeFromBrowserParent(BrowserParent* aBrowserParent) {
MOZ_ASSERT(!mBrowserParent); MOZ_ASSERT(!mBrowserParent);
mIsRemoteFrame = true; mIsRemoteFrame = true;
mBrowserParent = BrowserParent::GetFrom(aBrowserParent); mBrowserParent = aBrowserParent;
mChildID = mBrowserParent ? mBrowserParent->Manager()->ChildID() : 0; mChildID = mBrowserParent ? mBrowserParent->Manager()->ChildID() : 0;
MaybeUpdatePrimaryBrowserParent(eBrowserParentChanged); MaybeUpdatePrimaryBrowserParent(eBrowserParentChanged);
ReallyLoadFrameScripts(); ReallyLoadFrameScripts();

Просмотреть файл

@ -342,7 +342,7 @@ class nsFrameLoader final : public nsStubMutationObserver,
* this object, which means you can't have called ShowRemoteFrame() * this object, which means you can't have called ShowRemoteFrame()
* or ReallyStartLoading(). * or ReallyStartLoading().
*/ */
void SetRemoteBrowser(nsIRemoteTab* aBrowserParent); void InitializeFromBrowserParent(BrowserParent* aBrowserParent);
/** /**
* Stashes a detached nsIFrame on the frame loader. We do this when we're * Stashes a detached nsIFrame on the frame loader. We do this when we're

Просмотреть файл

@ -132,12 +132,26 @@ void nsGenericHTMLFrameElement::EnsureFrameLoader() {
mFrameLoader = nsFrameLoader::Create(this, mOpenerWindow, mNetworkCreated); mFrameLoader = nsFrameLoader::Create(this, mOpenerWindow, mNetworkCreated);
} }
nsresult nsGenericHTMLFrameElement::CreateRemoteFrameLoader( void nsGenericHTMLFrameElement::DisallowCreateFrameLoader() {
nsIRemoteTab* aBrowserParent) { MOZ_ASSERT(!mFrameLoader);
MOZ_ASSERT(!mFrameLoaderCreationDisallowed);
mFrameLoaderCreationDisallowed = true;
}
void nsGenericHTMLFrameElement::AllowCreateFrameLoader() {
MOZ_ASSERT(!mFrameLoader);
MOZ_ASSERT(mFrameLoaderCreationDisallowed);
mFrameLoaderCreationDisallowed = false;
}
void nsGenericHTMLFrameElement::CreateRemoteFrameLoader(
BrowserParent* aBrowserParent) {
MOZ_ASSERT(!mFrameLoader); MOZ_ASSERT(!mFrameLoader);
EnsureFrameLoader(); EnsureFrameLoader();
NS_ENSURE_STATE(mFrameLoader); if (NS_WARN_IF(!mFrameLoader)) {
mFrameLoader->SetRemoteBrowser(aBrowserParent); return;
}
mFrameLoader->InitializeFromBrowserParent(aBrowserParent);
if (nsSubDocumentFrame* subdocFrame = do_QueryFrame(GetPrimaryFrame())) { if (nsSubDocumentFrame* subdocFrame = do_QueryFrame(GetPrimaryFrame())) {
// The reflow for this element already happened while we were waiting // The reflow for this element already happened while we were waiting
@ -146,7 +160,6 @@ nsresult nsGenericHTMLFrameElement::CreateRemoteFrameLoader(
// ReflowFinished, and we need to do it properly now. // ReflowFinished, and we need to do it properly now.
mFrameLoader->UpdatePositionAndSize(subdocFrame); mFrameLoader->UpdatePositionAndSize(subdocFrame);
} }
return NS_OK;
} }
void nsGenericHTMLFrameElement::PresetOpenerWindow( void nsGenericHTMLFrameElement::PresetOpenerWindow(
@ -442,22 +455,6 @@ NS_IMETHODIMP nsGenericHTMLFrameElement::GetIsolated(bool* aOut) {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP
nsGenericHTMLFrameElement::DisallowCreateFrameLoader() {
MOZ_ASSERT(!mFrameLoader);
MOZ_ASSERT(!mFrameLoaderCreationDisallowed);
mFrameLoaderCreationDisallowed = true;
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLFrameElement::AllowCreateFrameLoader() {
MOZ_ASSERT(!mFrameLoader);
MOZ_ASSERT(mFrameLoaderCreationDisallowed);
mFrameLoaderCreationDisallowed = false;
return NS_OK;
}
NS_IMETHODIMP NS_IMETHODIMP
nsGenericHTMLFrameElement::InitializeBrowserAPI() { nsGenericHTMLFrameElement::InitializeBrowserAPI() {
MOZ_ASSERT(mFrameLoader); MOZ_ASSERT(mFrameLoader);

Просмотреть файл

@ -19,6 +19,7 @@
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
class BrowserParent;
template <typename> template <typename>
struct Nullable; struct Nullable;
class WindowProxyHolder; class WindowProxyHolder;
@ -90,6 +91,31 @@ class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
mozilla::dom::WindowProxyHolder>& aOpenerWindow, mozilla::dom::WindowProxyHolder>& aOpenerWindow,
mozilla::ErrorResult& aRv); mozilla::ErrorResult& aRv);
/**
* Normally, a frame tries to create its frame loader when its src is
* modified, or its contentWindow is accessed.
*
* disallowCreateFrameLoader prevents the frame element from creating its
* frame loader (in the same way that not being inside a document prevents the
* creation of a frame loader). allowCreateFrameLoader lifts this
* restriction.
*
* These methods are not re-entrant -- it is an error to call
* disallowCreateFrameLoader twice without first calling allowFrameLoader.
*
* It's also an error to call either method if we already have a frame loader.
*/
void DisallowCreateFrameLoader();
void AllowCreateFrameLoader();
/**
* Create a remote (i.e., out-of-process) frame loader attached to the given
* remote tab.
*
* It is an error to call this method if we already have a frame loader.
*/
void CreateRemoteFrameLoader(mozilla::dom::BrowserParent* aBrowserParent);
static void InitStatics(); static void InitStatics();
static bool BrowserFramesEnabled(); static bool BrowserFramesEnabled();

Просмотреть файл

@ -35,30 +35,6 @@ interface nsIMozBrowserFrame : nsIDOMMozBrowserFrame
*/ */
[infallible] readonly attribute boolean isolated; [infallible] readonly attribute boolean isolated;
/**
* Normally, a frame tries to create its frame loader when its src is
* modified, or its contentWindow is accessed.
*
* disallowCreateFrameLoader prevents the frame element from creating its
* frame loader (in the same way that not being inside a document prevents the
* creation of a frame loader). allowCreateFrameLoader lifts this restriction.
*
* These methods are not re-entrant -- it is an error to call
* disallowCreateFrameLoader twice without first calling allowFrameLoader.
*
* It's also an error to call either method if we already have a frame loader.
*/
void disallowCreateFrameLoader();
void allowCreateFrameLoader();
/**
* Create a remote (i.e., out-of-process) frame loader attached to the given
* remote tab.
*
* It is an error to call this method if we already have a frame loader.
*/
void createRemoteFrameLoader(in nsIRemoteTab aRemoteTab);
/** /**
* Initialize the API, and add frame message listener that supports API * Initialize the API, and add frame message listener that supports API
* invocations. * invocations.