2015-05-03 12:32:37 -07: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 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/. */
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
#ifndef mozilla_dom_TabChild_h
|
|
|
|
#define mozilla_dom_TabChild_h
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
#include "mozilla/dom/PBrowserChild.h"
|
2009-06-30 13:39:22 -07:00
|
|
|
#include "nsIWebNavigation.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2009-11-05 10:14:22 -08:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIWebBrowserChrome2.h"
|
2012-06-09 15:15:12 -07:00
|
|
|
#include "nsIEmbeddingSiteWindow.h"
|
2009-11-05 10:14:22 -08:00
|
|
|
#include "nsIWebBrowserChromeFocus.h"
|
2009-11-17 06:22:23 -08:00
|
|
|
#include "nsIDOMEventListener.h"
|
2009-12-31 17:34:06 -08:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2009-12-31 17:35:55 -08:00
|
|
|
#include "nsIWindowProvider.h"
|
2010-02-20 09:05:20 -08:00
|
|
|
#include "nsIDOMWindow.h"
|
2010-03-03 12:30:25 -08:00
|
|
|
#include "nsIDocShell.h"
|
2013-09-23 14:30:40 -07:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2010-02-20 09:05:20 -08:00
|
|
|
#include "nsFrameMessageManager.h"
|
2010-08-05 15:11:23 -07:00
|
|
|
#include "nsIPresShell.h"
|
2010-02-20 09:05:20 -08:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2010-03-26 11:39:39 -07:00
|
|
|
#include "nsWeakReference.h"
|
2010-05-13 10:44:51 -07:00
|
|
|
#include "nsITabChild.h"
|
2014-01-22 12:27:23 -08:00
|
|
|
#include "nsITooltipListener.h"
|
2012-06-14 19:31:55 -07: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 10:32:37 -08:00
|
|
|
#include "mozilla/dom/TabContext.h"
|
2014-03-31 23:13:50 -07:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2014-03-17 21:48:21 -07:00
|
|
|
#include "mozilla/EventDispatcher.h"
|
2013-09-25 04:21:16 -07:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-10-18 13:57:55 -07:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
2014-09-02 14:43:08 -07:00
|
|
|
#include "nsIWebBrowserChrome3.h"
|
2014-10-29 11:11:00 -07:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2015-08-04 19:47:10 -07:00
|
|
|
#include "AudioChannelService.h"
|
2015-06-17 01:44:50 -07:00
|
|
|
#include "PuppetWidget.h"
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2013-02-15 14:27:21 -08:00
|
|
|
class nsICachedFileDescriptorListener;
|
2013-06-14 14:47:56 -07:00
|
|
|
class nsIDOMWindowUtils;
|
2010-03-24 03:47:18 -07:00
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
namespace mozilla {
|
2010-08-20 16:24:41 -07:00
|
|
|
namespace layout {
|
|
|
|
class RenderFrameChild;
|
2015-07-13 08:25:42 -07:00
|
|
|
} // namespace layout
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2014-04-17 04:54:25 -07:00
|
|
|
namespace layers {
|
2015-02-09 11:05:18 -08:00
|
|
|
class APZEventState;
|
2015-07-05 20:02:26 -07:00
|
|
|
class ImageCompositeNotification;
|
2015-02-06 15:11:19 -08:00
|
|
|
struct SetTargetAPZCCallback;
|
2015-03-19 03:33:33 -07:00
|
|
|
struct SetAllowedTouchBehaviorCallback;
|
2015-07-13 08:25:42 -07:00
|
|
|
} // namespace layers
|
2014-04-09 12:16:16 -07:00
|
|
|
|
2014-04-21 13:40:09 -07:00
|
|
|
namespace widget {
|
|
|
|
struct AutoCacheNativeKeyCommands;
|
2015-07-13 08:25:42 -07:00
|
|
|
} // namespace widget
|
2014-04-21 13:40:09 -07:00
|
|
|
|
2014-11-12 12:59:19 -08:00
|
|
|
namespace plugins {
|
|
|
|
class PluginWidgetChild;
|
2015-07-13 08:25:42 -07:00
|
|
|
} // namespace plugins
|
2014-11-12 12:59:19 -08:00
|
|
|
|
2009-08-12 09:18:08 -07:00
|
|
|
namespace dom {
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2009-11-17 06:22:23 -08:00
|
|
|
class TabChild;
|
2012-08-01 23:02:29 -07:00
|
|
|
class ClonedMessageData;
|
2014-03-24 19:28:46 -07:00
|
|
|
class TabChildBase;
|
2009-11-17 06:22:23 -08:00
|
|
|
|
2014-03-31 23:13:50 -07:00
|
|
|
class TabChildGlobal : public DOMEventTargetHelper,
|
2010-02-20 09:05:20 -08:00
|
|
|
public nsIContentFrameMessageManager,
|
2013-12-11 17:51:56 -08:00
|
|
|
public nsIScriptObjectPrincipal,
|
2015-01-17 19:17:06 -08:00
|
|
|
public nsIGlobalObject,
|
|
|
|
public nsSupportsWeakReference
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 06:19:51 -07:00
|
|
|
explicit TabChildGlobal(TabChildBase* aTabChild);
|
2012-04-26 13:56:46 -07:00
|
|
|
void Init();
|
2010-02-20 09:05:20 -08:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-03-31 23:13:50 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TabChildGlobal, DOMEventTargetHelper)
|
2012-08-27 07:13:02 -07:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager)
|
|
|
|
NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
|
2015-02-19 17:12:11 -08:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGEMANAGERGLOBAL(mMessageManager)
|
2011-10-01 09:14:36 -07:00
|
|
|
NS_IMETHOD SendSyncMessage(const nsAString& aMessageName,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 09:21:15 -08:00
|
|
|
nsIPrincipal* aPrincipal,
|
2011-10-01 09:14:36 -07:00
|
|
|
JSContext* aCx,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aArgc,
|
2015-03-21 09:28:04 -07:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
2011-10-01 09:14:36 -07:00
|
|
|
return mMessageManager
|
2013-11-06 09:21:15 -08:00
|
|
|
? mMessageManager->SendSyncMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2011-10-01 09:14:36 -07:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
2010-02-20 09:05:20 -08:00
|
|
|
}
|
2013-10-01 09:15:06 -07:00
|
|
|
NS_IMETHOD SendRpcMessage(const nsAString& aMessageName,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 09:21:15 -08:00
|
|
|
nsIPrincipal* aPrincipal,
|
2013-10-01 09:15:06 -07:00
|
|
|
JSContext* aCx,
|
|
|
|
uint8_t aArgc,
|
2015-03-21 09:28:04 -07:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2013-10-01 09:15:06 -07:00
|
|
|
{
|
|
|
|
return mMessageManager
|
2013-11-06 09:21:15 -08:00
|
|
|
? mMessageManager->SendRpcMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2013-10-01 09:15:06 -07:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2015-03-21 09:28:04 -07:00
|
|
|
NS_IMETHOD GetContent(nsIDOMWindow** aContent) override;
|
|
|
|
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell) override;
|
2010-02-20 09:05:20 -08:00
|
|
|
|
2015-01-06 12:14:41 -08:00
|
|
|
nsresult AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
|
|
|
bool aUseCapture)
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
|
|
|
// By default add listeners only for trusted events!
|
2014-03-31 23:13:50 -07:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture, false, 2);
|
2010-02-20 09:05:20 -08:00
|
|
|
}
|
2014-03-31 23:13:50 -07:00
|
|
|
using DOMEventTargetHelper::AddEventListener;
|
2010-02-20 09:05:20 -08:00
|
|
|
NS_IMETHOD AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool aUseCapture, bool aWantsUntrusted,
|
2015-03-21 09:28:04 -07:00
|
|
|
uint8_t optional_argc) override
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
2014-03-31 23:13:50 -07:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture,
|
|
|
|
aWantsUntrusted,
|
|
|
|
optional_argc);
|
2010-02-20 09:05:20 -08:00
|
|
|
}
|
|
|
|
|
2013-08-08 17:16:47 -07:00
|
|
|
nsresult
|
2015-03-21 09:28:04 -07:00
|
|
|
PreHandleEvent(EventChainPreVisitor& aVisitor) override
|
2013-08-08 17:16:47 -07:00
|
|
|
{
|
|
|
|
aVisitor.mForceContentDispatch = true;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual JSContext* GetJSContextForEventHandlers() override;
|
|
|
|
virtual nsIPrincipal* GetPrincipal() override;
|
|
|
|
virtual JSObject* GetGlobalJSObject() override;
|
2010-02-20 09:05:20 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override
|
2014-10-07 02:44:48 -07:00
|
|
|
{
|
|
|
|
MOZ_CRASH("TabChildGlobal doesn't use DOM bindings!");
|
|
|
|
}
|
|
|
|
|
2010-02-20 09:05:20 -08:00
|
|
|
nsCOMPtr<nsIContentFrameMessageManager> mMessageManager;
|
2014-04-22 14:26:45 -07:00
|
|
|
nsRefPtr<TabChildBase> mTabChild;
|
2014-07-08 14:23:17 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~TabChildGlobal();
|
2010-02-20 09:05:20 -08:00
|
|
|
};
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class ContentListener final : public nsIDOMEventListener
|
2009-11-17 06:22:23 -08:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 06:19:51 -07:00
|
|
|
explicit ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
|
2009-11-17 06:22:23 -08:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
protected:
|
2014-06-23 12:56:07 -07:00
|
|
|
~ContentListener() {}
|
2009-11-17 06:22:23 -08:00
|
|
|
TabChild* mTabChild;
|
|
|
|
};
|
|
|
|
|
2014-03-24 19:28:46 -07: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-22 14:26:45 -07:00
|
|
|
class TabChildBase : public nsISupports,
|
2015-02-19 17:10:44 -08:00
|
|
|
public nsMessageManagerScriptExecutor,
|
2014-03-24 19:28:46 -07:00
|
|
|
public ipc::MessageManagerCallback
|
|
|
|
{
|
2015-06-17 01:44:50 -07:00
|
|
|
protected:
|
|
|
|
typedef mozilla::widget::PuppetWidget PuppetWidget;
|
|
|
|
|
2014-03-24 19:28:46 -07:00
|
|
|
public:
|
|
|
|
TabChildBase();
|
2014-06-13 10:56:38 -07:00
|
|
|
|
2014-04-22 14:26:45 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2014-06-13 10:56:38 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase)
|
2014-03-24 19:28:46 -07:00
|
|
|
|
2015-01-16 10:48:33 -08:00
|
|
|
virtual nsIWebNavigation* WebNavigation() const = 0;
|
2015-06-17 01:44:50 -07:00
|
|
|
virtual PuppetWidget* WebWidget() = 0;
|
2014-03-24 19:28:46 -07:00
|
|
|
nsIPrincipal* GetPrincipal() { return mPrincipal; }
|
|
|
|
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const mozilla::layers::FrameMetrics::ViewID& aViewId,
|
2015-06-17 09:32:41 -07:00
|
|
|
const Maybe<mozilla::layers::ZoomConstraints>& aConstraints) = 0;
|
2014-03-24 19:28:46 -07:00
|
|
|
|
2015-06-07 22:39:28 -07:00
|
|
|
virtual ScreenIntSize GetInnerSize() = 0;
|
|
|
|
|
2014-03-24 19:28:46 -07:00
|
|
|
protected:
|
2014-06-13 10:56:38 -07:00
|
|
|
virtual ~TabChildBase();
|
2014-03-24 19:28:46 -07:00
|
|
|
|
|
|
|
// Get the Document for the top-level window in this tab.
|
2015-01-16 10:48:33 -08:00
|
|
|
already_AddRefed<nsIDocument> GetDocument() const;
|
2015-04-14 13:44:59 -07:00
|
|
|
// Get the pres-shell of the document for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIPresShell> GetPresShell() const;
|
2014-03-24 19:28:46 -07:00
|
|
|
|
|
|
|
// 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);
|
|
|
|
|
2015-07-21 07:51:55 -07:00
|
|
|
void ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
2014-03-24 19:28:46 -07:00
|
|
|
|
|
|
|
bool UpdateFrameHandler(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsRefPtr<TabChildGlobal> mTabChildGlobal;
|
2014-09-02 14:43:08 -07:00
|
|
|
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
2014-03-24 19:28:46 -07:00
|
|
|
};
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class TabChild final : public TabChildBase,
|
2015-03-27 11:52:19 -07:00
|
|
|
public PBrowserChild,
|
|
|
|
public nsIWebBrowserChrome2,
|
|
|
|
public nsIEmbeddingSiteWindow,
|
|
|
|
public nsIWebBrowserChromeFocus,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIWindowProvider,
|
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsITabChild,
|
|
|
|
public nsIObserver,
|
|
|
|
public TabContext,
|
|
|
|
public nsITooltipListener
|
2009-06-30 13:39:22 -07:00
|
|
|
{
|
2012-08-01 23:02:29 -07:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2015-04-29 20:39:59 -07:00
|
|
|
typedef mozilla::OwningSerializedStructuredCloneBuffer OwningSerializedStructuredCloneBuffer;
|
2012-11-27 12:43:52 -08:00
|
|
|
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
|
2015-02-09 11:05:18 -08:00
|
|
|
typedef mozilla::layers::APZEventState APZEventState;
|
2015-02-06 15:11:19 -08:00
|
|
|
typedef mozilla::layers::SetTargetAPZCCallback SetTargetAPZCCallback;
|
2015-03-19 03:33:33 -07:00
|
|
|
typedef mozilla::layers::SetAllowedTouchBehaviorCallback SetAllowedTouchBehaviorCallback;
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2014-06-10 22:44:36 -07:00
|
|
|
public:
|
2015-01-30 01:07:12 -08:00
|
|
|
/**
|
|
|
|
* Find TabChild of aTabId in the same content process of the
|
|
|
|
* caller.
|
|
|
|
*/
|
|
|
|
static already_AddRefed<TabChild> FindTabChild(const TabId& aTabId);
|
2014-06-10 22:44:36 -07:00
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
public:
|
2015-08-04 19:47:10 -07:00
|
|
|
/**
|
2012-08-29 08:26:18 -07: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-21 18:17:52 -07:00
|
|
|
*/
|
2012-08-29 08:26:18 -07:00
|
|
|
static void PreloadSlowThings();
|
|
|
|
|
|
|
|
/** Return a TabChild with the given attributes. */
|
2013-07-10 10:07:51 -07:00
|
|
|
static already_AddRefed<TabChild>
|
2014-10-29 11:11:00 -07:00
|
|
|
Create(nsIContentChild* aManager, const TabId& aTabId, const TabContext& aContext, uint32_t aChromeFlags);
|
2012-08-29 08:26:18 -07:00
|
|
|
|
2012-09-05 09:23:45 -07:00
|
|
|
bool IsRootContentDocument();
|
2015-04-07 06:17:27 -07:00
|
|
|
// Let managees query if it is safe to send messages.
|
|
|
|
bool IsDestroyed() { return mDestroyed; }
|
2014-10-29 11:11:00 -07:00
|
|
|
const TabId GetTabId() const {
|
|
|
|
MOZ_ASSERT(mUniqueId != 0);
|
|
|
|
return mUniqueId;
|
2014-06-10 22:44:36 -07:00
|
|
|
}
|
|
|
|
|
2014-05-06 17:11:20 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-11-05 10:14:22 -08:00
|
|
|
NS_DECL_NSIWEBBROWSERCHROME
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROME2
|
|
|
|
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
|
2009-12-31 17:34:06 -08:00
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2009-12-31 17:35:55 -08:00
|
|
|
NS_DECL_NSIWINDOWPROVIDER
|
2012-05-28 02:27:25 -07:00
|
|
|
NS_DECL_NSITABCHILD
|
2012-08-08 13:37:57 -07:00
|
|
|
NS_DECL_NSIOBSERVER
|
2014-01-22 12:27:23 -08:00
|
|
|
NS_DECL_NSITOOLTIPLISTENER
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2012-09-27 22:43:12 -07:00
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
2013-10-01 09:15:06 -07:00
|
|
|
virtual bool DoSendBlockingMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
2015-09-02 09:20:30 -07:00
|
|
|
mozilla::dom::StructuredCloneIPCHelper& aHelper,
|
2013-10-01 09:15:06 -07:00
|
|
|
JS::Handle<JSObject *> aCpows,
|
2013-11-06 09:21:15 -08:00
|
|
|
nsIPrincipal* aPrincipal,
|
2015-04-29 20:39:59 -07:00
|
|
|
nsTArray<OwningSerializedStructuredCloneBuffer>* aRetVal,
|
2015-03-21 09:28:04 -07:00
|
|
|
bool aIsSync) override;
|
2013-07-10 15:05:39 -07:00
|
|
|
virtual bool DoSendAsyncMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
2015-09-02 09:20:30 -07:00
|
|
|
mozilla::dom::StructuredCloneIPCHelper& aHelper,
|
2013-11-06 09:21:15 -08:00
|
|
|
JS::Handle<JSObject *> aCpows,
|
2015-03-21 09:28:04 -07:00
|
|
|
nsIPrincipal* aPrincipal) override;
|
2014-03-24 19:28:46 -07:00
|
|
|
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
2015-06-17 09:32:41 -07:00
|
|
|
const Maybe<ZoomConstraints>& aConstraints) override;
|
2015-02-11 03:53:00 -08:00
|
|
|
virtual bool RecvLoadURL(const nsCString& aURI,
|
2015-03-21 09:28:04 -07:00
|
|
|
const BrowserConfiguration& aConfiguration) override;
|
2013-02-15 14:27:21 -08:00
|
|
|
virtual bool RecvCacheFileDescriptor(const nsString& aPath,
|
|
|
|
const FileDescriptor& aFileDescriptor)
|
2015-03-21 09:28:04 -07:00
|
|
|
override;
|
2015-03-05 01:13:05 -08:00
|
|
|
virtual bool RecvShow(const ScreenIntSize& aSize,
|
2014-11-24 11:05:35 -08:00
|
|
|
const ShowInfo& aInfo,
|
2014-11-16 10:23:22 -08:00
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
2015-02-06 08:26:29 -08:00
|
|
|
PRenderFrameChild* aRenderFrame,
|
2015-05-17 22:42:05 -07:00
|
|
|
const bool& aParentIsActive) override;
|
2015-06-07 22:39:28 -07:00
|
|
|
virtual bool RecvUpdateDimensions(const CSSRect& rect,
|
|
|
|
const CSSSize& size,
|
2015-08-28 18:12:41 -07:00
|
|
|
const nsSizeMode& sizeMode,
|
2015-08-18 14:55:09 -07:00
|
|
|
const ScreenOrientationInternal& orientation,
|
2015-04-21 07:33:56 -07:00
|
|
|
const LayoutDeviceIntPoint& chromeDisp) override;
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override;
|
2015-02-19 15:53:30 -08:00
|
|
|
virtual bool RecvRequestFlingSnap(const ViewID& aScrollId,
|
2015-03-21 09:28:04 -07:00
|
|
|
const CSSPoint& aDestination) override;
|
2014-02-05 14:43:20 -08:00
|
|
|
virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
|
2015-03-21 09:28:04 -07:00
|
|
|
const uint32_t& aScrollGeneration) override;
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual bool RecvHandleDoubleTap(const CSSPoint& aPoint,
|
2015-03-02 13:41:02 -08:00
|
|
|
const Modifiers& aModifiers,
|
2015-03-21 09:28:04 -07:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual bool RecvHandleSingleTap(const CSSPoint& aPoint,
|
2015-03-02 13:41:02 -08:00
|
|
|
const Modifiers& aModifiers,
|
2015-03-21 09:28:04 -07:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual bool RecvHandleLongTap(const CSSPoint& aPoint,
|
2015-03-02 13:41:02 -08:00
|
|
|
const Modifiers& aModifiers,
|
2014-10-24 10:29:30 -07:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
2015-03-21 09:28:04 -07:00
|
|
|
const uint64_t& aInputBlockId) override;
|
2014-04-15 10:39:20 -07:00
|
|
|
virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId,
|
|
|
|
const APZStateChange& aChange,
|
2015-03-21 09:28:04 -07:00
|
|
|
const int& aArg) override;
|
2015-06-19 05:25:41 -07:00
|
|
|
virtual bool RecvNotifyFlushComplete() override;
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool RecvActivate() override;
|
|
|
|
virtual bool RecvDeactivate() override;
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual bool RecvMouseEvent(const nsString& aType,
|
|
|
|
const float& aX,
|
|
|
|
const float& aY,
|
2012-08-22 08:56:38 -07:00
|
|
|
const int32_t& aButton,
|
|
|
|
const int32_t& aClickCount,
|
|
|
|
const int32_t& aModifiers,
|
2015-03-21 09:28:04 -07:00
|
|
|
const bool& aIgnoreRootScrollFrame) override;
|
|
|
|
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& event) override;
|
2015-07-27 15:35:51 -07:00
|
|
|
virtual bool RecvSynthMouseMoveEvent(const mozilla::WidgetMouseEvent& event) override;
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& event) override;
|
2015-04-08 11:48:11 -07:00
|
|
|
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
|
|
|
const uint32_t& aDragAction,
|
|
|
|
const uint32_t& aDropEffect) override;
|
2014-03-20 08:46:29 -07:00
|
|
|
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event,
|
2015-03-21 09:28:04 -07:00
|
|
|
const MaybeNativeKeyBinding& aBindings) override;
|
2014-12-09 02:40:26 -08:00
|
|
|
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
2015-03-21 09:28:04 -07:00
|
|
|
const uint64_t& aInputBlockId) override;
|
2013-11-13 10:20:31 -08:00
|
|
|
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
2014-10-24 10:29:30 -07:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
2015-05-14 05:16:00 -07:00
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsEventStatus& aApzResponse) override;
|
2013-11-13 10:20:31 -08:00
|
|
|
virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
|
2014-10-24 10:29:30 -07:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
2015-05-14 05:16:00 -07:00
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsEventStatus& aApzResponse) override;
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual bool RecvKeyEvent(const nsString& aType,
|
2012-08-22 08:56:38 -07:00
|
|
|
const int32_t& aKeyCode,
|
|
|
|
const int32_t& aCharCode,
|
|
|
|
const int32_t& aModifiers,
|
2015-03-21 09:28:04 -07:00
|
|
|
const bool& aPreventDefault) override;
|
2015-03-22 00:42:26 -07:00
|
|
|
virtual bool RecvMouseScrollTestEvent(const FrameMetrics::ViewID& aScrollId,
|
|
|
|
const nsString& aEvent) override;
|
2015-04-14 08:36:36 -07:00
|
|
|
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
|
|
|
|
const nsCString& aResponse) override;
|
2015-03-21 09:28:04 -07: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 09:46:41 -08:00
|
|
|
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
2015-03-21 09:28:04 -07:00
|
|
|
const bool& aRunInGlobalScope) override;
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
2013-07-10 15:05:39 -07:00
|
|
|
const ClonedMessageData& aData,
|
2015-01-16 11:58:52 -08:00
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
2015-03-21 09:28:04 -07:00
|
|
|
const IPC::Principal& aPrincipal) override;
|
2010-10-26 15:20:53 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) override;
|
2014-08-22 16:17:18 -07:00
|
|
|
|
2015-05-07 08:43:40 -07:00
|
|
|
virtual bool RecvSwappedWithOtherRemoteLoader() override;
|
|
|
|
|
2015-05-21 10:04:58 -07:00
|
|
|
virtual PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*,
|
|
|
|
const uint64_t&)
|
|
|
|
override;
|
|
|
|
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
|
2010-10-26 15:20:53 -07:00
|
|
|
virtual PDocumentRendererChild*
|
2013-12-26 10:06:53 -08:00
|
|
|
AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
|
2013-07-08 08:48:39 -07:00
|
|
|
const nsString& bgcolor,
|
|
|
|
const uint32_t& renderFlags, const bool& flushLayout,
|
2015-03-21 09:28:04 -07:00
|
|
|
const nsIntSize& renderSize) override;
|
|
|
|
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor) override;
|
2010-10-26 15:20:53 -07:00
|
|
|
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
|
|
|
|
const nsRect& documentRect,
|
2013-12-26 10:06:53 -08:00
|
|
|
const gfx::Matrix& transform,
|
2010-10-26 15:20:53 -07:00
|
|
|
const nsString& bgcolor,
|
2012-08-22 08:56:38 -07:00
|
|
|
const uint32_t& renderFlags,
|
2010-10-26 15:20:53 -07:00
|
|
|
const bool& flushLayout,
|
2015-03-21 09:28:04 -07:00
|
|
|
const nsIntSize& renderSize) override;
|
2010-10-26 15:20:53 -07:00
|
|
|
|
2014-02-23 12:19:43 -08:00
|
|
|
virtual PColorPickerChild*
|
2015-03-21 09:28:04 -07:00
|
|
|
AllocPColorPickerChild(const nsString& title, const nsString& initialColor) override;
|
|
|
|
virtual bool DeallocPColorPickerChild(PColorPickerChild* actor) override;
|
2014-02-23 12:19:43 -08:00
|
|
|
|
2014-02-17 16:30:06 -08:00
|
|
|
virtual PFilePickerChild*
|
2015-03-21 09:28:04 -07:00
|
|
|
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
2014-02-17 16:30:06 -08:00
|
|
|
virtual bool
|
2015-03-21 09:28:04 -07:00
|
|
|
DeallocPFilePickerChild(PFilePickerChild* actor) override;
|
2014-02-17 16:30:06 -08:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
virtual PIndexedDBPermissionRequestChild*
|
|
|
|
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal)
|
2015-03-21 09:28:04 -07:00
|
|
|
override;
|
2014-09-26 16:21:57 -07:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIndexedDBPermissionRequestChild(
|
|
|
|
PIndexedDBPermissionRequestChild* aActor)
|
2015-03-21 09:28:04 -07:00
|
|
|
override;
|
2014-09-26 16:21:57 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsIWebNavigation* WebNavigation() const override { return mWebNav; }
|
2015-06-17 01:44:50 -07:00
|
|
|
virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
|
2009-11-06 12:43:39 -08:00
|
|
|
|
2012-08-29 08:26:18 -07:00
|
|
|
/** Return the DPI of the widget this TabChild draws to. */
|
|
|
|
void GetDPI(float* aDPI);
|
2013-05-01 16:06:19 -07:00
|
|
|
void GetDefaultScale(double *aScale);
|
2012-08-29 08:26:18 -07:00
|
|
|
|
2015-05-07 18:29:00 -07:00
|
|
|
void GetMaxTouchPoints(uint32_t* aTouchPoints);
|
|
|
|
|
2015-08-18 14:55:09 -07:00
|
|
|
ScreenOrientationInternal GetOrientation() const { return mOrientation; }
|
2012-11-21 18:40:57 -08:00
|
|
|
|
2011-10-20 15:17:09 -07:00
|
|
|
void SetBackgroundColor(const nscolor& aColor);
|
2012-07-17 16:59:45 -07:00
|
|
|
|
|
|
|
void NotifyPainted();
|
2012-07-19 23:48:27 -07:00
|
|
|
|
2014-04-21 13:40:09 -07:00
|
|
|
void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands* aAutoCache,
|
|
|
|
WidgetKeyboardEvent* aEvent);
|
2012-07-19 23:48:27 -07:00
|
|
|
|
2012-11-07 19:51:55 -08: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-15 14:27:21 -08: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-10 22:44:06 -07:00
|
|
|
nsIContentChild* Manager() { return mManager; }
|
2013-07-10 10:07:51 -07:00
|
|
|
|
2013-08-13 00:56:57 -07:00
|
|
|
bool GetUpdateHitRegion() { return mUpdateHitRegion; }
|
|
|
|
|
|
|
|
void UpdateHitRegion(const nsRegion& aRegion);
|
|
|
|
|
2013-09-12 12:24:11 -07:00
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(nsIDocShell* aDocShell)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsITabChild> tc = do_GetInterface(aDocShell);
|
|
|
|
return static_cast<TabChild*>(tc.get());
|
|
|
|
}
|
|
|
|
|
2013-10-02 13:08:30 -07:00
|
|
|
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
2014-03-06 19:24:32 -08:00
|
|
|
static TabChild* GetFrom(uint64_t aLayersId);
|
|
|
|
|
2015-08-24 22:51:58 -07:00
|
|
|
void DidComposite(uint64_t aTransactionId,
|
|
|
|
const TimeStamp& aCompositeStart,
|
|
|
|
const TimeStamp& aCompositeEnd);
|
|
|
|
|
2015-05-04 23:32:47 -07:00
|
|
|
void ClearCachedResources();
|
2013-09-12 12:24:11 -07:00
|
|
|
|
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(nsIDOMWindow* aWindow)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
2015-08-13 07:42:19 -07:00
|
|
|
virtual bool RecvUIResolutionChanged(const float& aDpi, const double& aScale) override;
|
2014-05-23 07:36:50 -07:00
|
|
|
|
2015-04-22 07:58:33 -07:00
|
|
|
virtual bool RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
|
|
|
|
|
2014-11-12 12:59:19 -08:00
|
|
|
/**
|
|
|
|
* Native widget remoting protocol for use with windowed plugins with e10s.
|
|
|
|
*/
|
2015-03-21 09:28:04 -07:00
|
|
|
PPluginWidgetChild* AllocPPluginWidgetChild() override;
|
|
|
|
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override;
|
2015-02-05 13:48:44 -08:00
|
|
|
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
|
2014-11-12 12:59:19 -08:00
|
|
|
|
2015-04-21 07:33:56 -07:00
|
|
|
LayoutDeviceIntPoint GetChromeDisplacement() { return mChromeDisp; };
|
2014-12-11 06:44:07 -08:00
|
|
|
|
2015-01-06 21:42:00 -08:00
|
|
|
bool IPCOpen() { return mIPCOpen; }
|
|
|
|
|
2015-02-06 08:26:29 -08:00
|
|
|
bool ParentIsActive()
|
|
|
|
{
|
|
|
|
return mParentIsActive;
|
|
|
|
}
|
2015-06-04 13:51:10 -07:00
|
|
|
bool AsyncPanZoomEnabled() { return mAsyncPanZoomEnabled; }
|
2015-02-06 08:26:29 -08:00
|
|
|
|
2015-06-08 10:24:56 -07:00
|
|
|
virtual ScreenIntSize GetInnerSize() override;
|
2015-06-07 22:39:28 -07:00
|
|
|
|
2015-08-06 07:44:16 -07:00
|
|
|
virtual PWebBrowserPersistDocumentChild* AllocPWebBrowserPersistDocumentChild(const uint64_t& aOuterWindowID) override;
|
|
|
|
virtual bool RecvPWebBrowserPersistDocumentConstructor(PWebBrowserPersistDocumentChild *aActor,
|
|
|
|
const uint64_t& aOuterWindowID) override;
|
2015-08-05 14:25:39 -07:00
|
|
|
virtual bool DeallocPWebBrowserPersistDocumentChild(PWebBrowserPersistDocumentChild* aActor) override;
|
|
|
|
|
2010-08-05 15:11:23 -07:00
|
|
|
protected:
|
2014-07-08 14:23:17 -07:00
|
|
|
virtual ~TabChild();
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual PRenderFrameChild* AllocPRenderFrameChild() override;
|
|
|
|
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
|
|
|
|
virtual bool RecvDestroy() override;
|
|
|
|
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
|
2015-09-04 06:42:01 -07:00
|
|
|
virtual bool RecvSetDocShellIsActive(const bool& aIsActive) override;
|
2015-07-23 07:04:15 -07:00
|
|
|
virtual bool RecvNavigateByKey(const bool& aForward, const bool& aForDocumentNavigation) override;
|
2010-08-05 15:11:23 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool RecvRequestNotifyAfterRemotePaint() override;
|
2014-05-23 11:19:00 -07:00
|
|
|
|
2015-08-19 14:08:41 -07:00
|
|
|
virtual bool RecvSuppressDisplayport(const bool& aEnabled) override;
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool RecvParentActivated(const bool& aActivated) override;
|
2014-11-27 05:28:26 -08:00
|
|
|
|
2015-07-01 06:19:11 -07:00
|
|
|
virtual bool RecvStopIMEStateManagement() override;
|
2015-07-01 06:19:11 -07:00
|
|
|
virtual bool RecvMenuKeyboardListenerInstalled(
|
|
|
|
const bool& aInstalled) override;
|
2015-07-01 06:19:11 -07:00
|
|
|
|
2014-10-31 10:54:02 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
void MaybeRequestPreinitCamera();
|
|
|
|
#endif
|
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
private:
|
2012-08-29 08:26:18 -07: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 10:32:37 -08: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 08:26:18 -07:00
|
|
|
*/
|
2014-10-29 11:11:00 -07:00
|
|
|
TabChild(nsIContentChild* aManager,
|
|
|
|
const TabId& aTabId,
|
|
|
|
const TabContext& aContext,
|
|
|
|
uint32_t aChromeFlags);
|
2012-08-29 08:26:18 -07:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
|
2014-08-24 00:16:32 -07:00
|
|
|
class DelayedFireContextMenuEvent;
|
2014-02-21 15:12:43 -08: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
|
|
|
// 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 08:26:18 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
void ActorDestroy(ActorDestroyReason why) override;
|
2010-07-21 16:23:03 -07:00
|
|
|
|
2012-08-29 08:26:18 -07:00
|
|
|
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
|
|
|
|
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
|
2015-02-26 05:47:01 -08:00
|
|
|
bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
2014-11-16 10:23:22 -08:00
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame);
|
2010-08-20 16:24:40 -07:00
|
|
|
void DestroyWindow();
|
2012-09-10 21:30:33 -07:00
|
|
|
void SetProcessNameToAppName();
|
2013-07-09 16:26:07 -07:00
|
|
|
|
2012-06-12 15:01:25 -07:00
|
|
|
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
2015-02-26 05:47:01 -08:00
|
|
|
void DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
2014-11-16 10:23:22 -08:00
|
|
|
const uint64_t& aLayersId,
|
2015-05-17 22:42:05 -07:00
|
|
|
PRenderFrameChild* aRenderFrame);
|
2012-06-12 15:01:25 -07:00
|
|
|
|
2014-11-24 11:05:35 -08:00
|
|
|
void ApplyShowInfo(const ShowInfo& aInfo);
|
|
|
|
|
2013-01-05 06:53:16 -08: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-26 23:20:57 -07:00
|
|
|
void UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus);
|
2012-09-14 18:16:32 -07:00
|
|
|
|
2012-06-12 15:01:25 -07:00
|
|
|
nsresult
|
2015-01-16 10:06:56 -08:00
|
|
|
ProvideWindowCommon(nsIDOMWindow* aOpener,
|
2015-01-16 10:07:50 -08:00
|
|
|
bool aIframeMoz,
|
2015-01-16 10:06:56 -08:00
|
|
|
uint32_t aChromeFlags,
|
|
|
|
bool aCalledFromJS,
|
|
|
|
bool aPositionSpecified,
|
|
|
|
bool aSizeSpecified,
|
|
|
|
nsIURI* aURI,
|
|
|
|
const nsAString& aName,
|
|
|
|
const nsACString& aFeatures,
|
|
|
|
bool* aWindowIsNew,
|
|
|
|
nsIDOMWindow** aReturn);
|
2012-06-12 15:01:25 -07:00
|
|
|
|
2014-04-25 08:40:23 -07:00
|
|
|
bool HasValidInnerSize();
|
|
|
|
|
2015-01-30 01:07:12 -08:00
|
|
|
void SetTabId(const TabId& aTabId);
|
2014-10-29 11:11:00 -07:00
|
|
|
|
2015-06-07 22:39:28 -07:00
|
|
|
ScreenIntRect GetOuterRect();
|
|
|
|
|
|
|
|
void SetUnscaledInnerSize(const CSSSize& aSize) {
|
|
|
|
mUnscaledInnerSize = aSize;
|
|
|
|
}
|
|
|
|
|
2013-02-15 14:27:21 -08:00
|
|
|
class CachedFileDescriptorInfo;
|
|
|
|
class CachedFileDescriptorCallbackRunnable;
|
2014-07-11 11:15:10 -07:00
|
|
|
class DelayedDeleteRunnable;
|
2013-02-15 14:27:21 -08:00
|
|
|
|
2013-04-30 17:42:05 -07:00
|
|
|
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
2009-06-30 13:39:22 -07:00
|
|
|
nsCOMPtr<nsIWebNavigation> mWebNav;
|
2015-06-17 01:44:50 -07:00
|
|
|
nsRefPtr<PuppetWidget> mPuppetWidget;
|
2012-09-28 19:18:18 -07:00
|
|
|
nsCOMPtr<nsIURI> mLastURI;
|
2010-08-20 16:24:41 -07:00
|
|
|
RenderFrameChild* mRemoteFrame;
|
2014-06-10 22:44:06 -07:00
|
|
|
nsRefPtr<nsIContentChild> mManager;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mChromeFlags;
|
2015-08-19 14:08:41 -07:00
|
|
|
int32_t mActiveSuppressDisplayport;
|
2014-03-06 19:24:32 -08:00
|
|
|
uint64_t mLayersId;
|
2015-06-07 22:39:28 -07:00
|
|
|
CSSRect mUnscaledOuterRect;
|
2013-01-05 06:53:16 -08:00
|
|
|
// When we're tracking a possible tap gesture, this is the "down"
|
|
|
|
// point of the touchstart.
|
2013-07-16 12:54:59 -07:00
|
|
|
LayoutDevicePoint mGestureDownPoint;
|
2013-01-05 06:53:16 -08: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 00:16:32 -07:00
|
|
|
nsCOMPtr<nsITimer> mTapHoldTimer;
|
2013-05-29 17:56:09 -07:00
|
|
|
// Whether we have already received a FileDescriptor for the app package.
|
|
|
|
bool mAppPackageFileDescriptorRecved;
|
2013-02-15 14:27:21 -08:00
|
|
|
// At present only 1 of these is really expected.
|
|
|
|
nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
|
|
|
mCachedFileDescriptorInfos;
|
2011-10-20 15:17:09 -07: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-30 13:13:21 -07:00
|
|
|
bool mDidFakeShow;
|
2012-08-06 20:00:41 -07:00
|
|
|
bool mNotified;
|
2012-08-29 08:26:18 -07:00
|
|
|
bool mTriedBrowserInit;
|
2015-08-18 14:55:09 -07:00
|
|
|
ScreenOrientationInternal mOrientation;
|
2013-08-13 00:56:57 -07:00
|
|
|
bool mUpdateHitRegion;
|
2014-07-29 08:59:19 -07:00
|
|
|
|
2014-03-11 20:13:38 -07:00
|
|
|
bool mIgnoreKeyPressEvent;
|
2015-02-09 11:05:18 -08:00
|
|
|
nsRefPtr<APZEventState> mAPZEventState;
|
2015-03-19 03:33:33 -07:00
|
|
|
nsRefPtr<SetAllowedTouchBehaviorCallback> mSetAllowedTouchBehaviorCallback;
|
2014-04-25 08:40:23 -07:00
|
|
|
bool mHasValidInnerSize;
|
2014-08-24 00:16:32 -07:00
|
|
|
bool mDestroyed;
|
2014-12-11 06:44:07 -08:00
|
|
|
// Position of tab, relative to parent widget (typically the window)
|
2015-04-21 07:33:56 -07:00
|
|
|
LayoutDeviceIntPoint mChromeDisp;
|
2014-10-29 11:11:00 -07:00
|
|
|
TabId mUniqueId;
|
2014-12-12 09:50:46 -08:00
|
|
|
float mDPI;
|
|
|
|
double mDefaultScale;
|
2015-01-06 21:42:00 -08:00
|
|
|
bool mIPCOpen;
|
2015-02-06 08:26:29 -08:00
|
|
|
bool mParentIsActive;
|
2015-06-04 13:51:10 -07:00
|
|
|
bool mAsyncPanZoomEnabled;
|
2015-06-07 22:39:28 -07:00
|
|
|
CSSSize mUnscaledInnerSize;
|
2014-03-11 20:13:38 -07:00
|
|
|
|
2015-08-04 19:47:10 -07:00
|
|
|
nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
|
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
|
|
|
};
|
|
|
|
|
2015-07-13 08:25:42 -07:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
#endif // mozilla_dom_TabChild_h
|