2011-10-01 09:14:36 -07:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */
|
2009-08-18 12:05:15 -07:00
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
#ifndef mozilla_dom_TabChild_h
|
|
|
|
#define mozilla_dom_TabChild_h
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2010-07-19 11:33:33 -07:00
|
|
|
#include "mozilla/dom/PBrowserChild.h"
|
2009-06-30 13:39:22 -07:00
|
|
|
#include "nsIWebNavigation.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2009-11-05 10:14:22 -08:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIWebBrowserChrome2.h"
|
2012-06-09 15:15:12 -07:00
|
|
|
#include "nsIEmbeddingSiteWindow.h"
|
2009-11-05 10:14:22 -08:00
|
|
|
#include "nsIWebBrowserChromeFocus.h"
|
2009-11-17 06:22:23 -08:00
|
|
|
#include "nsIDOMEventListener.h"
|
2009-12-31 17:34:06 -08:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2009-12-31 17:35:55 -08:00
|
|
|
#include "nsIWindowProvider.h"
|
2010-02-20 09:05:20 -08:00
|
|
|
#include "nsIDOMWindow.h"
|
2010-03-03 12:30:25 -08:00
|
|
|
#include "nsIDocShell.h"
|
2013-09-23 14:30:40 -07:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2010-02-20 09:05:20 -08:00
|
|
|
#include "nsFrameMessageManager.h"
|
2012-09-28 19:18:18 -07:00
|
|
|
#include "nsIWebProgressListener.h"
|
2010-08-05 15:11:23 -07:00
|
|
|
#include "nsIPresShell.h"
|
2010-02-20 09:05:20 -08:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2010-03-26 11:39:39 -07:00
|
|
|
#include "nsWeakReference.h"
|
2010-05-13 10:44:51 -07:00
|
|
|
#include "nsITabChild.h"
|
2014-01-22 12:27:23 -08:00
|
|
|
#include "nsITooltipListener.h"
|
2012-06-14 19:31:55 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
#include "mozilla/dom/TabContext.h"
|
2014-03-31 23:13:50 -07:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2014-03-17 21:48:21 -07:00
|
|
|
#include "mozilla/EventDispatcher.h"
|
2013-09-25 04:21:16 -07:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-10-18 13:57:55 -07:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
2014-09-02 14:43:08 -07:00
|
|
|
#include "nsIWebBrowserChrome3.h"
|
2014-10-29 11:11:00 -07:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2013-02-15 14:27:21 -08:00
|
|
|
class nsICachedFileDescriptorListener;
|
2013-06-14 14:47:56 -07:00
|
|
|
class nsIDOMWindowUtils;
|
2010-03-24 03:47:18 -07:00
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
namespace mozilla {
|
2010-08-20 16:24:41 -07:00
|
|
|
namespace layout {
|
|
|
|
class RenderFrameChild;
|
|
|
|
}
|
|
|
|
|
2014-04-17 04:54:25 -07:00
|
|
|
namespace layers {
|
2014-04-09 12:16:16 -07:00
|
|
|
class ActiveElementManager;
|
|
|
|
}
|
|
|
|
|
2014-04-21 13:40:09 -07:00
|
|
|
namespace widget {
|
|
|
|
struct AutoCacheNativeKeyCommands;
|
|
|
|
}
|
|
|
|
|
2014-11-12 12:59:19 -08:00
|
|
|
namespace plugins {
|
|
|
|
class PluginWidgetChild;
|
|
|
|
}
|
|
|
|
|
2009-08-12 09:18:08 -07:00
|
|
|
namespace dom {
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2009-11-17 06:22:23 -08:00
|
|
|
class TabChild;
|
2012-08-01 23:02:29 -07:00
|
|
|
class ClonedMessageData;
|
2014-03-24 19:28:46 -07:00
|
|
|
class TabChildBase;
|
2009-11-17 06:22:23 -08:00
|
|
|
|
2014-03-31 23:13:50 -07:00
|
|
|
class TabChildGlobal : public DOMEventTargetHelper,
|
2010-02-20 09:05:20 -08:00
|
|
|
public nsIContentFrameMessageManager,
|
2013-12-11 17:51:56 -08:00
|
|
|
public nsIScriptObjectPrincipal,
|
|
|
|
public nsIGlobalObject
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 06:19:51 -07:00
|
|
|
explicit TabChildGlobal(TabChildBase* aTabChild);
|
2012-04-26 13:56:46 -07:00
|
|
|
void Init();
|
2010-02-20 09:05:20 -08:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-03-31 23:13:50 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TabChildGlobal, DOMEventTargetHelper)
|
2012-08-27 07:13:02 -07:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager)
|
|
|
|
NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
|
2011-10-01 09:14:36 -07:00
|
|
|
NS_IMETHOD SendSyncMessage(const nsAString& aMessageName,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 09:21:15 -08:00
|
|
|
nsIPrincipal* aPrincipal,
|
2011-10-01 09:14:36 -07:00
|
|
|
JSContext* aCx,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aArgc,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::MutableHandle<JS::Value> aRetval)
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
2011-10-01 09:14:36 -07:00
|
|
|
return mMessageManager
|
2013-11-06 09:21:15 -08:00
|
|
|
? mMessageManager->SendSyncMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2011-10-01 09:14:36 -07:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
2010-02-20 09:05:20 -08:00
|
|
|
}
|
2013-10-01 09:15:06 -07:00
|
|
|
NS_IMETHOD SendRpcMessage(const nsAString& aMessageName,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 09:21:15 -08:00
|
|
|
nsIPrincipal* aPrincipal,
|
2013-10-01 09:15:06 -07:00
|
|
|
JSContext* aCx,
|
|
|
|
uint8_t aArgc,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::MutableHandle<JS::Value> aRetval)
|
2013-10-01 09:15:06 -07:00
|
|
|
{
|
|
|
|
return mMessageManager
|
2013-11-06 09:21:15 -08:00
|
|
|
? mMessageManager->SendRpcMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2013-10-01 09:15:06 -07:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2013-06-05 09:15:48 -07:00
|
|
|
NS_IMETHOD GetContent(nsIDOMWindow** aContent) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD Dump(const nsAString& aStr) MOZ_OVERRIDE
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
|
|
|
return mMessageManager ? mMessageManager->Dump(aStr) : NS_OK;
|
|
|
|
}
|
2013-06-05 09:15:48 -07:00
|
|
|
NS_IMETHOD PrivateNoteIntentionalCrash() MOZ_OVERRIDE;
|
2011-06-25 02:52:00 -07:00
|
|
|
NS_IMETHOD Btoa(const nsAString& aBinaryData,
|
2013-06-05 09:15:48 -07:00
|
|
|
nsAString& aAsciiBase64String) MOZ_OVERRIDE;
|
2011-06-25 02:52:00 -07:00
|
|
|
NS_IMETHOD Atob(const nsAString& aAsciiString,
|
2013-06-05 09:15:48 -07:00
|
|
|
nsAString& aBinaryData) MOZ_OVERRIDE;
|
2010-02-20 09:05:20 -08:00
|
|
|
|
|
|
|
NS_IMETHOD AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool aUseCapture)
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
|
|
|
// By default add listeners only for trusted events!
|
2014-03-31 23:13:50 -07:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture, false, 2);
|
2010-02-20 09:05:20 -08:00
|
|
|
}
|
2014-03-31 23:13:50 -07:00
|
|
|
using DOMEventTargetHelper::AddEventListener;
|
2010-02-20 09:05:20 -08:00
|
|
|
NS_IMETHOD AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool aUseCapture, bool aWantsUntrusted,
|
2013-06-05 09:15:48 -07:00
|
|
|
uint8_t optional_argc) MOZ_OVERRIDE
|
2010-02-20 09:05:20 -08:00
|
|
|
{
|
2014-03-31 23:13:50 -07:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture,
|
|
|
|
aWantsUntrusted,
|
|
|
|
optional_argc);
|
2010-02-20 09:05:20 -08:00
|
|
|
}
|
|
|
|
|
2013-08-08 17:16:47 -07:00
|
|
|
nsresult
|
2014-03-17 21:48:19 -07:00
|
|
|
PreHandleEvent(EventChainPreVisitor& aVisitor)
|
2013-08-08 17:16:47 -07:00
|
|
|
{
|
|
|
|
aVisitor.mForceContentDispatch = true;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2013-06-05 09:15:48 -07:00
|
|
|
virtual JSContext* GetJSContextForEventHandlers() MOZ_OVERRIDE;
|
|
|
|
virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE;
|
2013-12-11 17:51:56 -08:00
|
|
|
virtual JSObject* GetGlobalJSObject() MOZ_OVERRIDE;
|
2010-02-20 09:05:20 -08:00
|
|
|
|
2014-10-07 02:44:48 -07:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
MOZ_CRASH("TabChildGlobal doesn't use DOM bindings!");
|
|
|
|
}
|
|
|
|
|
2010-02-20 09:05:20 -08:00
|
|
|
nsCOMPtr<nsIContentFrameMessageManager> mMessageManager;
|
2014-04-22 14:26:45 -07:00
|
|
|
nsRefPtr<TabChildBase> mTabChild;
|
2014-07-08 14:23:17 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~TabChildGlobal();
|
2010-02-20 09:05:20 -08:00
|
|
|
};
|
|
|
|
|
2012-06-14 19:31:55 -07:00
|
|
|
class ContentListener MOZ_FINAL : public nsIDOMEventListener
|
2009-11-17 06:22:23 -08:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 06:19:51 -07:00
|
|
|
explicit ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
|
2009-11-17 06:22:23 -08:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
protected:
|
2014-06-23 12:56:07 -07:00
|
|
|
~ContentListener() {}
|
2009-11-17 06:22:23 -08:00
|
|
|
TabChild* mTabChild;
|
|
|
|
};
|
|
|
|
|
2014-03-24 19:28:46 -07:00
|
|
|
// This is base clase which helps to share Viewport and touch related functionality
|
|
|
|
// between b2g/android FF/embedlite clients implementation.
|
|
|
|
// It make sense to place in this class all helper functions, and functionality which could be shared between
|
|
|
|
// Cross-process/Cross-thread implmentations.
|
2014-04-22 14:26:45 -07:00
|
|
|
class TabChildBase : public nsISupports,
|
|
|
|
public nsFrameScriptExecutor,
|
2014-03-24 19:28:46 -07:00
|
|
|
public ipc::MessageManagerCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TabChildBase();
|
2014-06-13 10:56:38 -07:00
|
|
|
|
2014-04-22 14:26:45 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2014-06-13 10:56:38 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase)
|
2014-03-24 19:28:46 -07:00
|
|
|
|
|
|
|
virtual nsIWebNavigation* WebNavigation() = 0;
|
|
|
|
virtual nsIWidget* WebWidget() = 0;
|
|
|
|
nsIPrincipal* GetPrincipal() { return mPrincipal; }
|
|
|
|
bool IsAsyncPanZoomEnabled();
|
|
|
|
// Recalculates the display state, including the CSS
|
|
|
|
// viewport. This should be called whenever we believe the
|
|
|
|
// viewport data on a document may have changed. If it didn't
|
|
|
|
// change, this function doesn't do anything. However, it should
|
|
|
|
// not be called all the time as it is fairly expensive.
|
2014-08-06 09:41:05 -07:00
|
|
|
bool HandlePossibleViewportChange(const ScreenIntSize& aOldScreenSize);
|
2014-03-24 19:28:46 -07:00
|
|
|
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const mozilla::layers::FrameMetrics::ViewID& aViewId,
|
|
|
|
const bool& aIsRoot,
|
|
|
|
const mozilla::layers::ZoomConstraints& aConstraints) = 0;
|
|
|
|
|
|
|
|
nsEventStatus DispatchSynthesizedMouseEvent(uint32_t aMsg, uint64_t aTime,
|
|
|
|
const LayoutDevicePoint& aRefPoint,
|
|
|
|
nsIWidget* aWidget);
|
|
|
|
|
|
|
|
protected:
|
2014-06-13 10:56:38 -07:00
|
|
|
virtual ~TabChildBase();
|
2014-03-24 19:28:46 -07:00
|
|
|
CSSSize GetPageSize(nsCOMPtr<nsIDocument> aDocument, const CSSSize& aViewport);
|
|
|
|
|
|
|
|
// Get the DOMWindowUtils for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIDOMWindowUtils> GetDOMWindowUtils();
|
|
|
|
// Get the Document for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIDocument> GetDocument();
|
|
|
|
|
|
|
|
// Wrapper for nsIDOMWindowUtils.setCSSViewport(). This updates some state
|
|
|
|
// variables local to this class before setting it.
|
|
|
|
void SetCSSViewport(const CSSSize& aSize);
|
|
|
|
|
|
|
|
// Wraps up a JSON object as a structured clone and sends it to the browser
|
|
|
|
// chrome script.
|
|
|
|
//
|
|
|
|
// XXX/bug 780335: Do the work the browser chrome script does in C++ instead
|
|
|
|
// so we don't need things like this.
|
|
|
|
void DispatchMessageManagerMessage(const nsAString& aMessageName,
|
|
|
|
const nsAString& aJSONData);
|
|
|
|
|
|
|
|
nsEventStatus DispatchWidgetEvent(WidgetGUIEvent& event);
|
|
|
|
|
|
|
|
void InitializeRootMetrics();
|
|
|
|
|
|
|
|
mozilla::layers::FrameMetrics ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
|
|
|
|
|
|
|
bool UpdateFrameHandler(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
|
|
|
|
|
|
|
protected:
|
2014-05-29 10:20:02 -07:00
|
|
|
CSSSize mOldViewportSize;
|
2014-03-24 19:28:46 -07:00
|
|
|
bool mContentDocumentIsDisplayed;
|
|
|
|
nsRefPtr<TabChildGlobal> mTabChildGlobal;
|
|
|
|
ScreenIntSize mInnerSize;
|
|
|
|
mozilla::layers::FrameMetrics mLastRootMetrics;
|
|
|
|
mozilla::layout::ScrollingBehavior mScrolling;
|
2014-09-02 14:43:08 -07:00
|
|
|
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
2014-03-24 19:28:46 -07:00
|
|
|
};
|
|
|
|
|
2014-08-05 10:33:55 -07:00
|
|
|
class TabChild MOZ_FINAL : public TabChildBase,
|
|
|
|
public PBrowserChild,
|
|
|
|
public nsIWebBrowserChrome2,
|
|
|
|
public nsIEmbeddingSiteWindow,
|
|
|
|
public nsIWebBrowserChromeFocus,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIWindowProvider,
|
|
|
|
public nsIDOMEventListener,
|
|
|
|
public nsIWebProgressListener,
|
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsITabChild,
|
|
|
|
public nsIObserver,
|
|
|
|
public TabContext,
|
|
|
|
public nsITooltipListener
|
2009-06-30 13:39:22 -07:00
|
|
|
{
|
2012-08-01 23:02:29 -07:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2012-11-27 12:43:52 -08:00
|
|
|
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
|
|
|
|
typedef mozilla::layout::ScrollingBehavior ScrollingBehavior;
|
2014-04-17 04:54:25 -07:00
|
|
|
typedef mozilla::layers::ActiveElementManager ActiveElementManager;
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2014-06-10 22:44:36 -07:00
|
|
|
public:
|
2014-10-29 11:11:00 -07:00
|
|
|
static std::map<TabId, nsRefPtr<TabChild>>& NestedTabChildMap();
|
2014-06-10 22:44:36 -07:00
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
public:
|
2012-08-29 08:26:18 -07:00
|
|
|
/**
|
|
|
|
* This is expected to be called off the critical path to content
|
|
|
|
* startup. This is an opportunity to load things that are slow
|
|
|
|
* on the critical path.
|
2012-06-21 18:17:52 -07:00
|
|
|
*/
|
2012-08-29 08:26:18 -07:00
|
|
|
static void PreloadSlowThings();
|
2014-12-18 01:01:33 -08:00
|
|
|
static void PostForkPreload();
|
2012-08-29 08:26:18 -07:00
|
|
|
|
|
|
|
/** Return a TabChild with the given attributes. */
|
2013-07-10 10:07:51 -07:00
|
|
|
static already_AddRefed<TabChild>
|
2014-10-29 11:11:00 -07:00
|
|
|
Create(nsIContentChild* aManager, const TabId& aTabId, const TabContext& aContext, uint32_t aChromeFlags);
|
2012-08-29 08:26:18 -07:00
|
|
|
|
2012-09-05 09:23:45 -07:00
|
|
|
bool IsRootContentDocument();
|
|
|
|
|
2014-10-29 11:11:00 -07:00
|
|
|
const TabId GetTabId() const {
|
|
|
|
MOZ_ASSERT(mUniqueId != 0);
|
|
|
|
return mUniqueId;
|
2014-06-10 22:44:36 -07:00
|
|
|
}
|
|
|
|
|
2014-05-06 17:11:20 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-11-05 10:14:22 -08:00
|
|
|
NS_DECL_NSIWEBBROWSERCHROME
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROME2
|
|
|
|
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
|
2009-12-31 17:34:06 -08:00
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2009-12-31 17:35:55 -08:00
|
|
|
NS_DECL_NSIWINDOWPROVIDER
|
2012-09-28 19:18:18 -07:00
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
2012-05-28 02:27:25 -07:00
|
|
|
NS_DECL_NSITABCHILD
|
2012-08-08 13:37:57 -07:00
|
|
|
NS_DECL_NSIOBSERVER
|
2014-01-22 12:27:23 -08:00
|
|
|
NS_DECL_NSITOOLTIPLISTENER
|
2009-06-30 13:39:22 -07:00
|
|
|
|
2012-09-27 22:43:12 -07:00
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
2013-10-01 09:15:06 -07:00
|
|
|
virtual bool DoSendBlockingMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
const mozilla::dom::StructuredCloneData& aData,
|
|
|
|
JS::Handle<JSObject *> aCpows,
|
2013-11-06 09:21:15 -08:00
|
|
|
nsIPrincipal* aPrincipal,
|
2013-10-01 09:15:06 -07:00
|
|
|
InfallibleTArray<nsString>* aJSONRetVal,
|
|
|
|
bool aIsSync) MOZ_OVERRIDE;
|
2013-07-10 15:05:39 -07:00
|
|
|
virtual bool DoSendAsyncMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
const mozilla::dom::StructuredCloneData& aData,
|
2013-11-06 09:21:15 -08:00
|
|
|
JS::Handle<JSObject *> aCpows,
|
|
|
|
nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
|
2014-03-24 19:28:46 -07:00
|
|
|
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
|
|
|
const bool& aIsRoot,
|
|
|
|
const ZoomConstraints& aConstraints) MOZ_OVERRIDE;
|
2014-01-17 09:46:41 -08:00
|
|
|
virtual bool RecvLoadURL(const nsCString& uri) MOZ_OVERRIDE;
|
2013-02-15 14:27:21 -08:00
|
|
|
virtual bool RecvCacheFileDescriptor(const nsString& aPath,
|
|
|
|
const FileDescriptor& aFileDescriptor)
|
|
|
|
MOZ_OVERRIDE;
|
2014-11-16 10:23:22 -08:00
|
|
|
virtual bool RecvShow(const nsIntSize& aSize,
|
2014-11-24 11:05:35 -08:00
|
|
|
const ShowInfo& aInfo,
|
2014-11-16 10:23:22 -08:00
|
|
|
const ScrollingBehavior& aScrolling,
|
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame) MOZ_OVERRIDE;
|
2014-08-08 10:23:50 -07:00
|
|
|
virtual bool RecvUpdateDimensions(const nsIntRect& rect,
|
2014-01-17 09:46:41 -08:00
|
|
|
const nsIntSize& size,
|
2014-12-11 06:44:07 -08:00
|
|
|
const ScreenOrientation& orientation,
|
|
|
|
const nsIntPoint& chromeDisp) MOZ_OVERRIDE;
|
2014-01-17 09:46:41 -08:00
|
|
|
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
2014-02-05 14:43:20 -08:00
|
|
|
virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
|
|
|
|
const uint32_t& aScrollGeneration) MOZ_OVERRIDE;
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual bool RecvHandleDoubleTap(const CSSPoint& aPoint,
|
2014-02-07 09:13:50 -08:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual bool RecvHandleSingleTap(const CSSPoint& aPoint,
|
2014-02-07 09:13:50 -08:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual bool RecvHandleLongTap(const CSSPoint& aPoint,
|
2014-10-24 10:29:30 -07:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) MOZ_OVERRIDE;
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual bool RecvHandleLongTapUp(const CSSPoint& aPoint,
|
2014-02-07 09:13:50 -08:00
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
2014-04-15 10:39:20 -07:00
|
|
|
virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId,
|
|
|
|
const APZStateChange& aChange,
|
|
|
|
const int& aArg) MOZ_OVERRIDE;
|
2014-01-17 09:46:41 -08:00
|
|
|
virtual bool RecvActivate() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvDeactivate() MOZ_OVERRIDE;
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual bool RecvMouseEvent(const nsString& aType,
|
|
|
|
const float& aX,
|
|
|
|
const float& aY,
|
2012-08-22 08:56:38 -07:00
|
|
|
const int32_t& aButton,
|
|
|
|
const int32_t& aClickCount,
|
|
|
|
const int32_t& aModifiers,
|
2014-01-17 09:46:41 -08:00
|
|
|
const bool& aIgnoreRootScrollFrame) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvRealMouseEvent(const mozilla::WidgetMouseEvent& event) MOZ_OVERRIDE;
|
2014-03-20 08:46:29 -07:00
|
|
|
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event,
|
|
|
|
const MaybeNativeKeyBinding& aBindings) MOZ_OVERRIDE;
|
2014-12-09 02:40:26 -08:00
|
|
|
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) MOZ_OVERRIDE;
|
2013-11-13 10:20:31 -08:00
|
|
|
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
2014-10-24 10:29:30 -07:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) MOZ_OVERRIDE;
|
2013-11-13 10:20:31 -08:00
|
|
|
virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
|
2014-10-24 10:29:30 -07:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) MOZ_OVERRIDE;
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual bool RecvKeyEvent(const nsString& aType,
|
2012-08-22 08:56:38 -07:00
|
|
|
const int32_t& aKeyCode,
|
|
|
|
const int32_t& aCharCode,
|
|
|
|
const int32_t& aModifiers,
|
2014-01-17 09:46:41 -08:00
|
|
|
const bool& aPreventDefault) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
|
|
|
const bool& aRunInGlobalScope) MOZ_OVERRIDE;
|
2010-07-19 11:33:33 -07:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
2013-07-10 15:05:39 -07:00
|
|
|
const ClonedMessageData& aData,
|
2013-11-06 09:21:15 -08:00
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
2010-10-26 15:20:53 -07:00
|
|
|
|
2014-08-22 16:17:18 -07:00
|
|
|
virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) MOZ_OVERRIDE;
|
|
|
|
|
2010-10-26 15:20:53 -07:00
|
|
|
virtual PDocumentRendererChild*
|
2013-12-26 10:06:53 -08:00
|
|
|
AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
|
2013-07-08 08:48:39 -07:00
|
|
|
const nsString& bgcolor,
|
|
|
|
const uint32_t& renderFlags, const bool& flushLayout,
|
2014-01-17 09:46:41 -08:00
|
|
|
const nsIntSize& renderSize) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor) MOZ_OVERRIDE;
|
2010-10-26 15:20:53 -07:00
|
|
|
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
|
|
|
|
const nsRect& documentRect,
|
2013-12-26 10:06:53 -08:00
|
|
|
const gfx::Matrix& transform,
|
2010-10-26 15:20:53 -07:00
|
|
|
const nsString& bgcolor,
|
2012-08-22 08:56:38 -07:00
|
|
|
const uint32_t& renderFlags,
|
2010-10-26 15:20:53 -07:00
|
|
|
const bool& flushLayout,
|
2014-01-17 09:46:41 -08:00
|
|
|
const nsIntSize& renderSize) MOZ_OVERRIDE;
|
2010-10-26 15:20:53 -07:00
|
|
|
|
2014-02-23 12:19:43 -08:00
|
|
|
virtual PColorPickerChild*
|
|
|
|
AllocPColorPickerChild(const nsString& title, const nsString& initialColor) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPColorPickerChild(PColorPickerChild* actor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 09:46:41 -08:00
|
|
|
virtual PContentPermissionRequestChild*
|
2014-02-09 12:34:40 -08:00
|
|
|
AllocPContentPermissionRequestChild(const InfallibleTArray<PermissionRequest>& aRequests,
|
2014-01-17 09:46:41 -08:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor) MOZ_OVERRIDE;
|
2010-05-13 10:44:51 -07:00
|
|
|
|
2014-02-17 16:30:06 -08:00
|
|
|
virtual PFilePickerChild*
|
|
|
|
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
DeallocPFilePickerChild(PFilePickerChild* actor) MOZ_OVERRIDE;
|
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
virtual PIndexedDBPermissionRequestChild*
|
|
|
|
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIndexedDBPermissionRequestChild(
|
|
|
|
PIndexedDBPermissionRequestChild* aActor)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
|
2014-03-24 19:28:46 -07:00
|
|
|
virtual nsIWebNavigation* WebNavigation() MOZ_OVERRIDE { return mWebNav; }
|
|
|
|
virtual nsIWidget* WebWidget() MOZ_OVERRIDE { return mWidget; }
|
2009-11-06 12:43:39 -08:00
|
|
|
|
2012-08-29 08:26:18 -07:00
|
|
|
/** Return the DPI of the widget this TabChild draws to. */
|
|
|
|
void GetDPI(float* aDPI);
|
2013-05-01 16:06:19 -07:00
|
|
|
void GetDefaultScale(double *aScale);
|
2012-08-29 08:26:18 -07:00
|
|
|
|
2012-11-21 18:40:57 -08:00
|
|
|
ScreenOrientation GetOrientation() { return mOrientation; }
|
|
|
|
|
2011-10-20 15:17:09 -07:00
|
|
|
void SetBackgroundColor(const nscolor& aColor);
|
2012-07-17 16:59:45 -07:00
|
|
|
|
|
|
|
void NotifyPainted();
|
2012-07-19 23:48:27 -07:00
|
|
|
|
2014-04-21 13:40:09 -07:00
|
|
|
void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands* aAutoCache,
|
|
|
|
WidgetKeyboardEvent* aEvent);
|
2012-07-19 23:48:27 -07:00
|
|
|
|
2013-05-23 08:52:06 -07:00
|
|
|
/** Return a boolean indicating if the page has called preventDefault on
|
|
|
|
* the event.
|
|
|
|
*/
|
2013-09-11 05:28:58 -07:00
|
|
|
bool DispatchMouseEvent(const nsString& aType,
|
|
|
|
const CSSPoint& aPoint,
|
|
|
|
const int32_t& aButton,
|
|
|
|
const int32_t& aClickCount,
|
|
|
|
const int32_t& aModifiers,
|
|
|
|
const bool& aIgnoreRootScrollFrame,
|
|
|
|
const unsigned short& aInputSourceArg);
|
2013-05-23 08:52:06 -07:00
|
|
|
|
2012-11-07 19:51:55 -08:00
|
|
|
/**
|
|
|
|
* Signal to this TabChild that it should be made visible:
|
|
|
|
* activated widget, retained layer tree, etc. (Respectively,
|
|
|
|
* made not visible.)
|
|
|
|
*/
|
|
|
|
void MakeVisible();
|
|
|
|
void MakeHidden();
|
|
|
|
|
2013-02-15 14:27:21 -08:00
|
|
|
// Returns true if the file descriptor was found in the cache, false
|
|
|
|
// otherwise.
|
|
|
|
bool GetCachedFileDescriptor(const nsAString& aPath,
|
|
|
|
nsICachedFileDescriptorListener* aCallback);
|
|
|
|
|
|
|
|
void CancelCachedFileDescriptorCallback(
|
|
|
|
const nsAString& aPath,
|
|
|
|
nsICachedFileDescriptorListener* aCallback);
|
|
|
|
|
2014-06-10 22:44:06 -07:00
|
|
|
nsIContentChild* Manager() { return mManager; }
|
2013-07-10 10:07:51 -07:00
|
|
|
|
2013-08-13 00:56:57 -07:00
|
|
|
bool GetUpdateHitRegion() { return mUpdateHitRegion; }
|
|
|
|
|
|
|
|
void UpdateHitRegion(const nsRegion& aRegion);
|
|
|
|
|
2013-09-12 12:24:11 -07:00
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(nsIDocShell* aDocShell)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsITabChild> tc = do_GetInterface(aDocShell);
|
|
|
|
return static_cast<TabChild*>(tc.get());
|
|
|
|
}
|
|
|
|
|
2013-10-02 13:08:30 -07:00
|
|
|
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
2014-03-06 19:24:32 -08:00
|
|
|
static TabChild* GetFrom(uint64_t aLayersId);
|
|
|
|
|
2014-05-28 14:42:14 -07:00
|
|
|
void DidComposite(uint64_t aTransactionId);
|
2013-09-12 12:24:11 -07:00
|
|
|
|
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(nsIDOMWindow* aWindow)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
2014-05-23 07:36:50 -07:00
|
|
|
virtual bool RecvUIResolutionChanged() MOZ_OVERRIDE;
|
|
|
|
|
2014-11-12 12:59:19 -08:00
|
|
|
/**
|
|
|
|
* Native widget remoting protocol for use with windowed plugins with e10s.
|
|
|
|
*/
|
|
|
|
PPluginWidgetChild* AllocPPluginWidgetChild() MOZ_OVERRIDE;
|
|
|
|
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) MOZ_OVERRIDE;
|
|
|
|
already_AddRefed<nsIWidget> CreatePluginWidget(nsIWidget* aParent);
|
|
|
|
|
2014-12-11 06:44:07 -08:00
|
|
|
nsIntPoint GetChromeDisplacement() { return mChromeDisp; };
|
|
|
|
|
2010-08-05 15:11:23 -07:00
|
|
|
protected:
|
2014-07-08 14:23:17 -07:00
|
|
|
virtual ~TabChild();
|
|
|
|
|
2014-11-16 10:23:22 -08:00
|
|
|
virtual PRenderFrameChild* AllocPRenderFrameChild() MOZ_OVERRIDE;
|
2013-07-08 08:48:39 -07:00
|
|
|
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) MOZ_OVERRIDE;
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool RecvDestroy() MOZ_OVERRIDE;
|
2013-08-13 00:56:57 -07:00
|
|
|
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) MOZ_OVERRIDE;
|
2014-02-20 03:26:13 -08:00
|
|
|
virtual bool RecvSetIsDocShellActive(const bool& aIsActive) MOZ_OVERRIDE;
|
2010-08-05 15:11:23 -07:00
|
|
|
|
2014-05-23 11:19:00 -07:00
|
|
|
virtual bool RecvRequestNotifyAfterRemotePaint();
|
|
|
|
|
2014-11-27 05:28:26 -08:00
|
|
|
virtual bool RecvParentActivated(const bool& aActivated) MOZ_OVERRIDE;
|
|
|
|
|
2014-10-31 10:54:02 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
void MaybeRequestPreinitCamera();
|
|
|
|
#endif
|
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
private:
|
2012-08-29 08:26:18 -07:00
|
|
|
/**
|
|
|
|
* Create a new TabChild object.
|
|
|
|
*
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* |aOwnOrContainingAppId| is the app-id of our frame or of the closest app
|
|
|
|
* frame in the hierarchy which contains us.
|
|
|
|
*
|
|
|
|
* |aIsBrowserElement| indicates whether we're a browser (but not an app).
|
2012-08-29 08:26:18 -07:00
|
|
|
*/
|
2014-10-29 11:11:00 -07:00
|
|
|
TabChild(nsIContentChild* aManager,
|
|
|
|
const TabId& aTabId,
|
|
|
|
const TabContext& aContext,
|
|
|
|
uint32_t aChromeFlags);
|
2012-08-29 08:26:18 -07:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
|
2014-08-24 00:16:32 -07:00
|
|
|
class DelayedFireSingleTapEvent;
|
|
|
|
class DelayedFireContextMenuEvent;
|
2014-02-21 15:12:43 -08:00
|
|
|
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
// Notify others that our TabContext has been updated. (At the moment, this
|
|
|
|
// sets the appropriate app-id and is-browser flags on our docshell.)
|
|
|
|
//
|
|
|
|
// You should call this after calling TabContext::SetTabContext(). We also
|
|
|
|
// call this during Init().
|
|
|
|
void NotifyTabContextUpdated();
|
2012-08-29 08:26:18 -07:00
|
|
|
|
2014-01-17 09:46:41 -08:00
|
|
|
void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
2010-07-21 16:23:03 -07:00
|
|
|
|
2012-08-29 08:26:18 -07:00
|
|
|
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
|
|
|
|
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
|
2014-11-16 10:23:22 -08:00
|
|
|
bool InitRenderingState(const ScrollingBehavior& aScrolling,
|
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame);
|
2010-08-20 16:24:40 -07:00
|
|
|
void DestroyWindow();
|
2012-09-10 21:30:33 -07:00
|
|
|
void SetProcessNameToAppName();
|
2013-07-09 16:26:07 -07:00
|
|
|
|
2012-06-12 15:01:25 -07:00
|
|
|
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
2014-11-16 10:23:22 -08:00
|
|
|
void DoFakeShow(const ScrollingBehavior& aScrolling,
|
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame);
|
2012-06-12 15:01:25 -07:00
|
|
|
|
2014-11-24 11:05:35 -08:00
|
|
|
void ApplyShowInfo(const ShowInfo& aInfo);
|
|
|
|
|
2013-01-05 06:53:16 -08:00
|
|
|
// These methods are used for tracking synthetic mouse events
|
|
|
|
// dispatched for compatibility. On each touch event, we
|
|
|
|
// UpdateTapState(). If we've detected that the current gesture
|
|
|
|
// isn't a tap, then we CancelTapTracking(). In the meantime, we
|
|
|
|
// may detect a context-menu event, and if so we
|
|
|
|
// FireContextMenuEvent().
|
|
|
|
void FireContextMenuEvent();
|
|
|
|
void CancelTapTracking();
|
2013-09-26 23:20:57 -07:00
|
|
|
void UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus);
|
2012-09-14 18:16:32 -07:00
|
|
|
|
2012-06-12 15:01:25 -07:00
|
|
|
nsresult
|
|
|
|
BrowserFrameProvideWindow(nsIDOMWindow* aOpener,
|
|
|
|
nsIURI* aURI,
|
|
|
|
const nsAString& aName,
|
|
|
|
const nsACString& aFeatures,
|
|
|
|
bool* aWindowIsNew,
|
|
|
|
nsIDOMWindow** aReturn);
|
|
|
|
|
2014-04-25 08:40:23 -07:00
|
|
|
bool HasValidInnerSize();
|
|
|
|
|
2014-07-21 11:48:00 -07:00
|
|
|
void SendPendingTouchPreventedResponse(bool aPreventDefault,
|
|
|
|
const ScrollableLayerGuid& aGuid);
|
|
|
|
|
2014-12-09 02:40:26 -08:00
|
|
|
// Adds the scrollable layer target to the target list, and returns whether
|
|
|
|
// or not the caller should wait for a refresh to send a target
|
|
|
|
// notification.
|
|
|
|
bool PrepareForSetTargetAPZCNotification(const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
nsIFrame* aRootFrame,
|
|
|
|
const nsIntPoint& aRefPoint,
|
|
|
|
nsTArray<ScrollableLayerGuid>* aTargets);
|
|
|
|
|
|
|
|
// Sends a SetTarget notification for APZC, given one or more previous
|
|
|
|
// calls to PrepareForAPZCSetTargetNotification().
|
|
|
|
void SendSetTargetAPZCNotification(nsIPresShell* aShell,
|
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsTArray<ScrollableLayerGuid>& aTargets,
|
|
|
|
bool aWaitForRefresh);
|
|
|
|
|
2014-11-21 18:36:25 -08:00
|
|
|
void SendSetTargetAPZCNotification(const WidgetTouchEvent& aEvent,
|
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId);
|
|
|
|
|
2014-10-29 11:11:00 -07:00
|
|
|
void SetTabId(const TabId& aTabId)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mUniqueId == 0);
|
|
|
|
|
|
|
|
mUniqueId = aTabId;
|
|
|
|
NestedTabChildMap()[mUniqueId] = this;
|
|
|
|
}
|
|
|
|
|
2013-02-15 14:27:21 -08:00
|
|
|
class CachedFileDescriptorInfo;
|
|
|
|
class CachedFileDescriptorCallbackRunnable;
|
2014-07-11 11:15:10 -07:00
|
|
|
class DelayedDeleteRunnable;
|
2013-02-15 14:27:21 -08:00
|
|
|
|
2013-04-30 17:42:05 -07:00
|
|
|
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
2009-06-30 13:39:22 -07:00
|
|
|
nsCOMPtr<nsIWebNavigation> mWebNav;
|
2010-08-20 16:24:40 -07:00
|
|
|
nsCOMPtr<nsIWidget> mWidget;
|
2012-09-28 19:18:18 -07:00
|
|
|
nsCOMPtr<nsIURI> mLastURI;
|
2010-08-20 16:24:41 -07:00
|
|
|
RenderFrameChild* mRemoteFrame;
|
2014-06-10 22:44:06 -07:00
|
|
|
nsRefPtr<nsIContentChild> mManager;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mChromeFlags;
|
2014-03-06 19:24:32 -08:00
|
|
|
uint64_t mLayersId;
|
2013-03-04 06:37:43 -08:00
|
|
|
nsIntRect mOuterRect;
|
2013-01-05 06:53:16 -08:00
|
|
|
// When we're tracking a possible tap gesture, this is the "down"
|
|
|
|
// point of the touchstart.
|
2013-07-16 12:54:59 -07:00
|
|
|
LayoutDevicePoint mGestureDownPoint;
|
2013-01-05 06:53:16 -08:00
|
|
|
// The touch identifier of the active gesture.
|
|
|
|
int32_t mActivePointerId;
|
|
|
|
// A timer task that fires if the tap-hold timeout is exceeded by
|
|
|
|
// the touch we're tracking. That is, if touchend or a touchmove
|
|
|
|
// that exceeds the gesture threshold doesn't happen.
|
2014-08-24 00:16:32 -07:00
|
|
|
nsCOMPtr<nsITimer> mTapHoldTimer;
|
2013-05-29 17:56:09 -07:00
|
|
|
// Whether we have already received a FileDescriptor for the app package.
|
|
|
|
bool mAppPackageFileDescriptorRecved;
|
2013-02-15 14:27:21 -08:00
|
|
|
// At present only 1 of these is really expected.
|
|
|
|
nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
|
|
|
mCachedFileDescriptorInfos;
|
2011-10-20 15:17:09 -07:00
|
|
|
nscolor mLastBackgroundColor;
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones DONTBUILD
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
(Re-landing changeset a6a847452dbf, backed out in 5091aa6083c4, because it was originally landed with the incorrect bug number.)
2012-10-30 13:13:21 -07:00
|
|
|
bool mDidFakeShow;
|
2012-08-06 20:00:41 -07:00
|
|
|
bool mNotified;
|
2012-08-29 08:26:18 -07:00
|
|
|
bool mTriedBrowserInit;
|
2012-11-21 18:40:57 -08:00
|
|
|
ScreenOrientation mOrientation;
|
2013-08-13 00:56:57 -07:00
|
|
|
bool mUpdateHitRegion;
|
2014-07-16 05:33:50 -07:00
|
|
|
bool mPendingTouchPreventedResponse;
|
|
|
|
ScrollableLayerGuid mPendingTouchPreventedGuid;
|
2014-10-24 10:29:30 -07:00
|
|
|
uint64_t mPendingTouchPreventedBlockId;
|
2014-02-14 16:45:45 -08:00
|
|
|
void FireSingleTapEvent(LayoutDevicePoint aPoint);
|
2010-02-20 09:05:20 -08:00
|
|
|
|
2014-07-29 08:59:19 -07:00
|
|
|
bool mTouchEndCancelled;
|
2014-07-29 08:59:19 -07:00
|
|
|
bool mEndTouchIsClick;
|
2014-07-29 08:59:19 -07:00
|
|
|
|
2014-03-11 20:13:38 -07:00
|
|
|
bool mIgnoreKeyPressEvent;
|
2014-04-09 12:16:16 -07:00
|
|
|
nsRefPtr<ActiveElementManager> mActiveElementManager;
|
2014-04-25 08:40:23 -07:00
|
|
|
bool mHasValidInnerSize;
|
2014-08-24 00:16:32 -07:00
|
|
|
bool mDestroyed;
|
2014-12-11 06:44:07 -08:00
|
|
|
// Position of tab, relative to parent widget (typically the window)
|
|
|
|
nsIntPoint mChromeDisp;
|
2014-10-29 11:11:00 -07:00
|
|
|
TabId mUniqueId;
|
2014-12-12 09:50:46 -08:00
|
|
|
float mDPI;
|
|
|
|
double mDefaultScale;
|
2014-03-11 20:13:38 -07:00
|
|
|
|
2009-06-30 13:39:22 -07:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
#endif // mozilla_dom_TabChild_h
|