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-08-12 20:18:08 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
#ifndef mozilla_dom_ContentChild_h
|
|
|
|
#define mozilla_dom_ContentChild_h
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2017-08-03 12:22:11 +03:00
|
|
|
#include "mozilla/Atomics.h"
|
2011-12-18 01:45:29 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-06-11 09:44:13 +04:00
|
|
|
#include "mozilla/dom/ContentBridgeParent.h"
|
2014-06-11 09:44:06 +04:00
|
|
|
#include "mozilla/dom/nsIContentChild.h"
|
2014-11-04 04:58:00 +03:00
|
|
|
#include "mozilla/dom/PBrowserOrId.h"
|
2010-07-19 22:33:33 +04:00
|
|
|
#include "mozilla/dom/PContentChild.h"
|
2017-09-16 01:48:37 +03:00
|
|
|
#include "mozilla/StaticPtr.h"
|
2016-06-07 23:10:18 +03:00
|
|
|
#include "nsAutoPtr.h"
|
2014-04-21 21:18:53 +04:00
|
|
|
#include "nsHashKeys.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsTHashtable.h"
|
2016-07-14 10:04:21 +03:00
|
|
|
#include "nsRefPtrHashtable.h"
|
2014-04-21 21:18:53 +04:00
|
|
|
|
2015-10-30 02:30:57 +03:00
|
|
|
#include "nsIWindowProvider.h"
|
2009-08-26 03:07:22 +04:00
|
|
|
|
2016-08-30 23:32:21 +03:00
|
|
|
#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
|
|
|
|
# include "nsIFile.h"
|
|
|
|
#endif
|
2014-04-21 21:18:53 +04:00
|
|
|
|
2010-03-11 08:33:00 +03:00
|
|
|
struct ChromePackage;
|
2010-07-21 22:42:32 +04:00
|
|
|
class nsIObserver;
|
2015-07-17 01:50:07 +03:00
|
|
|
struct SubstitutionMapping;
|
2010-03-11 08:33:00 +03:00
|
|
|
struct OverrideMapping;
|
2015-03-24 17:29:16 +03:00
|
|
|
class nsIDomainPolicy;
|
2016-11-19 00:54:57 +03:00
|
|
|
class nsIURIClassifierCallback;
|
2016-11-18 23:36:18 +03:00
|
|
|
struct LookAndFeelInt;
|
2018-10-30 03:13:29 +03:00
|
|
|
class nsDocShellLoadState;
|
2010-03-11 08:33:00 +03:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace mozilla {
|
2014-07-02 02:24:27 +04:00
|
|
|
class RemoteSpellcheckEngineChild;
|
2017-05-30 22:06:14 +03:00
|
|
|
class ChildProfilerController;
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2017-05-03 03:17:52 +03:00
|
|
|
using mozilla::loader::PScriptCacheChild;
|
|
|
|
|
2017-08-10 02:09:55 +03:00
|
|
|
#if !defined(XP_WIN)
|
|
|
|
// Returns whether or not the currently running build is an unpackaged
|
|
|
|
// developer build. This check is implemented by looking for omni.ja in the
|
|
|
|
// the obj/dist dir. We use this routine to detect when the build dir will
|
|
|
|
// use symlinks to the repo and object dir. On Windows, dev builds don't
|
|
|
|
// use symlinks.
|
|
|
|
bool IsDevelopmentBuild();
|
|
|
|
#endif /* !XP_WIN */
|
|
|
|
|
|
|
|
#if defined(XP_MACOSX)
|
|
|
|
// Return the repo directory and the repo object directory respectively. These
|
|
|
|
// should only be used on Mac developer builds to determine the path to the
|
|
|
|
// repo or object directory.
|
|
|
|
nsresult GetRepoDir(nsIFile** aRepoDir);
|
|
|
|
nsresult GetObjDir(nsIFile** aObjDir);
|
|
|
|
#endif /* XP_MACOSX */
|
|
|
|
|
2012-08-23 23:33:46 +04:00
|
|
|
namespace ipc {
|
|
|
|
class OptionalURIParams;
|
|
|
|
class URIParams;
|
|
|
|
} // namespace ipc
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
|
|
|
|
2018-06-23 06:35:49 +03:00
|
|
|
namespace ipc {
|
|
|
|
class SharedMap;
|
|
|
|
}
|
|
|
|
|
2010-09-15 20:44:57 +04:00
|
|
|
class AlertObserver;
|
2010-09-24 05:39:32 +04:00
|
|
|
class ConsoleListener;
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2014-11-04 04:58:00 +03:00
|
|
|
class TabChild;
|
2016-07-14 10:04:21 +03:00
|
|
|
class GetFilesHelperChild;
|
2017-02-08 12:19:01 +03:00
|
|
|
class FileCreatorHelper;
|
2010-07-21 22:42:32 +04:00
|
|
|
|
2015-03-21 21:35:18 +03:00
|
|
|
class ContentChild final : public PContentChild,
|
2015-10-30 02:30:57 +03:00
|
|
|
public nsIWindowProvider,
|
2015-03-21 21:35:18 +03:00
|
|
|
public nsIContentChild {
|
2016-01-05 12:59:30 +03:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2016-09-21 13:27:26 +03:00
|
|
|
typedef mozilla::ipc::FileDescriptor FileDescriptor;
|
2016-01-05 12:59:30 +03:00
|
|
|
typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
|
|
|
|
typedef mozilla::ipc::PFileDescriptorSetChild PFileDescriptorSetChild;
|
|
|
|
typedef mozilla::ipc::URIParams URIParams;
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
public:
|
2016-01-05 12:59:30 +03:00
|
|
|
NS_DECL_NSIWINDOWPROVIDER
|
|
|
|
|
|
|
|
ContentChild();
|
|
|
|
virtual ~ContentChild();
|
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
|
|
|
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) override { return 1; }
|
|
|
|
NS_IMETHOD_(MozExternalRefCountType) Release(void) override { return 1; }
|
|
|
|
|
|
|
|
struct AppInfo {
|
|
|
|
nsCString version;
|
|
|
|
nsCString buildID;
|
|
|
|
nsCString name;
|
|
|
|
nsCString UAName;
|
|
|
|
nsCString ID;
|
|
|
|
nsCString vendor;
|
2018-05-16 02:44:44 +03:00
|
|
|
nsCString sourceURL;
|
2016-01-05 12:59:30 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
nsresult ProvideWindowCommon(TabChild* aTabOpener,
|
2016-01-30 20:05:36 +03:00
|
|
|
mozIDOMWindowProxy* aOpener, bool aIframeMoz,
|
2016-01-05 12:59:30 +03:00
|
|
|
uint32_t aChromeFlags, bool aCalledFromJS,
|
|
|
|
bool aPositionSpecified, bool aSizeSpecified,
|
|
|
|
nsIURI* aURI, const nsAString& aName,
|
|
|
|
const nsACString& aFeatures, bool aForceNoOpener,
|
2018-10-30 03:13:29 +03:00
|
|
|
nsDocShellLoadState* aLoadState,
|
2016-01-05 12:59:30 +03:00
|
|
|
bool* aWindowIsNew,
|
2016-01-30 20:05:36 +03:00
|
|
|
mozIDOMWindowProxy** aReturn);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool Init(MessageLoop* aIOLoop, base::ProcessId aParentPid,
|
2018-05-08 17:31:44 +03:00
|
|
|
const char* aParentBuildID, IPC::Channel* aChannel,
|
2017-02-05 08:52:38 +03:00
|
|
|
uint64_t aChildID, bool aIsForBrowser);
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-02-05 08:52:38 +03:00
|
|
|
void InitXPCOM(const XPCOMInitData& aXPCOMInit,
|
|
|
|
const mozilla::dom::ipc::StructuredCloneData& aInitialData);
|
2013-07-03 11:24:32 +04:00
|
|
|
|
2017-06-22 20:45:48 +03:00
|
|
|
void InitGraphicsDeviceData(const ContentDeviceData& aData);
|
2010-05-11 16:44:12 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
static ContentChild* GetSingleton() { return sSingleton; }
|
2013-11-25 03:50:03 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
const AppInfo& GetAppInfo() { return mAppInfo; }
|
2015-04-11 01:18:05 +03:00
|
|
|
|
2017-07-25 06:27:40 +03:00
|
|
|
void SetProcessName(const nsAString& aName);
|
2010-09-15 20:44:57 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void GetProcessName(nsAString& aName) const;
|
2014-05-21 09:49:36 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void GetProcessName(nsACString& aName) const;
|
2010-10-20 00:35:08 +04:00
|
|
|
|
2019-01-12 07:51:20 +03:00
|
|
|
void LaunchRDDProcess();
|
|
|
|
|
2016-08-30 23:32:21 +03:00
|
|
|
#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
|
|
|
|
void GetProfileDir(nsIFile** aProfileDir) const {
|
|
|
|
*aProfileDir = mProfileDir;
|
|
|
|
NS_IF_ADDREF(*aProfileDir);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetProfileDir(nsIFile* aProfileDir) { mProfileDir = aProfileDir; }
|
|
|
|
#endif
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool IsAlive() const;
|
2015-10-30 22:30:00 +03:00
|
|
|
|
2016-09-03 02:23:00 +03:00
|
|
|
bool IsShuttingDown() const;
|
|
|
|
|
2018-06-23 06:35:49 +03:00
|
|
|
ipc::SharedMap* SharedData() { return mSharedData; };
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
static void AppendProcessId(nsACString& aName);
|
2010-09-15 20:44:57 +04:00
|
|
|
|
2017-08-03 14:00:41 +03:00
|
|
|
static void UpdateCookieStatus(nsIChannel* aChannel);
|
|
|
|
|
2017-01-27 01:40:17 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitContentBridgeChild(
|
|
|
|
Endpoint<PContentBridgeChild>&& aEndpoint) override;
|
2014-10-23 22:31:00 +04:00
|
|
|
|
2017-01-05 23:55:57 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitGMPService(
|
|
|
|
Endpoint<PGMPServiceChild>&& aGMPService) override;
|
2014-10-03 18:52:37 +04:00
|
|
|
|
2017-05-30 22:06:14 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitProfiler(
|
|
|
|
Endpoint<PProfilerChild>&& aEndpoint) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvGMPsChanged(
|
2016-11-01 06:25:19 +03:00
|
|
|
nsTArray<GMPCapabilityData>&& capabilities) override;
|
|
|
|
|
2017-01-05 23:54:52 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitProcessHangMonitor(
|
|
|
|
Endpoint<PProcessHangMonitorChild>&& aHangMonitor) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitRendering(
|
2017-06-14 18:39:59 +03:00
|
|
|
Endpoint<PCompositorManagerChild>&& aCompositor,
|
2016-09-20 11:15:49 +03:00
|
|
|
Endpoint<PImageBridgeChild>&& aImageBridge,
|
2016-11-08 05:21:35 +03:00
|
|
|
Endpoint<PVRManagerChild>&& aVRBridge,
|
2017-04-14 11:06:09 +03:00
|
|
|
Endpoint<PVideoDecoderManagerChild>&& aVideoManager,
|
|
|
|
nsTArray<uint32_t>&& namespaces) override;
|
2010-10-09 22:07:38 +04:00
|
|
|
|
2018-07-05 17:32:03 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestPerformanceMetrics(
|
|
|
|
const nsID& aID) override;
|
2018-03-20 22:07:41 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvReinitRendering(
|
2017-06-14 18:39:59 +03:00
|
|
|
Endpoint<PCompositorManagerChild>&& aCompositor,
|
2016-09-20 11:18:50 +03:00
|
|
|
Endpoint<PImageBridgeChild>&& aImageBridge,
|
2016-11-08 05:21:35 +03:00
|
|
|
Endpoint<PVRManagerChild>&& aVRBridge,
|
2017-04-14 11:06:09 +03:00
|
|
|
Endpoint<PVideoDecoderManagerChild>&& aVideoManager,
|
|
|
|
nsTArray<uint32_t>&& namespaces) override;
|
2016-09-20 11:18:50 +03:00
|
|
|
|
2017-07-18 05:42:59 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvAudioDefaultDeviceChange() override;
|
|
|
|
|
2017-05-12 08:44:27 +03:00
|
|
|
mozilla::ipc::IPCResult RecvReinitRenderingForDeviceReset() override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvSetProcessSandbox(
|
|
|
|
const MaybeFileDesc& aBroker) override;
|
2011-10-05 00:31:00 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PBrowserChild* AllocPBrowserChild(const TabId& aTabId,
|
2017-04-07 02:46:18 +03:00
|
|
|
const TabId& aSameTabGroupAs,
|
2016-01-05 12:59:30 +03:00
|
|
|
const IPCTabContext& aContext,
|
|
|
|
const uint32_t& aChromeFlags,
|
|
|
|
const ContentParentId& aCpID,
|
2016-07-11 01:28:13 +03:00
|
|
|
const bool& aIsForBrowser) override;
|
2012-08-02 10:32:04 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool DeallocPBrowserChild(PBrowserChild*) override;
|
2013-04-26 04:53:26 +04:00
|
|
|
|
Bug 1353629 - PBlob refactoring - part 4 - IPCBlobInputStream, r=smaug
IPCBlobInputStream is a new type of nsIInputStream that is used only in content
process when a Blob is sent from parent to child. This inputStream is for now,
just cloneable.
When the parent process sends a Blob to a content process, it has the Blob and
its inputStream. With its inputStream it creates a IPCBlobInputStreamParent
actor. This actor keeps the inputStream alive for following uses (not part of
this patch).
On the child side we will have, of course, a IPCBlobInputStreamChild actor.
This actor is able to create a IPCBlobInputStream when CreateStream() is
called. This means that 1 IPCBlobInputStreamChild can manage multiple
IPCBlobInputStreams each time one of them is cloned. When the last one of this
stream is released, the child actor sends a __delete__ request to the parent
side; the parent will be deleted, and the original inputStream, on the parent
side, will be released as well.
IPCBlobInputStream is a special inputStream because each method, except for
Available() fails. Basically, this inputStream cannot be used on the content
process for nothing else than knowing the size of the original stream.
In the following patches, I'll introduce an async way to use it.
2017-04-24 13:09:40 +03:00
|
|
|
virtual PIPCBlobInputStreamChild* AllocPIPCBlobInputStreamChild(
|
|
|
|
const nsID& aID, const uint64_t& aSize) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPIPCBlobInputStreamChild(
|
|
|
|
PIPCBlobInputStreamChild* aActor) override;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PHalChild* AllocPHalChild() override;
|
|
|
|
virtual bool DeallocPHalChild(PHalChild*) override;
|
|
|
|
|
|
|
|
virtual PHeapSnapshotTempFileHelperChild*
|
|
|
|
AllocPHeapSnapshotTempFileHelperChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPHeapSnapshotTempFileHelperChild(
|
|
|
|
PHeapSnapshotTempFileHelperChild*) override;
|
|
|
|
|
|
|
|
virtual PCycleCollectWithLogsChild* AllocPCycleCollectWithLogsChild(
|
|
|
|
const bool& aDumpAllTraces, const FileDescriptor& aGCLog,
|
|
|
|
const FileDescriptor& aCCLog) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPCycleCollectWithLogsChild(
|
|
|
|
PCycleCollectWithLogsChild* aActor) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPCycleCollectWithLogsConstructor(
|
2016-01-05 12:59:30 +03:00
|
|
|
PCycleCollectWithLogsChild* aChild, const bool& aDumpAllTraces,
|
|
|
|
const FileDescriptor& aGCLog, const FileDescriptor& aCCLog) override;
|
|
|
|
|
|
|
|
virtual PWebBrowserPersistDocumentChild* AllocPWebBrowserPersistDocumentChild(
|
|
|
|
PBrowserChild* aBrowser, const uint64_t& aOuterWindowID) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvPWebBrowserPersistDocumentConstructor(
|
|
|
|
PWebBrowserPersistDocumentChild* aActor, PBrowserChild* aBrowser,
|
|
|
|
const uint64_t& aOuterWindowID) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPWebBrowserPersistDocumentChild(
|
|
|
|
PWebBrowserPersistDocumentChild* aActor) override;
|
|
|
|
|
|
|
|
virtual PTestShellChild* AllocPTestShellChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPTestShellChild(PTestShellChild*) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPTestShellConstructor(
|
|
|
|
PTestShellChild*) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-05-03 03:17:52 +03:00
|
|
|
virtual PScriptCacheChild* AllocPScriptCacheChild(
|
|
|
|
const FileDescOrError& cacheFile, const bool& wantCacheData) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPScriptCacheChild(PScriptCacheChild*) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvPScriptCacheConstructor(
|
|
|
|
PScriptCacheChild*, const FileDescOrError& cacheFile,
|
|
|
|
const bool& wantCacheData) override;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
jsipc::CPOWManager* GetCPOWManager() override;
|
|
|
|
|
|
|
|
virtual PNeckoChild* AllocPNeckoChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPNeckoChild(PNeckoChild*) override;
|
|
|
|
|
|
|
|
virtual PPrintingChild* AllocPPrintingChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPPrintingChild(PPrintingChild*) override;
|
|
|
|
|
2017-03-14 14:28:58 +03:00
|
|
|
virtual PChildToParentStreamChild* SendPChildToParentStreamConstructor(
|
|
|
|
PChildToParentStreamChild*) override;
|
2016-09-21 13:27:26 +03:00
|
|
|
|
2017-03-14 14:28:58 +03:00
|
|
|
virtual PChildToParentStreamChild* AllocPChildToParentStreamChild() override;
|
|
|
|
virtual bool DeallocPChildToParentStreamChild(
|
|
|
|
PChildToParentStreamChild*) override;
|
2016-05-15 20:32:09 +03:00
|
|
|
|
2017-03-14 14:29:43 +03:00
|
|
|
virtual PParentToChildStreamChild* AllocPParentToChildStreamChild() override;
|
|
|
|
virtual bool DeallocPParentToChildStreamChild(
|
|
|
|
PParentToChildStreamChild*) override;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PPSMContentDownloaderChild* AllocPPSMContentDownloaderChild(
|
|
|
|
const uint32_t& aCertType) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPPSMContentDownloaderChild(
|
|
|
|
PPSMContentDownloaderChild* aDownloader) override;
|
|
|
|
|
|
|
|
virtual PExternalHelperAppChild* AllocPExternalHelperAppChild(
|
|
|
|
const OptionalURIParams& uri, const nsCString& aMimeContentType,
|
|
|
|
const nsCString& aContentDisposition,
|
|
|
|
const uint32_t& aContentDispositionHint,
|
|
|
|
const nsString& aContentDispositionFilename, const bool& aForceSave,
|
|
|
|
const int64_t& aContentLength, const bool& aWasFileChannel,
|
|
|
|
const OptionalURIParams& aReferrer, PBrowserChild* aBrowser) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPExternalHelperAppChild(
|
|
|
|
PExternalHelperAppChild* aService) override;
|
|
|
|
|
|
|
|
virtual PHandlerServiceChild* AllocPHandlerServiceChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPHandlerServiceChild(PHandlerServiceChild*) override;
|
|
|
|
|
|
|
|
virtual PMediaChild* AllocPMediaChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPMediaChild(PMediaChild* aActor) override;
|
|
|
|
|
|
|
|
virtual PPresentationChild* AllocPPresentationChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPPresentationChild(PPresentationChild* aActor) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyPresentationReceiverLaunched(
|
|
|
|
PBrowserChild* aIframe, const nsString& aSessionId) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyPresentationReceiverCleanUp(
|
|
|
|
const nsString& aSessionId) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyEmptyHTTPCache() override;
|
2016-08-08 06:04:55 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPSpeechSynthesisChild(
|
|
|
|
PSpeechSynthesisChild* aActor) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvRegisterChrome(
|
|
|
|
InfallibleTArray<ChromePackage>&& packages,
|
|
|
|
InfallibleTArray<SubstitutionMapping>&& resources,
|
|
|
|
InfallibleTArray<OverrideMapping>&& overrides, const nsCString& locale,
|
|
|
|
const bool& reset) override;
|
|
|
|
virtual mozilla::ipc::IPCResult RecvRegisterChromeItem(
|
|
|
|
const ChromeRegistryItem& item) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvClearImageCache(
|
|
|
|
const bool& privateLoader, const bool& chrome) override;
|
2016-06-07 01:23:43 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPJavaScriptChild(
|
|
|
|
mozilla::jsipc::PJavaScriptChild*) override;
|
|
|
|
|
|
|
|
virtual PRemoteSpellcheckEngineChild* AllocPRemoteSpellcheckEngineChild()
|
|
|
|
override;
|
|
|
|
|
|
|
|
virtual bool DeallocPRemoteSpellcheckEngineChild(
|
|
|
|
PRemoteSpellcheckEngineChild*) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvSetOffline(const bool& offline) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvSetConnectivity(
|
|
|
|
const bool& connectivity) override;
|
2016-11-17 19:35:24 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvSetCaptivePortalState(
|
|
|
|
const int32_t& state) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvBidiKeyboardNotify(
|
|
|
|
const bool& isLangRTL, const bool& haveBidiKeyboards) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-12-04 20:45:29 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyVisited(
|
|
|
|
nsTArray<URIParams>&& aURIs) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
// auto remove when alertfinished is received.
|
|
|
|
nsresult AddRemoteAlertObserver(const nsString& aData,
|
|
|
|
nsIObserver* aObserver);
|
|
|
|
|
2017-11-22 13:21:19 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPreferenceUpdate(
|
|
|
|
const Pref& aPref) override;
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvVarUpdate(
|
|
|
|
const GfxVarUpdate& pref) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvDataStoragePut(
|
|
|
|
const nsString& aFilename, const DataStorageItem& aItem) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvDataStorageRemove(
|
|
|
|
const nsString& aFilename, const nsCString& aKey,
|
|
|
|
const DataStorageType& aType) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvDataStorageClear(
|
|
|
|
const nsString& aFilename) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyAlertsObserver(
|
|
|
|
const nsCString& aType, const nsString& aData) override;
|
2014-08-29 04:20:27 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvLoadProcessScript(
|
|
|
|
const nsString& aURL) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvAsyncMessage(
|
|
|
|
const nsString& aMsg, InfallibleTArray<CpowEntry>&& aCpows,
|
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
const ClonedMessageData& aData) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2018-06-30 08:53:12 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRegisterStringBundles(
|
|
|
|
nsTArray<StringBundleDescriptor>&& stringBundles) override;
|
|
|
|
|
2018-06-23 06:35:49 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateSharedData(
|
|
|
|
const FileDescriptor& aMapFile, const uint32_t& aMapSize,
|
|
|
|
nsTArray<IPCBlob>&& aBlobs, nsTArray<nsCString>&& aChangedKeys) override;
|
|
|
|
|
Bug 1443954 - Part 3: Add support for RefCounted types to IPDL, r=bz,froydnj,baku
This patch was reviewed in parts, however the intermediate states would not build:
Bug 1443954 - Part 3A: Strip pointers from the argument to WriteParam and WriteIPDLParam before selecting the ParamTraits impl, r=froydnj
Bug 1443954 - Part 3B: Move nsIAlertNotification serialization to the refcounted system, r=bz
Bug 1443954 - Part 3C: Move geolocation serialization to the refcounted system, r=bz
Bug 1443954 - Part 3D: Move nsIInputStream serialization to the refcounted system, r=baku
Bug 1443954 - Part 3E: Move BlobImpl serialization to the refcounted system, r=baku
Bug 1443954 - Part 3F: Correctly implement ParamTraits for actors after the ParamTraits changes, r=froydnj
2018-03-07 04:14:59 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvGeolocationUpdate(
|
|
|
|
nsIDOMGeoPosition* aPosition) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvGeolocationError(
|
|
|
|
const uint16_t& errorCode) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvUpdateDictionaryList(
|
|
|
|
InfallibleTArray<nsString>&& aDictionaries) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-11-02 23:29:33 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvUpdateFontList(
|
|
|
|
InfallibleTArray<SystemFontListEntry>&& aFontList) override;
|
|
|
|
|
Bug 1348042 - Refactor LocaleService to operate in server-client mode. r=Ehsan,qdot
LocaleService serves two main functions. It is a central place for all code in the
engine to learn about locales, but it also does the language negotiation and selection.
The former is relevant in all processes, but the latter should only be performed
by the "main" process. In case of current Desktop Firefox, the parent process
is the one performing all the language negotiation, and content processes should
operate in the "client" mode.
In Fennec, there's a Java app on top of Gecko which should work as a "server"
and then all processes, including parent process of Gecko is merely a "client" for that.
This refactor finalizes this duality making it easily configurable to define in
which mode a given LocaleService operates.
The server-client model allows all clients to stay in sync with the server,
but operate transparently for all callers just returning the right values.
In order to initialize LocaleService in the client mode in child process with the
right locales I'm adding the list of app locales to the XPCOMInitData,
and then fire LocaleService::SetAppLocales in the child process initialization.
In order to keep the list up to date, I'm adding intl:app-locales-changed to
the list of observed topics, and when triggered, I send the updated list
to the child process, which updates LocaleService::SetAppLocales with the new
list.
MozReview-Commit-ID: K9X6berF3IO
--HG--
extra : rebase_source : ca5e502d064023fddfd63fe6fe5eccefce8dee52
2017-03-26 08:09:45 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvUpdateAppLocales(
|
|
|
|
nsTArray<nsCString>&& aAppLocales) override;
|
|
|
|
virtual mozilla::ipc::IPCResult RecvUpdateRequestedLocales(
|
|
|
|
nsTArray<nsCString>&& aRequestedLocales) override;
|
|
|
|
|
2018-06-20 18:57:50 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvClearSiteDataReloadNeeded(
|
|
|
|
const nsString& aOrigin) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvAddPermission(
|
|
|
|
const IPC::Permission& permission) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2018-07-10 11:09:59 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvRemoveAllPermissions() override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvFlushMemory(
|
|
|
|
const nsString& reason) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2017-06-07 02:35:51 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvActivateA11y(
|
|
|
|
const uint32_t& aMainChromeTid, const uint32_t& aMsaaID) override;
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvShutdownA11y() override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvGarbageCollect() override;
|
|
|
|
virtual mozilla::ipc::IPCResult RecvCycleCollect() override;
|
2018-01-12 01:14:09 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvUnlinkGhosts() override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvAppInfo(
|
|
|
|
const nsCString& version, const nsCString& buildID, const nsCString& name,
|
2018-05-16 02:44:44 +03:00
|
|
|
const nsCString& UAName, const nsCString& ID, const nsCString& vendor,
|
|
|
|
const nsCString& sourceURL) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-24 18:08:31 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvRemoteType(
|
|
|
|
const nsString& aRemoteType) override;
|
|
|
|
|
|
|
|
const nsAString& GetRemoteType() const;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvInitServiceWorkers(
|
2016-07-13 11:34:24 +03:00
|
|
|
const ServiceWorkerConfiguration& aConfig) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvInitBlobURLs(
|
2016-07-17 17:50:50 +03:00
|
|
|
nsTArray<BlobURLRegistrationData>&& aRegistations) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvLastPrivateDocShellDestroyed() override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyProcessPriorityChanged(
|
|
|
|
const hal::ProcessPriority& aPriority) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvMinimizeMemoryUsage() override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvLoadAndRegisterSheet(
|
|
|
|
const URIParams& aURI, const uint32_t& aType) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvUnregisterSheet(
|
|
|
|
const URIParams& aURI, const uint32_t& aType) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
|
|
|
|
|
|
|
|
void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyIdleObserver(
|
|
|
|
const uint64_t& aObserver, const nsCString& aTopic,
|
|
|
|
const nsString& aData) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvUpdateWindow(
|
|
|
|
const uintptr_t& aChildId) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvDomainSetChanged(
|
|
|
|
const uint32_t& aSetType, const uint32_t& aChangeType,
|
|
|
|
const OptionalURIParams& aDomain) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvShutdown() override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvInvokeDragSession(
|
2016-01-05 12:59:30 +03:00
|
|
|
nsTArray<IPCDataTransfer>&& aTransfers, const uint32_t& aAction) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvEndDragSession(
|
|
|
|
const bool& aDoneDrag, const bool& aUserCancelled,
|
2017-02-17 06:29:42 +03:00
|
|
|
const mozilla::LayoutDeviceIntPoint& aEndDragPoint,
|
|
|
|
const uint32_t& aKeyModifiers) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-01-14 08:19:51 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPush(const nsCString& aScope,
|
2016-03-28 21:50:39 +03:00
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
const nsString& aMessageId) override;
|
2016-01-14 08:19:51 +03:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPushWithData(
|
2016-01-14 08:19:51 +03:00
|
|
|
const nsCString& aScope, const IPC::Principal& aPrincipal,
|
|
|
|
const nsString& aMessageId, InfallibleTArray<uint8_t>&& aData) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPushSubscriptionChange(
|
2016-01-14 08:19:51 +03:00
|
|
|
const nsCString& aScope, const IPC::Principal& aPrincipal) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPushError(
|
2016-05-20 05:01:34 +03:00
|
|
|
const nsCString& aScope, const IPC::Principal& aPrincipal,
|
|
|
|
const nsString& aMessage, const uint32_t& aFlags) override;
|
2016-03-28 23:33:20 +03:00
|
|
|
|
2016-05-15 02:54:51 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvNotifyPushSubscriptionModifiedObservers(
|
|
|
|
const nsCString& aScope, const IPC::Principal& aPrincipal) override;
|
|
|
|
|
2017-01-21 07:11:35 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvActivate(PBrowserChild* aTab) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvDeactivate(PBrowserChild* aTab) override;
|
|
|
|
|
2017-03-09 14:30:26 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRefreshScreens(
|
|
|
|
nsTArray<ScreenDetails>&& aScreens) override;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
// Get the directory for IndexedDB files. We query the parent for this and
|
|
|
|
// cache the value
|
|
|
|
nsString& GetIndexedDBPath();
|
2011-04-30 03:46:20 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
ContentParentId GetID() const { return mID; }
|
2011-09-30 11:00:48 +04:00
|
|
|
|
2016-10-20 21:34:16 +03:00
|
|
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
2017-06-07 02:35:51 +03:00
|
|
|
uint32_t GetChromeMainThreadId() const { return mMainChromeTid; }
|
|
|
|
|
2016-10-20 21:34:16 +03:00
|
|
|
uint32_t GetMsaaID() const { return mMsaaID; }
|
|
|
|
#endif
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool IsForBrowser() const { return mIsForBrowser; }
|
2013-01-11 15:19:02 +04:00
|
|
|
|
2016-09-21 13:27:26 +03:00
|
|
|
virtual PFileDescriptorSetChild* SendPFileDescriptorSetConstructor(
|
|
|
|
const FileDescriptor&) override;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PFileDescriptorSetChild* AllocPFileDescriptorSetChild(
|
|
|
|
const FileDescriptor&) override;
|
2014-03-25 22:37:13 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool DeallocPFileDescriptorSetChild(
|
|
|
|
PFileDescriptorSetChild*) override;
|
2014-03-25 22:37:13 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool SendPBrowserConstructor(
|
2017-04-07 02:46:18 +03:00
|
|
|
PBrowserChild* actor, const TabId& aTabId, const TabId& aSameTabGroupAs,
|
2016-01-05 12:59:30 +03:00
|
|
|
const IPCTabContext& context, const uint32_t& chromeFlags,
|
|
|
|
const ContentParentId& aCpID, const bool& aIsForBrowser) override;
|
2014-06-11 09:44:13 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvPBrowserConstructor(
|
2017-04-07 02:46:18 +03:00
|
|
|
PBrowserChild* aCctor, const TabId& aTabId, const TabId& aSameTabGroupAs,
|
2016-11-15 06:26:00 +03:00
|
|
|
const IPCTabContext& aContext, const uint32_t& aChromeFlags,
|
|
|
|
const ContentParentId& aCpID, const bool& aIsForBrowser) override;
|
2013-02-23 08:24:28 +04:00
|
|
|
|
2016-06-15 19:57:46 +03:00
|
|
|
FORWARD_SHMEM_ALLOCATOR_TO(PContentChild)
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void GetAvailableDictionaries(InfallibleTArray<nsString>& aDictionaries);
|
2014-10-03 18:52:37 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
PBrowserOrId GetBrowserOrId(TabChild* aTabChild);
|
2014-11-04 04:58:00 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual POfflineCacheUpdateChild* AllocPOfflineCacheUpdateChild(
|
|
|
|
const URIParams& manifestURI, const URIParams& documentURI,
|
|
|
|
const PrincipalInfo& aLoadingPrincipalInfo,
|
2016-01-18 22:20:08 +03:00
|
|
|
const bool& stickDocument) override;
|
2014-11-13 03:31:00 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool DeallocPOfflineCacheUpdateChild(
|
|
|
|
POfflineCacheUpdateChild* offlineCacheUpdate) override;
|
2015-04-22 01:29:18 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PWebrtcGlobalChild* AllocPWebrtcGlobalChild() override;
|
2015-04-14 04:08:00 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool DeallocPWebrtcGlobalChild(PWebrtcGlobalChild* aActor) override;
|
2015-04-24 01:05:29 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PContentPermissionRequestChild* AllocPContentPermissionRequestChild(
|
|
|
|
const InfallibleTArray<PermissionRequest>& aRequests,
|
|
|
|
const IPC::Principal& aPrincipal,
|
2018-11-20 04:52:47 +03:00
|
|
|
const IPC::Principal& aTopLevelPrincipal,
|
2017-02-20 22:46:39 +03:00
|
|
|
const bool& aIsHandlingUserInput, const TabId& aTabId) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool DeallocPContentPermissionRequestChild(
|
|
|
|
PContentPermissionRequestChild* actor) override;
|
|
|
|
|
2016-03-13 16:25:23 +03:00
|
|
|
// Windows specific - set up audio session
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvSetAudioSessionData(
|
2016-03-13 16:25:23 +03:00
|
|
|
const nsID& aId, const nsString& aDisplayName,
|
|
|
|
const nsString& aIconPath) override;
|
2016-07-14 10:04:21 +03:00
|
|
|
|
|
|
|
// GetFiles for WebKit/Blink FileSystem API and Directory API must run on the
|
|
|
|
// parent process.
|
|
|
|
void CreateGetFilesRequest(const nsAString& aDirectoryPath,
|
|
|
|
bool aRecursiveFlag, nsID& aUUID,
|
|
|
|
GetFilesHelperChild* aChild);
|
|
|
|
|
|
|
|
void DeleteGetFilesRequest(nsID& aUUID, GetFilesHelperChild* aChild);
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvGetFilesResponse(
|
2016-07-14 10:04:21 +03:00
|
|
|
const nsID& aUUID, const GetFilesResponseResult& aResult) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvBlobURLRegistration(
|
2017-04-24 13:16:49 +03:00
|
|
|
const nsCString& aURI, const IPCBlob& aBlob,
|
2016-07-17 17:50:50 +03:00
|
|
|
const IPC::Principal& aPrincipal) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvBlobURLUnregistration(
|
2016-07-17 17:50:50 +03:00
|
|
|
const nsCString& aURI) override;
|
|
|
|
|
2017-02-08 12:19:01 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvFileCreationResponse(
|
|
|
|
const nsID& aUUID, const FileCreationResult& aResult) override;
|
|
|
|
|
2017-01-27 03:35:54 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestMemoryReport(
|
|
|
|
const uint32_t& generation, const bool& anonymize,
|
|
|
|
const bool& minimizeMemoryUsage, const MaybeFileDesc& DMDFile) override;
|
|
|
|
|
2017-02-05 08:52:38 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvSetXPCOMProcessAttributes(
|
|
|
|
const XPCOMInitData& aXPCOMInit, const StructuredCloneData& aInitialData,
|
2017-09-15 00:15:27 +03:00
|
|
|
nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache,
|
2018-07-21 00:44:00 +03:00
|
|
|
nsTArray<SystemFontListEntry>&& aFontList) override;
|
2017-02-05 08:52:38 +03:00
|
|
|
|
2017-03-14 02:06:04 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvProvideAnonymousTemporaryFile(
|
|
|
|
const uint64_t& aID, const FileDescOrError& aFD) override;
|
|
|
|
|
2017-03-03 00:53:33 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetPermissionsWithKey(
|
|
|
|
const nsCString& aPermissionKey,
|
|
|
|
nsTArray<IPC::Permission>&& aPerms) override;
|
|
|
|
|
2017-06-14 11:50:44 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvShareCodeCoverageMutex(
|
2017-06-14 12:15:41 +03:00
|
|
|
const CrossProcessMutexHandle& aHandle) override;
|
2017-06-14 11:50:44 +03:00
|
|
|
|
2017-07-14 11:57:22 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvFlushCodeCoverageCounters(
|
2018-10-15 11:36:45 +03:00
|
|
|
FlushCodeCoverageCountersResolver&& aResolver) override;
|
2017-07-14 11:57:22 +03:00
|
|
|
|
2018-12-05 23:44:53 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvGetMemoryUniqueSetSize(
|
|
|
|
GetMemoryUniqueSetSizeResolver&& aResolver) override;
|
|
|
|
|
2017-07-28 10:14:54 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvSetInputEventQueueEnabled() override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvFlushInputEventQueue() override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvSuspendInputEventQueue() override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvResumeInputEventQueue() override;
|
|
|
|
|
2017-08-29 14:05:40 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvAddDynamicScalars(
|
|
|
|
nsTArray<DynamicScalarDefinition>&& aDefs) override;
|
|
|
|
|
2016-10-27 21:40:50 +03:00
|
|
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
|
|
|
bool SendGetA11yContentId();
|
|
|
|
#endif // defined(XP_WIN) && defined(ACCESSIBILITY)
|
|
|
|
|
2017-11-02 20:23:16 +03:00
|
|
|
// Get a reference to the font list passed from the chrome process,
|
2016-11-15 16:58:29 +03:00
|
|
|
// for use during gfx initialization.
|
2017-11-02 20:23:16 +03:00
|
|
|
InfallibleTArray<mozilla::dom::SystemFontListEntry>& SystemFontList() {
|
|
|
|
return mFontList;
|
2016-11-15 16:58:29 +03:00
|
|
|
}
|
|
|
|
|
2017-04-07 09:15:16 +03:00
|
|
|
// PURLClassifierChild
|
2016-11-19 00:54:57 +03:00
|
|
|
virtual PURLClassifierChild* AllocPURLClassifierChild(
|
2019-01-18 00:24:43 +03:00
|
|
|
const Principal& aPrincipal, bool* aSuccess) override;
|
2016-11-19 00:54:57 +03:00
|
|
|
virtual bool DeallocPURLClassifierChild(PURLClassifierChild* aActor) override;
|
|
|
|
|
2017-04-07 09:15:16 +03:00
|
|
|
// PURLClassifierLocalChild
|
|
|
|
virtual PURLClassifierLocalChild* AllocPURLClassifierLocalChild(
|
2018-12-14 14:40:17 +03:00
|
|
|
const URIParams& aUri,
|
|
|
|
const nsTArray<IPCURLClassifierFeature>& aFeatures) override;
|
2017-04-07 09:15:16 +03:00
|
|
|
virtual bool DeallocPURLClassifierLocalChild(
|
|
|
|
PURLClassifierLocalChild* aActor) override;
|
|
|
|
|
2017-12-07 11:32:52 +03:00
|
|
|
virtual PLoginReputationChild* AllocPLoginReputationChild(
|
|
|
|
const URIParams& aUri) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPLoginReputationChild(
|
|
|
|
PLoginReputationChild* aActor) override;
|
|
|
|
|
2016-11-18 23:36:18 +03:00
|
|
|
nsTArray<LookAndFeelInt>& LookAndFeelCache() { return mLookAndFeelCache; }
|
|
|
|
|
2016-10-04 11:31:27 +03:00
|
|
|
/**
|
|
|
|
* Helper function for protocols that use the GPU process when available.
|
|
|
|
* Overrides FatalError to just be a warning when communicating with the
|
|
|
|
* GPU process since we don't want to crash the content process when the
|
|
|
|
* GPU process crashes.
|
|
|
|
*/
|
2018-04-23 21:13:36 +03:00
|
|
|
static void FatalErrorIfNotUsingGPUProcess(const char* const aErrorMsg,
|
2016-10-04 11:31:27 +03:00
|
|
|
base::ProcessId aOtherPid);
|
|
|
|
|
2017-02-08 12:19:01 +03:00
|
|
|
// This method is used by FileCreatorHelper for the creation of a BlobImpl.
|
|
|
|
void FileCreationRequest(nsID& aUUID, FileCreatorHelper* aHelper,
|
|
|
|
const nsAString& aFullPath, const nsAString& aType,
|
|
|
|
const nsAString& aName,
|
|
|
|
const Optional<int64_t>& aLastModified,
|
2017-03-03 11:42:54 +03:00
|
|
|
bool aExistenceCheck, bool aIsFromNsIFile);
|
2017-02-08 12:19:01 +03:00
|
|
|
|
2017-03-14 02:06:04 +03:00
|
|
|
typedef std::function<void(PRFileDesc*)> AnonymousTemporaryFileCallback;
|
2017-04-27 19:44:57 +03:00
|
|
|
nsresult AsyncOpenAnonymousTemporaryFile(
|
|
|
|
const AnonymousTemporaryFileCallback& aCallback);
|
2017-03-14 02:06:04 +03:00
|
|
|
|
2017-05-02 12:57:51 +03:00
|
|
|
virtual already_AddRefed<nsIEventTarget> GetEventTargetFor(
|
|
|
|
TabChild* aTabChild) override;
|
|
|
|
|
2017-06-06 20:39:46 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetPluginList(
|
2017-07-14 03:11:55 +03:00
|
|
|
const uint32_t& aPluginEpoch, nsTArray<PluginTag>&& aPluginTags,
|
|
|
|
nsTArray<FakePluginTag>&& aFakePluginTags) override;
|
2017-06-06 20:39:46 +03:00
|
|
|
|
2017-11-01 20:19:38 +03:00
|
|
|
virtual PClientOpenWindowOpChild* AllocPClientOpenWindowOpChild(
|
|
|
|
const ClientOpenWindowArgs& aArgs) override;
|
|
|
|
|
|
|
|
virtual mozilla::ipc::IPCResult RecvPClientOpenWindowOpConstructor(
|
|
|
|
PClientOpenWindowOpChild* aActor,
|
|
|
|
const ClientOpenWindowArgs& aArgs) override;
|
|
|
|
|
|
|
|
virtual bool DeallocPClientOpenWindowOpChild(
|
|
|
|
PClientOpenWindowOpChild* aActor) override;
|
|
|
|
|
2018-07-22 14:52:42 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSaveRecording(
|
|
|
|
const FileDescriptor& aFile) override;
|
|
|
|
|
2017-08-09 23:59:27 +03:00
|
|
|
#ifdef NIGHTLY_BUILD
|
|
|
|
// Fetch the current number of pending input events.
|
|
|
|
//
|
|
|
|
// NOTE: This method performs an atomic read, and is safe to call from all
|
|
|
|
// threads.
|
|
|
|
uint32_t GetPendingInputEvents() { return mPendingInputEvents; }
|
|
|
|
#endif
|
|
|
|
|
2009-12-07 09:03:49 +03:00
|
|
|
private:
|
2016-06-02 15:52:17 +03:00
|
|
|
static void ForceKillTimerCallback(nsITimer* aTimer, void* aClosure);
|
|
|
|
void StartForceKillTimer();
|
|
|
|
|
2018-01-28 10:41:36 +03:00
|
|
|
void ShutdownInternal();
|
|
|
|
|
2018-02-15 02:07:53 +03:00
|
|
|
mozilla::ipc::IPCResult GetResultForRenderingInitFailure(
|
|
|
|
base::ProcessId aOtherPid);
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) override;
|
2009-12-07 09:03:49 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual void ProcessingError(Result aCode, const char* aReason) override;
|
2010-08-21 03:24:40 +04:00
|
|
|
|
2016-11-04 21:13:52 +03:00
|
|
|
virtual already_AddRefed<nsIEventTarget> GetConstructedEventTarget(
|
|
|
|
const Message& aMsg) override;
|
|
|
|
|
2017-06-15 00:28:01 +03:00
|
|
|
virtual already_AddRefed<nsIEventTarget> GetSpecificMessageEventTarget(
|
|
|
|
const Message& aMsg) override;
|
|
|
|
|
2017-08-09 23:59:27 +03:00
|
|
|
virtual void OnChannelReceivedMessage(const Message& aMsg) override;
|
|
|
|
|
2019-01-02 16:29:18 +03:00
|
|
|
virtual mozilla::ipc::IPCResult RecvWindowClose(
|
|
|
|
const BrowsingContextId& aContextId, const bool& aTrustedCaller) override;
|
|
|
|
virtual mozilla::ipc::IPCResult RecvWindowFocus(
|
|
|
|
const BrowsingContextId& aContextId) override;
|
|
|
|
virtual mozilla::ipc::IPCResult RecvWindowBlur(
|
|
|
|
const BrowsingContextId& aContextId) override;
|
|
|
|
virtual mozilla::ipc::IPCResult RecvWindowPostMessage(
|
|
|
|
const BrowsingContextId& aContextId, const ClonedMessageData& aMessage,
|
|
|
|
const PostMessageData& aData) override;
|
|
|
|
|
2018-11-29 23:47:20 +03:00
|
|
|
#ifdef NIGHTLY_BUILD
|
2017-08-09 23:59:27 +03:00
|
|
|
virtual PContentChild::Result OnMessageReceived(const Message& aMsg) override;
|
2018-12-20 22:39:21 +03:00
|
|
|
#else
|
|
|
|
using PContentChild::OnMessageReceived;
|
2018-12-19 14:38:23 +03:00
|
|
|
#endif
|
2017-08-09 23:59:27 +03:00
|
|
|
|
|
|
|
virtual PContentChild::Result OnMessageReceived(const Message& aMsg,
|
|
|
|
Message*& aReply) override;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
InfallibleTArray<nsAutoPtr<AlertObserver>> mAlertObservers;
|
|
|
|
RefPtr<ConsoleListener> mConsoleListener;
|
2009-08-13 04:32:50 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
nsTHashtable<nsPtrHashKey<nsIObserver>> mIdleObservers;
|
2014-04-21 21:18:53 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
InfallibleTArray<nsString> mAvailableDictionaries;
|
2014-10-03 18:52:37 +04:00
|
|
|
|
2017-11-02 20:23:16 +03:00
|
|
|
// Temporary storage for a list of available fonts, passed from the
|
2016-11-15 16:58:29 +03:00
|
|
|
// parent process and used to initialize gfx in the child. Currently used
|
2017-11-02 23:29:33 +03:00
|
|
|
// only on MacOSX and Linux.
|
2017-11-02 20:23:16 +03:00
|
|
|
InfallibleTArray<mozilla::dom::SystemFontListEntry> mFontList;
|
2016-11-18 23:36:18 +03:00
|
|
|
// Temporary storage for nsXPLookAndFeel flags.
|
|
|
|
nsTArray<LookAndFeelInt> mLookAndFeelCache;
|
2016-11-15 16:58:29 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
|
|
|
* An ID unique to the process containing our corresponding
|
|
|
|
* content parent.
|
|
|
|
*
|
|
|
|
* We expect our content parent to set this ID immediately after opening a
|
|
|
|
* channel to us.
|
|
|
|
*/
|
|
|
|
ContentParentId mID;
|
2011-09-30 11:00:48 +04:00
|
|
|
|
2016-10-20 21:34:16 +03:00
|
|
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
2017-06-07 02:35:51 +03:00
|
|
|
/**
|
|
|
|
* The thread ID of the main thread in the chrome process.
|
|
|
|
*/
|
|
|
|
uint32_t mMainChromeTid;
|
|
|
|
|
2016-10-20 21:34:16 +03:00
|
|
|
/**
|
|
|
|
* This is an a11y-specific unique id for the content process that is
|
|
|
|
* generated by the chrome process.
|
|
|
|
*/
|
|
|
|
uint32_t mMsaaID;
|
|
|
|
#endif
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
AppInfo mAppInfo;
|
2012-04-25 20:35:58 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool mIsForBrowser;
|
2017-09-22 07:35:46 +03:00
|
|
|
nsString mRemoteType = VoidString();
|
2016-01-05 12:59:30 +03:00
|
|
|
bool mIsAlive;
|
|
|
|
nsString mProcessName;
|
2012-08-23 14:23:43 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
static ContentChild* sSingleton;
|
2010-05-26 04:13:47 +04:00
|
|
|
|
2017-09-16 01:48:37 +03:00
|
|
|
class ShutdownCanary;
|
|
|
|
static StaticAutoPtr<ShutdownCanary> sShutdownCanary;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
nsCOMPtr<nsIDomainPolicy> mPolicy;
|
2016-06-02 15:52:17 +03:00
|
|
|
nsCOMPtr<nsITimer> mForceKillTimer;
|
2015-03-24 17:29:16 +03:00
|
|
|
|
2018-06-23 06:35:49 +03:00
|
|
|
RefPtr<ipc::SharedMap> mSharedData;
|
|
|
|
|
2017-05-30 22:06:14 +03:00
|
|
|
#ifdef MOZ_GECKO_PROFILER
|
|
|
|
RefPtr<ChildProfilerController> mProfilerController;
|
|
|
|
#endif
|
|
|
|
|
2016-08-30 23:32:21 +03:00
|
|
|
#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
|
|
|
|
nsCOMPtr<nsIFile> mProfileDir;
|
|
|
|
#endif
|
|
|
|
|
2016-07-14 10:04:21 +03:00
|
|
|
// Hashtable to keep track of the pending GetFilesHelper objects.
|
|
|
|
// This GetFilesHelperChild objects are removed when RecvGetFilesResponse is
|
|
|
|
// received.
|
2016-09-03 02:23:00 +03:00
|
|
|
nsRefPtrHashtable<nsIDHashKey, GetFilesHelperChild> mGetFilesPendingRequests;
|
|
|
|
|
2017-02-08 12:19:01 +03:00
|
|
|
// Hashtable to keep track of the pending file creation.
|
|
|
|
// These items are removed when RecvFileCreationResponse is received.
|
|
|
|
nsRefPtrHashtable<nsIDHashKey, FileCreatorHelper> mFileCreationPending;
|
|
|
|
|
2017-03-14 02:06:04 +03:00
|
|
|
nsClassHashtable<nsUint64HashKey, AnonymousTemporaryFileCallback>
|
|
|
|
mPendingAnonymousTemporaryFiles;
|
|
|
|
|
2017-08-03 12:22:11 +03:00
|
|
|
mozilla::Atomic<bool> mShuttingDown;
|
2016-07-14 10:04:21 +03:00
|
|
|
|
2017-08-09 23:59:27 +03:00
|
|
|
#ifdef NIGHTLY_BUILD
|
|
|
|
// NOTE: This member is atomic because it can be accessed from
|
|
|
|
// off-main-thread.
|
|
|
|
mozilla::Atomic<uint32_t> mPendingInputEvents;
|
|
|
|
#endif
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(ContentChild);
|
2009-08-12 20:18:08 +04:00
|
|
|
};
|
|
|
|
|
2015-01-28 22:53:46 +03:00
|
|
|
uint64_t NextWindowID();
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
#endif // mozilla_dom_ContentChild_h
|