2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Class for managing loading of a subframe (creation of the docshell,
|
|
|
|
* handling of loads in it, recursion-checking).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsFrameLoader_h_
|
|
|
|
#define nsFrameLoader_h_
|
|
|
|
|
|
|
|
#include "nsIDocShell.h"
|
|
|
|
#include "nsStringFwd.h"
|
|
|
|
#include "nsIFrameLoader.h"
|
2010-09-03 13:10:46 -07:00
|
|
|
#include "nsPoint.h"
|
2009-10-05 04:52:19 -07:00
|
|
|
#include "nsSize.h"
|
2008-03-21 04:44:09 -07:00
|
|
|
#include "nsIURI.h"
|
2009-06-30 13:39:22 -07:00
|
|
|
#include "nsAutoPtr.h"
|
2010-02-20 09:05:20 -08:00
|
|
|
#include "nsFrameMessageManager.h"
|
2011-10-01 10:14:35 -07:00
|
|
|
#include "mozilla/dom/Element.h"
|
2012-06-18 19:30:09 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-07-30 17:42:26 -07:00
|
|
|
#include "FrameMetrics.h"
|
2012-09-04 20:00:26 -07:00
|
|
|
#include "nsStubMutationObserver.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsIURI;
|
2010-08-30 17:49:07 -07:00
|
|
|
class nsSubDocumentFrame;
|
2013-01-03 05:23:11 -08:00
|
|
|
class nsView;
|
2010-05-18 05:28:37 -07:00
|
|
|
class nsIInProcessContentFrameMessageManager;
|
2010-05-28 12:34:50 -07:00
|
|
|
class AutoResetInShow;
|
2012-06-12 15:01:25 -07:00
|
|
|
class nsITabParent;
|
2012-09-04 20:00:26 -07:00
|
|
|
class nsIDocShellTreeItem;
|
|
|
|
class nsIDocShellTreeOwner;
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
class mozIApplication;
|
2009-07-20 12:04:52 -07:00
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
namespace mozilla {
|
2010-07-19 11:33:33 -07:00
|
|
|
namespace dom {
|
2013-07-17 16:34:57 -07:00
|
|
|
class ContentParent;
|
2010-07-19 11:33:33 -07:00
|
|
|
class PBrowserParent;
|
|
|
|
class TabParent;
|
2012-09-27 22:43:12 -07:00
|
|
|
struct StructuredCloneData;
|
2010-07-19 11:33:33 -07:00
|
|
|
}
|
2010-08-20 16:24:41 -07:00
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
class RenderFrameParent;
|
|
|
|
}
|
2009-06-30 13:39:22 -07:00
|
|
|
}
|
2009-10-28 13:41:46 -07:00
|
|
|
|
2013-06-12 05:04:28 -07:00
|
|
|
#if defined(MOZ_WIDGET_GTK)
|
2009-10-28 13:41:46 -07:00
|
|
|
typedef struct _GtkWidget GtkWidget;
|
|
|
|
#endif
|
2010-02-04 08:00:52 -08:00
|
|
|
#ifdef MOZ_WIDGET_QT
|
|
|
|
class QX11EmbedContainer;
|
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-18 19:30:09 -07:00
|
|
|
class nsFrameLoader MOZ_FINAL : public nsIFrameLoader,
|
2012-09-27 22:43:12 -07:00
|
|
|
public nsStubMutationObserver,
|
|
|
|
public mozilla::dom::ipc::MessageManagerCallback
|
2011-01-13 09:45:14 -08:00
|
|
|
{
|
|
|
|
friend class AutoResetInShow;
|
|
|
|
typedef mozilla::dom::PBrowserParent PBrowserParent;
|
|
|
|
typedef mozilla::dom::TabParent TabParent;
|
|
|
|
typedef mozilla::layout::RenderFrameParent RenderFrameParent;
|
|
|
|
|
|
|
|
protected:
|
2011-10-01 10:14:35 -07:00
|
|
|
nsFrameLoader(mozilla::dom::Element* aOwner, bool aNetworkCreated);
|
2011-01-13 09:45:14 -08:00
|
|
|
|
2013-07-17 16:34:57 -07:00
|
|
|
~nsFrameLoader();
|
2008-02-26 07:10:01 -08:00
|
|
|
|
2014-06-24 19:09:15 -07:00
|
|
|
public:
|
2011-10-01 10:14:35 -07:00
|
|
|
static nsFrameLoader* Create(mozilla::dom::Element* aOwner,
|
|
|
|
bool aNetworkCreated);
|
2009-08-19 02:09:26 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2011-01-11 13:34:31 -08:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFrameLoader, nsIFrameLoader)
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSIFRAMELOADER
|
2012-09-04 20:00:26 -07:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
2014-06-02 05:08:21 -07:00
|
|
|
nsresult CheckForRecursiveLoad(nsIURI* aURI);
|
2008-03-21 04:44:09 -07:00
|
|
|
nsresult ReallyStartLoading();
|
2008-02-26 06:47:51 -08:00
|
|
|
void Finalize();
|
2008-04-24 03:33:22 -07:00
|
|
|
nsIDocShell* GetExistingDocShell() { return mDocShell; }
|
2013-04-05 17:44:26 -07:00
|
|
|
mozilla::dom::EventTarget* GetTabChildGlobalAsEventTarget();
|
2009-12-10 20:02:13 -08:00
|
|
|
nsresult CreateStaticClone(nsIFrameLoader* aDest);
|
|
|
|
|
2012-09-27 22:43:12 -07:00
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
2013-11-23 21:32:45 -08:00
|
|
|
virtual bool DoLoadFrameScript(const nsAString& aURL,
|
|
|
|
bool aRunInGlobalScope) MOZ_OVERRIDE;
|
2013-07-10 15:05:39 -07:00
|
|
|
virtual bool DoSendAsyncMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
const mozilla::dom::StructuredCloneData& aData,
|
2013-11-06 09:21:15 -08:00
|
|
|
JS::Handle<JSObject *> aCpows,
|
|
|
|
nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
|
2013-05-29 13:43:41 -07:00
|
|
|
virtual bool CheckPermission(const nsAString& aPermission) MOZ_OVERRIDE;
|
|
|
|
virtual bool CheckManifestURL(const nsAString& aManifestURL) MOZ_OVERRIDE;
|
|
|
|
virtual bool CheckAppHasPermission(const nsAString& aPermission) MOZ_OVERRIDE;
|
2012-09-27 22:43:12 -07:00
|
|
|
|
2009-10-16 12:42:29 -07:00
|
|
|
/**
|
2009-10-16 12:42:29 -07:00
|
|
|
* Called from the layout frame associated with this frame loader;
|
|
|
|
* this notifies us to hook up with the widget and view.
|
2009-10-16 12:42:29 -07:00
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
bool Show(int32_t marginWidth, int32_t marginHeight,
|
|
|
|
int32_t scrollbarPrefX, int32_t scrollbarPrefY,
|
2010-08-30 17:49:07 -07:00
|
|
|
nsSubDocumentFrame* frame);
|
2009-10-16 12:42:29 -07:00
|
|
|
|
2011-05-13 10:41:00 -07:00
|
|
|
/**
|
|
|
|
* Called when the margin properties of the containing frame are changed.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
void MarginsChanged(uint32_t aMarginWidth, uint32_t aMarginHeight);
|
2011-05-13 10:41:00 -07:00
|
|
|
|
2009-10-16 12:42:29 -07:00
|
|
|
/**
|
2009-10-16 12:42:29 -07:00
|
|
|
* Called from the layout frame associated with this frame loader, when
|
|
|
|
* the frame is being torn down; this notifies us that out widget and view
|
|
|
|
* are going away and we should unhook from them.
|
2009-10-16 12:42:29 -07:00
|
|
|
*/
|
|
|
|
void Hide();
|
|
|
|
|
2009-12-10 20:02:13 -08:00
|
|
|
nsresult CloneForStatic(nsIFrameLoader* aOriginal);
|
|
|
|
|
2008-08-07 16:15:40 -07:00
|
|
|
// The guts of an nsIFrameLoaderOwner::SwapFrameLoader implementation. A
|
|
|
|
// frame loader owner needs to call this, and pass in the two references to
|
|
|
|
// nsRefPtrs for frame loaders that need to be swapped.
|
|
|
|
nsresult SwapWithOtherLoader(nsFrameLoader* aOther,
|
|
|
|
nsRefPtr<nsFrameLoader>& aFirstToSwap,
|
|
|
|
nsRefPtr<nsFrameLoader>& aSecondToSwap);
|
2009-10-29 10:58:31 -07:00
|
|
|
|
2014-10-06 19:30:42 -07:00
|
|
|
nsresult SwapWithOtherRemoteLoader(nsFrameLoader* aOther,
|
|
|
|
nsRefPtr<nsFrameLoader>& aFirstToSwap,
|
|
|
|
nsRefPtr<nsFrameLoader>& aSecondToSwap);
|
|
|
|
|
2010-04-11 17:34:02 -07:00
|
|
|
// When IPC is enabled, destroy any associated child process.
|
|
|
|
void DestroyChild();
|
|
|
|
|
2010-08-05 15:11:23 -07:00
|
|
|
/**
|
|
|
|
* Return the primary frame for our owning content, or null if it
|
|
|
|
* can't be found.
|
|
|
|
*/
|
|
|
|
nsIFrame* GetPrimaryFrameOfOwningContent() const
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
return mOwnerContent ? mOwnerContent->GetPrimaryFrame() : nullptr;
|
2010-08-05 15:11:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the document that owns this, or null if we don't have
|
|
|
|
* an owner.
|
|
|
|
*/
|
2012-05-11 00:47:40 -07:00
|
|
|
nsIDocument* GetOwnerDoc() const
|
2012-07-30 07:20:58 -07:00
|
|
|
{ return mOwnerContent ? mOwnerContent->OwnerDoc() : nullptr; }
|
2010-08-05 15:11:23 -07:00
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
PBrowserParent* GetRemoteBrowser();
|
2010-08-20 16:24:41 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The "current" render frame is the one on which the most recent
|
|
|
|
* remote layer-tree transaction was executed. If no content has
|
|
|
|
* been drawn yet, or the remote browser doesn't have any drawn
|
2013-04-02 18:14:24 -07:00
|
|
|
* content for whatever reason, return nullptr. The returned render
|
2010-08-20 16:24:41 -07:00
|
|
|
* frame has an associated shadow layer tree.
|
|
|
|
*
|
|
|
|
* Note that the returned render frame might not be a frame
|
|
|
|
* constructed for this->GetURL(). This can happen, e.g., if the
|
|
|
|
* <browser> was just navigated to a new URL, but hasn't painted the
|
|
|
|
* new page yet. A render frame for the previous page may be
|
|
|
|
* returned. (In-process <browser> behaves similarly, and this
|
|
|
|
* behavior seems desirable.)
|
|
|
|
*/
|
|
|
|
RenderFrameParent* GetCurrentRemoteFrame() const
|
|
|
|
{
|
|
|
|
return mCurrentRemoteFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* |aFrame| can be null. If non-null, it must be the remote frame
|
|
|
|
* on which the most recent layer transaction completed for this's
|
|
|
|
* <browser>.
|
|
|
|
*/
|
|
|
|
void SetCurrentRemoteFrame(RenderFrameParent* aFrame)
|
|
|
|
{
|
|
|
|
mCurrentRemoteFrame = aFrame;
|
|
|
|
}
|
2010-02-20 09:05:20 -08:00
|
|
|
nsFrameMessageManager* GetFrameMessageManager() { return mMessageManager; }
|
|
|
|
|
2011-10-01 10:14:35 -07:00
|
|
|
mozilla::dom::Element* GetOwnerContent() { return mOwnerContent; }
|
2011-12-05 04:38:46 -08:00
|
|
|
bool ShouldClipSubdocument() { return mClipSubdocument; }
|
|
|
|
|
2012-02-17 15:41:13 -08:00
|
|
|
bool ShouldClampScrollPosition() { return mClampScrollPosition; }
|
|
|
|
|
2012-06-12 15:01:25 -07:00
|
|
|
/**
|
|
|
|
* Tell this FrameLoader to use a particular remote browser.
|
|
|
|
*
|
|
|
|
* This will assert if mRemoteBrowser or mCurrentRemoteFrame is non-null. In
|
|
|
|
* practice, this means you can't have successfully run TryRemoteBrowser() on
|
|
|
|
* this object, which means you can't have called ShowRemoteFrame() or
|
|
|
|
* ReallyStartLoading().
|
|
|
|
*/
|
|
|
|
void SetRemoteBrowser(nsITabParent* aTabParent);
|
|
|
|
|
2012-08-13 21:06:44 -07:00
|
|
|
/**
|
|
|
|
* Stashes a detached view on the frame loader. We do this when we're
|
|
|
|
* destroying the nsSubDocumentFrame. If the nsSubdocumentFrame is
|
|
|
|
* being reframed we'll restore the detached view when it's recreated,
|
|
|
|
* otherwise we'll discard the old presentation and set the detached
|
|
|
|
* subdoc view to null. aContainerDoc is the document containing the
|
|
|
|
* the subdoc frame. This enables us to detect when the containing
|
|
|
|
* document has changed during reframe, so we can discard the presentation
|
|
|
|
* in that case.
|
|
|
|
*/
|
2013-01-03 05:23:11 -08:00
|
|
|
void SetDetachedSubdocView(nsView* aDetachedView,
|
2012-08-13 21:06:44 -07:00
|
|
|
nsIDocument* aContainerDoc);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the detached view and the document containing the view,
|
|
|
|
* as set by SetDetachedSubdocView().
|
|
|
|
*/
|
2013-01-03 05:23:11 -08:00
|
|
|
nsView* GetDetachedSubdocView(nsIDocument** aContainerDoc) const;
|
2012-08-13 21:06:44 -07:00
|
|
|
|
2013-08-06 03:01:23 -07:00
|
|
|
/**
|
|
|
|
* Applies a new set of sandbox flags. These are merged with the sandbox
|
|
|
|
* flags from our owning content's owning document with a logical OR, this
|
|
|
|
* ensures that we can only add restrictions and never remove them.
|
|
|
|
*/
|
|
|
|
void ApplySandboxFlags(uint32_t sandboxFlags);
|
|
|
|
|
2013-10-25 17:04:50 -07:00
|
|
|
void GetURL(nsString& aURL);
|
|
|
|
|
2015-01-09 00:55:18 -08:00
|
|
|
void ActivateUpdateHitRegion();
|
|
|
|
void DeactivateUpdateHitRegion();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
|
|
|
|
2012-05-08 09:20:35 -07:00
|
|
|
void SetOwnerContent(mozilla::dom::Element* aContent);
|
|
|
|
|
2009-10-16 12:42:27 -07:00
|
|
|
bool ShouldUseRemoteProcess();
|
|
|
|
|
2012-04-25 09:35:58 -07:00
|
|
|
/**
|
2012-07-13 14:10:20 -07:00
|
|
|
* Is this a frameloader for a bona fide <iframe mozbrowser> or
|
|
|
|
* <iframe mozapp>? (I.e., does the frame return true for
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* nsIMozBrowserFrame::GetReallyIsBrowserOrApp()?)
|
2012-04-25 09:35:58 -07:00
|
|
|
*/
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
bool OwnerIsBrowserOrAppFrame();
|
2012-04-25 09:35:58 -07:00
|
|
|
|
2014-08-19 07:14:22 -07:00
|
|
|
/**
|
|
|
|
* Is this a frameloader for a bona fide <iframe mozwidget>? (I.e., does the
|
|
|
|
* frame return true for nsIMozBrowserFrame::GetReallyIsWidget()?)
|
|
|
|
*/
|
|
|
|
bool OwnerIsWidget();
|
|
|
|
|
2012-07-13 14:10:20 -07:00
|
|
|
/**
|
|
|
|
* Is this a frameloader for a bona fide <iframe mozapp>? (I.e., does the
|
|
|
|
* frame return true for nsIMozBrowserFrame::GetReallyIsApp()?)
|
|
|
|
*/
|
|
|
|
bool OwnerIsAppFrame();
|
|
|
|
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
/**
|
|
|
|
* Is this a frame loader for a bona fide <iframe mozbrowser>?
|
|
|
|
*/
|
|
|
|
bool OwnerIsBrowserFrame();
|
|
|
|
|
2013-02-06 15:49:27 -08:00
|
|
|
/**
|
|
|
|
* Get our owning element's app manifest URL, or return the empty string if
|
|
|
|
* our owning element doesn't have an app manifest URL.
|
|
|
|
*/
|
|
|
|
void GetOwnerAppManifestURL(nsAString& aOut);
|
|
|
|
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
/**
|
|
|
|
* Get the app for our frame. This is the app whose manifest is returned by
|
|
|
|
* GetOwnerAppManifestURL.
|
|
|
|
*/
|
|
|
|
already_AddRefed<mozIApplication> GetOwnApp();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the app which contains this frame. This is the app associated with
|
|
|
|
* the frame element's principal.
|
|
|
|
*/
|
|
|
|
already_AddRefed<mozIApplication> GetContainingApp();
|
|
|
|
|
2009-10-16 12:42:27 -07:00
|
|
|
/**
|
|
|
|
* If we are an IPC frame, set mRemoteFrame. Otherwise, create and
|
|
|
|
* initialize mDocShell.
|
|
|
|
*/
|
|
|
|
nsresult MaybeCreateDocShell();
|
2010-05-18 05:28:37 -07:00
|
|
|
nsresult EnsureMessageManager();
|
2009-10-05 04:52:19 -07:00
|
|
|
|
|
|
|
// Properly retrieves documentSize of any subdocument type.
|
2014-08-08 10:23:50 -07:00
|
|
|
nsresult GetWindowDimensions(nsIntRect& aRect);
|
2009-10-05 04:52:19 -07:00
|
|
|
|
|
|
|
// Updates the subdocument position and size. This gets called only
|
|
|
|
// when we have our own in-process DocShell.
|
2014-06-02 05:08:21 -07:00
|
|
|
nsresult UpdateBaseWindowPositionAndSize(nsSubDocumentFrame *aIFrame);
|
2008-03-21 04:44:09 -07:00
|
|
|
nsresult CheckURILoad(nsIURI* aURI);
|
2010-02-24 18:45:43 -08:00
|
|
|
void FireErrorEvent();
|
|
|
|
nsresult ReallyStartLoadingInternal();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
// Return true if remote browser created; nothing else to do
|
|
|
|
bool TryRemoteBrowser();
|
2009-10-28 13:41:46 -07:00
|
|
|
|
2010-08-20 16:24:40 -07:00
|
|
|
// Tell the remote browser that it's now "virtually visible"
|
2013-11-04 14:40:50 -08:00
|
|
|
bool ShowRemoteFrame(const nsIntSize& size,
|
2013-01-09 23:23:55 -08:00
|
|
|
nsSubDocumentFrame *aFrame = nullptr);
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2012-09-04 20:00:26 -07:00
|
|
|
bool AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
|
|
|
|
nsIDocShellTreeOwner* aOwner,
|
|
|
|
int32_t aParentType,
|
2014-01-06 14:34:15 -08:00
|
|
|
nsIDocShell* aParentNode);
|
2012-09-04 20:00:26 -07:00
|
|
|
|
|
|
|
nsIAtom* TypeAttrName() const {
|
|
|
|
return mOwnerContent->IsXUL() ? nsGkAtoms::type : nsGkAtoms::mozframetype;
|
|
|
|
}
|
|
|
|
|
2013-01-05 14:02:29 -08:00
|
|
|
// Update the permission manager's app-id refcount based on mOwnerContent's
|
|
|
|
// own-or-containing-app.
|
|
|
|
void ResetPermissionManagerStatus();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
2008-03-21 04:44:09 -07:00
|
|
|
nsCOMPtr<nsIURI> mURIToLoad;
|
2011-10-01 10:14:35 -07:00
|
|
|
mozilla::dom::Element* mOwnerContent; // WEAK
|
2012-09-04 20:00:26 -07:00
|
|
|
|
2013-01-05 14:02:29 -08:00
|
|
|
// Note: this variable must be modified only by ResetPermissionManagerStatus()
|
|
|
|
uint32_t mAppIdSentToPermissionManager;
|
|
|
|
|
2010-05-18 05:28:37 -07:00
|
|
|
public:
|
|
|
|
// public because a callback needs these.
|
|
|
|
nsRefPtr<nsFrameMessageManager> mMessageManager;
|
|
|
|
nsCOMPtr<nsIInProcessContentFrameMessageManager> mChildMessageManager;
|
|
|
|
private:
|
2012-08-13 21:06:44 -07:00
|
|
|
// Stores the root view of the subdocument while the subdocument is being
|
|
|
|
// reframed. Used to restore the presentation after reframing.
|
2013-01-03 05:23:11 -08:00
|
|
|
nsView* mDetachedSubdocViews;
|
2012-08-13 21:06:44 -07:00
|
|
|
// Stores the containing document of the frame corresponding to this
|
|
|
|
// frame loader. This is reference is kept valid while the subframe's
|
|
|
|
// presentation is detached and stored in mDetachedSubdocViews. This
|
|
|
|
// enables us to detect whether the frame has moved documents during
|
|
|
|
// a reframe, so that we know not to restore the presentation.
|
|
|
|
nsCOMPtr<nsIDocument> mContainerDocWhileDetached;
|
|
|
|
|
2015-01-05 11:16:09 -08:00
|
|
|
bool mIsPrerendered : 1;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mDepthTooGreat : 1;
|
|
|
|
bool mIsTopLevelContent : 1;
|
|
|
|
bool mDestroyCalled : 1;
|
|
|
|
bool mNeedsAsyncDestroy : 1;
|
|
|
|
bool mInSwap : 1;
|
|
|
|
bool mInShow : 1;
|
|
|
|
bool mHideCalled : 1;
|
2010-08-17 07:13:55 -07:00
|
|
|
// True when the object is created for an element which the parser has
|
|
|
|
// created using NS_FROM_PARSER_NETWORK flag. If the element is modified,
|
|
|
|
// it may lose the flag.
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mNetworkCreated : 1;
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mRemoteBrowserShown : 1;
|
2011-12-05 04:38:46 -08:00
|
|
|
bool mRemoteFrame : 1;
|
|
|
|
bool mClipSubdocument : 1;
|
2012-02-17 15:41:13 -08:00
|
|
|
bool mClampScrollPosition : 1;
|
2012-07-09 11:00:55 -07:00
|
|
|
bool mRemoteBrowserInitialized : 1;
|
2012-09-04 20:00:26 -07:00
|
|
|
bool mObservingOwnerContent : 1;
|
2011-12-05 04:38:46 -08:00
|
|
|
|
2013-04-25 17:53:26 -07:00
|
|
|
// Backs nsIFrameLoader::{Get,Set}Visible. Visibility state here relates to
|
|
|
|
// whether this frameloader's <iframe mozbrowser> is setVisible(true)'ed, and
|
|
|
|
// doesn't necessarily correlate with docshell/document visibility.
|
|
|
|
bool mVisible : 1;
|
|
|
|
|
2013-07-17 16:34:57 -07:00
|
|
|
// The ContentParent associated with mRemoteBrowser. This was added as a
|
|
|
|
// strong ref in bug 545237, and we're not sure if we can get rid of it.
|
2014-06-10 22:44:03 -07:00
|
|
|
nsRefPtr<mozilla::dom::nsIContentParent> mContentParent;
|
2010-08-20 16:24:41 -07:00
|
|
|
RenderFrameParent* mCurrentRemoteFrame;
|
2010-07-19 11:33:33 -07:00
|
|
|
TabParent* mRemoteBrowser;
|
2013-09-12 12:24:10 -07:00
|
|
|
uint64_t mChildID;
|
2010-06-07 13:38:02 -07:00
|
|
|
|
2011-06-21 17:32:43 -07:00
|
|
|
// See nsIFrameLoader.idl. EVENT_MODE_NORMAL_DISPATCH automatically
|
|
|
|
// forwards some input events to out-of-process content.
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mEventMode;
|
2014-01-15 11:05:00 -08:00
|
|
|
|
2014-02-20 14:19:18 -08:00
|
|
|
// Indicate if we have sent 'remote-browser-pending'.
|
2014-01-15 11:05:00 -08:00
|
|
|
bool mPendingFrameSent;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|