2009-08-18 19:05:15 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2012-05-21 11:12:37 +00: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-08-12 16:18:08 +00:00
|
|
|
|
2010-07-19 18:33:33 +00:00
|
|
|
#ifndef mozilla_dom_ContentParent_h
|
|
|
|
#define mozilla_dom_ContentParent_h
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2010-07-19 18:33:33 +00:00
|
|
|
#include "mozilla/dom/PContentParent.h"
|
2014-06-11 05:44:03 +00:00
|
|
|
#include "mozilla/dom/nsIContentParent.h"
|
2009-08-12 16:18:08 +00:00
|
|
|
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
2012-08-03 19:35:58 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-02-05 16:37:26 +00:00
|
|
|
#include "mozilla/FileUtils.h"
|
2013-02-14 20:41:29 +00:00
|
|
|
#include "mozilla/HalTypes.h"
|
2013-04-26 00:53:26 +00:00
|
|
|
#include "mozilla/LinkedList.h"
|
2013-07-17 21:31:10 +00:00
|
|
|
#include "mozilla/StaticPtr.h"
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2013-12-13 16:28:46 +00:00
|
|
|
#include "nsDataHashtable.h"
|
2012-09-28 05:43:12 +00:00
|
|
|
#include "nsFrameMessageManager.h"
|
2013-12-13 16:28:46 +00:00
|
|
|
#include "nsHashKeys.h"
|
2009-09-03 00:18:27 +00:00
|
|
|
#include "nsIObserver.h"
|
2010-02-02 01:53:52 +00:00
|
|
|
#include "nsIThreadInternal.h"
|
2010-09-21 04:16:37 +00:00
|
|
|
#include "nsIDOMGeoPositionCallback.h"
|
2014-10-23 18:31:00 +00:00
|
|
|
#include "nsIDOMGeoPositionErrorCallback.h"
|
2013-01-02 21:21:37 +00:00
|
|
|
#include "PermissionMessageUtils.h"
|
2009-09-03 00:18:27 +00:00
|
|
|
|
2012-09-28 05:43:24 +00:00
|
|
|
#define CHILD_PROCESS_SHUTDOWN_MESSAGE NS_LITERAL_STRING("child-process-shutdown")
|
|
|
|
|
2012-08-09 02:58:06 +00:00
|
|
|
class mozIApplication;
|
2012-11-09 17:52:09 +00:00
|
|
|
class nsConsoleService;
|
2014-05-13 17:13:00 +00:00
|
|
|
class nsICycleCollectorLogSink;
|
2012-08-02 06:02:29 +00:00
|
|
|
class nsIDOMBlob;
|
2014-05-13 17:13:00 +00:00
|
|
|
class nsIDumpGCAndCCLogsCallback;
|
2013-01-16 05:29:48 +00:00
|
|
|
class nsIMemoryReporter;
|
2015-01-07 05:42:23 +00:00
|
|
|
class nsITimer;
|
2013-12-13 16:28:46 +00:00
|
|
|
class ParentIdleListener;
|
2012-08-02 06:02:29 +00:00
|
|
|
|
2009-08-12 16:18:08 +00:00
|
|
|
namespace mozilla {
|
2014-07-01 22:24:27 +00:00
|
|
|
class PRemoteSpellcheckEngineParent;
|
2009-09-09 22:00:14 +00:00
|
|
|
|
2009-08-12 18:31:48 +00:00
|
|
|
namespace ipc {
|
2012-08-23 19:33:46 +00:00
|
|
|
class OptionalURIParams;
|
2014-09-26 23:21:57 +00:00
|
|
|
class PFileDescriptorSetParent;
|
2012-08-23 19:33:46 +00:00
|
|
|
class URIParams;
|
2009-08-12 18:31:48 +00:00
|
|
|
class TestShellParent;
|
2012-08-23 19:33:46 +00:00
|
|
|
} // namespace ipc
|
2009-08-12 18:31:48 +00:00
|
|
|
|
2013-07-03 07:24:32 +00:00
|
|
|
namespace jsipc {
|
2014-10-06 22:45:42 +00:00
|
|
|
class JavaScriptShared;
|
2013-06-03 10:14:37 +00:00
|
|
|
class PJavaScriptParent;
|
2013-07-03 07:24:32 +00:00
|
|
|
}
|
|
|
|
|
2012-07-17 23:59:45 +00:00
|
|
|
namespace layers {
|
|
|
|
class PCompositorParent;
|
2014-05-01 01:52:00 +00:00
|
|
|
class PSharedBufferManagerParent;
|
2012-08-23 19:33:46 +00:00
|
|
|
} // namespace layers
|
2012-07-17 23:59:45 +00:00
|
|
|
|
2009-08-12 16:18:08 +00:00
|
|
|
namespace dom {
|
|
|
|
|
2013-08-20 19:45:30 +00:00
|
|
|
class Element;
|
2009-08-12 16:18:08 +00:00
|
|
|
class TabParent;
|
2010-11-19 01:15:23 +00:00
|
|
|
class PStorageParent;
|
2012-08-02 06:02:29 +00:00
|
|
|
class ClonedMessageData;
|
2013-09-23 21:30:40 +00:00
|
|
|
class MemoryReport;
|
|
|
|
class TabContext;
|
2014-08-13 06:18:00 +00:00
|
|
|
class ContentBridgeParent;
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2014-08-05 17:33:55 +00:00
|
|
|
class ContentParent MOZ_FINAL : public PContentParent
|
|
|
|
, public nsIContentParent
|
|
|
|
, public nsIObserver
|
|
|
|
, public nsIDOMGeoPositionCallback
|
2014-10-23 18:31:00 +00:00
|
|
|
, public nsIDOMGeoPositionErrorCallback
|
2014-08-05 17:33:55 +00:00
|
|
|
, public mozilla::LinkedListElement<ContentParent>
|
2009-08-12 16:18:08 +00:00
|
|
|
{
|
|
|
|
typedef mozilla::ipc::GeckoChildProcessHost GeckoChildProcessHost;
|
2012-08-23 19:33:46 +00:00
|
|
|
typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
|
2014-09-26 23:21:57 +00:00
|
|
|
typedef mozilla::ipc::PFileDescriptorSetParent PFileDescriptorSetParent;
|
2009-11-11 08:34:08 +00:00
|
|
|
typedef mozilla::ipc::TestShellParent TestShellParent;
|
2012-08-23 19:33:46 +00:00
|
|
|
typedef mozilla::ipc::URIParams URIParams;
|
2012-08-02 06:02:29 +00:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2009-08-12 16:18:08 +00:00
|
|
|
|
|
|
|
public:
|
2014-08-22 05:41:34 +00:00
|
|
|
#ifdef MOZ_NUWA_PROCESS
|
2014-09-30 14:12:11 +00:00
|
|
|
static int32_t NuwaPid() {
|
|
|
|
return sNuwaPid;
|
|
|
|
}
|
|
|
|
|
2014-08-22 05:41:34 +00:00
|
|
|
static bool IsNuwaReady() {
|
|
|
|
return sNuwaReady;
|
|
|
|
}
|
|
|
|
#endif
|
2014-06-11 05:44:03 +00:00
|
|
|
virtual bool IsContentParent() MOZ_OVERRIDE { return true; }
|
2012-08-16 01:46:03 +00:00
|
|
|
/**
|
|
|
|
* Start up the content-process machinery. This might include
|
|
|
|
* scheduling pre-launch tasks.
|
|
|
|
*/
|
|
|
|
static void StartUp();
|
|
|
|
/** Shut down the content-process machinery. */
|
|
|
|
static void ShutDown();
|
2012-12-28 09:45:16 +00:00
|
|
|
/**
|
|
|
|
* Ensure that all subprocesses are terminated and their OS
|
|
|
|
* resources have been reaped. This is synchronous and can be
|
|
|
|
* very expensive in general. It also bypasses the normal
|
|
|
|
* shutdown process.
|
|
|
|
*/
|
|
|
|
static void JoinAllSubprocesses();
|
2012-08-16 01:46:03 +00:00
|
|
|
|
2013-11-19 11:03:30 +00:00
|
|
|
static bool PreallocatedProcessReady();
|
|
|
|
|
2014-08-13 06:18:00 +00:00
|
|
|
/**
|
|
|
|
* Get or create a content process for:
|
|
|
|
* 1. browser iframe
|
|
|
|
* 2. remote xul <browser>
|
|
|
|
* 3. normal iframe
|
|
|
|
*/
|
2013-04-02 23:52:51 +00:00
|
|
|
static already_AddRefed<ContentParent>
|
2014-08-13 06:18:00 +00:00
|
|
|
GetNewOrUsedBrowserProcess(bool aForBrowserElement = false,
|
|
|
|
hal::ProcessPriority aPriority =
|
|
|
|
hal::ProcessPriority::PROCESS_PRIORITY_FOREGROUND,
|
|
|
|
ContentParent* aOpener = nullptr);
|
2012-07-13 21:10:20 +00:00
|
|
|
|
2013-04-26 00:53:26 +00:00
|
|
|
/**
|
|
|
|
* Create a subprocess suitable for use as a preallocated app process.
|
|
|
|
*/
|
|
|
|
static already_AddRefed<ContentParent> PreallocateAppProcess();
|
|
|
|
|
2013-11-22 03:25:34 +00:00
|
|
|
static already_AddRefed<ContentParent> RunNuwaProcess();
|
2013-06-03 10:14:40 +00:00
|
|
|
|
2012-07-13 21:10:20 +00:00
|
|
|
/**
|
2013-02-14 20:41:30 +00:00
|
|
|
* Get or create a content process for the given TabContext. aFrameElement
|
|
|
|
* should be the frame/iframe element with which this process will
|
|
|
|
* associated.
|
2012-07-13 21:10:20 +00:00
|
|
|
*/
|
2013-02-14 20:41:30 +00:00
|
|
|
static TabParent*
|
|
|
|
CreateBrowserOrApp(const TabContext& aContext,
|
2014-06-20 17:55:40 +00:00
|
|
|
Element* aFrameElement,
|
|
|
|
ContentParent* aOpenerContentParent);
|
2012-08-09 02:58:06 +00:00
|
|
|
|
2011-08-02 19:35:42 +00:00
|
|
|
static void GetAll(nsTArray<ContentParent*>& aArray);
|
2013-07-17 21:31:10 +00:00
|
|
|
static void GetAllEvenIfDead(nsTArray<ContentParent*>& aArray);
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2014-06-13 20:40:46 +00:00
|
|
|
static bool IgnoreIPCPrincipal();
|
|
|
|
|
2014-10-03 14:52:37 +00:00
|
|
|
static void NotifyUpdatedDictionaries();
|
|
|
|
|
2014-06-11 05:44:13 +00:00
|
|
|
virtual bool RecvCreateChildProcess(const IPCTabContext& aContext,
|
|
|
|
const hal::ProcessPriority& aPriority,
|
2014-10-29 18:11:00 +00:00
|
|
|
const TabId& aOpenerTabId,
|
|
|
|
ContentParentId* aCpId,
|
2014-06-11 05:44:13 +00:00
|
|
|
bool* aIsForApp,
|
2014-10-29 18:11:00 +00:00
|
|
|
bool* aIsForBrowser,
|
|
|
|
TabId* aTabId) MOZ_OVERRIDE;
|
2014-12-19 01:35:48 +00:00
|
|
|
virtual bool RecvBridgeToChildProcess(const ContentParentId& aCpId) MOZ_OVERRIDE;
|
2014-06-11 05:44:13 +00:00
|
|
|
|
2014-12-19 01:35:48 +00:00
|
|
|
virtual bool RecvLoadPlugin(const uint32_t& aPluginId) MOZ_OVERRIDE;
|
2014-10-29 15:05:36 +00:00
|
|
|
virtual bool RecvFindPlugins(const uint32_t& aPluginEpoch,
|
|
|
|
nsTArray<PluginTag>* aPlugins,
|
|
|
|
uint32_t* aNewPluginEpoch) MOZ_OVERRIDE;
|
|
|
|
|
2014-03-20 00:22:25 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(ContentParent, nsIObserver)
|
|
|
|
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2009-09-03 00:18:27 +00:00
|
|
|
NS_DECL_NSIOBSERVER
|
2010-09-21 04:16:37 +00:00
|
|
|
NS_DECL_NSIDOMGEOPOSITIONCALLBACK
|
2014-10-23 18:31:00 +00:00
|
|
|
NS_DECL_NSIDOMGEOPOSITIONERRORCALLBACK
|
2009-09-03 00:18:27 +00:00
|
|
|
|
2012-09-28 05:43:12 +00:00
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
2013-07-10 22:05:39 +00:00
|
|
|
virtual bool DoSendAsyncMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
const mozilla::dom::StructuredCloneData& aData,
|
2013-11-06 17:21:15 +00:00
|
|
|
JS::Handle<JSObject *> aCpows,
|
|
|
|
nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
|
2013-06-05 16:15:48 +00:00
|
|
|
virtual bool CheckPermission(const nsAString& aPermission) MOZ_OVERRIDE;
|
|
|
|
virtual bool CheckManifestURL(const nsAString& aManifestURL) MOZ_OVERRIDE;
|
|
|
|
virtual bool CheckAppHasPermission(const nsAString& aPermission) MOZ_OVERRIDE;
|
2013-06-29 10:52:16 +00:00
|
|
|
virtual bool CheckAppHasStatus(unsigned short aStatus) MOZ_OVERRIDE;
|
2014-08-12 12:59:47 +00:00
|
|
|
virtual bool KillChild() MOZ_OVERRIDE;
|
2012-09-28 05:43:12 +00:00
|
|
|
|
2013-01-10 13:22:14 +00:00
|
|
|
/** Notify that a tab is beginning its destruction sequence. */
|
|
|
|
void NotifyTabDestroying(PBrowserParent* aTab);
|
2012-07-17 18:27:27 +00:00
|
|
|
/** Notify that a tab was destroyed during normal operation. */
|
2013-01-10 13:22:14 +00:00
|
|
|
void NotifyTabDestroyed(PBrowserParent* aTab,
|
|
|
|
bool aNotifiedDestroying);
|
2009-11-11 08:34:08 +00:00
|
|
|
|
|
|
|
TestShellParent* CreateTestShell();
|
|
|
|
bool DestroyTestShell(TestShellParent* aTestShell);
|
2011-06-23 23:31:58 +00:00
|
|
|
TestShellParent* GetTestShellSingleton();
|
2014-10-06 22:45:42 +00:00
|
|
|
jsipc::JavaScriptShared* GetCPOWManager() MOZ_OVERRIDE;
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2014-10-29 18:11:00 +00:00
|
|
|
static TabId
|
|
|
|
AllocateTabId(const TabId& aOpenerTabId,
|
|
|
|
const IPCTabContext& aContext,
|
|
|
|
const ContentParentId& aCpId);
|
|
|
|
static void
|
|
|
|
DeallocateTabId(const TabId& aTabId, const ContentParentId& aCpId);
|
|
|
|
|
2010-03-29 20:29:45 +00:00
|
|
|
void ReportChildAlreadyBlocked();
|
2010-02-02 01:53:52 +00:00
|
|
|
bool RequestRunToCompletion();
|
|
|
|
|
2010-04-12 00:24:45 +00:00
|
|
|
bool IsAlive();
|
2014-06-11 05:44:13 +00:00
|
|
|
virtual bool IsForApp() MOZ_OVERRIDE;
|
|
|
|
virtual bool IsForBrowser() MOZ_OVERRIDE
|
2014-06-03 21:15:27 +00:00
|
|
|
{
|
|
|
|
return mIsForBrowser;
|
|
|
|
}
|
2014-01-14 18:35:08 +00:00
|
|
|
#ifdef MOZ_NUWA_PROCESS
|
2014-12-18 09:01:04 +00:00
|
|
|
bool IsNuwaProcess() const;
|
2014-01-14 18:35:08 +00:00
|
|
|
#endif
|
2010-04-12 00:24:45 +00:00
|
|
|
|
2011-06-08 19:56:31 +00:00
|
|
|
GeckoChildProcessHost* Process() {
|
|
|
|
return mSubprocess;
|
|
|
|
}
|
|
|
|
|
2013-07-17 21:31:10 +00:00
|
|
|
int32_t Pid();
|
2013-04-26 00:53:26 +00:00
|
|
|
|
2014-06-11 05:44:13 +00:00
|
|
|
ContentParent* Opener() {
|
|
|
|
return mOpener;
|
|
|
|
}
|
|
|
|
|
2014-06-03 14:36:46 +00:00
|
|
|
bool NeedsPermissionsUpdate() const {
|
2014-12-18 09:01:04 +00:00
|
|
|
#ifdef MOZ_NUWA_PROCESS
|
|
|
|
return !IsNuwaProcess() && mSendPermissionUpdates;
|
|
|
|
#else
|
2011-08-02 19:35:42 +00:00
|
|
|
return mSendPermissionUpdates;
|
2014-12-18 09:01:04 +00:00
|
|
|
#endif
|
2011-08-02 19:35:42 +00:00
|
|
|
}
|
|
|
|
|
2014-06-03 14:36:46 +00:00
|
|
|
bool NeedsDataStoreInfos() const {
|
|
|
|
return mSendDataStoreInfos;
|
|
|
|
}
|
|
|
|
|
2012-09-05 22:18:48 +00:00
|
|
|
/**
|
|
|
|
* Kill our subprocess and make sure it dies. Should only be used
|
|
|
|
* in emergency situations since it bypasses the normal shutdown
|
|
|
|
* process.
|
|
|
|
*/
|
|
|
|
void KillHard();
|
|
|
|
|
2014-10-24 00:28:00 +00:00
|
|
|
ContentParentId ChildID() MOZ_OVERRIDE { return mChildID; }
|
2013-10-26 00:04:50 +00:00
|
|
|
const nsString& AppManifestURL() const { return mAppManifestURL; }
|
|
|
|
|
2013-04-26 00:53:26 +00:00
|
|
|
bool IsPreallocated();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a user-friendly name for this ContentParent. We make no guarantees
|
|
|
|
* about this name: It might not be unique, apps can spoof special names,
|
|
|
|
* etc. So please don't use this name to make any decisions about the
|
|
|
|
* ContentParent based on the value returned here.
|
|
|
|
*/
|
2014-05-21 06:06:54 +00:00
|
|
|
void FriendlyName(nsAString& aName, bool aAnonymize = false);
|
2012-12-28 17:57:35 +00:00
|
|
|
|
2013-06-03 10:14:40 +00:00
|
|
|
virtual void OnChannelError() MOZ_OVERRIDE;
|
|
|
|
|
2015-01-02 18:50:21 +00:00
|
|
|
virtual void OnBeginSyncTransaction() MOZ_OVERRIDE;
|
|
|
|
|
2013-06-03 10:14:37 +00:00
|
|
|
virtual PCrashReporterParent*
|
|
|
|
AllocPCrashReporterParent(const NativeThreadId& tid,
|
2014-01-17 17:46:41 +00:00
|
|
|
const uint32_t& processType) MOZ_OVERRIDE;
|
2013-06-03 10:14:37 +00:00
|
|
|
virtual bool
|
|
|
|
RecvPCrashReporterConstructor(PCrashReporterParent* actor,
|
|
|
|
const NativeThreadId& tid,
|
|
|
|
const uint32_t& processType) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual PNeckoParent* AllocPNeckoParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPNeckoConstructor(PNeckoParent* aActor) MOZ_OVERRIDE {
|
|
|
|
return PContentParent::RecvPNeckoConstructor(aActor);
|
|
|
|
}
|
|
|
|
|
2014-10-28 15:59:08 +00:00
|
|
|
virtual PPrintingParent* AllocPPrintingParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPPrintingConstructor(PPrintingParent* aActor) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPPrintingParent(PPrintingParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-07-14 17:22:26 +00:00
|
|
|
virtual PScreenManagerParent*
|
|
|
|
AllocPScreenManagerParent(uint32_t* aNumberOfScreens,
|
|
|
|
float* aSystemDefaultScale,
|
|
|
|
bool* aSuccess) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPScreenManagerParent(PScreenManagerParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2013-06-03 10:14:37 +00:00
|
|
|
virtual PHalParent* AllocPHalParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPHalConstructor(PHalParent* aActor) MOZ_OVERRIDE {
|
|
|
|
return PContentParent::RecvPHalConstructor(aActor);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual PStorageParent* AllocPStorageParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPStorageConstructor(PStorageParent* aActor) MOZ_OVERRIDE {
|
|
|
|
return PContentParent::RecvPStorageConstructor(aActor);
|
|
|
|
}
|
2013-06-03 10:14:40 +00:00
|
|
|
|
2013-06-03 10:14:37 +00:00
|
|
|
virtual PJavaScriptParent*
|
|
|
|
AllocPJavaScriptParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
RecvPJavaScriptConstructor(PJavaScriptParent* aActor) MOZ_OVERRIDE {
|
|
|
|
return PContentParent::RecvPJavaScriptConstructor(aActor);
|
|
|
|
}
|
2014-07-01 22:24:27 +00:00
|
|
|
virtual PRemoteSpellcheckEngineParent* AllocPRemoteSpellcheckEngineParent() MOZ_OVERRIDE;
|
2013-06-03 10:14:37 +00:00
|
|
|
|
2013-11-24 09:06:27 +00:00
|
|
|
virtual bool RecvRecordingDeviceEvents(const nsString& aRecordingStatus,
|
|
|
|
const nsString& aPageURL,
|
|
|
|
const bool& aIsAudio,
|
|
|
|
const bool& aIsVideo) MOZ_OVERRIDE;
|
2014-05-13 17:13:00 +00:00
|
|
|
|
|
|
|
bool CycleCollectWithLogs(bool aDumpAllTraces,
|
|
|
|
nsICycleCollectorLogSink* aSink,
|
|
|
|
nsIDumpGCAndCCLogsCallback* aCallback);
|
|
|
|
|
2014-06-11 05:44:03 +00:00
|
|
|
virtual PBlobParent* SendPBlobConstructor(
|
|
|
|
PBlobParent* aActor,
|
|
|
|
const BlobConstructorParams& aParams) MOZ_OVERRIDE;
|
|
|
|
|
2014-10-29 18:11:00 +00:00
|
|
|
virtual bool RecvAllocateTabId(const TabId& aOpenerTabId,
|
|
|
|
const IPCTabContext& aContext,
|
|
|
|
const ContentParentId& aCpId,
|
|
|
|
TabId* aTabId) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool RecvDeallocateTabId(const TabId& aTabId) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
nsTArray<TabContext> GetManagedTabContext();
|
2014-11-13 00:31:00 +00:00
|
|
|
|
|
|
|
virtual POfflineCacheUpdateParent*
|
|
|
|
AllocPOfflineCacheUpdateParent(const URIParams& aManifestURI,
|
|
|
|
const URIParams& aDocumentURI,
|
|
|
|
const bool& aStickDocument,
|
|
|
|
const TabId& aTabId) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
RecvPOfflineCacheUpdateConstructor(POfflineCacheUpdateParent* aActor,
|
|
|
|
const URIParams& aManifestURI,
|
|
|
|
const URIParams& aDocumentURI,
|
|
|
|
const bool& stickDocument,
|
|
|
|
const TabId& aTabId) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool RecvSetOfflinePermission(const IPC::Principal& principal) MOZ_OVERRIDE;
|
|
|
|
|
2015-01-10 18:18:59 +00:00
|
|
|
virtual bool RecvFinishShutdown() MOZ_OVERRIDE;
|
|
|
|
|
2010-02-02 01:53:52 +00:00
|
|
|
protected:
|
2013-06-05 16:15:48 +00:00
|
|
|
void OnChannelConnected(int32_t pid) MOZ_OVERRIDE;
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
2013-06-03 10:14:40 +00:00
|
|
|
void OnNuwaForkTimeout();
|
2010-02-02 01:53:52 +00:00
|
|
|
|
2013-08-27 04:56:57 +00:00
|
|
|
bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE;
|
|
|
|
|
2009-08-12 16:18:08 +00:00
|
|
|
private:
|
2013-04-26 00:53:26 +00:00
|
|
|
static nsDataHashtable<nsStringHashKey, ContentParent*> *sAppContentParents;
|
|
|
|
static nsTArray<ContentParent*>* sNonAppContentParents;
|
|
|
|
static nsTArray<ContentParent*>* sPrivateContent;
|
2013-07-17 21:31:10 +00:00
|
|
|
static StaticAutoPtr<LinkedList<ContentParent> > sContentParents;
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2012-12-28 09:45:16 +00:00
|
|
|
static void JoinProcessesIOThread(const nsTArray<ContentParent*>* aProcesses,
|
|
|
|
Monitor* aMonitor, bool* aDone);
|
|
|
|
|
2013-02-08 14:32:23 +00:00
|
|
|
// Take the preallocated process and transform it into a "real" app process,
|
|
|
|
// for the specified manifest URL. If there is no preallocated process (or
|
2014-08-13 06:18:00 +00:00
|
|
|
// if it's dead), create a new one and set aTookPreAllocated to false.
|
2013-02-08 14:32:23 +00:00
|
|
|
static already_AddRefed<ContentParent>
|
2014-08-13 06:18:00 +00:00
|
|
|
GetNewOrPreallocatedAppProcess(mozIApplication* aApp,
|
|
|
|
hal::ProcessPriority aInitialPriority,
|
|
|
|
ContentParent* aOpener,
|
|
|
|
/*out*/ bool* aTookPreAllocated = nullptr);
|
2013-02-14 20:41:30 +00:00
|
|
|
|
2013-07-23 23:39:17 +00:00
|
|
|
static hal::ProcessPriority GetInitialProcessPriority(Element* aFrameElement);
|
2013-02-08 14:32:23 +00:00
|
|
|
|
2014-08-13 06:18:00 +00:00
|
|
|
static ContentBridgeParent* CreateContentBridgeParent(const TabContext& aContext,
|
2014-10-29 18:11:00 +00:00
|
|
|
const hal::ProcessPriority& aPriority,
|
|
|
|
const TabId& aOpenerTabId,
|
|
|
|
/*out*/ TabId* aTabId);
|
2014-08-13 06:18:00 +00:00
|
|
|
|
2009-08-12 18:31:48 +00:00
|
|
|
// Hide the raw constructor methods since we don't want client code
|
|
|
|
// using them.
|
2014-06-11 05:44:13 +00:00
|
|
|
virtual PBrowserParent* SendPBrowserConstructor(
|
|
|
|
PBrowserParent* actor,
|
2014-10-29 18:11:00 +00:00
|
|
|
const TabId& aTabId,
|
2014-06-11 05:44:13 +00:00
|
|
|
const IPCTabContext& context,
|
|
|
|
const uint32_t& chromeFlags,
|
2014-10-24 00:28:00 +00:00
|
|
|
const ContentParentId& aCpId,
|
2014-06-11 05:44:13 +00:00
|
|
|
const bool& aIsForApp,
|
|
|
|
const bool& aIsForBrowser) MOZ_OVERRIDE;
|
2010-07-19 18:33:33 +00:00
|
|
|
using PContentParent::SendPTestShellConstructor;
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2013-04-26 00:53:26 +00:00
|
|
|
// No more than one of !!aApp, aIsForBrowser, and aIsForPreallocated may be
|
|
|
|
// true.
|
|
|
|
ContentParent(mozIApplication* aApp,
|
2014-06-11 05:44:13 +00:00
|
|
|
ContentParent* aOpener,
|
2013-04-26 00:53:26 +00:00
|
|
|
bool aIsForBrowser,
|
|
|
|
bool aIsForPreallocated,
|
2013-06-03 10:14:40 +00:00
|
|
|
hal::ProcessPriority aInitialPriority = hal::PROCESS_PRIORITY_FOREGROUND,
|
|
|
|
bool aIsNuwaProcess = false);
|
|
|
|
|
|
|
|
#ifdef MOZ_NUWA_PROCESS
|
|
|
|
ContentParent(ContentParent* aTemplate,
|
|
|
|
const nsAString& aAppManifestURL,
|
|
|
|
base::ProcessHandle aPid,
|
2014-03-12 22:48:15 +00:00
|
|
|
const nsTArray<ProtocolFdMapping>& aFds);
|
2013-06-03 10:14:40 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// The common initialization for the constructors.
|
|
|
|
void InitializeMembers();
|
2013-04-26 00:53:26 +00:00
|
|
|
|
2013-11-29 09:28:54 +00:00
|
|
|
// The common initialization logic shared by all constuctors.
|
|
|
|
void InitInternal(ProcessPriority aPriority,
|
|
|
|
bool aSetupOffMainThreadCompositing,
|
|
|
|
bool aSendRegisteredChrome);
|
|
|
|
|
2010-07-19 18:33:33 +00:00
|
|
|
virtual ~ContentParent();
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2010-12-26 20:03:52 +00:00
|
|
|
void Init();
|
|
|
|
|
2014-08-01 18:02:55 +00:00
|
|
|
// If the frame element indicates that the child process is "critical" and
|
|
|
|
// has a pending system message, this function acquires the CPU wake lock on
|
|
|
|
// behalf of the child. We'll release the lock when the system message is
|
|
|
|
// handled or after a timeout, whichever comes first.
|
|
|
|
void MaybeTakeCPUWakeLock(Element* aFrameElement);
|
|
|
|
|
2013-02-14 20:41:30 +00:00
|
|
|
// Set the child process's priority and then check whether the child is
|
|
|
|
// still alive. Returns true if the process is still alive, and false
|
|
|
|
// otherwise. If you pass a FOREGROUND* priority here, it's (hopefully)
|
|
|
|
// unlikely that the process will be killed after this point.
|
|
|
|
bool SetPriorityAndCheckIsAlive(hal::ProcessPriority aPriority);
|
|
|
|
|
2012-08-16 01:46:03 +00:00
|
|
|
// Transform a pre-allocated app process into a "real" app
|
2014-03-12 22:48:15 +00:00
|
|
|
// process, for the specified manifest URL.
|
2014-09-09 08:57:53 +00:00
|
|
|
void TransformPreallocatedIntoApp(ContentParent* aOpener,
|
|
|
|
const nsAString& aAppManifestURL);
|
2012-08-16 01:46:03 +00:00
|
|
|
|
2014-02-13 10:42:41 +00:00
|
|
|
// Transform a pre-allocated app process into a browser process. If this
|
|
|
|
// returns false, the child process has died.
|
2014-09-09 08:57:53 +00:00
|
|
|
void TransformPreallocatedIntoBrowser(ContentParent* aOpener);
|
2014-02-13 10:42:41 +00:00
|
|
|
|
2012-07-17 18:27:27 +00:00
|
|
|
/**
|
|
|
|
* Mark this ContentParent as dead for the purposes of Get*().
|
|
|
|
* This method is idempotent.
|
|
|
|
*/
|
|
|
|
void MarkAsDead();
|
|
|
|
|
2015-01-10 18:18:59 +00:00
|
|
|
/**
|
|
|
|
* How we will shut down this ContentParent and its subprocess.
|
|
|
|
*/
|
|
|
|
enum ShutDownMethod {
|
|
|
|
// Send a shutdown message and wait for FinishShutdown call back.
|
|
|
|
SEND_SHUTDOWN_MESSAGE,
|
|
|
|
// Close the channel ourselves and let the subprocess clean up itself.
|
|
|
|
CLOSE_CHANNEL,
|
|
|
|
// Close the channel with error and let the subprocess clean up itself.
|
|
|
|
CLOSE_CHANNEL_WITH_ERROR,
|
|
|
|
};
|
|
|
|
|
2012-07-17 18:27:27 +00:00
|
|
|
/**
|
|
|
|
* Exit the subprocess and vamoose. After this call IsAlive()
|
|
|
|
* will return false and this ContentParent will not be returned
|
|
|
|
* by the Get*() funtions. However, the shutdown sequence itself
|
|
|
|
* may be asynchronous.
|
2013-07-15 12:55:13 +00:00
|
|
|
*
|
2015-01-10 18:18:59 +00:00
|
|
|
* If aMethod is CLOSE_CHANNEL_WITH_ERROR and this is the first call
|
|
|
|
* to ShutDownProcess, then we'll close our channel using CloseWithError()
|
2013-07-15 12:55:13 +00:00
|
|
|
* rather than vanilla Close(). CloseWithError() indicates to IPC that this
|
2013-07-17 19:13:20 +00:00
|
|
|
* is an abnormal shutdown (e.g. a crash).
|
2012-07-17 18:27:27 +00:00
|
|
|
*/
|
2015-01-10 18:18:59 +00:00
|
|
|
void ShutDownProcess(ShutDownMethod aMethod);
|
2012-07-17 18:27:27 +00:00
|
|
|
|
2014-05-30 21:03:05 +00:00
|
|
|
// Perform any steps necesssary to gracefully shtudown the message
|
|
|
|
// manager and null out mMessageManager.
|
|
|
|
void ShutDownMessageManager();
|
|
|
|
|
2015-01-10 18:45:58 +00:00
|
|
|
// Start the force-kill timer on shutdown.
|
|
|
|
void StartForceKillTimer();
|
|
|
|
|
2015-01-07 05:42:23 +00:00
|
|
|
static void ForceKillTimerCallback(nsITimer* aTimer, void* aClosure);
|
|
|
|
|
2013-09-26 04:19:09 +00:00
|
|
|
PCompositorParent*
|
2013-07-08 15:48:39 +00:00
|
|
|
AllocPCompositorParent(mozilla::ipc::Transport* aTransport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
2013-09-26 04:19:09 +00:00
|
|
|
PImageBridgeParent*
|
2013-07-08 15:48:39 +00:00
|
|
|
AllocPImageBridgeParent(mozilla::ipc::Transport* aTransport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
2012-07-17 23:59:45 +00:00
|
|
|
|
2014-05-01 01:52:00 +00:00
|
|
|
PSharedBufferManagerParent*
|
|
|
|
AllocPSharedBufferManagerParent(mozilla::ipc::Transport* aTranport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
2013-11-27 07:59:41 +00:00
|
|
|
PBackgroundParent*
|
|
|
|
AllocPBackgroundParent(Transport* aTransport, ProcessId aOtherProcess)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
|
2014-10-24 00:28:00 +00:00
|
|
|
virtual bool RecvGetProcessAttributes(ContentParentId* aCpId,
|
2012-09-05 00:36:16 +00:00
|
|
|
bool* aIsForApp,
|
|
|
|
bool* aIsForBrowser) MOZ_OVERRIDE;
|
2014-10-03 14:52:37 +00:00
|
|
|
virtual bool RecvGetXPCOMProcessAttributes(bool* aIsOffline,
|
2014-10-22 09:50:00 +00:00
|
|
|
InfallibleTArray<nsString>* dictionaries,
|
|
|
|
ClipboardCapabilities* clipboardCaps)
|
2014-10-03 14:52:37 +00:00
|
|
|
MOZ_OVERRIDE;
|
2012-09-05 00:36:16 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*) MOZ_OVERRIDE;
|
2013-07-03 07:24:32 +00:00
|
|
|
|
2014-07-01 22:24:27 +00:00
|
|
|
virtual bool DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParent*) MOZ_OVERRIDE;
|
2014-10-29 18:11:00 +00:00
|
|
|
virtual PBrowserParent* AllocPBrowserParent(const TabId& aTabId,
|
|
|
|
const IPCTabContext& aContext,
|
2014-06-03 21:15:27 +00:00
|
|
|
const uint32_t& aChromeFlags,
|
2014-10-24 00:28:00 +00:00
|
|
|
const ContentParentId& aCpId,
|
2014-06-03 21:15:27 +00:00
|
|
|
const bool& aIsForApp,
|
|
|
|
const bool& aIsForBrowser) MOZ_OVERRIDE;
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool DeallocPBrowserParent(PBrowserParent* frame) MOZ_OVERRIDE;
|
2009-08-12 16:18:08 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PDeviceStorageRequestParent*
|
|
|
|
AllocPDeviceStorageRequestParent(const DeviceStorageParams&) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent*) MOZ_OVERRIDE;
|
2012-06-19 23:14:39 +00:00
|
|
|
|
2014-03-05 03:25:40 +00:00
|
|
|
virtual PFileSystemRequestParent*
|
|
|
|
AllocPFileSystemRequestParent(const FileSystemParams&) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPFileSystemRequestParent(PFileSystemRequestParent*) MOZ_OVERRIDE;
|
|
|
|
|
2014-09-26 23:21:57 +00:00
|
|
|
virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPBlobParent(PBlobParent* aActor) MOZ_OVERRIDE;
|
2012-08-02 06:02:29 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) MOZ_OVERRIDE;
|
2010-11-24 14:15:03 +00:00
|
|
|
|
2013-02-27 20:31:19 +00:00
|
|
|
virtual bool RecvGetRandomValues(const uint32_t& length,
|
2014-01-17 17:46:41 +00:00
|
|
|
InfallibleTArray<uint8_t>* randomValues) MOZ_OVERRIDE;
|
2013-02-27 20:31:19 +00:00
|
|
|
|
2015-01-06 20:14:41 +00:00
|
|
|
virtual bool RecvIsSecureURI(const uint32_t& aType, const URIParams& aURI,
|
|
|
|
const uint32_t& aFlags, bool* aIsSecureURI) MOZ_OVERRIDE;
|
2014-07-22 12:17:45 +00:00
|
|
|
|
2013-07-08 15:48:39 +00:00
|
|
|
virtual bool DeallocPHalParent(PHalParent*) MOZ_OVERRIDE;
|
2011-10-05 22:15:45 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PMemoryReportRequestParent*
|
2014-05-21 06:06:54 +00:00
|
|
|
AllocPMemoryReportRequestParent(const uint32_t& aGeneration,
|
|
|
|
const bool &aAnonymize,
|
|
|
|
const bool &aMinimizeMemoryUsage,
|
2014-09-18 15:59:00 +00:00
|
|
|
const MaybeFileDesc &aDMDFile) MOZ_OVERRIDE;
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor) MOZ_OVERRIDE;
|
2011-02-16 18:43:23 +00:00
|
|
|
|
2014-05-13 17:13:00 +00:00
|
|
|
virtual PCycleCollectWithLogsParent*
|
|
|
|
AllocPCycleCollectWithLogsParent(const bool& aDumpAllTraces,
|
|
|
|
const FileDescriptor& aGCLog,
|
|
|
|
const FileDescriptor& aCCLog) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
DeallocPCycleCollectWithLogsParent(PCycleCollectWithLogsParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PTestShellParent* AllocPTestShellParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPTestShellParent(PTestShellParent* shell) MOZ_OVERRIDE;
|
2009-08-12 18:31:48 +00:00
|
|
|
|
2014-07-01 10:28:18 +00:00
|
|
|
virtual PMobileConnectionParent* AllocPMobileConnectionParent(const uint32_t& aClientId) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPMobileConnectionParent(PMobileConnectionParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool DeallocPNeckoParent(PNeckoParent* necko) MOZ_OVERRIDE;
|
2009-08-18 19:05:15 +00:00
|
|
|
|
2013-07-08 15:48:39 +00:00
|
|
|
virtual PExternalHelperAppParent* AllocPExternalHelperAppParent(
|
2012-08-23 19:33:46 +00:00
|
|
|
const OptionalURIParams& aUri,
|
2010-09-15 22:55:08 +00:00
|
|
|
const nsCString& aMimeContentType,
|
|
|
|
const nsCString& aContentDisposition,
|
2014-02-13 22:43:58 +00:00
|
|
|
const uint32_t& aContentDispositionHint,
|
2014-08-18 09:06:11 +00:00
|
|
|
const nsString& aContentDispositionFilename,
|
2010-09-15 22:55:08 +00:00
|
|
|
const bool& aForceSave,
|
2012-08-22 15:56:38 +00:00
|
|
|
const int64_t& aContentLength,
|
2013-09-12 19:24:10 +00:00
|
|
|
const OptionalURIParams& aReferrer,
|
2014-01-17 17:46:41 +00:00
|
|
|
PBrowserParent* aBrowser) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService) MOZ_OVERRIDE;
|
2010-09-15 22:55:08 +00:00
|
|
|
|
2014-08-18 09:06:11 +00:00
|
|
|
virtual PCellBroadcastParent* AllocPCellBroadcastParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPCellBroadcastParent(PCellBroadcastParent*) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPCellBroadcastConstructor(PCellBroadcastParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PSmsParent* AllocPSmsParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPSmsParent(PSmsParent*) MOZ_OVERRIDE;
|
2011-11-20 22:40:53 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PTelephonyParent* AllocPTelephonyParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPTelephonyParent(PTelephonyParent*) MOZ_OVERRIDE;
|
2013-09-07 06:19:53 +00:00
|
|
|
|
2014-09-26 05:00:24 +00:00
|
|
|
virtual PVoicemailParent* AllocPVoicemailParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPVoicemailConstructor(PVoicemailParent* aActor) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPVoicemailParent(PVoicemailParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool DeallocPStorageParent(PStorageParent* aActor) MOZ_OVERRIDE;
|
2010-11-19 01:15:23 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PBluetoothParent* AllocPBluetoothParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPBluetoothParent(PBluetoothParent* aActor) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor) MOZ_OVERRIDE;
|
2012-09-13 16:37:14 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PFMRadioParent* AllocPFMRadioParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPFMRadioParent(PFMRadioParent* aActor) MOZ_OVERRIDE;
|
2013-09-03 22:28:06 +00:00
|
|
|
|
2013-11-18 21:49:53 +00:00
|
|
|
virtual PAsmJSCacheEntryParent* AllocPAsmJSCacheEntryParent(
|
|
|
|
const asmjscache::OpenMode& aOpenMode,
|
2013-12-05 04:32:52 +00:00
|
|
|
const asmjscache::WriteParams& aWriteParams,
|
2013-11-18 21:49:53 +00:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPAsmJSCacheEntryParent(
|
|
|
|
PAsmJSCacheEntryParent* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor) MOZ_OVERRIDE;
|
2013-04-03 22:13:17 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue) MOZ_OVERRIDE;
|
2010-05-28 18:09:15 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions) MOZ_OVERRIDE;
|
2011-04-29 23:46:20 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvSetClipboardText(const nsString& text,
|
|
|
|
const bool& isPrivateData,
|
|
|
|
const int32_t& whichClipboard) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvGetClipboardText(const int32_t& whichClipboard, nsString* text) MOZ_OVERRIDE;
|
2014-02-10 00:13:10 +00:00
|
|
|
virtual bool RecvEmptyClipboard(const int32_t& whichClipboard) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvClipboardHasText(const int32_t& whichClipboard, bool* hasText) MOZ_OVERRIDE;
|
2010-05-26 00:13:47 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvGetSystemColors(const uint32_t& colorsCount,
|
|
|
|
InfallibleTArray<uint32_t>* colors) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvGetIconForExtension(const nsCString& aFileExt,
|
|
|
|
const uint32_t& aIconSize,
|
|
|
|
InfallibleTArray<uint8_t>* bits) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvGetShowPasswordSetting(bool* showPassword) MOZ_OVERRIDE;
|
2011-03-30 18:04:41 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvStartVisitedQuery(const URIParams& uri) MOZ_OVERRIDE;
|
2010-07-02 15:50:41 +00:00
|
|
|
|
2012-08-23 19:33:46 +00:00
|
|
|
virtual bool RecvVisitURI(const URIParams& uri,
|
|
|
|
const OptionalURIParams& referrer,
|
2014-01-17 17:46:41 +00:00
|
|
|
const uint32_t& flags) MOZ_OVERRIDE;
|
2010-07-02 15:50:24 +00:00
|
|
|
|
2012-08-23 19:33:46 +00:00
|
|
|
virtual bool RecvSetURITitle(const URIParams& uri,
|
2014-01-17 17:46:41 +00:00
|
|
|
const nsString& title) MOZ_OVERRIDE;
|
2012-12-06 03:01:58 +00:00
|
|
|
|
2010-09-15 16:44:57 +00:00
|
|
|
virtual bool RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle,
|
2011-09-29 06:19:26 +00:00
|
|
|
const nsString& aText, const bool& aTextClickable,
|
2013-03-18 13:24:53 +00:00
|
|
|
const nsString& aCookie, const nsString& aName,
|
2013-11-11 23:56:21 +00:00
|
|
|
const nsString& aBidi, const nsString& aLang,
|
2014-08-21 00:56:12 +00:00
|
|
|
const nsString& aData,
|
2014-11-28 19:08:29 +00:00
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
const bool& aInPrivateBrowsing) MOZ_OVERRIDE;
|
2013-03-18 13:24:53 +00:00
|
|
|
|
2013-11-11 23:56:21 +00:00
|
|
|
virtual bool RecvCloseAlert(const nsString& aName,
|
2014-01-17 17:46:41 +00:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
2010-07-02 15:53:42 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvLoadURIExternal(const URIParams& uri) MOZ_OVERRIDE;
|
2010-08-10 17:14:45 +00:00
|
|
|
|
2012-08-02 06:02:29 +00:00
|
|
|
virtual bool RecvSyncMessage(const nsString& aMsg,
|
|
|
|
const ClonedMessageData& aData,
|
2013-07-10 22:05:39 +00:00
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
2013-11-06 17:21:15 +00:00
|
|
|
const IPC::Principal& aPrincipal,
|
2014-01-17 17:46:41 +00:00
|
|
|
InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
|
2014-10-08 04:32:45 +00:00
|
|
|
virtual bool RecvRpcMessage(const nsString& aMsg,
|
|
|
|
const ClonedMessageData& aData,
|
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
|
2012-08-02 06:02:29 +00:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMsg,
|
2013-07-10 22:05:39 +00:00
|
|
|
const ClonedMessageData& aData,
|
2013-11-06 17:21:15 +00:00
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
2014-01-17 17:46:41 +00:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
2010-08-31 18:58:35 +00:00
|
|
|
|
2013-01-09 15:03:28 +00:00
|
|
|
virtual bool RecvFilePathUpdateNotify(const nsString& aType,
|
2013-05-11 09:10:18 +00:00
|
|
|
const nsString& aStorageName,
|
2013-01-09 15:03:28 +00:00
|
|
|
const nsString& aFilePath,
|
2014-01-17 17:46:41 +00:00
|
|
|
const nsCString& aReason) MOZ_OVERRIDE;
|
2013-01-09 15:03:28 +00:00
|
|
|
|
2013-02-26 17:27:31 +00:00
|
|
|
virtual bool RecvAddGeolocationListener(const IPC::Principal& aPrincipal,
|
2014-01-17 17:46:41 +00:00
|
|
|
const bool& aHighAccuracy) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvRemoveGeolocationListener() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable) MOZ_OVERRIDE;
|
2010-09-21 04:16:37 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvConsoleMessage(const nsString& aMessage) MOZ_OVERRIDE;
|
2010-09-24 01:39:32 +00:00
|
|
|
virtual bool RecvScriptError(const nsString& aMessage,
|
|
|
|
const nsString& aSourceName,
|
|
|
|
const nsString& aSourceLine,
|
2012-08-22 15:56:38 +00:00
|
|
|
const uint32_t& aLineNumber,
|
|
|
|
const uint32_t& aColNumber,
|
|
|
|
const uint32_t& aFlags,
|
2014-01-17 17:46:41 +00:00
|
|
|
const nsCString& aCategory) MOZ_OVERRIDE;
|
2010-09-24 01:39:32 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvPrivateDocShellsExist(const bool& aExist) MOZ_OVERRIDE;
|
2012-08-02 06:32:04 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvFirstIdle() MOZ_OVERRIDE;
|
2012-10-09 04:46:19 +00:00
|
|
|
|
2014-04-10 17:39:20 +00:00
|
|
|
virtual bool RecvAudioChannelGetState(const AudioChannel& aChannel,
|
2013-01-09 07:18:16 +00:00
|
|
|
const bool& aElementHidden,
|
|
|
|
const bool& aElementWasHidden,
|
2014-01-17 17:46:41 +00:00
|
|
|
AudioChannelState* aValue) MOZ_OVERRIDE;
|
2012-12-06 03:01:58 +00:00
|
|
|
|
2014-04-10 17:39:20 +00:00
|
|
|
virtual bool RecvAudioChannelRegisterType(const AudioChannel& aChannel,
|
2014-01-17 17:46:41 +00:00
|
|
|
const bool& aWithVideo) MOZ_OVERRIDE;
|
2014-04-10 17:39:20 +00:00
|
|
|
virtual bool RecvAudioChannelUnregisterType(const AudioChannel& aChannel,
|
2013-09-18 03:46:22 +00:00
|
|
|
const bool& aElementHidden,
|
2014-01-17 17:46:41 +00:00
|
|
|
const bool& aWithVideo) MOZ_OVERRIDE;
|
2013-01-09 07:18:16 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvAudioChannelChangedNotification() MOZ_OVERRIDE;
|
2012-12-06 03:01:58 +00:00
|
|
|
|
2014-04-10 17:39:20 +00:00
|
|
|
virtual bool RecvAudioChannelChangeDefVolChannel(const int32_t& aChannel,
|
2014-01-17 17:46:41 +00:00
|
|
|
const bool& aHidden) MOZ_OVERRIDE;
|
2014-05-21 05:49:36 +00:00
|
|
|
virtual bool RecvGetSystemMemory(const uint64_t& getterId) MOZ_OVERRIDE;
|
2014-09-15 18:51:25 +00:00
|
|
|
virtual bool RecvGetVolumes(InfallibleTArray<VolumeInfo>* aResult) MOZ_OVERRIDE;
|
2012-12-15 00:01:34 +00:00
|
|
|
|
2014-06-03 14:36:46 +00:00
|
|
|
virtual bool RecvDataStoreGetStores(
|
|
|
|
const nsString& aName,
|
2014-07-17 03:53:23 +00:00
|
|
|
const nsString& aOwner,
|
2014-06-03 14:36:46 +00:00
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
InfallibleTArray<DataStoreSetting>* aValue) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvSpeakerManagerGetSpeakerStatus(bool* aValue) MOZ_OVERRIDE;
|
2013-11-24 23:50:03 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvSpeakerManagerForceSpeaker(const bool& aEnable) MOZ_OVERRIDE;
|
2013-11-24 23:50:03 +00:00
|
|
|
|
2013-02-14 20:41:30 +00:00
|
|
|
virtual bool RecvSystemMessageHandled() MOZ_OVERRIDE;
|
|
|
|
|
2013-06-03 10:14:40 +00:00
|
|
|
virtual bool RecvNuwaReady() MOZ_OVERRIDE;
|
|
|
|
|
2014-12-18 09:01:04 +00:00
|
|
|
virtual bool RecvNuwaWaitForFreeze() MOZ_OVERRIDE;
|
|
|
|
|
2013-06-03 10:14:40 +00:00
|
|
|
virtual bool RecvAddNewProcess(const uint32_t& aPid,
|
|
|
|
const InfallibleTArray<ProtocolFdMapping>& aFds) MOZ_OVERRIDE;
|
|
|
|
|
2013-07-09 06:37:47 +00:00
|
|
|
virtual bool RecvCreateFakeVolume(const nsString& fsName, const nsString& mountPoint) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) MOZ_OVERRIDE;
|
|
|
|
|
2014-09-11 13:50:55 +00:00
|
|
|
virtual bool RecvKeywordToURI(const nsCString& aKeyword,
|
|
|
|
nsString* aProviderName,
|
|
|
|
OptionalInputStreamParams* aPostData,
|
2014-01-17 17:46:41 +00:00
|
|
|
OptionalURIParams* aURI) MOZ_OVERRIDE;
|
2013-08-16 17:59:31 +00:00
|
|
|
|
2014-09-11 13:50:55 +00:00
|
|
|
virtual bool RecvNotifyKeywordSearchLoading(const nsString &aProvider,
|
|
|
|
const nsString &aKeyword) MOZ_OVERRIDE;
|
|
|
|
|
2011-07-13 06:52:31 +00:00
|
|
|
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
|
|
|
|
|
2014-06-11 05:44:39 +00:00
|
|
|
virtual bool RecvAllocateLayerTreeId(uint64_t* aId) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvDeallocateLayerTreeId(const uint64_t& aId) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-11 01:09:20 +00:00
|
|
|
virtual bool RecvGetGraphicsFeatureStatus(const int32_t& aFeature,
|
|
|
|
int32_t* aStatus,
|
2014-01-17 17:46:41 +00:00
|
|
|
bool* aSuccess) MOZ_OVERRIDE;
|
2014-01-11 01:09:20 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvAddIdleObserver(const uint64_t& observerId,
|
|
|
|
const uint32_t& aIdleTimeInS) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvRemoveIdleObserver(const uint64_t& observerId,
|
|
|
|
const uint32_t& aIdleTimeInS) MOZ_OVERRIDE;
|
2013-12-13 16:28:46 +00:00
|
|
|
|
2014-02-05 16:37:26 +00:00
|
|
|
virtual bool
|
|
|
|
RecvBackUpXResources(const FileDescriptor& aXSocketFd) MOZ_OVERRIDE;
|
|
|
|
|
2014-06-24 17:11:36 +00:00
|
|
|
virtual bool
|
|
|
|
RecvOpenAnonymousTemporaryFile(FileDescriptor* aFD) MOZ_OVERRIDE;
|
|
|
|
|
2014-11-26 22:28:28 +00:00
|
|
|
virtual bool
|
2014-12-19 17:07:04 +00:00
|
|
|
RecvKeygenProcessValue(const nsString& oldValue, const nsString& challenge,
|
|
|
|
const nsString& keytype, const nsString& keyparams,
|
|
|
|
nsString* newValue) MOZ_OVERRIDE;
|
2014-11-26 22:28:28 +00:00
|
|
|
|
|
|
|
virtual bool
|
2014-12-19 17:07:04 +00:00
|
|
|
RecvKeygenProvideContent(nsString* aAttribute,
|
|
|
|
nsTArray<nsString>* aContent) MOZ_OVERRIDE;
|
2014-11-26 22:28:28 +00:00
|
|
|
|
2014-03-25 18:37:13 +00:00
|
|
|
virtual PFileDescriptorSetParent*
|
|
|
|
AllocPFileDescriptorSetParent(const mozilla::ipc::FileDescriptor&) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPFileDescriptorSetParent(PFileDescriptorSetParent*) MOZ_OVERRIDE;
|
|
|
|
|
2014-09-26 23:21:57 +00:00
|
|
|
virtual bool
|
|
|
|
RecvGetFileReferences(const PersistenceType& aPersistenceType,
|
|
|
|
const nsCString& aOrigin,
|
|
|
|
const nsString& aDatabaseName,
|
|
|
|
const int64_t& aFileId,
|
|
|
|
int32_t* aRefCnt,
|
|
|
|
int32_t* aDBRefCnt,
|
|
|
|
int32_t* aSliceRefCnt,
|
|
|
|
bool* aResult) MOZ_OVERRIDE;
|
|
|
|
|
2014-03-07 21:35:19 +00:00
|
|
|
virtual PDocAccessibleParent* AllocPDocAccessibleParent(PDocAccessibleParent*, const uint64_t&) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPDocAccessibleParent(PDocAccessibleParent*) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc,
|
|
|
|
PDocAccessibleParent* aParentDoc, const uint64_t& aParentID) MOZ_OVERRIDE;
|
|
|
|
|
2013-07-31 21:26:19 +00:00
|
|
|
// If you add strong pointers to cycle collected objects here, be sure to
|
|
|
|
// release these objects in ShutDownProcess. See the comment there for more
|
|
|
|
// details.
|
|
|
|
|
2009-09-03 00:18:27 +00:00
|
|
|
GeckoChildProcessHost* mSubprocess;
|
2014-06-11 05:44:13 +00:00
|
|
|
ContentParent* mOpener;
|
2010-02-02 01:53:52 +00:00
|
|
|
|
2014-10-24 00:28:00 +00:00
|
|
|
ContentParentId mChildID;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mGeolocationWatchID;
|
2010-02-02 01:53:52 +00:00
|
|
|
|
2013-04-26 00:53:26 +00:00
|
|
|
nsString mAppManifestURL;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* We cache mAppName instead of looking it up using mAppManifestURL when we
|
|
|
|
* need it because it turns out that getting an app from the apps service is
|
|
|
|
* expensive.
|
|
|
|
*/
|
|
|
|
nsString mAppName;
|
|
|
|
|
2013-01-10 13:22:14 +00:00
|
|
|
// After we initiate shutdown, we also start a timer to ensure
|
|
|
|
// that even content processes that are 100% blocked (say from
|
|
|
|
// SIGSTOP), are still killed eventually. This task enforces that
|
|
|
|
// timer.
|
2015-01-07 05:42:23 +00:00
|
|
|
nsCOMPtr<nsITimer> mForceKillTimer;
|
2013-01-10 13:22:14 +00:00
|
|
|
// How many tabs we're waiting to finish their destruction
|
|
|
|
// sequence. Precisely, how many TabParents have called
|
|
|
|
// NotifyTabDestroying() but not called NotifyTabDestroyed().
|
|
|
|
int32_t mNumDestroyingTabs;
|
2012-11-27 20:43:52 +00:00
|
|
|
// True only while this is ready to be used to host remote tabs.
|
|
|
|
// This must not be used for new purposes after mIsAlive goes to
|
|
|
|
// false, but some previously scheduled IPC traffic may still pass
|
|
|
|
// through.
|
2012-09-05 00:36:16 +00:00
|
|
|
bool mIsAlive;
|
2013-08-07 18:08:52 +00:00
|
|
|
|
2012-09-05 00:36:16 +00:00
|
|
|
bool mSendPermissionUpdates;
|
2014-06-03 14:36:46 +00:00
|
|
|
bool mSendDataStoreInfos;
|
2012-09-05 00:36:16 +00:00
|
|
|
bool mIsForBrowser;
|
2014-01-14 18:35:08 +00:00
|
|
|
bool mIsNuwaProcess;
|
2012-09-05 00:36:16 +00:00
|
|
|
|
2013-08-17 00:44:17 +00:00
|
|
|
// These variables track whether we've called Close(), CloseWithError()
|
|
|
|
// and KillHard() on our channel.
|
2013-08-07 18:08:52 +00:00
|
|
|
bool mCalledClose;
|
|
|
|
bool mCalledCloseWithError;
|
2013-08-17 00:44:17 +00:00
|
|
|
bool mCalledKillHard;
|
2014-12-18 18:52:00 +00:00
|
|
|
bool mCreatedPairedMinidumps;
|
2015-01-10 18:18:59 +00:00
|
|
|
bool mShutdownPending;
|
2015-01-10 18:39:33 +00:00
|
|
|
bool mIPCOpen;
|
2013-08-07 18:08:52 +00:00
|
|
|
|
2011-06-08 19:56:31 +00:00
|
|
|
friend class CrashReporterParent;
|
2012-11-09 17:52:09 +00:00
|
|
|
|
|
|
|
nsRefPtr<nsConsoleService> mConsoleService;
|
2012-11-09 18:23:18 +00:00
|
|
|
nsConsoleService* GetConsoleService();
|
2013-12-13 16:28:46 +00:00
|
|
|
|
2014-03-18 00:23:03 +00:00
|
|
|
nsDataHashtable<nsUint64HashKey, nsRefPtr<ParentIdleListener> > mIdleListeners;
|
2014-02-05 16:37:26 +00:00
|
|
|
|
|
|
|
#ifdef MOZ_X11
|
|
|
|
// Dup of child's X socket, used to scope its resources to this
|
|
|
|
// object instead of the child process's lifetime.
|
|
|
|
ScopedClose mChildXSocketFdDup;
|
|
|
|
#endif
|
2014-08-22 05:41:34 +00:00
|
|
|
|
|
|
|
#ifdef MOZ_NUWA_PROCESS
|
2014-09-30 14:12:11 +00:00
|
|
|
static int32_t sNuwaPid;
|
2014-08-22 05:41:34 +00:00
|
|
|
static bool sNuwaReady;
|
|
|
|
#endif
|
2009-08-12 16:18:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-12-13 16:28:46 +00:00
|
|
|
class ParentIdleListener : public nsIObserver {
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
|
|
|
ParentIdleListener(mozilla::dom::ContentParent* aParent, uint64_t aObserver)
|
|
|
|
: mParent(aParent), mObserver(aObserver)
|
|
|
|
{}
|
|
|
|
private:
|
2014-06-23 19:56:07 +00:00
|
|
|
virtual ~ParentIdleListener() {}
|
2013-12-13 16:28:46 +00:00
|
|
|
nsRefPtr<mozilla::dom::ContentParent> mParent;
|
|
|
|
uint64_t mObserver;
|
|
|
|
};
|
|
|
|
|
2009-08-12 16:18:08 +00:00
|
|
|
#endif
|