2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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/. */
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
#ifndef mozilla_dom_TabChild_h
|
|
|
|
#define mozilla_dom_TabChild_h
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
#include "mozilla/dom/PBrowserChild.h"
|
2009-07-01 00:39:22 +04:00
|
|
|
#include "nsIWebNavigation.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2009-11-05 21:14:22 +03:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIWebBrowserChrome2.h"
|
2012-06-10 02:15:12 +04:00
|
|
|
#include "nsIEmbeddingSiteWindow.h"
|
2009-11-05 21:14:22 +03:00
|
|
|
#include "nsIWebBrowserChromeFocus.h"
|
2009-11-17 17:22:23 +03:00
|
|
|
#include "nsIDOMEventListener.h"
|
2010-01-01 04:34:06 +03:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
#include "nsIWindowProvider.h"
|
2010-02-20 20:05:20 +03:00
|
|
|
#include "nsIDOMWindow.h"
|
2010-03-03 23:30:25 +03:00
|
|
|
#include "nsIDocShell.h"
|
2013-09-24 01:30:40 +04:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2010-02-20 20:05:20 +03:00
|
|
|
#include "nsFrameMessageManager.h"
|
2012-09-29 06:18:18 +04:00
|
|
|
#include "nsIWebProgressListener.h"
|
2010-08-06 02:11:23 +04:00
|
|
|
#include "nsIPresShell.h"
|
2010-02-20 20:05:20 +03:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2010-03-26 21:39:39 +03:00
|
|
|
#include "nsWeakReference.h"
|
2010-05-13 21:44:51 +04:00
|
|
|
#include "nsITabChild.h"
|
2014-01-23 00:27:23 +04:00
|
|
|
#include "nsITooltipListener.h"
|
2012-06-15 06:31:55 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
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 22:32:37 +04:00
|
|
|
#include "mozilla/dom/TabContext.h"
|
2014-04-01 10:13:50 +04:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2014-03-18 08:48:21 +04:00
|
|
|
#include "mozilla/EventDispatcher.h"
|
2013-09-25 15:21:16 +04:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-10-19 00:57:55 +04:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
2014-09-03 01:43:08 +04:00
|
|
|
#include "nsIWebBrowserChrome3.h"
|
2014-10-29 21:11:00 +03:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2015-06-17 11:44:50 +03:00
|
|
|
#include "PuppetWidget.h"
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2013-02-16 02:27:21 +04:00
|
|
|
class nsICachedFileDescriptorListener;
|
2013-06-15 01:47:56 +04:00
|
|
|
class nsIDOMWindowUtils;
|
2010-03-24 13:47:18 +03:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
namespace mozilla {
|
2010-08-21 03:24:41 +04:00
|
|
|
namespace layout {
|
|
|
|
class RenderFrameChild;
|
|
|
|
}
|
|
|
|
|
2014-04-17 15:54:25 +04:00
|
|
|
namespace layers {
|
2015-02-09 22:05:18 +03:00
|
|
|
class APZEventState;
|
2015-07-06 06:02:26 +03:00
|
|
|
class ImageCompositeNotification;
|
2015-02-07 02:11:19 +03:00
|
|
|
struct SetTargetAPZCCallback;
|
2015-03-19 13:33:33 +03:00
|
|
|
struct SetAllowedTouchBehaviorCallback;
|
2014-04-09 23:16:16 +04:00
|
|
|
}
|
|
|
|
|
2014-04-22 00:40:09 +04:00
|
|
|
namespace widget {
|
|
|
|
struct AutoCacheNativeKeyCommands;
|
|
|
|
}
|
|
|
|
|
2014-11-12 23:59:19 +03:00
|
|
|
namespace plugins {
|
|
|
|
class PluginWidgetChild;
|
|
|
|
}
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2009-11-17 17:22:23 +03:00
|
|
|
class TabChild;
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2014-03-25 06:28:46 +04:00
|
|
|
class TabChildBase;
|
2009-11-17 17:22:23 +03:00
|
|
|
|
2014-04-01 10:13:50 +04:00
|
|
|
class TabChildGlobal : public DOMEventTargetHelper,
|
2010-02-20 20:05:20 +03:00
|
|
|
public nsIContentFrameMessageManager,
|
2013-12-12 05:51:56 +04:00
|
|
|
public nsIScriptObjectPrincipal,
|
2015-01-18 06:17:06 +03:00
|
|
|
public nsIGlobalObject,
|
|
|
|
public nsSupportsWeakReference
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 17:19:51 +04:00
|
|
|
explicit TabChildGlobal(TabChildBase* aTabChild);
|
2012-04-27 00:56:46 +04:00
|
|
|
void Init();
|
2010-02-20 20:05:20 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-04-01 10:13:50 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TabChildGlobal, DOMEventTargetHelper)
|
2012-08-27 18:13:02 +04:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager)
|
|
|
|
NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
|
2015-02-20 04:12:11 +03:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGEMANAGERGLOBAL(mMessageManager)
|
2011-10-01 20:14:36 +04:00
|
|
|
NS_IMETHOD SendSyncMessage(const nsAString& aMessageName,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 21:21:15 +04:00
|
|
|
nsIPrincipal* aPrincipal,
|
2011-10-01 20:14:36 +04:00
|
|
|
JSContext* aCx,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aArgc,
|
2015-03-21 19:28:04 +03:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
2011-10-01 20:14:36 +04:00
|
|
|
return mMessageManager
|
2013-11-06 21:21:15 +04:00
|
|
|
? mMessageManager->SendSyncMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2011-10-01 20:14:36 +04:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
2010-02-20 20:05:20 +03:00
|
|
|
}
|
2013-10-01 20:15:06 +04:00
|
|
|
NS_IMETHOD SendRpcMessage(const nsAString& aMessageName,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 21:21:15 +04:00
|
|
|
nsIPrincipal* aPrincipal,
|
2013-10-01 20:15:06 +04:00
|
|
|
JSContext* aCx,
|
|
|
|
uint8_t aArgc,
|
2015-03-21 19:28:04 +03:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2013-10-01 20:15:06 +04:00
|
|
|
{
|
|
|
|
return mMessageManager
|
2013-11-06 21:21:15 +04:00
|
|
|
? mMessageManager->SendRpcMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2013-10-01 20:15:06 +04:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD GetContent(nsIDOMWindow** aContent) override;
|
|
|
|
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell) override;
|
2010-02-20 20:05:20 +03:00
|
|
|
|
2015-01-06 23:14:41 +03:00
|
|
|
nsresult AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
|
|
|
bool aUseCapture)
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
|
|
|
// By default add listeners only for trusted events!
|
2014-04-01 10:13:50 +04:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture, false, 2);
|
2010-02-20 20:05:20 +03:00
|
|
|
}
|
2014-04-01 10:13:50 +04:00
|
|
|
using DOMEventTargetHelper::AddEventListener;
|
2010-02-20 20:05:20 +03:00
|
|
|
NS_IMETHOD AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aUseCapture, bool aWantsUntrusted,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint8_t optional_argc) override
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
2014-04-01 10:13:50 +04:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture,
|
|
|
|
aWantsUntrusted,
|
|
|
|
optional_argc);
|
2010-02-20 20:05:20 +03:00
|
|
|
}
|
|
|
|
|
2013-08-09 04:16:47 +04:00
|
|
|
nsresult
|
2015-03-21 19:28:04 +03:00
|
|
|
PreHandleEvent(EventChainPreVisitor& aVisitor) override
|
2013-08-09 04:16:47 +04:00
|
|
|
{
|
|
|
|
aVisitor.mForceContentDispatch = true;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSContext* GetJSContextForEventHandlers() override;
|
|
|
|
virtual nsIPrincipal* GetPrincipal() override;
|
|
|
|
virtual JSObject* GetGlobalJSObject() override;
|
2010-02-20 20:05:20 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override
|
2014-10-07 13:44:48 +04:00
|
|
|
{
|
|
|
|
MOZ_CRASH("TabChildGlobal doesn't use DOM bindings!");
|
|
|
|
}
|
|
|
|
|
2010-02-20 20:05:20 +03:00
|
|
|
nsCOMPtr<nsIContentFrameMessageManager> mMessageManager;
|
2014-04-23 01:26:45 +04:00
|
|
|
nsRefPtr<TabChildBase> mTabChild;
|
2014-07-09 01:23:17 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~TabChildGlobal();
|
2010-02-20 20:05:20 +03:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class ContentListener final : public nsIDOMEventListener
|
2009-11-17 17:22:23 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 17:19:51 +04:00
|
|
|
explicit ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
|
2009-11-17 17:22:23 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
protected:
|
2014-06-23 23:56:07 +04:00
|
|
|
~ContentListener() {}
|
2009-11-17 17:22:23 +03:00
|
|
|
TabChild* mTabChild;
|
|
|
|
};
|
|
|
|
|
2014-03-25 06:28:46 +04:00
|
|
|
// This is base clase which helps to share Viewport and touch related functionality
|
|
|
|
// between b2g/android FF/embedlite clients implementation.
|
|
|
|
// It make sense to place in this class all helper functions, and functionality which could be shared between
|
|
|
|
// Cross-process/Cross-thread implmentations.
|
2014-04-23 01:26:45 +04:00
|
|
|
class TabChildBase : public nsISupports,
|
2015-02-20 04:10:44 +03:00
|
|
|
public nsMessageManagerScriptExecutor,
|
2014-03-25 06:28:46 +04:00
|
|
|
public ipc::MessageManagerCallback
|
|
|
|
{
|
2015-06-17 11:44:50 +03:00
|
|
|
protected:
|
|
|
|
typedef mozilla::widget::PuppetWidget PuppetWidget;
|
|
|
|
|
2014-03-25 06:28:46 +04:00
|
|
|
public:
|
|
|
|
TabChildBase();
|
2014-06-13 21:56:38 +04:00
|
|
|
|
2014-04-23 01:26:45 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2014-06-13 21:56:38 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase)
|
2014-03-25 06:28:46 +04:00
|
|
|
|
2015-01-16 21:48:33 +03:00
|
|
|
virtual nsIWebNavigation* WebNavigation() const = 0;
|
2015-06-17 11:44:50 +03:00
|
|
|
virtual PuppetWidget* WebWidget() = 0;
|
2014-03-25 06:28:46 +04:00
|
|
|
nsIPrincipal* GetPrincipal() { return mPrincipal; }
|
|
|
|
// Recalculates the display state, including the CSS
|
|
|
|
// viewport. This should be called whenever we believe the
|
|
|
|
// viewport data on a document may have changed. If it didn't
|
|
|
|
// change, this function doesn't do anything. However, it should
|
|
|
|
// not be called all the time as it is fairly expensive.
|
2014-08-06 20:41:05 +04:00
|
|
|
bool HandlePossibleViewportChange(const ScreenIntSize& aOldScreenSize);
|
2014-03-25 06:28:46 +04:00
|
|
|
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const mozilla::layers::FrameMetrics::ViewID& aViewId,
|
2015-06-17 19:32:41 +03:00
|
|
|
const Maybe<mozilla::layers::ZoomConstraints>& aConstraints) = 0;
|
2014-03-25 06:28:46 +04:00
|
|
|
|
2015-06-08 08:39:28 +03:00
|
|
|
virtual ScreenIntSize GetInnerSize() = 0;
|
|
|
|
|
2014-03-25 06:28:46 +04:00
|
|
|
protected:
|
2014-06-13 21:56:38 +04:00
|
|
|
virtual ~TabChildBase();
|
2014-03-25 06:28:46 +04:00
|
|
|
CSSSize GetPageSize(nsCOMPtr<nsIDocument> aDocument, const CSSSize& aViewport);
|
|
|
|
|
|
|
|
// Get the DOMWindowUtils for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIDOMWindowUtils> GetDOMWindowUtils();
|
|
|
|
// Get the Document for the top-level window in this tab.
|
2015-01-16 21:48:33 +03:00
|
|
|
already_AddRefed<nsIDocument> GetDocument() const;
|
2015-04-14 23:44:59 +03:00
|
|
|
// Get the pres-shell of the document for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIPresShell> GetPresShell() const;
|
2014-03-25 06:28:46 +04:00
|
|
|
|
|
|
|
// Wrapper for nsIDOMWindowUtils.setCSSViewport(). This updates some state
|
|
|
|
// variables local to this class before setting it.
|
|
|
|
void SetCSSViewport(const CSSSize& aSize);
|
|
|
|
|
|
|
|
// Wraps up a JSON object as a structured clone and sends it to the browser
|
|
|
|
// chrome script.
|
|
|
|
//
|
|
|
|
// XXX/bug 780335: Do the work the browser chrome script does in C++ instead
|
|
|
|
// so we don't need things like this.
|
|
|
|
void DispatchMessageManagerMessage(const nsAString& aMessageName,
|
|
|
|
const nsAString& aJSONData);
|
|
|
|
|
|
|
|
void InitializeRootMetrics();
|
|
|
|
|
|
|
|
mozilla::layers::FrameMetrics ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
|
|
|
|
|
|
|
bool UpdateFrameHandler(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
|
|
|
|
|
|
|
protected:
|
2014-05-29 21:20:02 +04:00
|
|
|
CSSSize mOldViewportSize;
|
2014-03-25 06:28:46 +04:00
|
|
|
bool mContentDocumentIsDisplayed;
|
|
|
|
nsRefPtr<TabChildGlobal> mTabChildGlobal;
|
|
|
|
mozilla::layers::FrameMetrics mLastRootMetrics;
|
2014-09-03 01:43:08 +04:00
|
|
|
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
2014-03-25 06:28:46 +04:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class TabChild final : public TabChildBase,
|
2015-03-27 21:52:19 +03:00
|
|
|
public PBrowserChild,
|
|
|
|
public nsIWebBrowserChrome2,
|
|
|
|
public nsIEmbeddingSiteWindow,
|
|
|
|
public nsIWebBrowserChromeFocus,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIWindowProvider,
|
|
|
|
public nsIDOMEventListener,
|
|
|
|
public nsIWebProgressListener,
|
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsITabChild,
|
|
|
|
public nsIObserver,
|
|
|
|
public TabContext,
|
|
|
|
public nsITooltipListener
|
2009-07-01 00:39:22 +04:00
|
|
|
{
|
2012-08-02 10:02:29 +04:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2015-04-30 06:39:59 +03:00
|
|
|
typedef mozilla::OwningSerializedStructuredCloneBuffer OwningSerializedStructuredCloneBuffer;
|
2012-11-28 00:43:52 +04:00
|
|
|
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
|
2015-02-09 22:05:18 +03:00
|
|
|
typedef mozilla::layers::APZEventState APZEventState;
|
2015-02-07 02:11:19 +03:00
|
|
|
typedef mozilla::layers::SetTargetAPZCCallback SetTargetAPZCCallback;
|
2015-03-19 13:33:33 +03:00
|
|
|
typedef mozilla::layers::SetAllowedTouchBehaviorCallback SetAllowedTouchBehaviorCallback;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2014-06-11 09:44:36 +04:00
|
|
|
public:
|
2015-01-30 12:07:12 +03:00
|
|
|
/**
|
|
|
|
* Find TabChild of aTabId in the same content process of the
|
|
|
|
* caller.
|
|
|
|
*/
|
|
|
|
static already_AddRefed<TabChild> FindTabChild(const TabId& aTabId);
|
2014-06-11 09:44:36 +04:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
public:
|
2012-08-29 19:26:18 +04:00
|
|
|
/**
|
|
|
|
* This is expected to be called off the critical path to content
|
|
|
|
* startup. This is an opportunity to load things that are slow
|
|
|
|
* on the critical path.
|
2012-06-22 05:17:52 +04:00
|
|
|
*/
|
2012-08-29 19:26:18 +04:00
|
|
|
static void PreloadSlowThings();
|
|
|
|
|
|
|
|
/** Return a TabChild with the given attributes. */
|
2013-07-10 21:07:51 +04:00
|
|
|
static already_AddRefed<TabChild>
|
2014-10-29 21:11:00 +03:00
|
|
|
Create(nsIContentChild* aManager, const TabId& aTabId, const TabContext& aContext, uint32_t aChromeFlags);
|
2012-08-29 19:26:18 +04:00
|
|
|
|
2012-09-05 20:23:45 +04:00
|
|
|
bool IsRootContentDocument();
|
2015-04-07 16:17:27 +03:00
|
|
|
// Let managees query if it is safe to send messages.
|
|
|
|
bool IsDestroyed() { return mDestroyed; }
|
2014-10-29 21:11:00 +03:00
|
|
|
const TabId GetTabId() const {
|
|
|
|
MOZ_ASSERT(mUniqueId != 0);
|
|
|
|
return mUniqueId;
|
2014-06-11 09:44:36 +04:00
|
|
|
}
|
|
|
|
|
2014-05-07 04:11:20 +04:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-11-05 21:14:22 +03:00
|
|
|
NS_DECL_NSIWEBBROWSERCHROME
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROME2
|
|
|
|
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
|
2010-01-01 04:34:06 +03:00
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2010-01-01 04:35:55 +03:00
|
|
|
NS_DECL_NSIWINDOWPROVIDER
|
2012-09-29 06:18:18 +04:00
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
2012-05-28 13:27:25 +04:00
|
|
|
NS_DECL_NSITABCHILD
|
2012-08-09 00:37:57 +04:00
|
|
|
NS_DECL_NSIOBSERVER
|
2014-01-23 00:27:23 +04:00
|
|
|
NS_DECL_NSITOOLTIPLISTENER
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2012-09-28 09:43:12 +04:00
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
2013-10-01 20:15:06 +04:00
|
|
|
virtual bool DoSendBlockingMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
const mozilla::dom::StructuredCloneData& aData,
|
|
|
|
JS::Handle<JSObject *> aCpows,
|
2013-11-06 21:21:15 +04:00
|
|
|
nsIPrincipal* aPrincipal,
|
2015-04-30 06:39:59 +03:00
|
|
|
nsTArray<OwningSerializedStructuredCloneBuffer>* aRetVal,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aIsSync) override;
|
2013-07-11 02:05:39 +04:00
|
|
|
virtual bool DoSendAsyncMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
const mozilla::dom::StructuredCloneData& aData,
|
2013-11-06 21:21:15 +04:00
|
|
|
JS::Handle<JSObject *> aCpows,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIPrincipal* aPrincipal) override;
|
2014-03-25 06:28:46 +04:00
|
|
|
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
2015-06-17 19:32:41 +03:00
|
|
|
const Maybe<ZoomConstraints>& aConstraints) override;
|
2015-02-11 14:53:00 +03:00
|
|
|
virtual bool RecvLoadURL(const nsCString& aURI,
|
2015-03-21 19:28:04 +03:00
|
|
|
const BrowserConfiguration& aConfiguration) override;
|
2013-02-16 02:27:21 +04:00
|
|
|
virtual bool RecvCacheFileDescriptor(const nsString& aPath,
|
|
|
|
const FileDescriptor& aFileDescriptor)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2015-03-05 12:13:05 +03:00
|
|
|
virtual bool RecvShow(const ScreenIntSize& aSize,
|
2014-11-24 22:05:35 +03:00
|
|
|
const ShowInfo& aInfo,
|
2014-11-16 21:23:22 +03:00
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
2015-02-06 19:26:29 +03:00
|
|
|
PRenderFrameChild* aRenderFrame,
|
2015-05-18 08:42:05 +03:00
|
|
|
const bool& aParentIsActive) override;
|
2015-06-08 08:39:28 +03:00
|
|
|
virtual bool RecvUpdateDimensions(const CSSRect& rect,
|
|
|
|
const CSSSize& size,
|
2014-12-11 17:44:07 +03:00
|
|
|
const ScreenOrientation& orientation,
|
2015-04-21 17:33:56 +03:00
|
|
|
const LayoutDeviceIntPoint& chromeDisp) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override;
|
2015-02-20 02:53:30 +03:00
|
|
|
virtual bool RecvRequestFlingSnap(const ViewID& aScrollId,
|
2015-03-21 19:28:04 +03:00
|
|
|
const CSSPoint& aDestination) override;
|
2014-02-06 02:43:20 +04:00
|
|
|
virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
|
2015-03-21 19:28:04 +03:00
|
|
|
const uint32_t& aScrollGeneration) override;
|
2014-03-12 23:27:45 +04:00
|
|
|
virtual bool RecvHandleDoubleTap(const CSSPoint& aPoint,
|
2015-03-03 00:41:02 +03:00
|
|
|
const Modifiers& aModifiers,
|
2015-03-21 19:28:04 +03:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
2014-03-12 23:27:45 +04:00
|
|
|
virtual bool RecvHandleSingleTap(const CSSPoint& aPoint,
|
2015-03-03 00:41:02 +03:00
|
|
|
const Modifiers& aModifiers,
|
2015-03-21 19:28:04 +03:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
2014-03-12 23:27:45 +04:00
|
|
|
virtual bool RecvHandleLongTap(const CSSPoint& aPoint,
|
2015-03-03 00:41:02 +03:00
|
|
|
const Modifiers& aModifiers,
|
2014-10-24 21:29:30 +04:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
2015-03-21 19:28:04 +03:00
|
|
|
const uint64_t& aInputBlockId) override;
|
2014-04-15 21:39:20 +04:00
|
|
|
virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId,
|
|
|
|
const APZStateChange& aChange,
|
2015-03-21 19:28:04 +03:00
|
|
|
const int& aArg) override;
|
2015-06-19 15:25:41 +03:00
|
|
|
virtual bool RecvNotifyFlushComplete() override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvActivate() override;
|
|
|
|
virtual bool RecvDeactivate() override;
|
2010-07-19 22:33:33 +04:00
|
|
|
virtual bool RecvMouseEvent(const nsString& aType,
|
|
|
|
const float& aX,
|
|
|
|
const float& aY,
|
2012-08-22 19:56:38 +04:00
|
|
|
const int32_t& aButton,
|
|
|
|
const int32_t& aClickCount,
|
|
|
|
const int32_t& aModifiers,
|
2015-03-21 19:28:04 +03:00
|
|
|
const bool& aIgnoreRootScrollFrame) override;
|
|
|
|
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& event) override;
|
|
|
|
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& event) override;
|
2015-04-08 21:48:11 +03:00
|
|
|
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
|
|
|
const uint32_t& aDragAction,
|
|
|
|
const uint32_t& aDropEffect) override;
|
2014-03-20 19:46:29 +04:00
|
|
|
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event,
|
2015-03-21 19:28:04 +03:00
|
|
|
const MaybeNativeKeyBinding& aBindings) override;
|
2014-12-09 13:40:26 +03:00
|
|
|
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
2015-03-21 19:28:04 +03:00
|
|
|
const uint64_t& aInputBlockId) override;
|
2013-11-13 22:20:31 +04:00
|
|
|
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
2014-10-24 21:29:30 +04:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
2015-05-14 15:16:00 +03:00
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsEventStatus& aApzResponse) override;
|
2013-11-13 22:20:31 +04:00
|
|
|
virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
|
2014-10-24 21:29:30 +04:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
2015-05-14 15:16:00 +03:00
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsEventStatus& aApzResponse) override;
|
2010-07-19 22:33:33 +04:00
|
|
|
virtual bool RecvKeyEvent(const nsString& aType,
|
2012-08-22 19:56:38 +04:00
|
|
|
const int32_t& aKeyCode,
|
|
|
|
const int32_t& aCharCode,
|
|
|
|
const int32_t& aModifiers,
|
2015-03-21 19:28:04 +03:00
|
|
|
const bool& aPreventDefault) override;
|
2015-03-22 10:42:26 +03:00
|
|
|
virtual bool RecvMouseScrollTestEvent(const FrameMetrics::ViewID& aScrollId,
|
|
|
|
const nsString& aEvent) override;
|
2015-04-14 18:36:36 +03:00
|
|
|
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
|
|
|
|
const nsCString& aResponse) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) override;
|
|
|
|
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) override;
|
|
|
|
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) override;
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
2015-03-21 19:28:04 +03:00
|
|
|
const bool& aRunInGlobalScope) override;
|
2010-07-19 22:33:33 +04:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
2013-07-11 02:05:39 +04:00
|
|
|
const ClonedMessageData& aData,
|
2015-01-16 22:58:52 +03:00
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
2015-03-21 19:28:04 +03:00
|
|
|
const IPC::Principal& aPrincipal) override;
|
2010-10-27 02:20:53 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) override;
|
2014-08-23 03:17:18 +04:00
|
|
|
|
2015-05-07 18:43:40 +03:00
|
|
|
virtual bool RecvSwappedWithOtherRemoteLoader() override;
|
|
|
|
|
2015-05-21 20:04:58 +03:00
|
|
|
virtual PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*,
|
|
|
|
const uint64_t&)
|
|
|
|
override;
|
|
|
|
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
|
2010-10-27 02:20:53 +04:00
|
|
|
virtual PDocumentRendererChild*
|
2013-12-26 22:06:53 +04:00
|
|
|
AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
|
2013-07-08 19:48:39 +04:00
|
|
|
const nsString& bgcolor,
|
|
|
|
const uint32_t& renderFlags, const bool& flushLayout,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsIntSize& renderSize) override;
|
|
|
|
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor) override;
|
2010-10-27 02:20:53 +04:00
|
|
|
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
|
|
|
|
const nsRect& documentRect,
|
2013-12-26 22:06:53 +04:00
|
|
|
const gfx::Matrix& transform,
|
2010-10-27 02:20:53 +04:00
|
|
|
const nsString& bgcolor,
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t& renderFlags,
|
2010-10-27 02:20:53 +04:00
|
|
|
const bool& flushLayout,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsIntSize& renderSize) override;
|
2010-10-27 02:20:53 +04:00
|
|
|
|
2014-02-24 00:19:43 +04:00
|
|
|
virtual PColorPickerChild*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPColorPickerChild(const nsString& title, const nsString& initialColor) override;
|
|
|
|
virtual bool DeallocPColorPickerChild(PColorPickerChild* actor) override;
|
2014-02-24 00:19:43 +04:00
|
|
|
|
2014-02-18 04:30:06 +04:00
|
|
|
virtual PFilePickerChild*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
2014-02-18 04:30:06 +04:00
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPFilePickerChild(PFilePickerChild* actor) override;
|
2014-02-18 04:30:06 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual PIndexedDBPermissionRequestChild*
|
|
|
|
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIndexedDBPermissionRequestChild(
|
|
|
|
PIndexedDBPermissionRequestChild* aActor)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIWebNavigation* WebNavigation() const override { return mWebNav; }
|
2015-06-17 11:44:50 +03:00
|
|
|
virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
|
2009-11-06 23:43:39 +03:00
|
|
|
|
2012-08-29 19:26:18 +04:00
|
|
|
/** Return the DPI of the widget this TabChild draws to. */
|
|
|
|
void GetDPI(float* aDPI);
|
2013-05-02 03:06:19 +04:00
|
|
|
void GetDefaultScale(double *aScale);
|
2012-08-29 19:26:18 +04:00
|
|
|
|
2015-05-08 04:29:00 +03:00
|
|
|
void GetMaxTouchPoints(uint32_t* aTouchPoints);
|
|
|
|
|
2012-11-22 06:40:57 +04:00
|
|
|
ScreenOrientation GetOrientation() { return mOrientation; }
|
|
|
|
|
2011-10-21 02:17:09 +04:00
|
|
|
void SetBackgroundColor(const nscolor& aColor);
|
2012-07-18 03:59:45 +04:00
|
|
|
|
|
|
|
void NotifyPainted();
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2014-04-22 00:40:09 +04:00
|
|
|
void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands* aAutoCache,
|
|
|
|
WidgetKeyboardEvent* aEvent);
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2012-11-08 07:51:55 +04:00
|
|
|
/**
|
|
|
|
* Signal to this TabChild that it should be made visible:
|
|
|
|
* activated widget, retained layer tree, etc. (Respectively,
|
|
|
|
* made not visible.)
|
|
|
|
*/
|
|
|
|
void MakeVisible();
|
|
|
|
void MakeHidden();
|
|
|
|
|
2013-02-16 02:27:21 +04:00
|
|
|
// Returns true if the file descriptor was found in the cache, false
|
|
|
|
// otherwise.
|
|
|
|
bool GetCachedFileDescriptor(const nsAString& aPath,
|
|
|
|
nsICachedFileDescriptorListener* aCallback);
|
|
|
|
|
|
|
|
void CancelCachedFileDescriptorCallback(
|
|
|
|
const nsAString& aPath,
|
|
|
|
nsICachedFileDescriptorListener* aCallback);
|
|
|
|
|
2014-06-11 09:44:06 +04:00
|
|
|
nsIContentChild* Manager() { return mManager; }
|
2013-07-10 21:07:51 +04:00
|
|
|
|
2013-08-13 11:56:57 +04:00
|
|
|
bool GetUpdateHitRegion() { return mUpdateHitRegion; }
|
|
|
|
|
|
|
|
void UpdateHitRegion(const nsRegion& aRegion);
|
|
|
|
|
2013-09-12 23:24:11 +04:00
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(nsIDocShell* aDocShell)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsITabChild> tc = do_GetInterface(aDocShell);
|
|
|
|
return static_cast<TabChild*>(tc.get());
|
|
|
|
}
|
|
|
|
|
2013-10-03 00:08:30 +04:00
|
|
|
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
2014-03-07 07:24:32 +04:00
|
|
|
static TabChild* GetFrom(uint64_t aLayersId);
|
|
|
|
|
2014-05-29 01:42:14 +04:00
|
|
|
void DidComposite(uint64_t aTransactionId);
|
2015-05-05 09:32:47 +03:00
|
|
|
void ClearCachedResources();
|
2013-09-12 23:24:11 +04:00
|
|
|
|
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(nsIDOMWindow* aWindow)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvUIResolutionChanged() override;
|
2014-05-23 18:36:50 +04:00
|
|
|
|
2015-04-22 17:58:33 +03:00
|
|
|
virtual bool RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
|
|
|
|
|
2014-11-12 23:59:19 +03:00
|
|
|
/**
|
|
|
|
* Native widget remoting protocol for use with windowed plugins with e10s.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
PPluginWidgetChild* AllocPPluginWidgetChild() override;
|
|
|
|
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override;
|
2015-02-06 00:48:44 +03:00
|
|
|
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
|
2014-11-12 23:59:19 +03:00
|
|
|
|
2015-04-21 17:33:56 +03:00
|
|
|
LayoutDeviceIntPoint GetChromeDisplacement() { return mChromeDisp; };
|
2014-12-11 17:44:07 +03:00
|
|
|
|
2015-01-07 08:42:00 +03:00
|
|
|
bool IPCOpen() { return mIPCOpen; }
|
|
|
|
|
2015-02-06 19:26:29 +03:00
|
|
|
bool ParentIsActive()
|
|
|
|
{
|
|
|
|
return mParentIsActive;
|
|
|
|
}
|
2015-06-04 23:51:10 +03:00
|
|
|
bool AsyncPanZoomEnabled() { return mAsyncPanZoomEnabled; }
|
2015-02-06 19:26:29 +03:00
|
|
|
|
2015-06-08 20:24:56 +03:00
|
|
|
virtual ScreenIntSize GetInnerSize() override;
|
2015-06-08 08:39:28 +03:00
|
|
|
|
2010-08-06 02:11:23 +04:00
|
|
|
protected:
|
2014-07-09 01:23:17 +04:00
|
|
|
virtual ~TabChild();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual PRenderFrameChild* AllocPRenderFrameChild() override;
|
|
|
|
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
|
|
|
|
virtual bool RecvDestroy() override;
|
|
|
|
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
|
|
|
|
virtual bool RecvSetIsDocShellActive(const bool& aIsActive) override;
|
2010-08-06 02:11:23 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvRequestNotifyAfterRemotePaint() override;
|
2014-05-23 22:19:00 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvParentActivated(const bool& aActivated) override;
|
2014-11-27 16:28:26 +03:00
|
|
|
|
2015-07-01 16:19:11 +03:00
|
|
|
virtual bool RecvStopIMEStateManagement() override;
|
2015-07-01 16:19:11 +03:00
|
|
|
virtual bool RecvMenuKeyboardListenerInstalled(
|
|
|
|
const bool& aInstalled) override;
|
2015-07-01 16:19:11 +03:00
|
|
|
|
2014-10-31 20:54:02 +03:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
void MaybeRequestPreinitCamera();
|
|
|
|
#endif
|
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
private:
|
2012-08-29 19:26:18 +04:00
|
|
|
/**
|
|
|
|
* Create a new TabChild object.
|
|
|
|
*
|
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 22:32:37 +04:00
|
|
|
* |aOwnOrContainingAppId| is the app-id of our frame or of the closest app
|
|
|
|
* frame in the hierarchy which contains us.
|
|
|
|
*
|
|
|
|
* |aIsBrowserElement| indicates whether we're a browser (but not an app).
|
2012-08-29 19:26:18 +04:00
|
|
|
*/
|
2014-10-29 21:11:00 +03:00
|
|
|
TabChild(nsIContentChild* aManager,
|
|
|
|
const TabId& aTabId,
|
|
|
|
const TabContext& aContext,
|
|
|
|
uint32_t aChromeFlags);
|
2012-08-29 19:26:18 +04:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
|
2014-08-24 11:16:32 +04:00
|
|
|
class DelayedFireContextMenuEvent;
|
2014-02-22 03:12:43 +04: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 22:32:37 +04:00
|
|
|
// Notify others that our TabContext has been updated. (At the moment, this
|
|
|
|
// sets the appropriate app-id and is-browser flags on our docshell.)
|
|
|
|
//
|
|
|
|
// You should call this after calling TabContext::SetTabContext(). We also
|
|
|
|
// call this during Init().
|
|
|
|
void NotifyTabContextUpdated();
|
2012-08-29 19:26:18 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason why) override;
|
2010-07-22 03:23:03 +04:00
|
|
|
|
2012-08-29 19:26:18 +04:00
|
|
|
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
|
|
|
|
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
|
2015-02-26 16:47:01 +03:00
|
|
|
bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
2014-11-16 21:23:22 +03:00
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame);
|
2010-08-21 03:24:40 +04:00
|
|
|
void DestroyWindow();
|
2012-09-11 08:30:33 +04:00
|
|
|
void SetProcessNameToAppName();
|
2013-07-10 03:26:07 +04:00
|
|
|
|
2012-06-13 02:01:25 +04:00
|
|
|
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
2015-02-26 16:47:01 +03:00
|
|
|
void DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
2014-11-16 21:23:22 +03:00
|
|
|
const uint64_t& aLayersId,
|
2015-05-18 08:42:05 +03:00
|
|
|
PRenderFrameChild* aRenderFrame);
|
2012-06-13 02:01:25 +04:00
|
|
|
|
2014-11-24 22:05:35 +03:00
|
|
|
void ApplyShowInfo(const ShowInfo& aInfo);
|
|
|
|
|
2013-01-05 18:53:16 +04:00
|
|
|
// These methods are used for tracking synthetic mouse events
|
|
|
|
// dispatched for compatibility. On each touch event, we
|
|
|
|
// UpdateTapState(). If we've detected that the current gesture
|
|
|
|
// isn't a tap, then we CancelTapTracking(). In the meantime, we
|
|
|
|
// may detect a context-menu event, and if so we
|
|
|
|
// FireContextMenuEvent().
|
|
|
|
void FireContextMenuEvent();
|
|
|
|
void CancelTapTracking();
|
2013-09-27 10:20:57 +04:00
|
|
|
void UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus);
|
2012-09-15 05:16:32 +04:00
|
|
|
|
2012-06-13 02:01:25 +04:00
|
|
|
nsresult
|
2015-01-16 21:06:56 +03:00
|
|
|
ProvideWindowCommon(nsIDOMWindow* aOpener,
|
2015-01-16 21:07:50 +03:00
|
|
|
bool aIframeMoz,
|
2015-01-16 21:06:56 +03:00
|
|
|
uint32_t aChromeFlags,
|
|
|
|
bool aCalledFromJS,
|
|
|
|
bool aPositionSpecified,
|
|
|
|
bool aSizeSpecified,
|
|
|
|
nsIURI* aURI,
|
|
|
|
const nsAString& aName,
|
|
|
|
const nsACString& aFeatures,
|
|
|
|
bool* aWindowIsNew,
|
|
|
|
nsIDOMWindow** aReturn);
|
2012-06-13 02:01:25 +04:00
|
|
|
|
2014-04-25 19:40:23 +04:00
|
|
|
bool HasValidInnerSize();
|
|
|
|
|
2015-01-30 12:07:12 +03:00
|
|
|
void SetTabId(const TabId& aTabId);
|
2014-10-29 21:11:00 +03:00
|
|
|
|
2015-06-08 08:39:28 +03:00
|
|
|
ScreenIntRect GetOuterRect();
|
|
|
|
|
|
|
|
void SetUnscaledInnerSize(const CSSSize& aSize) {
|
|
|
|
mUnscaledInnerSize = aSize;
|
|
|
|
}
|
|
|
|
|
2013-02-16 02:27:21 +04:00
|
|
|
class CachedFileDescriptorInfo;
|
|
|
|
class CachedFileDescriptorCallbackRunnable;
|
2014-07-11 22:15:10 +04:00
|
|
|
class DelayedDeleteRunnable;
|
2013-02-16 02:27:21 +04:00
|
|
|
|
2013-05-01 04:42:05 +04:00
|
|
|
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
2009-07-01 00:39:22 +04:00
|
|
|
nsCOMPtr<nsIWebNavigation> mWebNav;
|
2015-06-17 11:44:50 +03:00
|
|
|
nsRefPtr<PuppetWidget> mPuppetWidget;
|
2012-09-29 06:18:18 +04:00
|
|
|
nsCOMPtr<nsIURI> mLastURI;
|
2010-08-21 03:24:41 +04:00
|
|
|
RenderFrameChild* mRemoteFrame;
|
2014-06-11 09:44:06 +04:00
|
|
|
nsRefPtr<nsIContentChild> mManager;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mChromeFlags;
|
2014-03-07 07:24:32 +04:00
|
|
|
uint64_t mLayersId;
|
2015-06-08 08:39:28 +03:00
|
|
|
CSSRect mUnscaledOuterRect;
|
2013-01-05 18:53:16 +04:00
|
|
|
// When we're tracking a possible tap gesture, this is the "down"
|
|
|
|
// point of the touchstart.
|
2013-07-16 23:54:59 +04:00
|
|
|
LayoutDevicePoint mGestureDownPoint;
|
2013-01-05 18:53:16 +04:00
|
|
|
// The touch identifier of the active gesture.
|
|
|
|
int32_t mActivePointerId;
|
|
|
|
// A timer task that fires if the tap-hold timeout is exceeded by
|
|
|
|
// the touch we're tracking. That is, if touchend or a touchmove
|
|
|
|
// that exceeds the gesture threshold doesn't happen.
|
2014-08-24 11:16:32 +04:00
|
|
|
nsCOMPtr<nsITimer> mTapHoldTimer;
|
2013-05-30 04:56:09 +04:00
|
|
|
// Whether we have already received a FileDescriptor for the app package.
|
|
|
|
bool mAppPackageFileDescriptorRecved;
|
2013-02-16 02:27:21 +04:00
|
|
|
// At present only 1 of these is really expected.
|
|
|
|
nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
|
|
|
mCachedFileDescriptorInfos;
|
2011-10-21 02:17:09 +04:00
|
|
|
nscolor mLastBackgroundColor;
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones DONTBUILD
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.
(Re-landing changeset a6a847452dbf, backed out in 5091aa6083c4, because it was originally landed with the incorrect bug number.)
2012-10-31 00:13:21 +04:00
|
|
|
bool mDidFakeShow;
|
2012-08-07 07:00:41 +04:00
|
|
|
bool mNotified;
|
2012-08-29 19:26:18 +04:00
|
|
|
bool mTriedBrowserInit;
|
2012-11-22 06:40:57 +04:00
|
|
|
ScreenOrientation mOrientation;
|
2013-08-13 11:56:57 +04:00
|
|
|
bool mUpdateHitRegion;
|
2014-07-29 19:59:19 +04:00
|
|
|
|
2014-03-12 07:13:38 +04:00
|
|
|
bool mIgnoreKeyPressEvent;
|
2015-02-09 22:05:18 +03:00
|
|
|
nsRefPtr<APZEventState> mAPZEventState;
|
2015-03-19 13:33:33 +03:00
|
|
|
nsRefPtr<SetAllowedTouchBehaviorCallback> mSetAllowedTouchBehaviorCallback;
|
2014-04-25 19:40:23 +04:00
|
|
|
bool mHasValidInnerSize;
|
2014-08-24 11:16:32 +04:00
|
|
|
bool mDestroyed;
|
2014-12-11 17:44:07 +03:00
|
|
|
// Position of tab, relative to parent widget (typically the window)
|
2015-04-21 17:33:56 +03:00
|
|
|
LayoutDeviceIntPoint mChromeDisp;
|
2014-10-29 21:11:00 +03:00
|
|
|
TabId mUniqueId;
|
2014-12-12 20:50:46 +03:00
|
|
|
float mDPI;
|
|
|
|
double mDefaultScale;
|
2015-01-07 08:42:00 +03:00
|
|
|
bool mIPCOpen;
|
2015-02-06 19:26:29 +03:00
|
|
|
bool mParentIsActive;
|
2015-06-04 23:51:10 +03:00
|
|
|
bool mAsyncPanZoomEnabled;
|
2015-06-08 08:39:28 +03:00
|
|
|
CSSSize mUnscaledInnerSize;
|
2014-03-12 07:13:38 +04:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
#endif // mozilla_dom_TabChild_h
|