2016-01-08 23:40:26 +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-30 00:23:05 +03:00
|
|
|
#ifndef mozilla_dom_BrowserParent_h
|
|
|
|
#define mozilla_dom_BrowserParent_h
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "js/TypeDecls.h"
|
2017-02-01 18:38:16 +03:00
|
|
|
#include "LiveResizeListener.h"
|
2015-06-05 12:28:18 +03:00
|
|
|
#include "mozilla/ContentCache.h"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2019-05-07 19:08:22 +03:00
|
|
|
#include "mozilla/dom/BrowserBridgeParent.h"
|
2010-07-19 22:33:33 +04:00
|
|
|
#include "mozilla/dom/PBrowserParent.h"
|
2015-10-30 02:30:57 +03:00
|
|
|
#include "mozilla/dom/PContent.h"
|
2014-02-18 04:30:06 +04:00
|
|
|
#include "mozilla/dom/PFilePickerParent.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"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "mozilla/EventForwards.h"
|
2015-04-08 21:48:11 +03:00
|
|
|
#include "mozilla/dom/File.h"
|
2018-09-25 05:48:02 +03:00
|
|
|
#include "mozilla/gfx/CrossProcessPaint.h"
|
2016-05-11 04:16:41 +03:00
|
|
|
#include "mozilla/layers/CompositorBridgeParent.h"
|
2018-11-07 00:35:37 +03:00
|
|
|
#include "mozilla/layout/RenderFrame.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2016-05-11 04:16:41 +03:00
|
|
|
#include "mozilla/Move.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2012-06-23 05:27:30 +04:00
|
|
|
#include "nsIAuthPromptProvider.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
#include "nsIBrowserDOMWindow.h"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "nsIDOMEventListener.h"
|
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
|
|
|
#include "nsIKeyEventInPluginCallback.h"
|
2019-04-09 23:59:37 +03:00
|
|
|
#include "nsIRemoteTab.h"
|
2014-01-23 00:27:23 +04:00
|
|
|
#include "nsIXULBrowserWindow.h"
|
2015-04-21 17:33:56 +03:00
|
|
|
#include "nsRefreshDriver.h"
|
2014-06-06 06:49:43 +04:00
|
|
|
#include "nsWeakReference.h"
|
2013-07-11 18:43:35 +04:00
|
|
|
#include "Units.h"
|
2015-04-15 02:29:10 +03:00
|
|
|
#include "nsIWidget.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
|
2012-06-23 05:27:30 +04:00
|
|
|
class nsFrameLoader;
|
2013-10-19 00:57:55 +04:00
|
|
|
class nsIContent;
|
2013-11-06 21:21:15 +04:00
|
|
|
class nsIPrincipal;
|
2012-06-23 05:27:30 +04:00
|
|
|
class nsIURI;
|
2014-01-11 05:10:57 +04:00
|
|
|
class nsILoadContext;
|
2014-10-29 21:11:00 +03:00
|
|
|
class nsIDocShell;
|
2018-04-09 23:30:33 +03:00
|
|
|
class nsIWebBrowserPersistDocumentReceiver;
|
2009-11-06 23:43:39 +03:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
namespace mozilla {
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2015-10-08 17:51:31 +03:00
|
|
|
namespace a11y {
|
2015-10-06 20:10:47 +03:00
|
|
|
class DocAccessibleParent;
|
2015-10-08 17:51:31 +03:00
|
|
|
}
|
2015-10-06 20:10:47 +03:00
|
|
|
|
2015-01-27 00:32:18 +03:00
|
|
|
namespace jsipc {
|
|
|
|
class CpowHolder;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace jsipc
|
2015-01-27 00:32:18 +03:00
|
|
|
|
2012-07-20 10:48:27 +04:00
|
|
|
namespace layers {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
struct TextureFactoryIdentifier;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2014-09-11 17:46:17 +04:00
|
|
|
namespace widget {
|
|
|
|
struct IMENotification;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace widget
|
2014-09-11 17:46:17 +04:00
|
|
|
|
2015-04-08 21:48:11 +03:00
|
|
|
namespace gfx {
|
|
|
|
class SourceSurface;
|
|
|
|
class DataSourceSurface;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gfx
|
2015-04-08 21:48:11 +03:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2019-01-29 20:32:28 +03:00
|
|
|
class CanonicalBrowsingContext;
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2019-02-25 23:04:47 +03:00
|
|
|
class ContentParent;
|
2013-07-24 03:39:17 +04:00
|
|
|
class Element;
|
2015-04-08 21:48:11 +03:00
|
|
|
class DataTransfer;
|
2019-05-15 18:34:03 +03:00
|
|
|
class BrowserHost;
|
|
|
|
class BrowserBridgeParent;
|
2015-09-10 23:50:58 +03:00
|
|
|
|
|
|
|
namespace ipc {
|
|
|
|
class StructuredCloneData;
|
|
|
|
} // namespace ipc
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-05-06 17:47:56 +03:00
|
|
|
/**
|
|
|
|
* BrowserParent implements the parent actor part of the PBrowser protocol. See
|
|
|
|
* PBrowser for more information.
|
|
|
|
*/
|
2019-04-10 00:38:15 +03:00
|
|
|
class BrowserParent final : public PBrowserParent,
|
|
|
|
public nsIDOMEventListener,
|
|
|
|
public nsIAuthPromptProvider,
|
|
|
|
public nsIKeyEventInPluginCallback,
|
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public TabContext,
|
|
|
|
public LiveResizeListener {
|
2016-01-05 12:59:30 +03:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2019-02-06 18:57:37 +03:00
|
|
|
friend class PBrowserParent;
|
|
|
|
|
2019-04-10 00:38:15 +03:00
|
|
|
virtual ~BrowserParent();
|
2014-06-23 23:56:07 +04:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
public:
|
2016-01-05 12:59:30 +03:00
|
|
|
// Helper class for ContentParent::RecvCreateWindow.
|
|
|
|
struct AutoUseNewTab;
|
2012-08-09 06:58:06 +04:00
|
|
|
|
2019-04-02 17:35:51 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_NSIAUTHPROMPTPROVIDER
|
2016-01-05 12:59:30 +03:00
|
|
|
// nsIDOMEventListener interfaces
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
2015-10-30 02:30:57 +03:00
|
|
|
|
2019-05-08 22:34:47 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(BrowserParent, nsIDOMEventListener)
|
2019-04-02 17:35:51 +03:00
|
|
|
|
2019-04-10 00:38:15 +03:00
|
|
|
BrowserParent(ContentParent* aManager, const TabId& aTabId,
|
|
|
|
const TabContext& aContext,
|
|
|
|
CanonicalBrowsingContext* aBrowsingContext,
|
2019-05-15 18:34:03 +03:00
|
|
|
uint32_t aChromeFlags);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-30 00:57:42 +03:00
|
|
|
// Call from LayoutStatics only
|
|
|
|
static void InitializeStatics();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the focused BrowserParent or nullptr if chrome or another app
|
|
|
|
* is focused.
|
|
|
|
*/
|
|
|
|
static BrowserParent* GetFocused();
|
|
|
|
|
|
|
|
static BrowserParent* GetFrom(nsFrameLoader* aFrameLoader);
|
|
|
|
|
|
|
|
static BrowserParent* GetFrom(PBrowserParent* aBrowserParent);
|
|
|
|
|
|
|
|
static BrowserParent* GetFrom(nsIContent* aContent);
|
|
|
|
|
|
|
|
static BrowserParent* GetBrowserParentFromLayersId(
|
|
|
|
layers::LayersId aLayersId);
|
|
|
|
|
|
|
|
static TabId GetTabIdFrom(nsIDocShell* docshell);
|
|
|
|
|
|
|
|
static bool AreRecordReplayTabsActive() {
|
|
|
|
return gNumActiveRecordReplayTabs != 0;
|
|
|
|
}
|
|
|
|
|
2019-04-30 01:14:17 +03:00
|
|
|
const TabId GetTabId() const { return mTabId; }
|
|
|
|
|
|
|
|
ContentParent* Manager() const { return mManager; }
|
|
|
|
|
|
|
|
CanonicalBrowsingContext* GetBrowsingContext() { return mBrowsingContext; }
|
|
|
|
|
|
|
|
already_AddRefed<nsILoadContext> GetLoadContext();
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
Element* GetOwnerElement() const { return mFrameElement; }
|
2019-04-30 01:14:17 +03:00
|
|
|
|
|
|
|
nsIBrowserDOMWindow* GetBrowserDOMWindow() const { return mBrowserDOMWindow; }
|
|
|
|
|
2016-04-27 22:40:36 +03:00
|
|
|
already_AddRefed<nsPIDOMWindowOuter> GetParentWindowOuter();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-30 01:14:17 +03:00
|
|
|
already_AddRefed<nsIWidget> GetTopLevelWidget();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-30 01:14:17 +03:00
|
|
|
// Returns the closest widget for our frameloader's content.
|
|
|
|
already_AddRefed<nsIWidget> GetWidget() const;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-30 01:14:17 +03:00
|
|
|
// Returns the top-level widget for our frameloader's document.
|
|
|
|
already_AddRefed<nsIWidget> GetDocWidget() const;
|
|
|
|
|
|
|
|
nsIXULBrowserWindow* GetXULBrowserWindow();
|
|
|
|
|
|
|
|
/**
|
2019-05-31 06:27:26 +03:00
|
|
|
* Return the top level DocAccessibleParent for this BrowserParent.
|
|
|
|
* Note that in the case of an out-of-process iframe, the returned actor
|
|
|
|
* might not be at the top level of the DocAccessibleParent tree; i.e. it
|
|
|
|
* might have a parent. However, it will be at the top level in its content
|
|
|
|
* process. That is, doc->IsTopLevelInContentProcess() will always be true,
|
|
|
|
* but doc->IsTopLevel() might not.
|
2019-04-30 01:14:17 +03:00
|
|
|
*/
|
|
|
|
a11y::DocAccessibleParent* GetTopLevelDocAccessible() const;
|
|
|
|
|
|
|
|
layout::RenderFrame* GetRenderFrame();
|
|
|
|
|
2019-05-15 18:34:03 +03:00
|
|
|
// Returns the BrowserBridgeParent if this BrowserParent is for an
|
|
|
|
// out-of-process iframe and nullptr otherwise.
|
|
|
|
BrowserBridgeParent* GetBrowserBridgeParent() const;
|
|
|
|
|
|
|
|
// Returns the BrowserHost if this BrowserParent is for a top-level browser
|
|
|
|
// and nullptr otherwise.
|
|
|
|
BrowserHost* GetBrowserHost() const;
|
|
|
|
|
2019-04-30 01:14:17 +03:00
|
|
|
ShowInfo GetShowInfo();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Let managees query if Destroy() is already called so they don't send out
|
|
|
|
* messages when the PBrowser actor is being destroyed.
|
|
|
|
*/
|
|
|
|
bool IsDestroyed() const { return mIsDestroyed; }
|
|
|
|
|
2019-06-04 19:19:27 +03:00
|
|
|
/**
|
|
|
|
* Returns whether we're in the process of creating a new window (from
|
|
|
|
* window.open). If so, LoadURL calls are being skipped until everything is
|
|
|
|
* set up. For further details, see `mCreatingWindow` below.
|
|
|
|
*/
|
|
|
|
bool CreatingWindow() const { return mCreatingWindow; }
|
|
|
|
|
2019-05-07 19:08:22 +03:00
|
|
|
/*
|
|
|
|
* Visit each BrowserParent in the tree formed by PBrowser and
|
|
|
|
* PBrowserBridge, including `this`.
|
|
|
|
*/
|
|
|
|
template <typename Callback>
|
|
|
|
void VisitAll(Callback aCallback) {
|
|
|
|
aCallback(this);
|
|
|
|
VisitAllDescendants(aCallback);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Visit each BrowserParent in the tree formed by PBrowser and
|
|
|
|
* PBrowserBridge, excluding `this`.
|
|
|
|
*/
|
|
|
|
template <typename Callback>
|
|
|
|
void VisitAllDescendants(Callback aCallback) {
|
|
|
|
const auto& browserBridges = ManagedPBrowserBridgeParent();
|
|
|
|
for (auto iter = browserBridges.ConstIter(); !iter.Done(); iter.Next()) {
|
|
|
|
BrowserBridgeParent* browserBridge =
|
|
|
|
static_cast<BrowserBridgeParent*>(iter.Get()->GetKey());
|
|
|
|
BrowserParent* browserParent = browserBridge->GetBrowserParent();
|
|
|
|
|
|
|
|
aCallback(browserParent);
|
|
|
|
browserParent->VisitAllDescendants(aCallback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Visit each BrowserBridgeParent that is a child of this BrowserParent.
|
|
|
|
*/
|
|
|
|
template <typename Callback>
|
|
|
|
void VisitChildren(Callback aCallback) {
|
|
|
|
const auto& browserBridges = ManagedPBrowserBridgeParent();
|
|
|
|
for (auto iter = browserBridges.ConstIter(); !iter.Done(); iter.Next()) {
|
|
|
|
BrowserBridgeParent* browserBridge =
|
|
|
|
static_cast<BrowserBridgeParent*>(iter.Get()->GetKey());
|
|
|
|
aCallback(browserBridge);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-30 01:14:17 +03:00
|
|
|
void SetOwnerElement(Element* aElement);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserDOMWindow) {
|
|
|
|
mBrowserDOMWindow = aBrowserDOMWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetHasContentOpener(bool aHasContentOpener);
|
|
|
|
|
|
|
|
void SwapFrameScriptsFrom(nsTArray<FrameScriptInfo>& aFrameScripts) {
|
|
|
|
aFrameScripts.SwapElements(mDelayedFrameScripts);
|
|
|
|
}
|
|
|
|
|
2019-04-30 01:14:17 +03:00
|
|
|
void CacheFrameLoader(nsFrameLoader* aFrameLoader);
|
2018-10-20 03:02:37 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void Destroy();
|
|
|
|
|
|
|
|
void RemoveWindowListeners();
|
|
|
|
|
|
|
|
void AddWindowListeners();
|
2015-10-30 02:30:57 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvMoveFocus(const bool& aForward,
|
|
|
|
const bool& aForDocumentNavigation);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSizeShellTo(const uint32_t& aFlags,
|
|
|
|
const int32_t& aWidth,
|
|
|
|
const int32_t& aHeight,
|
|
|
|
const int32_t& aShellItemWidth,
|
|
|
|
const int32_t& aShellItemHeight);
|
2016-05-11 12:44:57 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDropLinks(nsTArray<nsString>&& aLinks);
|
2015-11-11 01:35:12 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvEvent(const RemoteDOMEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvReplyKeyEvent(const WidgetKeyboardEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccessKeyNotHandled(
|
|
|
|
const WidgetKeyboardEvent& aEvent);
|
2016-05-11 15:56:42 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetHasBeforeUnload(const bool& aHasBeforeUnload);
|
2017-04-14 00:54:07 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRegisterProtocolHandler(const nsString& aScheme,
|
|
|
|
nsIURI* aHandlerURI,
|
|
|
|
const nsString& aTitle,
|
|
|
|
nsIURI* aDocURI);
|
2018-12-13 16:47:39 +03:00
|
|
|
|
2019-05-23 21:49:08 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOnStateChange(
|
|
|
|
const Maybe<WebProgressData>& awebProgressData,
|
|
|
|
const RequestData& aRequestData, const uint32_t aStateFlags,
|
|
|
|
const nsresult aStatus,
|
|
|
|
const Maybe<WebProgressStateChangeData>& aStateChangeData);
|
|
|
|
|
2019-04-03 20:32:41 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOnProgressChange(
|
|
|
|
const Maybe<WebProgressData>& aWebProgressData,
|
|
|
|
const RequestData& aRequestData, const int32_t aCurSelfProgress,
|
|
|
|
const int32_t aMaxSelfProgress, const int32_t aCurTotalProgres,
|
|
|
|
const int32_t aMaxTotalProgress);
|
|
|
|
|
2019-04-03 20:31:54 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOnStatusChange(
|
|
|
|
const Maybe<WebProgressData>& aWebProgressData,
|
|
|
|
const RequestData& aRequestData, const nsresult aStatus,
|
|
|
|
const nsString& aMessage);
|
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOnContentBlockingEvent(
|
2019-03-21 07:50:53 +03:00
|
|
|
const Maybe<WebProgressData>& aWebProgressData,
|
2019-02-06 18:58:43 +03:00
|
|
|
const RequestData& aRequestData, const uint32_t& aEvent);
|
2019-01-25 17:44:09 +03:00
|
|
|
|
2019-05-24 18:45:05 +03:00
|
|
|
bool GetWebProgressListener(nsIBrowser** aOutBrowser,
|
|
|
|
nsIWebProgress** aOutManager,
|
|
|
|
nsIWebProgressListener** aOutListener);
|
|
|
|
|
2019-04-03 20:31:41 +03:00
|
|
|
void ReconstructWebProgressAndRequest(
|
|
|
|
nsIWebProgress* aManager, const Maybe<WebProgressData>& aWebProgressData,
|
|
|
|
const RequestData& aRequestData,
|
|
|
|
nsCOMPtr<nsIWebProgress>& aOutWebProgress,
|
|
|
|
nsCOMPtr<nsIRequest>& aOutRequest);
|
|
|
|
|
2019-05-04 13:42:52 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSessionStoreUpdate(
|
|
|
|
const Maybe<nsCString>& aDocShellCaps, const Maybe<bool>& aPrivatedMode,
|
|
|
|
const nsTArray<nsCString>& aPositions,
|
2019-05-22 12:06:14 +03:00
|
|
|
const nsTArray<int32_t>& aPositionDescendants, const uint32_t& aFlushId,
|
|
|
|
const bool& aIsFinal);
|
2019-05-04 13:42:52 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvBrowserFrameOpenWindow(
|
2017-06-15 20:28:11 +03:00
|
|
|
PBrowserParent* aOpener, const nsString& aURL, const nsString& aName,
|
2019-04-25 02:50:40 +03:00
|
|
|
bool aForceNoReferrer, const nsString& aFeatures,
|
|
|
|
BrowserFrameOpenWindowResolver&& aResolve);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSyncMessage(
|
2016-01-05 12:59:30 +03:00
|
|
|
const nsString& aMessage, const ClonedMessageData& aData,
|
2019-04-25 17:18:11 +03:00
|
|
|
InfallibleTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
|
2019-02-06 18:58:43 +03:00
|
|
|
nsTArray<ipc::StructuredCloneData>* aRetVal);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRpcMessage(
|
2016-01-05 12:59:30 +03:00
|
|
|
const nsString& aMessage, const ClonedMessageData& aData,
|
2019-04-25 17:18:11 +03:00
|
|
|
InfallibleTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
|
2019-02-06 18:58:43 +03:00
|
|
|
nsTArray<ipc::StructuredCloneData>* aRetVal);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMessage,
|
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
2019-04-25 17:18:11 +03:00
|
|
|
nsIPrincipal* aPrincipal,
|
2019-02-06 18:58:43 +03:00
|
|
|
const ClonedMessageData& aData);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyIMEFocus(
|
2016-01-05 12:59:30 +03:00
|
|
|
const ContentCache& aContentCache,
|
|
|
|
const widget::IMENotification& aEventMessage,
|
2019-02-06 18:58:43 +03:00
|
|
|
NotifyIMEFocusResolver&& aResolve);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyIMETextChange(
|
2016-01-05 12:59:30 +03:00
|
|
|
const ContentCache& aContentCache,
|
2019-02-06 18:58:43 +03:00
|
|
|
const widget::IMENotification& aEventMessage);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyIMECompositionUpdate(
|
2016-01-05 12:59:30 +03:00
|
|
|
const ContentCache& aContentCache,
|
2019-02-06 18:58:43 +03:00
|
|
|
const widget::IMENotification& aEventMessage);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyIMESelection(
|
2016-01-05 12:59:30 +03:00
|
|
|
const ContentCache& aContentCache,
|
2019-02-06 18:58:43 +03:00
|
|
|
const widget::IMENotification& aEventMessage);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateContentCache(
|
|
|
|
const ContentCache& aContentCache);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyIMEMouseButtonEvent(
|
|
|
|
const widget::IMENotification& aEventMessage, bool* aConsumedByIME);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyIMEPositionChange(
|
2016-01-05 12:59:30 +03:00
|
|
|
const ContentCache& aContentCache,
|
2019-02-06 18:58:43 +03:00
|
|
|
const widget::IMENotification& aEventMessage);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOnEventNeedingAckHandled(
|
|
|
|
const EventMessage& aMessage);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestIMEToCommitComposition(
|
|
|
|
const bool& aCancel, bool* aIsCommitted, nsString* aCommittedString);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvStartPluginIME(
|
2016-01-05 12:59:30 +03:00
|
|
|
const WidgetKeyboardEvent& aKeyboardEvent, const int32_t& aPanelX,
|
2019-02-06 18:58:43 +03:00
|
|
|
const int32_t& aPanelY, nsString* aCommitted);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetPluginFocused(const bool& aFocused);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetCandidateWindowForPlugin(
|
|
|
|
const widget::CandidateWindowPosition& aPosition);
|
|
|
|
mozilla::ipc::IPCResult RecvEnableIMEForPlugin(const bool& aEnable);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDefaultProcOfPluginEvent(
|
|
|
|
const WidgetPluginEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvGetInputContext(widget::IMEState* aIMEState);
|
2018-04-11 19:26:33 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetInputContext(
|
2018-06-19 23:31:24 +03:00
|
|
|
const widget::InputContext& aContext,
|
2019-02-06 18:58:43 +03:00
|
|
|
const widget::InputContextAction& aAction);
|
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
|
|
|
|
|
|
|
// See nsIKeyEventInPluginCallback
|
|
|
|
virtual void HandledWindowedPluginKeyEvent(
|
|
|
|
const NativeEventData& aKeyEventData, bool aIsConsumed) override;
|
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOnWindowedPluginKeyEvent(
|
|
|
|
const NativeEventData& aKeyEventData);
|
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-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestFocus(const bool& aCanRaise);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvLookUpDictionary(
|
2016-11-15 06:26:00 +03:00
|
|
|
const nsString& aText, nsTArray<mozilla::FontRange>&& aFontRangeArray,
|
2019-02-06 18:58:43 +03:00
|
|
|
const bool& aIsVertical, const LayoutDeviceIntPoint& aPoint);
|
2016-04-26 11:18:04 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvEnableDisableCommands(
|
2016-01-05 12:59:30 +03:00
|
|
|
const nsString& aAction, nsTArray<nsCString>&& aEnabledCommands,
|
2019-02-06 18:58:43 +03:00
|
|
|
nsTArray<nsCString>&& aDisabledCommands);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetCursor(
|
2019-01-15 16:56:52 +03:00
|
|
|
const nsCursor& aValue, const bool& aHasCustomCursor,
|
|
|
|
const nsCString& aUri, const uint32_t& aWidth, const uint32_t& aHeight,
|
|
|
|
const uint32_t& aStride, const gfx::SurfaceFormat& aFormat,
|
2019-02-14 00:02:55 +03:00
|
|
|
const uint32_t& aHotspotX, const uint32_t& aHotspotY, const bool& aForce);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-14 00:02:55 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetStatus(const uint32_t& aType,
|
|
|
|
const nsString& aStatus);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvShowTooltip(const uint32_t& aX,
|
|
|
|
const uint32_t& aY,
|
|
|
|
const nsString& aTooltip,
|
|
|
|
const nsString& aDirection);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvHideTooltip();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetNativeChildOfShareableWindow(
|
|
|
|
const uintptr_t& childWindow);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDispatchFocusToTopLevelWindow();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRespondStartSwipeEvent(
|
|
|
|
const uint64_t& aInputBlockId, const bool& aStartSwipe);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDispatchWheelEvent(
|
|
|
|
const mozilla::WidgetWheelEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDispatchMouseEvent(
|
|
|
|
const mozilla::WidgetMouseEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDispatchKeyboardEvent(
|
|
|
|
const mozilla::WidgetKeyboardEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PColorPickerParent* AllocPColorPickerParent(const nsString& aTitle,
|
|
|
|
const nsString& aInitialColor);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
bool DeallocPColorPickerParent(PColorPickerParent* aColorPicker);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PDocAccessibleParent* AllocPDocAccessibleParent(PDocAccessibleParent*,
|
|
|
|
const uint64_t&,
|
|
|
|
const uint32_t&,
|
|
|
|
const IAccessibleHolder&);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
bool DeallocPDocAccessibleParent(PDocAccessibleParent*);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPDocAccessibleConstructor(
|
2016-01-05 12:59:30 +03:00
|
|
|
PDocAccessibleParent* aDoc, PDocAccessibleParent* aParentDoc,
|
2016-10-27 22:16:24 +03:00
|
|
|
const uint64_t& aParentID, const uint32_t& aMsaaID,
|
2016-12-02 02:28:54 +03:00
|
|
|
const IAccessibleHolder& aDocCOMProxy) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PWindowGlobalParent* AllocPWindowGlobalParent(const WindowGlobalInit& aInit);
|
2018-08-30 01:21:25 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
bool DeallocPWindowGlobalParent(PWindowGlobalParent* aActor);
|
2018-08-30 01:21:25 +03:00
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvPWindowGlobalConstructor(
|
|
|
|
PWindowGlobalParent* aActor, const WindowGlobalInit& aInit) override;
|
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
PBrowserBridgeParent* AllocPBrowserBridgeParent(
|
2019-03-14 21:50:47 +03:00
|
|
|
const nsString& aPresentationURL, const nsString& aRemoteType,
|
2019-04-09 00:22:58 +03:00
|
|
|
BrowsingContext* aBrowsingContext, const uint32_t& aChromeFlags);
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
bool DeallocPBrowserBridgeParent(PBrowserBridgeParent* aActor);
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPBrowserBridgeConstructor(
|
|
|
|
PBrowserBridgeParent* aActor, const nsString& aPresentationURL,
|
2019-04-09 00:22:58 +03:00
|
|
|
const nsString& aRemoteType, BrowsingContext* aBrowsingContext,
|
|
|
|
const uint32_t& aChromeFlags) override;
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void LoadURL(nsIURI* aURI);
|
|
|
|
|
2019-04-17 03:53:28 +03:00
|
|
|
void ResumeLoad(uint64_t aPendingSwitchID);
|
|
|
|
|
2018-11-07 00:15:07 +03:00
|
|
|
void InitRendering();
|
2018-11-05 22:56:29 +03:00
|
|
|
void MaybeShowFrame();
|
2017-01-17 23:52:45 +03:00
|
|
|
|
2019-04-25 06:36:27 +03:00
|
|
|
bool Show(const ScreenIntSize& aSize, bool aParentIsActive);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
void UpdateDimensions(const nsIntRect& aRect, const ScreenIntSize& aSize);
|
2017-06-07 21:36:46 +03:00
|
|
|
|
|
|
|
DimensionInfo GetDimensionInfo();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-09-20 21:03:58 +03:00
|
|
|
nsresult UpdatePosition();
|
|
|
|
|
2016-02-23 19:10:00 +03:00
|
|
|
void SizeModeChanged(const nsSizeMode& aSizeMode);
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void ThemeChanged();
|
|
|
|
|
2016-05-11 15:56:42 +03:00
|
|
|
void HandleAccessKey(const WidgetKeyboardEvent& aEvent,
|
2017-07-06 11:36:19 +03:00
|
|
|
nsTArray<uint32_t>& aCharCodes);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
void Activate();
|
|
|
|
|
2019-05-27 18:09:53 +03:00
|
|
|
void Deactivate();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent);
|
|
|
|
|
|
|
|
void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset,
|
|
|
|
mozilla::WidgetEvent* aEvent);
|
|
|
|
|
|
|
|
LayoutDeviceToCSSScale GetLayoutDeviceToCSSScale();
|
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestNativeKeyBindings(
|
2017-05-19 12:46:02 +03:00
|
|
|
const uint32_t& aType, const mozilla::WidgetKeyboardEvent& aEvent,
|
2019-02-06 18:58:43 +03:00
|
|
|
nsTArray<mozilla::CommandInt>* aCommands);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSynthesizeNativeKeyEvent(
|
2016-01-05 12:59:30 +03:00
|
|
|
const int32_t& aNativeKeyboardLayout, const int32_t& aNativeKeyCode,
|
|
|
|
const uint32_t& aModifierFlags, const nsString& aCharacters,
|
2019-02-06 18:58:43 +03:00
|
|
|
const nsString& aUnmodifiedCharacters, const uint64_t& aObserverId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSynthesizeNativeMouseEvent(
|
2016-01-05 12:59:30 +03:00
|
|
|
const LayoutDeviceIntPoint& aPoint, const uint32_t& aNativeMessage,
|
2019-02-06 18:58:43 +03:00
|
|
|
const uint32_t& aModifierFlags, const uint64_t& aObserverId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSynthesizeNativeMouseMove(
|
|
|
|
const LayoutDeviceIntPoint& aPoint, const uint64_t& aObserverId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSynthesizeNativeMouseScrollEvent(
|
2016-01-05 12:59:30 +03:00
|
|
|
const LayoutDeviceIntPoint& aPoint, const uint32_t& aNativeMessage,
|
|
|
|
const double& aDeltaX, const double& aDeltaY, const double& aDeltaZ,
|
|
|
|
const uint32_t& aModifierFlags, const uint32_t& aAdditionalFlags,
|
2019-02-06 18:58:43 +03:00
|
|
|
const uint64_t& aObserverId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSynthesizeNativeTouchPoint(
|
2016-01-05 12:59:30 +03:00
|
|
|
const uint32_t& aPointerId, const TouchPointerState& aPointerState,
|
2016-04-15 13:39:36 +03:00
|
|
|
const LayoutDeviceIntPoint& aPoint, const double& aPointerPressure,
|
2019-02-06 18:58:43 +03:00
|
|
|
const uint32_t& aPointerOrientation, const uint64_t& aObserverId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSynthesizeNativeTouchTap(
|
2016-04-15 13:39:36 +03:00
|
|
|
const LayoutDeviceIntPoint& aPoint, const bool& aLongTap,
|
2019-02-06 18:58:43 +03:00
|
|
|
const uint64_t& aObserverId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvClearNativeTouchSequence(
|
|
|
|
const uint64_t& aObserverId);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetPrefersReducedMotionOverrideForTest(
|
|
|
|
const bool& aValue);
|
|
|
|
mozilla::ipc::IPCResult RecvResetPrefersReducedMotionOverrideForTest();
|
2018-09-15 04:00:07 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void SendMouseEvent(const nsAString& aType, float aX, float aY,
|
|
|
|
int32_t aButton, int32_t aClickCount, int32_t aModifiers,
|
|
|
|
bool aIgnoreRootScrollFrame);
|
|
|
|
|
2017-07-05 12:59:44 +03:00
|
|
|
/**
|
|
|
|
* The following Send*Event() marks aEvent as posted to remote process if
|
|
|
|
* it succeeded. So, you can check the result with
|
|
|
|
* aEvent.HasBeenPostedToRemoteProcess().
|
|
|
|
*/
|
|
|
|
void SendRealMouseEvent(WidgetMouseEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-07-05 12:59:44 +03:00
|
|
|
void SendRealDragEvent(WidgetDragEvent& aEvent, uint32_t aDragAction,
|
2019-04-25 17:18:11 +03:00
|
|
|
uint32_t aDropEffect, nsIPrincipal* aPrincipal);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-07-05 12:59:44 +03:00
|
|
|
void SendMouseWheelEvent(WidgetWheelEvent& aEvent);
|
|
|
|
|
|
|
|
void SendRealKeyEvent(WidgetKeyboardEvent& aEvent);
|
|
|
|
|
|
|
|
void SendRealTouchEvent(WidgetTouchEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-07-05 12:59:44 +03:00
|
|
|
void SendPluginEvent(WidgetPluginEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-07-05 12:59:44 +03:00
|
|
|
/**
|
|
|
|
* Different from above Send*Event(), these methods return true if the
|
|
|
|
* event has been posted to the remote process or failed to do that but
|
|
|
|
* shouldn't be handled by following event listeners.
|
|
|
|
* If you need to check if it's actually posted to the remote process,
|
|
|
|
* you can refer aEvent.HasBeenPostedToRemoteProcess().
|
|
|
|
*/
|
|
|
|
bool SendCompositionEvent(mozilla::WidgetCompositionEvent& aEvent);
|
|
|
|
|
|
|
|
bool SendSelectionEvent(mozilla::WidgetSelectionEvent& aEvent);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-09-21 17:26:33 +03:00
|
|
|
bool SendHandleTap(TapType aType, const LayoutDevicePoint& aPoint,
|
|
|
|
Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
|
|
|
|
uint64_t aInputBlockId);
|
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PFilePickerParent* AllocPFilePickerParent(const nsString& aTitle,
|
|
|
|
const int16_t& aMode);
|
2015-01-16 21:07:50 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
bool DeallocPFilePickerParent(PFilePickerParent* actor);
|
2015-01-16 21:07:50 +03:00
|
|
|
|
2019-03-22 22:14:01 +03:00
|
|
|
mozilla::ipc::IPCResult RecvIndexedDBPermissionRequest(
|
2019-04-25 17:18:11 +03:00
|
|
|
nsIPrincipal* aPrincipal, IndexedDBPermissionRequestResolver&& aResolve);
|
2015-04-08 21:48:11 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
|
2015-08-06 00:25:39 +03:00
|
|
|
|
2018-04-09 23:30:33 +03:00
|
|
|
void StartPersistence(uint64_t aOuterWindowID,
|
|
|
|
nsIWebBrowserPersistDocumentReceiver* aRecv,
|
|
|
|
ErrorResult& aRv);
|
2015-10-02 15:25:22 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool HandleQueryContentEvent(mozilla::WidgetQueryContentEvent& aEvent);
|
|
|
|
|
2016-08-31 04:30:45 +03:00
|
|
|
bool SendPasteTransferable(const IPCDataTransfer& aDataTransfer,
|
|
|
|
const bool& aIsPrivateData,
|
2019-04-25 17:18:11 +03:00
|
|
|
nsIPrincipal* aRequestingPrincipal,
|
2018-03-14 11:44:36 +03:00
|
|
|
const uint32_t& aContentPolicyType);
|
2016-08-31 04:30:45 +03:00
|
|
|
|
2019-03-04 20:35:47 +03:00
|
|
|
// Helper for transforming a point
|
|
|
|
LayoutDeviceIntPoint TransformPoint(
|
|
|
|
const LayoutDeviceIntPoint& aPoint,
|
|
|
|
const LayoutDeviceToLayoutDeviceMatrix4x4& aMatrix);
|
|
|
|
LayoutDevicePoint TransformPoint(
|
|
|
|
const LayoutDevicePoint& aPoint,
|
|
|
|
const LayoutDeviceToLayoutDeviceMatrix4x4& aMatrix);
|
|
|
|
|
|
|
|
// Transform a coordinate from the parent process coordinate space to the
|
|
|
|
// child process coordinate space.
|
|
|
|
LayoutDeviceIntPoint TransformParentToChild(
|
|
|
|
const LayoutDeviceIntPoint& aPoint);
|
|
|
|
LayoutDevicePoint TransformParentToChild(const LayoutDevicePoint& aPoint);
|
|
|
|
|
|
|
|
// Transform a coordinate from the child process coordinate space to the
|
|
|
|
// parent process coordinate space.
|
|
|
|
LayoutDeviceIntPoint TransformChildToParent(
|
|
|
|
const LayoutDeviceIntPoint& aPoint);
|
|
|
|
LayoutDevicePoint TransformChildToParent(const LayoutDevicePoint& aPoint);
|
|
|
|
LayoutDeviceIntRect TransformChildToParent(const LayoutDeviceIntRect& aRect);
|
|
|
|
|
|
|
|
// Returns the matrix that transforms event coordinates from the coordinate
|
|
|
|
// space of the child process to the coordinate space of the parent process.
|
|
|
|
LayoutDeviceToLayoutDeviceMatrix4x4 GetChildToParentConversionMatrix();
|
|
|
|
|
2019-03-09 23:33:17 +03:00
|
|
|
void SetChildToParentConversionMatrix(
|
|
|
|
const LayoutDeviceToLayoutDeviceMatrix4x4& aMatrix);
|
|
|
|
|
2017-07-14 01:33:25 +03:00
|
|
|
// Returns the offset from the origin of our frameloader's nearest widget to
|
|
|
|
// the origin of its layout frame. This offset is used to translate event
|
|
|
|
// coordinates relative to the PuppetWidget origin in the child process.
|
2019-03-04 20:35:47 +03:00
|
|
|
//
|
|
|
|
// GOING AWAY. PLEASE AVOID ADDING CALLERS. Use the above tranformation
|
|
|
|
// methods instead.
|
2016-01-05 12:59:30 +03:00
|
|
|
LayoutDeviceIntPoint GetChildProcessOffset();
|
2017-07-14 01:31:55 +03:00
|
|
|
|
|
|
|
// Returns the offset from the on-screen origin of our top-level window's
|
|
|
|
// widget (including window decorations) to the origin of our frameloader's
|
|
|
|
// nearest widget. This offset is used to translate coordinates from the
|
|
|
|
// PuppetWidget's origin to absolute screen coordinates in the child.
|
|
|
|
LayoutDeviceIntPoint GetClientOffset();
|
|
|
|
|
2019-05-06 15:00:03 +03:00
|
|
|
void StopIMEStateManagement();
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
|
|
|
* Native widget remoting protocol for use with windowed plugins with e10s.
|
|
|
|
*/
|
2019-02-06 18:58:07 +03:00
|
|
|
PPluginWidgetParent* AllocPPluginWidgetParent();
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
bool DeallocPPluginWidgetParent(PPluginWidgetParent* aActor);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PPaymentRequestParent* AllocPPaymentRequestParent();
|
2017-05-25 20:50:32 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
bool DeallocPPaymentRequestParent(PPaymentRequestParent* aActor);
|
2017-05-25 20:50:32 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool SendLoadRemoteScript(const nsString& aURL,
|
|
|
|
const bool& aRunInGlobalScope);
|
|
|
|
|
2018-07-30 16:24:50 +03:00
|
|
|
void LayerTreeUpdate(const LayersObserverEpoch& aEpoch, bool aActive);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2018-09-25 05:48:02 +03:00
|
|
|
void RequestRootPaint(gfx::CrossProcessPaint* aPaint, IntRect aRect,
|
|
|
|
float aScale, nscolor aBackgroundColor);
|
|
|
|
void RequestSubPaint(gfx::CrossProcessPaint* aPaint, float aScale,
|
|
|
|
nscolor aBackgroundColor);
|
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInvokeDragSession(
|
2016-01-05 12:59:30 +03:00
|
|
|
nsTArray<IPCDataTransfer>&& aTransfers, const uint32_t& aAction,
|
2019-03-21 07:52:48 +03:00
|
|
|
Maybe<Shmem>&& aVisualDnDData, const uint32_t& aStride,
|
2018-04-10 18:53:44 +03:00
|
|
|
const gfx::SurfaceFormat& aFormat, const LayoutDeviceIntRect& aDragRect,
|
2019-04-25 17:18:11 +03:00
|
|
|
nsIPrincipal* aPrincipal);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2018-02-09 04:43:53 +03:00
|
|
|
void AddInitialDnDDataTo(DataTransfer* aDataTransfer,
|
2019-01-04 06:16:46 +03:00
|
|
|
nsIPrincipal** aPrincipal);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-10-19 22:01:39 +03:00
|
|
|
bool TakeDragVisualization(RefPtr<mozilla::gfx::SourceSurface>& aSurface,
|
|
|
|
LayoutDeviceIntRect* aDragRect);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-04-10 00:31:24 +03:00
|
|
|
mozilla::ipc::IPCResult RecvEnsureLayersConnected(
|
2019-02-06 18:58:43 +03:00
|
|
|
CompositorOptions* aCompositorOptions);
|
2016-09-20 11:19:32 +03:00
|
|
|
|
2017-02-01 18:38:16 +03:00
|
|
|
// LiveResizeListener implementation
|
|
|
|
void LiveResizeStarted() override;
|
|
|
|
void LiveResizeStopped() override;
|
|
|
|
|
2017-03-21 10:44:12 +03:00
|
|
|
void SetReadyToHandleInputEvents() { mIsReadyToHandleInputEvents = true; }
|
|
|
|
bool IsReadyToHandleInputEvents() { return mIsReadyToHandleInputEvents; }
|
|
|
|
|
2018-11-05 19:52:03 +03:00
|
|
|
void NavigateByKey(bool aForward, bool aForDocumentNavigation);
|
|
|
|
|
2019-04-04 01:40:28 +03:00
|
|
|
void SkipBrowsingContextDetach();
|
|
|
|
|
2019-05-08 23:47:18 +03:00
|
|
|
bool GetDocShellIsActive();
|
|
|
|
void SetDocShellIsActive(bool aDocShellIsActive);
|
|
|
|
|
|
|
|
bool GetHasPresented();
|
|
|
|
bool GetHasLayers();
|
|
|
|
bool GetRenderLayers();
|
|
|
|
void SetRenderLayers(bool aRenderLayers);
|
|
|
|
void PreserveLayers(bool aPreserveLayers);
|
|
|
|
void ForceRepaint();
|
|
|
|
void NotifyResolutionChanged();
|
|
|
|
|
|
|
|
void Deprioritize();
|
|
|
|
|
|
|
|
bool GetHasContentOpener();
|
|
|
|
bool GetHasBeforeUnload();
|
|
|
|
|
|
|
|
bool StartApzAutoscroll(float aAnchorX, float aAnchorY, nsViewID aScrollId,
|
|
|
|
uint32_t aPresShellId);
|
|
|
|
void StopApzAutoscroll(nsViewID aScrollId, uint32_t aPresShellId);
|
2019-05-08 22:34:47 +03:00
|
|
|
|
2009-11-05 21:14:22 +03:00
|
|
|
protected:
|
2019-05-15 18:34:03 +03:00
|
|
|
friend BrowserBridgeParent;
|
|
|
|
friend BrowserHost;
|
|
|
|
|
|
|
|
void SetBrowserBridgeParent(BrowserBridgeParent* aBrowser);
|
|
|
|
void SetBrowserHost(BrowserHost* aBrowser);
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool ReceiveMessage(
|
|
|
|
const nsString& aMessage, bool aSync, ipc::StructuredCloneData* aData,
|
|
|
|
mozilla::jsipc::CpowHolder* aCpows, nsIPrincipal* aPrincipal,
|
|
|
|
nsTArray<ipc::StructuredCloneData>* aJSONRetVal = nullptr);
|
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAsyncAuthPrompt(const nsCString& aUri,
|
|
|
|
const nsString& aRealm,
|
|
|
|
const uint64_t& aCallbackId);
|
2010-03-30 00:29:45 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult Recv__delete__() override;
|
2014-06-11 09:44:36 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) override;
|
2012-07-17 22:27:27 +04:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRemotePaintIsReady();
|
2014-05-23 22:19:00 +04:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyCompositorTransaction();
|
2018-10-25 23:23:46 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRemoteIsReadyToHandleInputEvents();
|
2017-03-21 10:44:12 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvPaintWhileInterruptingJSNoOp(
|
|
|
|
const LayersObserverEpoch& aEpoch);
|
2016-07-23 02:36:45 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetDimensions(const uint32_t& aFlags,
|
|
|
|
const int32_t& aX,
|
|
|
|
const int32_t& aY,
|
|
|
|
const int32_t& aCx,
|
|
|
|
const int32_t& aCy);
|
2015-01-13 03:41:53 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvShowCanvasPermissionPrompt(
|
2019-05-17 16:23:04 +03:00
|
|
|
const nsCString& aOrigin, const bool& aHideDoorHanger);
|
2016-10-14 10:31:02 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetSystemFont(const nsCString& aFontName);
|
|
|
|
mozilla::ipc::IPCResult RecvGetSystemFont(nsCString* aFontName);
|
2018-08-07 05:58:36 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvVisitURI(const URIParams& aURI,
|
2019-03-06 17:05:50 +03:00
|
|
|
const Maybe<URIParams>& aLastVisitedURI,
|
2019-02-06 18:58:43 +03:00
|
|
|
const uint32_t& aFlags);
|
2018-11-16 20:29:57 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvQueryVisitedState(
|
|
|
|
InfallibleTArray<URIParams>&& aURIs);
|
2018-11-16 20:32:02 +03:00
|
|
|
|
2010-08-06 02:11:23 +04:00
|
|
|
private:
|
2018-11-05 19:52:03 +03:00
|
|
|
void SuppressDisplayport(bool aEnabled);
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void DestroyInternal();
|
|
|
|
|
2018-05-15 09:45:00 +03:00
|
|
|
void SetRenderLayersInternal(bool aEnabled, bool aForceRepaint);
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
already_AddRefed<nsFrameLoader> GetFrameLoader(
|
|
|
|
bool aUseCachedFrameLoaderAfterDestroy = false) const;
|
|
|
|
|
|
|
|
void TryCacheDPIAndScale();
|
|
|
|
|
|
|
|
bool AsyncPanZoomEnabled() const;
|
|
|
|
|
|
|
|
// Update state prior to routing an APZ-aware event to the child process.
|
|
|
|
// |aOutTargetGuid| will contain the identifier
|
|
|
|
// of the APZC instance that handled the event. aOutTargetGuid may be null.
|
|
|
|
// |aOutInputBlockId| will contain the identifier of the input block
|
|
|
|
// that this event was added to, if there was one. aOutInputBlockId may be
|
|
|
|
// null. |aOutApzResponse| will contain the response that the APZ gave when
|
|
|
|
// processing the input block; this is used for generating appropriate
|
|
|
|
// pointercancel events.
|
|
|
|
void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
|
|
|
|
uint64_t* aOutInputBlockId,
|
|
|
|
nsEventStatus* aOutApzResponse);
|
|
|
|
|
2019-04-30 00:33:21 +03:00
|
|
|
// When dropping links we perform a roundtrip from
|
|
|
|
// Parent (SendRealDragEvent) -> Child -> Parent (RecvDropLinks)
|
|
|
|
// and have to ensure that the child did not modify links to be loaded.
|
|
|
|
bool QueryDropLinksForVerification();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// This is used when APZ needs to find the BrowserParent associated with a
|
|
|
|
// layer to dispatch events.
|
|
|
|
typedef nsDataHashtable<nsUint64HashKey, BrowserParent*>
|
|
|
|
LayerToBrowserParentTable;
|
|
|
|
static LayerToBrowserParentTable* sLayerToBrowserParentTable;
|
|
|
|
|
|
|
|
static void AddBrowserParentToTable(layers::LayersId aLayersId,
|
|
|
|
BrowserParent* aBrowserParent);
|
|
|
|
|
|
|
|
static void RemoveBrowserParentFromTable(layers::LayersId aLayersId);
|
|
|
|
|
|
|
|
// Keeps track of which BrowserParent has keyboard focus
|
|
|
|
static StaticAutoPtr<nsTArray<BrowserParent*>> sFocusStack;
|
|
|
|
|
|
|
|
static void PushFocus(BrowserParent* aBrowserParent);
|
|
|
|
|
|
|
|
static void PopFocus(BrowserParent* aBrowserParent);
|
|
|
|
|
2019-04-30 00:50:29 +03:00
|
|
|
TabId mTabId;
|
|
|
|
|
|
|
|
RefPtr<ContentParent> mManager;
|
|
|
|
// The root browsing context loaded in this BrowserParent.
|
|
|
|
RefPtr<CanonicalBrowsingContext> mBrowsingContext;
|
|
|
|
nsCOMPtr<nsILoadContext> mLoadContext;
|
2019-05-21 17:14:57 +03:00
|
|
|
RefPtr<Element> mFrameElement;
|
2019-04-30 00:50:29 +03:00
|
|
|
nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
|
|
|
|
// We keep a strong reference to the frameloader after we've sent the
|
|
|
|
// Destroy message and before we've received __delete__. This allows us to
|
|
|
|
// dispatch message manager messages during this time.
|
|
|
|
RefPtr<nsFrameLoader> mFrameLoader;
|
|
|
|
uint32_t mChromeFlags;
|
|
|
|
|
|
|
|
// Pointer back to BrowserBridgeParent if there is one associated with
|
|
|
|
// this BrowserParent. This is non-owning to avoid cycles and is managed
|
|
|
|
// by the BrowserBridgeParent instance, which has the strong reference
|
|
|
|
// to this BrowserParent.
|
|
|
|
BrowserBridgeParent* mBrowserBridgeParent;
|
2019-05-15 18:34:03 +03:00
|
|
|
// Pointer to the BrowserHost that owns us, if any. This is mutually
|
|
|
|
// exclusive with mBrowserBridgeParent, and one is guaranteed to be
|
|
|
|
// non-null.
|
|
|
|
BrowserHost* mBrowserHost;
|
2019-04-30 00:50:29 +03:00
|
|
|
|
2019-04-30 00:33:21 +03:00
|
|
|
ContentCacheInParent mContentCache;
|
|
|
|
|
2019-04-30 00:50:29 +03:00
|
|
|
layout::RenderFrame mRenderFrame;
|
|
|
|
LayersObserverEpoch mLayerTreeEpoch;
|
|
|
|
|
|
|
|
Maybe<LayoutDeviceToLayoutDeviceMatrix4x4> mChildToParentConversionMatrix;
|
|
|
|
|
2019-04-30 00:33:21 +03:00
|
|
|
nsIntRect mRect;
|
|
|
|
ScreenIntSize mDimensions;
|
|
|
|
hal::ScreenOrientation mOrientation;
|
|
|
|
float mDPI;
|
|
|
|
int32_t mRounding;
|
|
|
|
CSSToLayoutDeviceScale mDefaultScale;
|
|
|
|
bool mUpdatedDimensions;
|
|
|
|
nsSizeMode mSizeMode;
|
|
|
|
LayoutDeviceIntPoint mClientOffset;
|
|
|
|
LayoutDeviceIntPoint mChromeOffset;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
// When loading a new tab or window via window.open, the child is
|
2019-04-10 01:39:01 +03:00
|
|
|
// responsible for loading the URL it wants into the new BrowserChild. When
|
|
|
|
// the parent receives the CreateWindow message, though, it sends a LoadURL
|
2016-01-05 12:59:30 +03:00
|
|
|
// message, usually for about:blank. It's important for the about:blank load
|
|
|
|
// to get processed because the Firefox frontend expects every new window to
|
|
|
|
// immediately start loading something (see bug 1123090). However, we want
|
|
|
|
// the child to process the LoadURL message before it returns from
|
|
|
|
// ProvideWindow so that the URL sent from the parent doesn't override the
|
|
|
|
// child's URL. This is not possible using our IPC mechanisms. To solve the
|
|
|
|
// problem, we skip sending the LoadURL message in the parent and instead
|
|
|
|
// return the URL as a result from CreateWindow. The child simulates
|
|
|
|
// receiving a LoadURL message before returning from ProvideWindow.
|
|
|
|
//
|
|
|
|
// The mCreatingWindow flag is set while dispatching CreateWindow. During
|
|
|
|
// that time, any LoadURL calls are skipped and the URL is stored in
|
|
|
|
// mSkippedURL.
|
|
|
|
bool mCreatingWindow;
|
|
|
|
nsCString mDelayedURL;
|
|
|
|
|
|
|
|
// When loading a new tab or window via window.open, we want to ensure that
|
|
|
|
// frame scripts for that tab are loaded before any scripts start to run in
|
|
|
|
// the window. We can't load the frame scripts the normal way, using
|
|
|
|
// separate IPC messages, since they won't be processed by the child until
|
|
|
|
// returning to the event loop, which is too late. Instead, we queue up
|
|
|
|
// frame scripts that we intend to load and send them as part of the
|
2019-04-10 01:39:01 +03:00
|
|
|
// CreateWindow response. Then BrowserChild loads them immediately.
|
2016-01-05 12:59:30 +03:00
|
|
|
nsTArray<FrameScriptInfo> mDelayedFrameScripts;
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// Cached cursor setting from BrowserChild. When the cursor is over the tab,
|
2016-01-05 12:59:30 +03:00
|
|
|
// it should take this appearance.
|
|
|
|
nsCursor mCursor;
|
|
|
|
nsCOMPtr<imgIContainer> mCustomCursor;
|
|
|
|
uint32_t mCustomCursorHotspotX, mCustomCursorHotspotY;
|
|
|
|
|
2017-08-22 11:07:03 +03:00
|
|
|
nsTArray<nsString> mVerifyDropLinks;
|
|
|
|
|
2016-02-26 18:52:06 +03:00
|
|
|
#ifdef DEBUG
|
2019-04-30 00:50:29 +03:00
|
|
|
int32_t mActiveSupressDisplayportCount = 0;
|
2016-02-26 18:52:06 +03:00
|
|
|
#endif
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2019-04-30 00:50:29 +03:00
|
|
|
// Cached value indicating the docshell active state of the remote browser.
|
|
|
|
bool mDocShellIsActive;
|
2016-07-23 02:36:45 +03:00
|
|
|
|
2019-04-30 00:50:29 +03:00
|
|
|
// When true, we've initiated normal shutdown and notified our managing
|
|
|
|
// PContent.
|
|
|
|
bool mMarkedDestroying;
|
|
|
|
// When true, the BrowserParent is invalid and we should not send IPC messages
|
|
|
|
// anymore.
|
|
|
|
bool mIsDestroyed;
|
|
|
|
// True if the cursor changes from the BrowserChild should change the widget
|
|
|
|
// cursor. This happens whenever the cursor is in the tab's region.
|
|
|
|
bool mTabSetsCursor;
|
|
|
|
|
|
|
|
bool mHasContentOpener;
|
2019-03-09 23:33:17 +03:00
|
|
|
|
2016-07-23 02:36:45 +03:00
|
|
|
// If this flag is set, then the tab's layers will be preserved even when
|
|
|
|
// the tab's docshell is inactive.
|
|
|
|
bool mPreserveLayers;
|
|
|
|
|
2017-11-07 23:08:47 +03:00
|
|
|
// Holds the most recent value passed to the RenderLayers function. This
|
|
|
|
// does not necessarily mean that the layers have finished rendering
|
|
|
|
// and have uploaded - for that, use mHasLayers.
|
2017-11-22 21:21:34 +03:00
|
|
|
bool mRenderLayers;
|
2017-11-03 17:27:05 +03:00
|
|
|
|
2018-10-01 20:05:32 +03:00
|
|
|
// Whether this is active for the ProcessPriorityManager or not.
|
|
|
|
bool mActiveInPriorityManager;
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// True if the compositor has reported that the BrowserChild has uploaded
|
2017-11-07 23:08:47 +03:00
|
|
|
// layers.
|
|
|
|
bool mHasLayers;
|
|
|
|
|
2019-04-10 00:38:15 +03:00
|
|
|
// True if this BrowserParent has had its layer tree sent to the compositor
|
2017-03-04 22:12:38 +03:00
|
|
|
// at least once.
|
|
|
|
bool mHasPresented;
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// True if at least one window hosted in the BrowserChild has added a
|
2017-04-14 00:54:07 +03:00
|
|
|
// beforeunload event listener.
|
|
|
|
bool mHasBeforeUnload;
|
|
|
|
|
2017-03-21 10:44:12 +03:00
|
|
|
// True when the remote browser is created and ready to handle input events.
|
|
|
|
bool mIsReadyToHandleInputEvents;
|
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
// True if we suppress the eMouseEnterIntoWidget event due to the BrowserChild
|
|
|
|
// was not ready to handle it. We will resend it when the next time we fire a
|
|
|
|
// mouse event and the BrowserChild is ready.
|
2017-07-24 05:46:40 +03:00
|
|
|
bool mIsMouseEnterIntoWidgetEventSuppressed;
|
|
|
|
|
2018-07-24 00:51:24 +03:00
|
|
|
// How many record/replay tabs have active docshells in this process.
|
|
|
|
static size_t gNumActiveRecordReplayTabs;
|
|
|
|
|
|
|
|
// Whether this tab is contributing to gNumActiveRecordReplayTabs.
|
|
|
|
bool mIsActiveRecordReplayTab;
|
|
|
|
|
|
|
|
// Update whether this is an active record/replay tab.
|
|
|
|
void SetIsActiveRecordReplayTab(bool aIsActive);
|
2009-07-01 00:39:22 +04:00
|
|
|
};
|
|
|
|
|
2019-04-10 00:38:15 +03:00
|
|
|
struct MOZ_STACK_CLASS BrowserParent::AutoUseNewTab final {
|
2015-10-30 02:30:57 +03:00
|
|
|
public:
|
2019-04-10 00:38:15 +03:00
|
|
|
AutoUseNewTab(BrowserParent* aNewTab, nsCString* aURLToLoad)
|
2017-04-17 01:52:02 +03:00
|
|
|
: mNewTab(aNewTab), mURLToLoad(aURLToLoad) {
|
2016-01-05 12:59:30 +03:00
|
|
|
MOZ_ASSERT(!aNewTab->mCreatingWindow);
|
|
|
|
|
|
|
|
aNewTab->mCreatingWindow = true;
|
|
|
|
aNewTab->mDelayedURL.Truncate();
|
|
|
|
}
|
|
|
|
|
|
|
|
~AutoUseNewTab() {
|
|
|
|
mNewTab->mCreatingWindow = false;
|
|
|
|
*mURLToLoad = mNewTab->mDelayedURL;
|
|
|
|
}
|
2015-10-30 02:30:57 +03:00
|
|
|
|
|
|
|
private:
|
2019-04-10 00:38:15 +03:00
|
|
|
BrowserParent* mNewTab;
|
2016-01-05 12:59:30 +03:00
|
|
|
nsCString* mURLToLoad;
|
2015-10-30 02:30:57 +03:00
|
|
|
};
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
} // namespace dom
|
2009-07-01 00:39:22 +04:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2019-04-30 00:23:05 +03:00
|
|
|
#endif // mozilla_dom_BrowserParent_h
|