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
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
#ifndef mozilla_dom_BrowserChild_h
|
|
|
|
#define mozilla_dom_BrowserChild_h
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2017-07-19 15:59:02 +03:00
|
|
|
#include "mozilla/dom/ContentFrameMessageManager.h"
|
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"
|
2019-12-04 16:50:01 +03:00
|
|
|
#include "nsIWebBrowserChrome.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-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"
|
2010-03-26 21:39:39 +03:00
|
|
|
#include "nsWeakReference.h"
|
2019-04-10 02:15:02 +03:00
|
|
|
#include "nsIBrowserChild.h"
|
2014-01-23 00:27:23 +04:00
|
|
|
#include "nsITooltipListener.h"
|
2019-01-25 17:44:09 +03:00
|
|
|
#include "nsIWebProgressListener.h"
|
2019-04-03 20:32:21 +03:00
|
|
|
#include "nsIWebProgressListener2.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"
|
2017-08-11 09:58:08 +03:00
|
|
|
#include "mozilla/dom/CoalescedMouseData.h"
|
2017-02-21 12:56:46 +03:00
|
|
|
#include "mozilla/dom/CoalescedWheelData.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"
|
2015-09-11 19:27:49 +03:00
|
|
|
#include "mozilla/layers/APZCCallbackHelper.h"
|
2017-01-13 01:29:41 +03:00
|
|
|
#include "mozilla/layers/CompositorOptions.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-08-05 05:47:10 +03:00
|
|
|
#include "AudioChannelService.h"
|
2015-06-17 11:44:50 +03:00
|
|
|
#include "PuppetWidget.h"
|
2016-01-08 22:17:39 +03:00
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2017-10-12 04:05:40 +03:00
|
|
|
#include "nsDeque.h"
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2019-04-03 20:29:15 +03:00
|
|
|
class nsBrowserStatusFilter;
|
2019-10-01 01:06:47 +03:00
|
|
|
class nsIDOMWindow;
|
2016-10-21 23:56:51 +03:00
|
|
|
class nsIHttpChannel;
|
2019-01-25 17:44:09 +03:00
|
|
|
class nsIRequest;
|
2017-07-05 11:23:23 +03:00
|
|
|
class nsISerialEventTarget;
|
2019-01-25 17:44:09 +03:00
|
|
|
class nsIWebProgress;
|
2018-08-03 22:21:03 +03:00
|
|
|
class nsWebBrowser;
|
2010-03-24 13:47:18 +03:00
|
|
|
|
2017-09-13 06:59:35 +03:00
|
|
|
template <typename T>
|
|
|
|
class nsTHashtable;
|
|
|
|
template <typename T>
|
|
|
|
class nsPtrHashKey;
|
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
namespace mozilla {
|
2017-07-05 11:23:23 +03:00
|
|
|
class AbstractThread;
|
2019-04-13 04:53:10 +03:00
|
|
|
class PresShell;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2014-04-17 15:54:25 +04:00
|
|
|
namespace layers {
|
2016-01-08 22:17:39 +03:00
|
|
|
class APZChild;
|
2015-02-09 22:05:18 +03:00
|
|
|
class APZEventState;
|
2016-01-08 22:17:39 +03:00
|
|
|
class AsyncDragMetrics;
|
2016-07-31 22:39:00 +03:00
|
|
|
class IAPZCTreeManager;
|
2015-07-06 06:02:26 +03:00
|
|
|
class ImageCompositeNotification;
|
2017-10-13 17:32:52 +03:00
|
|
|
class PCompositorBridgeChild;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
2014-04-09 23:16:16 +04:00
|
|
|
|
2014-04-22 00:40:09 +04:00
|
|
|
namespace widget {
|
|
|
|
struct AutoCacheNativeKeyCommands;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace widget
|
2014-04-22 00:40:09 +04:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
class BrowserChild;
|
2016-11-04 21:13:52 +03:00
|
|
|
class TabGroup;
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2017-08-11 09:58:08 +03:00
|
|
|
class CoalescedMouseData;
|
2017-02-21 12:56:46 +03:00
|
|
|
class CoalescedWheelData;
|
2019-05-04 13:42:52 +03:00
|
|
|
class ContentSessionStore;
|
|
|
|
class TabListener;
|
2019-01-25 17:44:09 +03:00
|
|
|
class RequestData;
|
|
|
|
class WebProgressData;
|
2009-11-17 17:22:23 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
class BrowserChildMessageManager : public ContentFrameMessageManager,
|
|
|
|
public nsIMessageSender,
|
|
|
|
public DispatcherTrait,
|
|
|
|
public nsSupportsWeakReference {
|
2010-02-20 20:05:20 +03:00
|
|
|
public:
|
2019-04-10 01:39:01 +03:00
|
|
|
explicit BrowserChildMessageManager(BrowserChild* aBrowserChild);
|
2018-06-27 01:31:27 +03:00
|
|
|
|
2010-02-20 20:05:20 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2019-04-10 01:39:01 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(BrowserChildMessageManager,
|
2018-08-11 00:04:23 +03:00
|
|
|
DOMEventTargetHelper)
|
2018-03-01 12:51:09 +03:00
|
|
|
|
2018-02-16 17:28:31 +03:00
|
|
|
void MarkForCC();
|
|
|
|
|
2018-08-11 00:03:18 +03:00
|
|
|
JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2017-07-19 15:59:02 +03:00
|
|
|
|
2019-01-02 16:26:56 +03:00
|
|
|
virtual Nullable<WindowProxyHolder> GetContent(ErrorResult& aError) override;
|
2017-07-19 15:59:02 +03:00
|
|
|
virtual already_AddRefed<nsIDocShell> GetDocShell(
|
|
|
|
ErrorResult& aError) override;
|
|
|
|
virtual already_AddRefed<nsIEventTarget> GetTabEventTarget() override;
|
2018-07-11 05:31:55 +03:00
|
|
|
virtual uint64_t ChromeOuterWindowID() override;
|
2017-07-19 15:59:02 +03:00
|
|
|
|
|
|
|
NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
|
2010-02-20 20:05:20 +03:00
|
|
|
|
2016-10-21 05:11:07 +03:00
|
|
|
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override {
|
2013-08-09 04:16:47 +04:00
|
|
|
aVisitor.mForceContentDispatch = true;
|
|
|
|
}
|
|
|
|
|
2017-07-05 11:23:23 +03:00
|
|
|
// Dispatch a runnable related to the global.
|
2017-07-26 11:13:35 +03:00
|
|
|
virtual nsresult Dispatch(mozilla::TaskCategory aCategory,
|
2017-07-05 11:23:23 +03:00
|
|
|
already_AddRefed<nsIRunnable>&& aRunnable) override;
|
|
|
|
|
|
|
|
virtual nsISerialEventTarget* EventTargetFor(
|
|
|
|
mozilla::TaskCategory aCategory) const override;
|
|
|
|
|
|
|
|
virtual AbstractThread* AbstractMainThreadFor(
|
|
|
|
mozilla::TaskCategory aCategory) override;
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
RefPtr<BrowserChild> mBrowserChild;
|
2014-07-09 01:23:17 +04:00
|
|
|
|
|
|
|
protected:
|
2019-04-10 01:39:01 +03:00
|
|
|
~BrowserChildMessageManager();
|
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:
|
2019-04-10 01:39:01 +03:00
|
|
|
explicit ContentListener(BrowserChild* aBrowserChild)
|
|
|
|
: mBrowserChild(aBrowserChild) {}
|
2009-11-17 17:22:23 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
protected:
|
2020-03-06 12:11:40 +03:00
|
|
|
~ContentListener() = default;
|
2019-04-10 01:39:01 +03:00
|
|
|
BrowserChild* mBrowserChild;
|
2009-11-17 17:22:23 +03:00
|
|
|
};
|
|
|
|
|
2019-05-06 17:47:56 +03:00
|
|
|
/**
|
|
|
|
* BrowserChild implements the child actor part of the PBrowser protocol. See
|
|
|
|
* PBrowser for more information.
|
|
|
|
*/
|
2019-06-03 23:04:46 +03:00
|
|
|
class BrowserChild final : public nsMessageManagerScriptExecutor,
|
|
|
|
public ipc::MessageManagerCallback,
|
2019-04-10 01:39:01 +03:00
|
|
|
public PBrowserChild,
|
2019-12-04 16:50:01 +03:00
|
|
|
public nsIWebBrowserChrome,
|
2019-04-10 01:39:01 +03:00
|
|
|
public nsIEmbeddingSiteWindow,
|
|
|
|
public nsIWebBrowserChromeFocus,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIWindowProvider,
|
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsIBrowserChild,
|
|
|
|
public nsIObserver,
|
|
|
|
public nsIWebProgressListener2,
|
|
|
|
public TabContext,
|
|
|
|
public nsITooltipListener,
|
|
|
|
public mozilla::ipc::IShmemAllocator {
|
2019-06-03 23:04:46 +03:00
|
|
|
typedef mozilla::widget::PuppetWidget PuppetWidget;
|
2016-01-05 12:59:30 +03:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2017-08-11 09:58:08 +03:00
|
|
|
typedef mozilla::dom::CoalescedMouseData CoalescedMouseData;
|
2017-02-21 12:56:46 +03:00
|
|
|
typedef mozilla::dom::CoalescedWheelData CoalescedWheelData;
|
2016-01-05 12:59:30 +03:00
|
|
|
typedef mozilla::layers::APZEventState APZEventState;
|
|
|
|
typedef mozilla::layers::SetAllowedTouchBehaviorCallback
|
|
|
|
SetAllowedTouchBehaviorCallback;
|
2018-03-15 01:18:27 +03:00
|
|
|
typedef mozilla::layers::TouchBehaviorFlags TouchBehaviorFlags;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2019-02-06 18:57:37 +03:00
|
|
|
friend class PBrowserChild;
|
|
|
|
|
2014-06-11 09:44:36 +04:00
|
|
|
public:
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
2019-04-10 01:39:01 +03:00
|
|
|
* Find BrowserChild of aTabId in the same content process of the
|
2016-01-05 12:59:30 +03:00
|
|
|
* caller.
|
|
|
|
*/
|
2019-04-10 01:39:01 +03:00
|
|
|
static already_AddRefed<BrowserChild> FindBrowserChild(const TabId& aTabId);
|
2014-06-11 09:44:36 +04:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// Return a list of all active BrowserChildren.
|
|
|
|
static nsTArray<RefPtr<BrowserChild>> GetAll();
|
2016-09-20 11:19:32 +03:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
public:
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
2019-04-10 01:39:01 +03:00
|
|
|
* Create a new BrowserChild object.
|
2016-01-05 12:59:30 +03:00
|
|
|
*/
|
2019-04-10 01:39:01 +03:00
|
|
|
BrowserChild(ContentChild* aManager, const TabId& aTabId, TabGroup* aTabGroup,
|
|
|
|
const TabContext& aContext, BrowsingContext* aBrowsingContext,
|
2019-05-29 19:35:37 +03:00
|
|
|
uint32_t aChromeFlags, bool aIsTopLevel);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-08-08 19:07:05 +03:00
|
|
|
nsresult Init(mozIDOMWindowProxy* aParent,
|
|
|
|
WindowGlobalChild* aInitialWindowChild);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
/** Return a BrowserChild with the given attributes. */
|
|
|
|
static already_AddRefed<BrowserChild> Create(
|
|
|
|
ContentChild* aManager, const TabId& aTabId, const TabId& aSameTabGroupAs,
|
|
|
|
const TabContext& aContext, BrowsingContext* aBrowsingContext,
|
2019-05-29 19:35:37 +03:00
|
|
|
uint32_t aChromeFlags, bool aIsTopLevel);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
// Let managees query if it is safe to send messages.
|
|
|
|
bool IsDestroyed() const { return mDestroyed; }
|
|
|
|
|
|
|
|
const TabId GetTabId() const {
|
|
|
|
MOZ_ASSERT(mUniqueId != 0);
|
|
|
|
return mUniqueId;
|
|
|
|
}
|
|
|
|
|
2019-06-03 23:04:46 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2016-01-05 12:59:30 +03:00
|
|
|
NS_DECL_NSIWEBBROWSERCHROME
|
|
|
|
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
NS_DECL_NSIWINDOWPROVIDER
|
2019-04-10 02:15:02 +03:00
|
|
|
NS_DECL_NSIBROWSERCHILD
|
2016-01-05 12:59:30 +03:00
|
|
|
NS_DECL_NSIOBSERVER
|
2019-01-25 17:44:09 +03:00
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
2019-04-03 20:32:21 +03:00
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER2
|
2016-01-05 12:59:30 +03:00
|
|
|
NS_DECL_NSITOOLTIPLISTENER
|
|
|
|
|
2019-06-03 23:04:46 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(BrowserChild,
|
|
|
|
nsIBrowserChild)
|
2017-10-02 17:58:52 +03:00
|
|
|
|
2016-06-15 15:49:13 +03:00
|
|
|
FORWARD_SHMEM_ALLOCATOR_TO(PBrowserChild)
|
|
|
|
|
2019-06-03 23:04:46 +03:00
|
|
|
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
|
|
|
|
return mBrowserChildMessageManager->WrapObject(aCx, aGivenProto);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIPrincipal* GetPrincipal() { return mPrincipal; }
|
|
|
|
// Get the Document for the top-level window in this tab.
|
|
|
|
already_AddRefed<Document> GetTopLevelDocument() const;
|
|
|
|
|
|
|
|
// Get the pres-shell of the document for the top-level window in this tab.
|
|
|
|
PresShell* GetTopLevelPresShell() const;
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
BrowserChildMessageManager* GetMessageManager() {
|
|
|
|
return mBrowserChildMessageManager;
|
2018-03-01 22:19:56 +03:00
|
|
|
}
|
|
|
|
|
2019-06-25 06:16:31 +03:00
|
|
|
bool IsTopLevel() const { return mIsTopLevel; }
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
|
|
|
virtual bool DoSendBlockingMessage(JSContext* aCx, const nsAString& aMessage,
|
|
|
|
StructuredCloneData& aData,
|
|
|
|
JS::Handle<JSObject*> aCpows,
|
|
|
|
nsIPrincipal* aPrincipal,
|
|
|
|
nsTArray<StructuredCloneData>* aRetVal,
|
|
|
|
bool aIsSync) override;
|
|
|
|
|
|
|
|
virtual nsresult DoSendAsyncMessage(JSContext* aCx, const nsAString& aMessage,
|
|
|
|
StructuredCloneData& aData,
|
|
|
|
JS::Handle<JSObject*> aCpows,
|
|
|
|
nsIPrincipal* aPrincipal) override;
|
|
|
|
|
2019-07-06 11:18:28 +03:00
|
|
|
bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
|
|
|
const Maybe<ZoomConstraints>& aConstraints);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvLoadURL(const nsCString& aURI,
|
2020-01-05 23:58:21 +03:00
|
|
|
const ParentShowInfo&);
|
2019-04-17 03:53:28 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvResumeLoad(const uint64_t& aPendingSwitchID,
|
2020-01-05 23:58:21 +03:00
|
|
|
const ParentShowInfo&);
|
2019-04-17 03:53:28 +03:00
|
|
|
|
2019-05-15 23:29:22 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2020-01-05 23:58:21 +03:00
|
|
|
mozilla::ipc::IPCResult RecvShow(const ParentShowInfo&, const OwnerShowInfo&);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitRendering(
|
2017-01-17 23:52:45 +03:00
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
2018-03-25 02:06:01 +03:00
|
|
|
const layers::LayersId& aLayersId,
|
2017-04-10 00:30:27 +03:00
|
|
|
const mozilla::layers::CompositorOptions& aCompositorOptions,
|
2019-05-06 22:29:29 +03:00
|
|
|
const bool& aLayersConnected);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-11-19 02:13:55 +03:00
|
|
|
mozilla::ipc::IPCResult RecvCompositorOptionsChanged(
|
|
|
|
const mozilla::layers::CompositorOptions& aNewOptions);
|
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateDimensions(
|
|
|
|
const mozilla::dom::DimensionInfo& aDimensionInfo);
|
|
|
|
mozilla::ipc::IPCResult RecvSizeModeChanged(const nsSizeMode& aSizeMode);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvChildToParentMatrix(
|
2019-09-12 11:08:45 +03:00
|
|
|
const mozilla::Maybe<mozilla::gfx::Matrix4x4>& aMatrix,
|
2020-02-11 06:35:56 +03:00
|
|
|
const mozilla::ScreenRect& aTopLevelViewportVisibleRectInBrowserCoords);
|
2019-04-09 13:26:31 +03:00
|
|
|
|
2019-11-14 09:00:05 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2019-11-14 08:59:47 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDynamicToolbarMaxHeightChanged(
|
|
|
|
const mozilla::ScreenIntCoord& aHeight);
|
|
|
|
|
2019-11-22 00:15:46 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDynamicToolbarOffsetChanged(
|
|
|
|
const mozilla::ScreenIntCoord& aOffset);
|
|
|
|
|
2017-01-21 07:11:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvActivate();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-01-21 07:11:35 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDeactivate();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-03-07 01:54:58 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvMouseEvent(const nsString& aType, const float& aX,
|
|
|
|
const float& aY,
|
|
|
|
const int32_t& aButton,
|
|
|
|
const int32_t& aClickCount,
|
|
|
|
const int32_t& aModifiers,
|
|
|
|
const bool& aIgnoreRootScrollFrame);
|
|
|
|
|
|
|
|
mozilla::ipc::IPCResult RecvRealMouseMoveEvent(
|
2016-11-15 06:26:00 +03:00
|
|
|
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityRealMouseMoveEvent(
|
2017-07-28 10:14:54 +03:00
|
|
|
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSynthMouseMoveEvent(
|
2016-11-15 06:26:00 +03:00
|
|
|
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
|
|
|
mozilla::ipc::IPCResult RecvNormalPrioritySynthMouseMoveEvent(
|
2017-07-28 10:14:54 +03:00
|
|
|
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRealMouseButtonEvent(
|
2016-11-15 06:26:00 +03:00
|
|
|
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityRealMouseButtonEvent(
|
2017-07-28 10:14:54 +03:00
|
|
|
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-09 23:21:28 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
|
|
|
const uint32_t& aDragAction,
|
|
|
|
const uint32_t& aDropEffect,
|
2019-08-20 15:43:02 +03:00
|
|
|
nsIPrincipal* aPrincipal,
|
|
|
|
nsIContentSecurityPolicy* aCsp);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRealKeyEvent(
|
|
|
|
const mozilla::WidgetKeyboardEvent& aEvent);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityRealKeyEvent(
|
|
|
|
const mozilla::WidgetKeyboardEvent& aEvent);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvMouseWheelEvent(
|
2016-11-15 06:26:00 +03:00
|
|
|
const mozilla::WidgetWheelEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityMouseWheelEvent(
|
2017-07-28 10:14:54 +03:00
|
|
|
const mozilla::WidgetWheelEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsEventStatus& aApzResponse);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityRealTouchEvent(
|
2016-01-08 22:17:39 +03:00
|
|
|
const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRealTouchMoveEvent(
|
2017-07-28 10:14:54 +03:00
|
|
|
const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityRealTouchMoveEvent(
|
2016-01-05 12:59:30 +03:00
|
|
|
const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
2019-05-06 22:29:29 +03:00
|
|
|
const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-22 12:06:14 +03:00
|
|
|
mozilla::ipc::IPCResult RecvFlushTabState(const uint32_t& aFlushId,
|
|
|
|
const bool& aIsFinal);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-07-11 12:46:14 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateEpoch(const uint32_t& aEpoch);
|
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNativeSynthesisResponse(
|
|
|
|
const uint64_t& aObserverId, const nsCString& aResponse);
|
2019-05-04 13:42:52 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvPluginEvent(const WidgetPluginEvent& aEvent);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvCompositionEvent(
|
|
|
|
const mozilla::WidgetCompositionEvent& aEvent);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityCompositionEvent(
|
|
|
|
const mozilla::WidgetCompositionEvent& aEvent);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSelectionEvent(
|
|
|
|
const mozilla::WidgetSelectionEvent& aEvent);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPrioritySelectionEvent(
|
|
|
|
const mozilla::WidgetSelectionEvent& aEvent);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-13 04:49:07 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetIsUnderHiddenEmbedderElement(
|
|
|
|
const bool& aIsUnderHiddenEmbedderElement);
|
|
|
|
|
2019-03-13 03:43:48 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvPasteTransferable(
|
2016-08-31 04:30:45 +03:00
|
|
|
const IPCDataTransfer& aDataTransfer, const bool& aIsPrivateData,
|
2019-05-06 22:29:29 +03:00
|
|
|
nsIPrincipal* aRequestingPrincipal, const uint32_t& aContentPolicyType);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvActivateFrameEvent(const nsString& aType,
|
|
|
|
const bool& aCapture);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvLoadRemoteScript(const nsString& aURL,
|
|
|
|
const bool& aRunInGlobalScope);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMessage,
|
2019-07-10 06:27:27 +03:00
|
|
|
nsTArray<CpowEntry>&& aCpows,
|
2019-05-06 22:29:29 +03:00
|
|
|
nsIPrincipal* aPrincipal,
|
|
|
|
const ClonedMessageData& aData);
|
|
|
|
mozilla::ipc::IPCResult RecvSwappedWithOtherRemoteLoader(
|
|
|
|
const IPCTabContext& aContext);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2020-03-04 11:16:31 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSafeAreaInsetsChanged(
|
|
|
|
const mozilla::ScreenIntMargin& aSafeAreaInsets);
|
|
|
|
|
2019-12-02 09:25:40 +03:00
|
|
|
#ifdef ACCESSIBILITY
|
2019-05-06 22:29:29 +03:00
|
|
|
PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*,
|
|
|
|
const uint64_t&,
|
|
|
|
const uint32_t&,
|
|
|
|
const IAccessibleHolder&);
|
|
|
|
bool DeallocPDocAccessibleChild(PDocAccessibleChild*);
|
2019-12-02 09:25:40 +03:00
|
|
|
#endif
|
2013-09-12 23:24:11 +04:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
PColorPickerChild* AllocPColorPickerChild(const nsString& aTitle,
|
|
|
|
const nsString& aInitialColor);
|
2013-09-12 23:24:11 +04:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
bool DeallocPColorPickerChild(PColorPickerChild* aActor);
|
2014-05-23 18:36:50 +04:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
PFilePickerChild* AllocPFilePickerChild(const nsString& aTitle,
|
|
|
|
const int16_t& aMode);
|
2015-04-22 17:58:33 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
bool DeallocPFilePickerChild(PFilePickerChild* aActor);
|
2015-09-18 15:19:13 +03:00
|
|
|
|
2019-06-03 23:04:46 +03:00
|
|
|
nsIWebNavigation* WebNavigation() const { return mWebNav; }
|
2015-12-11 19:17:33 +03:00
|
|
|
|
2019-06-03 23:04:46 +03:00
|
|
|
PuppetWidget* WebWidget() { return mPuppetWidget; }
|
2014-11-12 23:59:19 +03:00
|
|
|
|
2016-05-16 05:56:09 +03:00
|
|
|
bool IsTransparent() const { return mIsTransparent; }
|
|
|
|
|
2019-06-11 15:52:12 +03:00
|
|
|
const EffectsInfo& GetEffectsInfo() const { return mEffectsInfo; }
|
|
|
|
|
2018-08-29 23:54:56 +03:00
|
|
|
hal::ScreenOrientation GetOrientation() const { return mOrientation; }
|
2015-06-08 08:39:28 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void SetBackgroundColor(const nscolor& aColor);
|
|
|
|
|
|
|
|
void NotifyPainted();
|
|
|
|
|
2019-05-15 23:29:22 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY virtual mozilla::ipc::IPCResult RecvUpdateEffects(
|
2019-05-15 23:26:25 +03:00
|
|
|
const EffectsInfo& aEffects);
|
|
|
|
|
2017-05-19 12:46:02 +03:00
|
|
|
void RequestEditCommands(nsIWidget::NativeKeyBindingsType aType,
|
|
|
|
const WidgetKeyboardEvent& aEvent,
|
|
|
|
nsTArray<CommandInt>& aCommands);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-15 23:29:22 +03:00
|
|
|
bool IsVisible();
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
2019-04-10 01:39:01 +03:00
|
|
|
* Signal to this BrowserChild that it should be made visible:
|
2016-01-05 12:59:30 +03:00
|
|
|
* activated widget, retained layer tree, etc. (Respectively,
|
|
|
|
* made not visible.)
|
|
|
|
*/
|
2019-09-27 16:11:51 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT void UpdateVisibility();
|
|
|
|
MOZ_CAN_RUN_SCRIPT void MakeVisible();
|
2016-01-05 12:59:30 +03:00
|
|
|
void MakeHidden();
|
|
|
|
|
2019-02-25 23:04:49 +03:00
|
|
|
ContentChild* Manager() const { return mManager; }
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
static inline BrowserChild* GetFrom(nsIDocShell* aDocShell) {
|
2016-03-16 22:18:38 +03:00
|
|
|
if (!aDocShell) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
nsCOMPtr<nsIBrowserChild> tc = aDocShell->GetBrowserChild();
|
|
|
|
return static_cast<BrowserChild*>(tc.get());
|
2016-01-05 12:59:30 +03:00
|
|
|
}
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
static inline BrowserChild* GetFrom(mozIDOMWindow* aWindow) {
|
2016-01-30 20:05:36 +03:00
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
static inline BrowserChild* GetFrom(mozIDOMWindowProxy* aWindow) {
|
2016-01-30 20:05:36 +03:00
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
static BrowserChild* GetFrom(PresShell* aPresShell);
|
|
|
|
static BrowserChild* GetFrom(layers::LayersId aLayersId);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2018-03-25 02:06:01 +03:00
|
|
|
layers::LayersId GetLayersId() { return mLayersId; }
|
2017-10-13 17:32:36 +03:00
|
|
|
Maybe<bool> IsLayersConnected() { return mLayersConnected; }
|
2016-03-19 04:38:57 +03:00
|
|
|
|
2018-04-20 22:13:06 +03:00
|
|
|
void DidComposite(mozilla::layers::TransactionId aTransactionId,
|
2016-01-05 12:59:30 +03:00
|
|
|
const TimeStamp& aCompositeStart,
|
|
|
|
const TimeStamp& aCompositeEnd);
|
|
|
|
|
|
|
|
void DidRequestComposite(const TimeStamp& aCompositeReqStart,
|
|
|
|
const TimeStamp& aCompositeReqEnd);
|
|
|
|
|
|
|
|
void ClearCachedResources();
|
2016-02-29 09:53:12 +03:00
|
|
|
void InvalidateLayers();
|
2018-10-01 04:12:22 +03:00
|
|
|
void SchedulePaint();
|
2016-09-20 11:19:32 +03:00
|
|
|
void ReinitRendering();
|
2017-05-12 08:44:27 +03:00
|
|
|
void ReinitRenderingForDeviceReset();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
static inline BrowserChild* GetFrom(nsIDOMWindow* aWindow) {
|
2016-01-05 12:59:30 +03:00
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUIResolutionChanged(const float& aDpi,
|
|
|
|
const int32_t& aRounding,
|
|
|
|
const double& aScale);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvThemeChanged(
|
|
|
|
nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvHandleAccessKey(const WidgetKeyboardEvent& aEvent,
|
|
|
|
nsTArray<uint32_t>&& aCharCodes);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetUseGlobalHistory(const bool& aUse);
|
2016-03-23 21:39:28 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvHandledWindowedPluginKeyEvent(
|
|
|
|
const mozilla::NativeEventData& aKeyEventData, const bool& aIsConsumed);
|
Bug 1257759 part.5 PluginInstanceChild should post received native key event to chrome process if the key combination may be a shortcut key r=jimm
When PluginInstanceChild receives native key events, it should post the events to the chrome process first for checking if the key combination is reserved. However, posting all key events to the chrome process may make damage to the performance of text input. Therefore, this patch starts to post a key event whose key combination may be a shortcut key. However, for avoiding to shuffle the event order, it posts following key events until all posted key events are handled by the chrome process.
For receiving response from widget, this patch defines nsIKeyEventInPluginCallback. It's specified by nsIWidget::OnWindowedPluginKeyEvent() for ensuring the caller will receive the reply. Basically, the caller of nsIWidget::OnWindowedPluginKeyEvent() should reply to the child process. However, if the widget is a PuppetWidget, it cannot return the result synchronously. Therefore, PuppetWidget::OnWindowedPluginKeyEvent() returns NS_SUCCESS_EVENT_HANDLED_ASYNCHRONOUSLY and stores the callback to mKeyEventInPluginCallbacks. Then, TabParent::HandledWindowedPluginKeyEvent() will call PuppetWidget::HandledWindowedPluginKeyEvent().
MozReview-Commit-ID: G6brOU26NwQ
--HG--
extra : rebase_source : 8140456de278956d2d594e85c7b397ae366b4962
2016-04-19 14:09:37 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvPrint(const uint64_t& aOuterWindowID,
|
|
|
|
const PrintData& aPrintData);
|
2016-05-16 12:40:54 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateNativeWindowHandle(
|
|
|
|
const uintptr_t& aNewHandle);
|
2016-09-15 22:37:04 +03:00
|
|
|
|
2020-02-06 22:07:56 +03:00
|
|
|
mozilla::ipc::IPCResult RecvWillChangeProcess(
|
|
|
|
WillChangeProcessResolver&& aResolve);
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
|
|
|
* Native widget remoting protocol for use with windowed plugins with e10s.
|
|
|
|
*/
|
2019-05-06 22:29:29 +03:00
|
|
|
PPluginWidgetChild* AllocPPluginWidgetChild();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-02-09 19:53:50 +03:00
|
|
|
#ifdef XP_WIN
|
2016-01-05 12:59:30 +03:00
|
|
|
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
|
2017-02-09 19:53:50 +03:00
|
|
|
#endif
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
PPaymentRequestChild* AllocPPaymentRequestChild();
|
2017-05-25 20:50:32 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
bool DeallocPPaymentRequestChild(PPaymentRequestChild* aActor);
|
2017-05-25 20:50:32 +03:00
|
|
|
|
2016-03-08 22:14:43 +03:00
|
|
|
LayoutDeviceIntPoint GetClientOffset() const { return mClientOffset; }
|
2017-11-22 22:21:37 +03:00
|
|
|
LayoutDeviceIntPoint GetChromeOffset() const { return mChromeOffset; };
|
2019-11-14 08:59:47 +03:00
|
|
|
ScreenIntCoord GetDynamicToolbarMaxHeight() const {
|
|
|
|
return mDynamicToolbarMaxHeight;
|
|
|
|
};
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
bool IPCOpen() const { return mIPCOpen; }
|
|
|
|
|
|
|
|
bool ParentIsActive() const { return mParentIsActive; }
|
|
|
|
|
2017-11-03 10:38:34 +03:00
|
|
|
const mozilla::layers::CompositorOptions& GetCompositorOptions() const;
|
2017-01-13 01:29:41 +03:00
|
|
|
bool AsyncPanZoomEnabled() const;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-06-03 23:04:46 +03:00
|
|
|
ScreenIntSize GetInnerSize();
|
2019-08-30 21:45:29 +03:00
|
|
|
CSSSize GetUnscaledInnerSize() { return mUnscaledInnerSize; }
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-06-25 06:16:31 +03:00
|
|
|
Maybe<LayoutDeviceIntRect> GetVisibleRect() const;
|
2019-06-11 15:52:12 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
2020-01-05 23:58:21 +03:00
|
|
|
void DoFakeShow(const ParentShowInfo&);
|
2015-10-30 02:30:57 +03:00
|
|
|
|
2019-05-07 01:14:40 +03:00
|
|
|
void ContentReceivedInputBlock(uint64_t aInputBlockId,
|
2016-01-08 22:17:39 +03:00
|
|
|
bool aPreventDefault) const;
|
|
|
|
void SetTargetAPZC(
|
|
|
|
uint64_t aInputBlockId,
|
2019-03-22 21:28:42 +03:00
|
|
|
const nsTArray<layers::SLGuidAndRenderRoot>& aTargets) const;
|
2019-03-07 01:54:58 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvHandleTap(
|
|
|
|
const layers::GeckoContentController::TapType& aType,
|
|
|
|
const LayoutDevicePoint& aPoint, const Modifiers& aModifiers,
|
2019-05-06 22:29:29 +03:00
|
|
|
const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId);
|
2017-07-28 10:14:54 +03:00
|
|
|
|
2019-03-07 01:54:58 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2017-07-28 10:14:54 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNormalPriorityHandleTap(
|
|
|
|
const layers::GeckoContentController::TapType& aType,
|
|
|
|
const LayoutDevicePoint& aPoint, const Modifiers& aModifiers,
|
2019-05-06 22:29:29 +03:00
|
|
|
const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId);
|
2017-07-28 10:14:54 +03:00
|
|
|
|
2016-01-08 22:17:39 +03:00
|
|
|
void SetAllowedTouchBehavior(
|
|
|
|
uint64_t aInputBlockId, const nsTArray<TouchBehaviorFlags>& aFlags) const;
|
|
|
|
|
2018-09-19 21:50:20 +03:00
|
|
|
bool UpdateFrame(const layers::RepaintRequest& aRequest);
|
2016-01-08 22:17:39 +03:00
|
|
|
bool NotifyAPZStateChange(
|
|
|
|
const ViewID& aViewId,
|
|
|
|
const layers::GeckoContentController::APZStateChange& aChange,
|
|
|
|
const int& aArg);
|
|
|
|
void StartScrollbarDrag(const layers::AsyncDragMetrics& aDragMetrics);
|
|
|
|
void ZoomToRect(const uint32_t& aPresShellId,
|
2018-11-01 23:15:46 +03:00
|
|
|
const ScrollableLayerGuid::ViewID& aViewId,
|
2016-01-08 22:17:39 +03:00
|
|
|
const CSSRect& aRect, const uint32_t& aFlags);
|
|
|
|
|
2016-07-23 02:36:45 +03:00
|
|
|
// Request that the docshell be marked as active.
|
2019-09-27 01:11:17 +03:00
|
|
|
void PaintWhileInterruptingJS(const layers::LayersObserverEpoch& aEpoch);
|
2016-07-23 02:36:45 +03:00
|
|
|
|
2019-05-01 02:31:36 +03:00
|
|
|
nsresult CanCancelContentJS(nsIRemoteTab::NavigationType aNavigationType,
|
|
|
|
int32_t aNavigationIndex, nsIURI* aNavigationURI,
|
2019-05-01 02:31:46 +03:00
|
|
|
int32_t aEpoch, bool* aCanCancel);
|
2019-05-01 02:31:36 +03:00
|
|
|
|
2018-07-30 16:24:50 +03:00
|
|
|
layers::LayersObserverEpoch LayersObserverEpoch() const {
|
|
|
|
return mLayersObserverEpoch;
|
|
|
|
}
|
2018-07-22 15:02:26 +03:00
|
|
|
|
2016-09-15 22:37:04 +03:00
|
|
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
|
|
|
uintptr_t GetNativeWindowHandle() const { return mNativeWindowHandle; }
|
|
|
|
#endif
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// These methods return `true` if this BrowserChild is currently awaiting a
|
2017-01-26 22:20:44 +03:00
|
|
|
// Large-Allocation header.
|
2017-02-10 01:49:46 +03:00
|
|
|
bool StopAwaitingLargeAlloc();
|
2017-01-26 22:20:44 +03:00
|
|
|
bool IsAwaitingLargeAlloc();
|
2016-11-04 21:13:52 +03:00
|
|
|
|
2017-01-26 22:20:44 +03:00
|
|
|
mozilla::dom::TabGroup* TabGroup();
|
|
|
|
|
2017-05-02 00:04:55 +03:00
|
|
|
#if defined(ACCESSIBILITY)
|
|
|
|
void SetTopLevelDocAccessibleChild(PDocAccessibleChild* aTopLevelChild) {
|
|
|
|
mTopLevelDocAccessibleChild = aTopLevelChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
PDocAccessibleChild* GetTopLevelDocAccessibleChild() {
|
|
|
|
return mTopLevelDocAccessibleChild;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-06-15 20:23:55 +03:00
|
|
|
void AddPendingDocShellBlocker();
|
|
|
|
void RemovePendingDocShellBlocker();
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// The HANDLE object for the widget this BrowserChild in.
|
2017-06-13 20:37:31 +03:00
|
|
|
WindowsHandle WidgetNativeData() { return mWidgetNativeData; }
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// The transform from the coordinate space of this BrowserChild to the
|
|
|
|
// coordinate space of the native window its BrowserParent is in.
|
2019-04-09 13:26:31 +03:00
|
|
|
mozilla::LayoutDeviceToLayoutDeviceMatrix4x4
|
|
|
|
GetChildToParentConversionMatrix() const;
|
|
|
|
|
2020-02-11 06:35:56 +03:00
|
|
|
// Returns the portion of the visible rect of this remote document in the
|
|
|
|
// top browser window coordinate system. This is the result of being clipped
|
|
|
|
// by all ancestor viewports.
|
|
|
|
mozilla::ScreenRect GetTopLevelViewportVisibleRectInBrowserCoords() const;
|
2019-09-12 11:08:45 +03:00
|
|
|
|
2020-02-11 06:59:14 +03:00
|
|
|
// Similar to above GetTopLevelViewportVisibleRectInBrowserCoords(), but in
|
|
|
|
// this out-of-process document's coordinate system.
|
|
|
|
Maybe<LayoutDeviceRect> GetTopLevelViewportVisibleRectInSelfCoords() const;
|
|
|
|
|
2017-10-12 04:05:40 +03:00
|
|
|
// Prepare to dispatch all coalesced mousemove events. We'll move all data
|
|
|
|
// in mCoalescedMouseData to a nsDeque; then we start processing them. We
|
|
|
|
// can't fetch the coalesced event one by one and dispatch it because we may
|
|
|
|
// reentry the event loop and access to the same hashtable. It's called when
|
|
|
|
// dispatching some mouse events other than mousemove.
|
|
|
|
void FlushAllCoalescedMouseData();
|
|
|
|
void ProcessPendingCoalescedMouseDataAndDispatchEvents();
|
2017-07-20 02:10:48 +03:00
|
|
|
|
2017-10-12 04:05:40 +03:00
|
|
|
void HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId);
|
2017-08-11 09:58:08 +03:00
|
|
|
|
2019-05-01 02:31:46 +03:00
|
|
|
void SetCancelContentJSEpoch(int32_t aEpoch) {
|
|
|
|
mCancelContentJSEpoch = aEpoch;
|
|
|
|
}
|
|
|
|
|
2017-11-03 18:27:29 +03:00
|
|
|
static bool HasVisibleTabs() {
|
|
|
|
return sVisibleTabs && !sVisibleTabs->IsEmpty();
|
2017-07-20 02:10:48 +03:00
|
|
|
}
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// Returns the set of BrowserChilds that are currently rendering layers. There
|
|
|
|
// can be multiple BrowserChilds in this state if Firefox has multiple windows
|
|
|
|
// open or is warming tabs up. There can also be zero BrowserChilds in this
|
2017-11-03 18:27:29 +03:00
|
|
|
// state. Note that this function should only be called if HasVisibleTabs()
|
|
|
|
// returns true.
|
2019-04-10 01:39:01 +03:00
|
|
|
static const nsTHashtable<nsPtrHashKey<BrowserChild>>& GetVisibleTabs() {
|
2017-11-03 18:27:29 +03:00
|
|
|
MOZ_ASSERT(HasVisibleTabs());
|
|
|
|
return *sVisibleTabs;
|
2017-07-20 02:10:48 +03:00
|
|
|
}
|
|
|
|
|
2019-05-22 12:06:14 +03:00
|
|
|
bool UpdateSessionStore(uint32_t aFlushId, bool aIsFinal = false);
|
2019-05-04 13:42:52 +03:00
|
|
|
|
Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
This change is a continuation of Part 1 (Bug 1570128), where the 2D content rendered by Firefox for Firefox Reality on Desktop is marshalled through VRHost so that it can be presented in a VR environment.
A new class, FxrOutputHandler, is created to manage creating a sharable texture, sharing it through VRShMem, and updating it when content updates. This class updates content with both WebRender and conventional rendering output.
This initial iteration of FxrOutputHandler does not have synchronization between reading and writing this shared texture across processes. A subsequent fix (Bug 1581881) is pending, which will reuse WebVR code to manage writing to and reading from a pool of textures.
This also presents issues with rendering protected media, so an additional class, FxrWindowManager, is created to manage all windows created for Firefox Reality on Desktop so that it can inform whether or not protected media can be presented.
The automated manual tests in vrhosttest.cpp now show the real shared texture handle rather than a fake value, which shows that marshaling succeeded.
Differential Revision: https://phabricator.services.mozilla.com/D46179
--HG--
extra : moz-landing-system : lando
2019-09-26 15:50:44 +03:00
|
|
|
#ifdef XP_WIN
|
2019-10-14 22:10:39 +03:00
|
|
|
// Check if the window this BrowserChild is associated with supports
|
|
|
|
// protected media (EME) or not.
|
|
|
|
// Returns a promise the will resolve true if the window supports protected
|
|
|
|
// media or false if it does not. The promise will be rejected with an
|
|
|
|
// ResponseRejectReason if the IPC needed to do the check fails. Callers
|
|
|
|
// should treat the reject case as if the window does not support protected
|
|
|
|
// media to ensure robust handling.
|
|
|
|
RefPtr<IsWindowSupportingProtectedMediaPromise>
|
|
|
|
DoesWindowSupportProtectedMedia();
|
Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
This change is a continuation of Part 1 (Bug 1570128), where the 2D content rendered by Firefox for Firefox Reality on Desktop is marshalled through VRHost so that it can be presented in a VR environment.
A new class, FxrOutputHandler, is created to manage creating a sharable texture, sharing it through VRShMem, and updating it when content updates. This class updates content with both WebRender and conventional rendering output.
This initial iteration of FxrOutputHandler does not have synchronization between reading and writing this shared texture across processes. A subsequent fix (Bug 1581881) is pending, which will reuse WebVR code to manage writing to and reading from a pool of textures.
This also presents issues with rendering protected media, so an additional class, FxrWindowManager, is created to manage all windows created for Firefox Reality on Desktop so that it can inform whether or not protected media can be presented.
The automated manual tests in vrhosttest.cpp now show the real shared texture handle rather than a fake value, which shows that marshaling succeeded.
Differential Revision: https://phabricator.services.mozilla.com/D46179
--HG--
extra : moz-landing-system : lando
2019-09-26 15:50:44 +03:00
|
|
|
#endif
|
|
|
|
|
2020-01-13 17:08:25 +03:00
|
|
|
// Notify the content blocking event in the parent process. This sends an IPC
|
|
|
|
// message to the BrowserParent in the parent. The BrowserParent will find the
|
|
|
|
// top-level WindowGlobalParent and notify the event from it.
|
|
|
|
void NotifyContentBlockingEvent(
|
2020-02-11 12:33:32 +03:00
|
|
|
uint32_t aEvent, nsIChannel* aChannel, bool aBlocked,
|
|
|
|
const nsACString& aTrackingOrigin,
|
2020-01-13 17:08:25 +03:00
|
|
|
const nsTArray<nsCString>& aTrackingFullHashes,
|
|
|
|
const Maybe<AntiTrackingCommon::StorageAccessGrantedReason>& aReason);
|
|
|
|
|
2010-08-06 02:11:23 +04:00
|
|
|
protected:
|
2019-04-10 01:39:01 +03:00
|
|
|
virtual ~BrowserChild();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDestroy();
|
2014-07-09 01:23:17 +04:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetDocShellIsActive(const bool& aIsActive);
|
2017-11-03 17:27:05 +03:00
|
|
|
|
2019-05-06 16:25:35 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRenderLayers(
|
2019-09-27 01:11:17 +03:00
|
|
|
const bool& aEnabled, const layers::LayersObserverEpoch& aEpoch);
|
2014-05-23 22:19:00 +04:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNavigateByKey(const bool& aForward,
|
|
|
|
const bool& aForDocumentNavigation);
|
2015-08-20 00:08:41 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestNotifyAfterRemotePaint();
|
2014-11-27 16:28:26 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSuppressDisplayport(const bool& aEnabled);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvParentActivated(const bool& aActivated);
|
2017-08-23 12:02:57 +03:00
|
|
|
|
2020-01-13 14:30:44 +03:00
|
|
|
mozilla::ipc::IPCResult RecvScrollbarPreferenceChanged(ScrollbarPreference);
|
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetKeyboardIndicators(
|
|
|
|
const UIStateChangeType& aShowFocusRings);
|
2016-06-09 14:59:31 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvStopIMEStateManagement();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAwaitLargeAlloc();
|
2016-10-21 23:56:51 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAllowScriptsToClose();
|
2018-09-15 11:26:33 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetOriginAttributes(
|
|
|
|
const OriginAttributes& aOriginAttributes);
|
2017-06-06 21:22:17 +03:00
|
|
|
|
2019-05-06 22:29:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetWidgetNativeData(
|
|
|
|
const WindowsHandle& aWidgetNativeData);
|
2017-06-13 20:37:31 +03:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
private:
|
2019-06-03 23:04:46 +03: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);
|
|
|
|
|
|
|
|
void ProcessUpdateFrame(const mozilla::layers::RepaintRequest& aRequest);
|
|
|
|
|
|
|
|
bool UpdateFrameHandler(const mozilla::layers::RepaintRequest& aRequest);
|
|
|
|
|
2016-07-05 20:24:54 +03:00
|
|
|
void HandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers,
|
|
|
|
const ScrollableLayerGuid& aGuid);
|
|
|
|
|
2016-09-05 15:43:51 +03:00
|
|
|
// Notify others that our TabContext has been updated.
|
2016-01-05 12:59:30 +03:00
|
|
|
//
|
|
|
|
// You should call this after calling TabContext::SetTabContext(). We also
|
|
|
|
// call this during Init().
|
2016-09-05 15:43:51 +03:00
|
|
|
//
|
|
|
|
// @param aIsPreallocated true if this is called for Preallocated Tab.
|
|
|
|
void NotifyTabContextUpdated(bool aIsPreallocated);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-05-16 06:07:09 +03:00
|
|
|
// Update the frameType on our docshell.
|
|
|
|
void UpdateFrameType();
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason why) override;
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
bool InitBrowserChildMessageManager();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 01:58:22 +03:00
|
|
|
void InitRenderingState(
|
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
2018-03-25 02:06:01 +03:00
|
|
|
const layers::LayersId& aLayersId,
|
2018-11-06 00:03:15 +03:00
|
|
|
const mozilla::layers::CompositorOptions& aCompositorOptions);
|
2016-11-29 07:21:27 +03:00
|
|
|
void InitAPZState();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
void DestroyWindow();
|
|
|
|
|
2020-01-05 23:58:21 +03:00
|
|
|
void ApplyParentShowInfo(const ParentShowInfo&);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
bool HasValidInnerSize();
|
|
|
|
|
|
|
|
void SetTabId(const TabId& aTabId);
|
|
|
|
|
|
|
|
ScreenIntRect GetOuterRect();
|
|
|
|
|
|
|
|
void SetUnscaledInnerSize(const CSSSize& aSize) {
|
|
|
|
mUnscaledInnerSize = aSize;
|
|
|
|
}
|
|
|
|
|
2017-01-16 12:29:37 +03:00
|
|
|
bool SkipRepeatedKeyEvent(const WidgetKeyboardEvent& aEvent);
|
|
|
|
|
|
|
|
void UpdateRepeatedKeyEventEndTime(const WidgetKeyboardEvent& aEvent);
|
|
|
|
|
2017-02-21 12:56:46 +03:00
|
|
|
bool MaybeCoalesceWheelEvent(const WidgetWheelEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
bool* aIsNextWheelEvent);
|
|
|
|
|
|
|
|
void MaybeDispatchCoalescedWheelEvent();
|
|
|
|
|
Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Currently, access key is handled in EventStateManager::PreHandleEvent() with eKeyPress event, i.e., before dispatching it into the DOM tree, if the access key is registered in EventStateManager. So, the main process does not check if the preceding eKeyDown event is consumed in focused remote process.
When preceding eKeyDown event is consumed in the main process, eKeyPress event won't be dispatched by widget. However, if remote process has focus, it's impossible widget to stop dispatching eKeyPress event because preceding eKeyDown event hasn't been handled in the focused remote process yet. Therefore, main process needs to post eKeyPress event to check if preceding eKeyDown event was consumed. When eKeyPress event is marked as "waiting reply from remote process", TabChild sends it back to the main process only when preceding eKeyDown event wasn't consumed. So, only when eKeyPress event is back to the main process, main process should handle accesskey with it.
This patch makes EventStateManager::PreHandleEvent() check if a remote target has focus before handling accesskey. If a remote process has accesskey and there is an accesskey matching with eKeyPress event, it marks the event as "waiting reply from remote content" and stop propagation in the process.
Finally, when eKeyPress event is sent back to TabParent, TabParent::RecvReplyKeyEvent() calls EventStateManager::HandleAccessKey() before dispatching the reply event into the DOM tree.
MozReview-Commit-ID: KsOkakaIVzb
--HG--
extra : rebase_source : 7e0c6966a1bde085e34d45bca4b0166b9fc2f3f1
2017-07-22 04:50:41 +03:00
|
|
|
/**
|
|
|
|
* Dispatch aEvent on aEvent.mWidget.
|
|
|
|
*/
|
|
|
|
nsEventStatus DispatchWidgetEventViaAPZ(WidgetGUIEvent& aEvent);
|
|
|
|
|
2017-02-21 12:56:46 +03:00
|
|
|
void DispatchWheelEvent(const WidgetWheelEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId);
|
|
|
|
|
2017-11-03 17:27:05 +03:00
|
|
|
void InternalSetDocShellIsActive(bool aIsActive);
|
2017-06-15 20:23:55 +03:00
|
|
|
|
2017-10-13 17:32:52 +03:00
|
|
|
bool CreateRemoteLayerManager(
|
|
|
|
mozilla::layers::PCompositorBridgeChild* aCompositorChild);
|
|
|
|
|
2019-01-25 17:44:09 +03:00
|
|
|
nsresult PrepareProgressListenerData(nsIWebProgress* aWebProgress,
|
|
|
|
nsIRequest* aRequest,
|
2019-04-03 20:29:28 +03:00
|
|
|
Maybe<WebProgressData>& aWebProgressData,
|
2019-01-25 17:44:09 +03:00
|
|
|
RequestData& aRequestData);
|
2019-09-20 21:15:18 +03:00
|
|
|
already_AddRefed<nsIWebBrowserChrome3> GetWebBrowserChromeActor();
|
2019-01-25 17:44:09 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
class DelayedDeleteRunnable;
|
|
|
|
|
2019-06-03 23:04:46 +03:00
|
|
|
RefPtr<BrowserChildMessageManager> mBrowserChildMessageManager;
|
|
|
|
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
2016-01-05 12:59:30 +03:00
|
|
|
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
2018-08-03 22:21:03 +03:00
|
|
|
RefPtr<nsWebBrowser> mWebBrowser;
|
2016-01-05 12:59:30 +03:00
|
|
|
nsCOMPtr<nsIWebNavigation> mWebNav;
|
2017-04-10 23:42:36 +03:00
|
|
|
RefPtr<mozilla::dom::TabGroup> mTabGroup;
|
2016-01-05 12:59:30 +03:00
|
|
|
RefPtr<PuppetWidget> mPuppetWidget;
|
|
|
|
nsCOMPtr<nsIURI> mLastURI;
|
2019-02-25 23:04:49 +03:00
|
|
|
RefPtr<ContentChild> mManager;
|
2019-03-14 21:50:45 +03:00
|
|
|
RefPtr<BrowsingContext> mBrowsingContext;
|
2019-04-03 20:29:15 +03:00
|
|
|
RefPtr<nsBrowserStatusFilter> mStatusFilter;
|
2016-01-05 12:59:30 +03:00
|
|
|
uint32_t mChromeFlags;
|
2017-03-15 02:48:41 +03:00
|
|
|
uint32_t mMaxTouchPoints;
|
2018-03-25 02:06:01 +03:00
|
|
|
layers::LayersId mLayersId;
|
2016-01-05 12:59:30 +03:00
|
|
|
CSSRect mUnscaledOuterRect;
|
2017-10-13 17:32:36 +03:00
|
|
|
Maybe<bool> mLayersConnected;
|
2019-05-24 17:25:34 +03:00
|
|
|
EffectsInfo mEffectsInfo;
|
2016-01-05 12:59:30 +03:00
|
|
|
bool mDidFakeShow;
|
|
|
|
bool mNotified;
|
|
|
|
bool mTriedBrowserInit;
|
2018-08-29 23:54:56 +03:00
|
|
|
hal::ScreenOrientation mOrientation;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
bool mIgnoreKeyPressEvent;
|
|
|
|
RefPtr<APZEventState> mAPZEventState;
|
|
|
|
SetAllowedTouchBehaviorCallback mSetAllowedTouchBehaviorCallback;
|
|
|
|
bool mHasValidInnerSize;
|
|
|
|
bool mDestroyed;
|
2019-04-03 20:29:15 +03:00
|
|
|
|
2016-03-08 22:14:43 +03:00
|
|
|
// Position of client area relative to the outer window
|
|
|
|
LayoutDeviceIntPoint mClientOffset;
|
2016-01-05 12:59:30 +03:00
|
|
|
// Position of tab, relative to parent widget (typically the window)
|
2017-11-22 22:21:37 +03:00
|
|
|
LayoutDeviceIntPoint mChromeOffset;
|
2019-11-14 08:59:47 +03:00
|
|
|
ScreenIntCoord mDynamicToolbarMaxHeight;
|
2016-01-05 12:59:30 +03:00
|
|
|
TabId mUniqueId;
|
|
|
|
|
2019-05-29 19:35:37 +03:00
|
|
|
// Whether or not this browser is the child part of the top level PBrowser
|
|
|
|
// actor in a remote browser.
|
|
|
|
bool mIsTopLevel;
|
|
|
|
|
2018-07-17 22:41:16 +03:00
|
|
|
// Whether or not this tab has siblings (other tabs in the same window).
|
|
|
|
// This is one factor used when choosing to allow or deny a non-system
|
|
|
|
// script's attempt to resize the window.
|
|
|
|
bool mHasSiblings;
|
|
|
|
|
2017-01-13 01:29:41 +03:00
|
|
|
// Holds the compositor options for the compositor rendering this tab,
|
|
|
|
// once we find out which compositor that is.
|
|
|
|
Maybe<mozilla::layers::CompositorOptions> mCompositorOptions;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
friend class ContentChild;
|
|
|
|
|
2016-05-16 05:56:09 +03:00
|
|
|
bool mIsTransparent;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool mIPCOpen;
|
|
|
|
bool mParentIsActive;
|
|
|
|
CSSSize mUnscaledInnerSize;
|
|
|
|
bool mDidSetRealShowInfo;
|
2016-03-12 01:31:55 +03:00
|
|
|
bool mDidLoadURLInit;
|
2017-01-26 22:20:44 +03:00
|
|
|
bool mAwaitingLA;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-01-16 12:29:37 +03:00
|
|
|
bool mSkipKeyPress;
|
|
|
|
|
|
|
|
// Store the end time of the handling of the last repeated keydown/keypress
|
|
|
|
// event so that in case event handling takes time, some repeated events can
|
|
|
|
// be skipped to not flood child process.
|
|
|
|
mozilla::TimeStamp mRepeatedKeyEventTime;
|
|
|
|
|
2017-02-21 12:56:46 +03:00
|
|
|
// Similar to mRepeatedKeyEventTime, store the end time (from parent process)
|
|
|
|
// of handling the last repeated wheel event so that in case event handling
|
|
|
|
// takes time, some repeated events can be skipped to not flood child process.
|
|
|
|
mozilla::TimeStamp mLastWheelProcessedTimeFromParent;
|
2017-05-12 14:13:59 +03:00
|
|
|
mozilla::TimeDuration mLastWheelProcessingDuration;
|
2017-10-12 04:05:40 +03:00
|
|
|
|
|
|
|
// Hash table to track coalesced mousemove events for different pointers.
|
2017-09-20 06:57:56 +03:00
|
|
|
nsClassHashtable<nsUint32HashKey, CoalescedMouseData> mCoalescedMouseData;
|
2017-10-12 04:05:40 +03:00
|
|
|
|
|
|
|
nsDeque mToBeDispatchedMouseData;
|
|
|
|
|
2017-02-21 12:56:46 +03:00
|
|
|
CoalescedWheelData mCoalescedWheelData;
|
2017-08-11 09:58:08 +03:00
|
|
|
RefPtr<CoalescedMouseMoveFlusher> mCoalescedMouseEventFlusher;
|
2017-02-21 12:56:46 +03:00
|
|
|
|
2016-07-31 22:39:00 +03:00
|
|
|
RefPtr<layers::IAPZCTreeManager> mApzcTreeManager;
|
2019-05-04 13:42:52 +03:00
|
|
|
RefPtr<TabListener> mSessionStoreListener;
|
2016-01-08 22:17:39 +03:00
|
|
|
|
2016-07-23 02:36:45 +03:00
|
|
|
// The most recently seen layer observer epoch in RecvSetDocShellIsActive.
|
2018-07-30 16:24:50 +03:00
|
|
|
layers::LayersObserverEpoch mLayersObserverEpoch;
|
2016-07-23 02:36:45 +03:00
|
|
|
|
2016-09-15 22:37:04 +03:00
|
|
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
|
|
|
// The handle associated with the native window that contains this tab
|
|
|
|
uintptr_t mNativeWindowHandle;
|
|
|
|
#endif // defined(XP_WIN)
|
|
|
|
|
2017-05-02 00:04:55 +03:00
|
|
|
#if defined(ACCESSIBILITY)
|
|
|
|
PDocAccessibleChild* mTopLevelDocAccessibleChild;
|
|
|
|
#endif
|
2017-08-11 09:58:08 +03:00
|
|
|
bool mCoalesceMouseMoveEvents;
|
2017-05-02 00:04:55 +03:00
|
|
|
|
2019-05-23 21:48:18 +03:00
|
|
|
bool mShouldSendWebProgressEventsToParent;
|
|
|
|
|
2019-05-15 23:29:22 +03:00
|
|
|
// Whether we are rendering to the compositor or not.
|
|
|
|
bool mRenderLayers;
|
|
|
|
|
2018-01-09 01:53:09 +03:00
|
|
|
// In some circumstances, a DocShell might be in a state where it is
|
|
|
|
// "blocked", and we should not attempt to change its active state or
|
|
|
|
// the underlying PresShell state until the DocShell becomes unblocked.
|
|
|
|
// It is possible, however, for the parent process to send commands to
|
|
|
|
// change those states while the DocShell is blocked. We store those
|
|
|
|
// states temporarily as "pending", and only apply them once the DocShell
|
|
|
|
// is no longer blocked.
|
2017-06-15 20:23:55 +03:00
|
|
|
bool mPendingDocShellIsActive;
|
|
|
|
bool mPendingDocShellReceivedMessage;
|
2018-01-09 01:53:09 +03:00
|
|
|
bool mPendingRenderLayers;
|
|
|
|
bool mPendingRenderLayersReceivedMessage;
|
2018-07-30 16:24:50 +03:00
|
|
|
layers::LayersObserverEpoch mPendingLayersObserverEpoch;
|
2018-01-09 01:53:09 +03:00
|
|
|
// When mPendingDocShellBlockers is greater than 0, the DocShell is blocked,
|
|
|
|
// and once it reaches 0, it is no longer blocked.
|
2017-06-15 20:23:55 +03:00
|
|
|
uint32_t mPendingDocShellBlockers;
|
2019-05-01 02:31:46 +03:00
|
|
|
int32_t mCancelContentJSEpoch;
|
2017-06-15 20:23:55 +03:00
|
|
|
|
2017-06-13 20:37:31 +03:00
|
|
|
WindowsHandle mWidgetNativeData;
|
|
|
|
|
2019-04-09 13:26:31 +03:00
|
|
|
Maybe<LayoutDeviceToLayoutDeviceMatrix4x4> mChildToParentConversionMatrix;
|
2020-02-11 06:35:56 +03:00
|
|
|
ScreenRect mTopLevelViewportVisibleRectInBrowserCoords;
|
2019-04-09 13:26:31 +03:00
|
|
|
|
Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
This change is a continuation of Part 1 (Bug 1570128), where the 2D content rendered by Firefox for Firefox Reality on Desktop is marshalled through VRHost so that it can be presented in a VR environment.
A new class, FxrOutputHandler, is created to manage creating a sharable texture, sharing it through VRShMem, and updating it when content updates. This class updates content with both WebRender and conventional rendering output.
This initial iteration of FxrOutputHandler does not have synchronization between reading and writing this shared texture across processes. A subsequent fix (Bug 1581881) is pending, which will reuse WebVR code to manage writing to and reading from a pool of textures.
This also presents issues with rendering protected media, so an additional class, FxrWindowManager, is created to manage all windows created for Firefox Reality on Desktop so that it can inform whether or not protected media can be presented.
The automated manual tests in vrhosttest.cpp now show the real shared texture handle rather than a fake value, which shows that marshaling succeeded.
Differential Revision: https://phabricator.services.mozilla.com/D46179
--HG--
extra : moz-landing-system : lando
2019-09-26 15:50:44 +03:00
|
|
|
#ifdef XP_WIN
|
2019-10-14 22:10:39 +03:00
|
|
|
// Should only be accessed on main thread.
|
|
|
|
Maybe<bool> mWindowSupportsProtectedMedia;
|
Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
This change is a continuation of Part 1 (Bug 1570128), where the 2D content rendered by Firefox for Firefox Reality on Desktop is marshalled through VRHost so that it can be presented in a VR environment.
A new class, FxrOutputHandler, is created to manage creating a sharable texture, sharing it through VRShMem, and updating it when content updates. This class updates content with both WebRender and conventional rendering output.
This initial iteration of FxrOutputHandler does not have synchronization between reading and writing this shared texture across processes. A subsequent fix (Bug 1581881) is pending, which will reuse WebVR code to manage writing to and reading from a pool of textures.
This also presents issues with rendering protected media, so an additional class, FxrWindowManager, is created to manage all windows created for Firefox Reality on Desktop so that it can inform whether or not protected media can be presented.
The automated manual tests in vrhosttest.cpp now show the real shared texture handle rather than a fake value, which shows that marshaling succeeded.
Differential Revision: https://phabricator.services.mozilla.com/D46179
--HG--
extra : moz-landing-system : lando
2019-09-26 15:50:44 +03:00
|
|
|
#endif
|
|
|
|
|
2017-11-03 18:27:29 +03:00
|
|
|
// This state is used to keep track of the current visible tabs (the ones
|
|
|
|
// rendering layers). There may be more than one if there are multiple browser
|
|
|
|
// windows open, or tabs are being warmed up. There may be none if this
|
|
|
|
// process does not host any visible or warming tabs.
|
2019-04-10 01:39:01 +03:00
|
|
|
static nsTHashtable<nsPtrHashKey<BrowserChild>>* sVisibleTabs;
|
2017-07-20 02:10:48 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(BrowserChild);
|
2009-07-01 00:39:22 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
#endif // mozilla_dom_BrowserChild_h
|