2009-08-18 23:05:15 +04: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 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
|
|
|
|
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"
|
2014-04-21 21:18:53 +04:00
|
|
|
#include "nsHashKeys.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsTHashtable.h"
|
|
|
|
|
2013-09-24 01:30:40 +04:00
|
|
|
#include "nsWeakPtr.h"
|
2009-08-26 03:07:22 +04:00
|
|
|
|
2014-04-21 21:18:53 +04:00
|
|
|
|
2010-03-11 08:33:00 +03:00
|
|
|
struct ChromePackage;
|
2012-08-02 10:02:29 +04:00
|
|
|
class nsIDOMBlob;
|
2010-07-21 22:42:32 +04:00
|
|
|
class nsIObserver;
|
2010-03-11 08:33:00 +03:00
|
|
|
struct ResourceMapping;
|
|
|
|
struct OverrideMapping;
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace mozilla {
|
2014-07-02 02:24:27 +04:00
|
|
|
class RemoteSpellcheckEngineChild;
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2012-08-23 23:33:46 +04:00
|
|
|
namespace ipc {
|
|
|
|
class OptionalURIParams;
|
2014-09-27 03:21:57 +04:00
|
|
|
class PFileDescriptorSetChild;
|
2012-08-23 23:33:46 +04:00
|
|
|
class URIParams;
|
|
|
|
}// namespace ipc
|
|
|
|
|
2013-07-03 11:24:32 +04:00
|
|
|
namespace jsipc {
|
2014-10-07 02:45:42 +04:00
|
|
|
class JavaScriptShared;
|
2013-07-03 11:24:32 +04:00
|
|
|
}
|
|
|
|
|
2012-07-18 03:59:45 +04:00
|
|
|
namespace layers {
|
|
|
|
class PCompositorChild;
|
2012-08-23 23:33:46 +04:00
|
|
|
} // namespace layers
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
|
|
|
|
2010-09-15 20:44:57 +04:00
|
|
|
class AlertObserver;
|
2010-07-21 22:42:32 +04:00
|
|
|
class PrefObserver;
|
2010-09-24 05:39:32 +04:00
|
|
|
class ConsoleListener;
|
2010-11-19 04:15:23 +03:00
|
|
|
class PStorageChild;
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2014-11-04 04:58:00 +03:00
|
|
|
class TabChild;
|
2010-07-21 22:42:32 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
class ContentChild : public PContentChild
|
2014-06-11 09:44:06 +04:00
|
|
|
, public nsIContentChild
|
2009-08-12 20:18:08 +04:00
|
|
|
{
|
2012-08-02 10:02:29 +04:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2012-08-23 23:33:46 +04:00
|
|
|
typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
|
2014-09-27 03:21:57 +04:00
|
|
|
typedef mozilla::ipc::PFileDescriptorSetChild PFileDescriptorSetChild;
|
2012-08-23 23:33:46 +04:00
|
|
|
typedef mozilla::ipc::URIParams URIParams;
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
public:
|
2010-07-19 22:33:33 +04:00
|
|
|
ContentChild();
|
|
|
|
virtual ~ContentChild();
|
2014-06-11 09:44:06 +04:00
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
|
|
|
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) { return 1; }
|
|
|
|
NS_IMETHOD_(MozExternalRefCountType) Release(void) { return 1; }
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2011-10-05 00:31:00 +04:00
|
|
|
struct AppInfo
|
|
|
|
{
|
|
|
|
nsCString version;
|
|
|
|
nsCString buildID;
|
2013-04-22 20:41:59 +04:00
|
|
|
nsCString name;
|
|
|
|
nsCString UAName;
|
2014-09-24 10:14:55 +04:00
|
|
|
nsCString ID;
|
|
|
|
nsCString vendor;
|
2011-10-05 00:31:00 +04:00
|
|
|
};
|
|
|
|
|
2009-10-28 00:52:37 +03:00
|
|
|
bool Init(MessageLoop* aIOLoop,
|
|
|
|
base::ProcessHandle aParentHandle,
|
|
|
|
IPC::Channel* aChannel);
|
2014-02-13 14:42:41 +04:00
|
|
|
void InitProcessAttributes();
|
2010-09-24 05:39:32 +04:00
|
|
|
void InitXPCOM();
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
static ContentChild* GetSingleton() {
|
2009-08-13 04:32:50 +04:00
|
|
|
return sSingleton;
|
|
|
|
}
|
|
|
|
|
2011-10-05 00:31:00 +04:00
|
|
|
const AppInfo& GetAppInfo() {
|
|
|
|
return mAppInfo;
|
|
|
|
}
|
2014-03-26 08:56:35 +04:00
|
|
|
void SetProcessName(const nsAString& aName, bool aDontOverride = false);
|
2013-10-25 07:47:48 +04:00
|
|
|
void GetProcessName(nsAString& aName);
|
|
|
|
void GetProcessName(nsACString& aName);
|
2014-10-14 01:28:00 +04:00
|
|
|
bool IsAlive();
|
2013-10-25 07:47:48 +04:00
|
|
|
static void AppendProcessId(nsACString& aName);
|
2012-10-06 01:54:54 +04:00
|
|
|
|
2014-06-11 09:44:13 +04:00
|
|
|
ContentBridgeParent* GetLastBridge() {
|
|
|
|
MOZ_ASSERT(mLastBridge);
|
|
|
|
ContentBridgeParent* parent = mLastBridge;
|
|
|
|
mLastBridge = nullptr;
|
|
|
|
return parent;
|
|
|
|
}
|
|
|
|
nsRefPtr<ContentBridgeParent> mLastBridge;
|
|
|
|
|
2014-10-29 18:05:36 +03:00
|
|
|
PPluginModuleParent *
|
|
|
|
AllocPPluginModuleParent(mozilla::ipc::Transport* transport,
|
|
|
|
base::ProcessId otherProcess) MOZ_OVERRIDE;
|
|
|
|
|
2014-06-11 09:44:13 +04:00
|
|
|
PContentBridgeParent*
|
|
|
|
AllocPContentBridgeParent(mozilla::ipc::Transport* transport,
|
|
|
|
base::ProcessId otherProcess) MOZ_OVERRIDE;
|
|
|
|
PContentBridgeChild*
|
|
|
|
AllocPContentBridgeChild(mozilla::ipc::Transport* transport,
|
|
|
|
base::ProcessId otherProcess) MOZ_OVERRIDE;
|
|
|
|
|
2013-09-26 08:19:09 +04:00
|
|
|
PCompositorChild*
|
2013-07-08 19:48:39 +04:00
|
|
|
AllocPCompositorChild(mozilla::ipc::Transport* aTransport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
2014-05-01 05:52:00 +04:00
|
|
|
|
|
|
|
PSharedBufferManagerChild*
|
|
|
|
AllocPSharedBufferManagerChild(mozilla::ipc::Transport* aTransport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
|
|
|
|
2013-09-26 08:19:09 +04:00
|
|
|
PImageBridgeChild*
|
2013-07-08 19:48:39 +04:00
|
|
|
AllocPImageBridgeChild(mozilla::ipc::Transport* aTransport,
|
|
|
|
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
|
2010-03-24 13:47:18 +03:00
|
|
|
|
2014-09-10 15:36:17 +04:00
|
|
|
#if defined(XP_WIN) && defined(MOZ_CONTENT_SANDBOX)
|
|
|
|
// Cleans up any resources used by the process when sandboxed.
|
|
|
|
void CleanUpSandboxEnvironment();
|
|
|
|
#endif
|
|
|
|
|
2014-03-13 02:48:15 +04:00
|
|
|
virtual bool RecvSetProcessSandbox() MOZ_OVERRIDE;
|
2013-01-18 00:06:36 +04:00
|
|
|
|
2013-11-27 11:59:41 +04:00
|
|
|
PBackgroundChild*
|
|
|
|
AllocPBackgroundChild(Transport* aTransport, ProcessId aOtherProcess)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
|
2014-10-29 21:11:00 +03:00
|
|
|
virtual PBrowserChild* AllocPBrowserChild(const TabId& aTabId,
|
|
|
|
const IPCTabContext& aContext,
|
2014-06-04 01:15:27 +04:00
|
|
|
const uint32_t& aChromeFlags,
|
2014-10-24 04:28:00 +04:00
|
|
|
const ContentParentId& aCpID,
|
2014-06-04 01:15:27 +04:00
|
|
|
const bool& aIsForApp,
|
|
|
|
const bool& aIsForBrowser);
|
2013-07-08 19:48:39 +04:00
|
|
|
virtual bool DeallocPBrowserChild(PBrowserChild*);
|
2009-08-12 20:18:08 +04:00
|
|
|
|
2013-07-08 19:48:39 +04:00
|
|
|
virtual PDeviceStorageRequestChild* AllocPDeviceStorageRequestChild(const DeviceStorageParams&);
|
|
|
|
virtual bool DeallocPDeviceStorageRequestChild(PDeviceStorageRequestChild*);
|
2012-06-20 03:14:39 +04:00
|
|
|
|
2014-03-05 07:25:40 +04:00
|
|
|
virtual PFileSystemRequestChild* AllocPFileSystemRequestChild(const FileSystemParams&);
|
|
|
|
virtual bool DeallocPFileSystemRequestChild(PFileSystemRequestChild*);
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPBlobChild(PBlobChild* aActor) MOZ_OVERRIDE;
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2011-06-08 23:56:31 +04:00
|
|
|
virtual PCrashReporterChild*
|
2013-07-08 19:48:39 +04:00
|
|
|
AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
|
2014-01-17 21:46:41 +04:00
|
|
|
const uint32_t& processType) MOZ_OVERRIDE;
|
2011-06-08 23:56:31 +04:00
|
|
|
virtual bool
|
2014-01-17 21:46:41 +04:00
|
|
|
DeallocPCrashReporterChild(PCrashReporterChild*) MOZ_OVERRIDE;
|
2010-11-24 17:15:03 +03:00
|
|
|
|
2013-07-08 19:48:39 +04:00
|
|
|
virtual PHalChild* AllocPHalChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPHalChild(PHalChild*) MOZ_OVERRIDE;
|
2011-10-06 02:15:45 +04:00
|
|
|
|
2011-02-16 21:43:23 +03:00
|
|
|
virtual PMemoryReportRequestChild*
|
2014-05-21 10:06:54 +04:00
|
|
|
AllocPMemoryReportRequestChild(const uint32_t& aGeneration,
|
|
|
|
const bool& aAnonymize,
|
|
|
|
const bool& aMinimizeMemoryUsage,
|
2014-09-18 19:59:00 +04:00
|
|
|
const MaybeFileDesc& aDMDFile) MOZ_OVERRIDE;
|
2011-02-16 21:43:23 +03:00
|
|
|
virtual bool
|
2014-01-17 21:46:41 +04:00
|
|
|
DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor) MOZ_OVERRIDE;
|
2011-02-16 21:43:23 +03:00
|
|
|
|
|
|
|
virtual bool
|
2014-05-21 10:06:54 +04:00
|
|
|
RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* aChild,
|
|
|
|
const uint32_t& aGeneration,
|
|
|
|
const bool& aAnonymize,
|
|
|
|
const bool &aMinimizeMemoryUsage,
|
2014-09-18 19:59:00 +04:00
|
|
|
const MaybeFileDesc &aDMDFile) MOZ_OVERRIDE;
|
2011-02-16 21:43:23 +03:00
|
|
|
|
2014-05-13 21:13:00 +04:00
|
|
|
virtual PCycleCollectWithLogsChild*
|
|
|
|
AllocPCycleCollectWithLogsChild(const bool& aDumpAllTraces,
|
|
|
|
const FileDescriptor& aGCLog,
|
|
|
|
const FileDescriptor& aCCLog) MOZ_OVERRIDE;
|
2012-12-06 07:01:58 +04:00
|
|
|
virtual bool
|
2014-05-13 21:13:00 +04:00
|
|
|
DeallocPCycleCollectWithLogsChild(PCycleCollectWithLogsChild* aActor) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
RecvPCycleCollectWithLogsConstructor(PCycleCollectWithLogsChild* aChild,
|
|
|
|
const bool& aDumpAllTraces,
|
|
|
|
const FileDescriptor& aGCLog,
|
|
|
|
const FileDescriptor& aCCLog) MOZ_OVERRIDE;
|
2012-12-06 07:01:58 +04:00
|
|
|
|
2012-10-16 06:12:14 +04:00
|
|
|
virtual bool
|
2014-05-13 21:13:00 +04:00
|
|
|
RecvAudioChannelNotify() MOZ_OVERRIDE;
|
2012-10-03 05:19:11 +04:00
|
|
|
|
2014-06-03 18:36:46 +04:00
|
|
|
virtual bool
|
|
|
|
RecvDataStoreNotify(const uint32_t& aAppId, const nsString& aName,
|
|
|
|
const nsString& aManifestURL) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PTestShellChild* AllocPTestShellChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPTestShellChild(PTestShellChild*) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvPTestShellConstructor(PTestShellChild*) MOZ_OVERRIDE;
|
2014-10-07 02:45:42 +04:00
|
|
|
jsipc::JavaScriptShared* GetCPOWManager() MOZ_OVERRIDE;
|
2009-08-26 03:07:22 +04:00
|
|
|
|
2014-07-01 14:28:18 +04:00
|
|
|
PMobileConnectionChild*
|
|
|
|
SendPMobileConnectionConstructor(PMobileConnectionChild* aActor,
|
|
|
|
const uint32_t& aClientId);
|
|
|
|
virtual PMobileConnectionChild*
|
|
|
|
AllocPMobileConnectionChild(const uint32_t& aClientId) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
DeallocPMobileConnectionChild(PMobileConnectionChild* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PNeckoChild* AllocPNeckoChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPNeckoChild(PNeckoChild*) MOZ_OVERRIDE;
|
2009-08-18 23:05:15 +04:00
|
|
|
|
2014-10-28 18:59:08 +03:00
|
|
|
virtual PPrintingChild* AllocPPrintingChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPPrintingChild(PPrintingChild*) MOZ_OVERRIDE;
|
|
|
|
|
2014-07-14 21:22:26 +04:00
|
|
|
virtual PScreenManagerChild*
|
|
|
|
AllocPScreenManagerChild(uint32_t* aNumberOfScreens,
|
|
|
|
float* aSystemDefaultScale,
|
|
|
|
bool* aSuccess) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPScreenManagerChild(PScreenManagerChild*) MOZ_OVERRIDE;
|
|
|
|
|
2013-07-08 19:48:39 +04:00
|
|
|
virtual PExternalHelperAppChild *AllocPExternalHelperAppChild(
|
2012-08-23 23:33:46 +04:00
|
|
|
const OptionalURIParams& uri,
|
2010-09-16 02:55:08 +04:00
|
|
|
const nsCString& aMimeContentType,
|
|
|
|
const nsCString& aContentDisposition,
|
2014-02-14 02:43:58 +04:00
|
|
|
const uint32_t& aContentDispositionHint,
|
|
|
|
const nsString& aContentDispositionFilename,
|
2010-09-16 02:55:08 +04:00
|
|
|
const bool& aForceSave,
|
2012-08-22 19:56:38 +04:00
|
|
|
const int64_t& aContentLength,
|
2013-09-12 23:24:10 +04:00
|
|
|
const OptionalURIParams& aReferrer,
|
2014-01-17 21:46:41 +04:00
|
|
|
PBrowserChild* aBrowser) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService) MOZ_OVERRIDE;
|
2010-09-16 02:55:08 +04:00
|
|
|
|
2014-08-18 13:06:11 +04:00
|
|
|
virtual PCellBroadcastChild* AllocPCellBroadcastChild() MOZ_OVERRIDE;
|
|
|
|
PCellBroadcastChild* SendPCellBroadcastConstructor(PCellBroadcastChild* aActor);
|
|
|
|
virtual bool DeallocPCellBroadcastChild(PCellBroadcastChild* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PSmsChild* AllocPSmsChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPSmsChild(PSmsChild*) MOZ_OVERRIDE;
|
2011-11-21 02:40:53 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PTelephonyChild* AllocPTelephonyChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPTelephonyChild(PTelephonyChild*) MOZ_OVERRIDE;
|
2013-09-07 10:19:53 +04:00
|
|
|
|
2014-09-26 09:00:24 +04:00
|
|
|
virtual PVoicemailChild* AllocPVoicemailChild() MOZ_OVERRIDE;
|
|
|
|
PVoicemailChild* SendPVoicemailConstructor(PVoicemailChild* aActor);
|
|
|
|
virtual bool DeallocPVoicemailChild(PVoicemailChild*) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PStorageChild* AllocPStorageChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPStorageChild(PStorageChild* aActor) MOZ_OVERRIDE;
|
2010-11-19 04:15:23 +03:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PBluetoothChild* AllocPBluetoothChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPBluetoothChild(PBluetoothChild* aActor) MOZ_OVERRIDE;
|
2012-09-13 20:37:14 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PFMRadioChild* AllocPFMRadioChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPFMRadioChild(PFMRadioChild* aActor) MOZ_OVERRIDE;
|
2013-09-04 02:28:06 +04:00
|
|
|
|
2013-11-19 01:49:53 +04:00
|
|
|
virtual PAsmJSCacheEntryChild* AllocPAsmJSCacheEntryChild(
|
|
|
|
const asmjscache::OpenMode& aOpenMode,
|
2013-12-05 08:32:52 +04:00
|
|
|
const asmjscache::WriteParams& aWriteParams,
|
2013-11-19 01:49:53 +04:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPAsmJSCacheEntryChild(
|
|
|
|
PAsmJSCacheEntryChild* aActor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) MOZ_OVERRIDE;
|
2013-04-04 02:13:17 +04:00
|
|
|
|
2010-11-09 05:49:00 +03:00
|
|
|
virtual bool RecvRegisterChrome(const InfallibleTArray<ChromePackage>& packages,
|
|
|
|
const InfallibleTArray<ResourceMapping>& resources,
|
2011-01-12 00:34:31 +03:00
|
|
|
const InfallibleTArray<OverrideMapping>& overrides,
|
2014-07-26 00:17:36 +04:00
|
|
|
const nsCString& locale,
|
|
|
|
const bool& reset) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvRegisterChromeItem(const ChromeRegistryItem& item) MOZ_OVERRIDE;
|
2010-03-11 08:33:00 +03:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) MOZ_OVERRIDE;
|
2014-07-02 02:24:27 +04:00
|
|
|
virtual PRemoteSpellcheckEngineChild* AllocPRemoteSpellcheckEngineChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild*) MOZ_OVERRIDE;
|
2013-07-03 11:24:32 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvSetOffline(const bool& offline) MOZ_OVERRIDE;
|
2010-05-11 16:44:12 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvSpeakerManagerNotify() MOZ_OVERRIDE;
|
2013-11-25 03:50:03 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvNotifyVisited(const URIParams& aURI) MOZ_OVERRIDE;
|
2010-09-15 20:44:57 +04:00
|
|
|
// auto remove when alertfinished is received.
|
|
|
|
nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver);
|
|
|
|
|
2014-05-21 09:49:36 +04:00
|
|
|
virtual bool RecvSystemMemoryAvailable(const uint64_t& aGetterId,
|
|
|
|
const uint32_t& aMemoryAvailable) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvPreferenceUpdate(const PrefSetting& aPref) MOZ_OVERRIDE;
|
2010-10-20 00:35:08 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvNotifyAlertsObserver(const nsCString& aType,
|
|
|
|
const nsString& aData) MOZ_OVERRIDE;
|
2010-09-15 20:44:57 +04:00
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMsg,
|
2013-07-11 02:05:39 +04:00
|
|
|
const ClonedMessageData& aData,
|
2013-11-06 21:21:15 +04:00
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
2014-01-17 21:46:41 +04:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
2010-05-26 04:13:47 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere) MOZ_OVERRIDE;
|
2010-09-21 08:16:37 +04:00
|
|
|
|
2014-10-23 22:31:00 +04:00
|
|
|
virtual bool RecvGeolocationError(const uint16_t& errorCode) MOZ_OVERRIDE;
|
|
|
|
|
2014-10-03 18:52:37 +04:00
|
|
|
virtual bool RecvUpdateDictionaryList(const InfallibleTArray<nsString>& aDictionaries) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvAddPermission(const IPC::Permission& permission) MOZ_OVERRIDE;
|
2010-10-09 22:07:38 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvScreenSizeChanged(const gfxIntSize &size) MOZ_OVERRIDE;
|
2010-12-12 01:36:08 +03:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvFlushMemory(const nsString& reason) MOZ_OVERRIDE;
|
2010-12-12 01:36:08 +03:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvActivateA11y() MOZ_OVERRIDE;
|
2011-07-21 08:37:32 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvGarbageCollect() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvCycleCollect() MOZ_OVERRIDE;
|
2011-09-13 21:53:51 +04:00
|
|
|
|
2013-04-22 20:41:59 +04:00
|
|
|
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
|
2014-09-24 10:14:55 +04:00
|
|
|
const nsCString& name, const nsCString& UAName,
|
|
|
|
const nsCString& ID, const nsCString& vendor) MOZ_OVERRIDE;
|
2011-10-05 00:31:00 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvLastPrivateDocShellDestroyed() MOZ_OVERRIDE;
|
2012-04-20 04:13:20 +04:00
|
|
|
|
2013-05-11 13:10:18 +04:00
|
|
|
virtual bool RecvFilePathUpdate(const nsString& aStorageType,
|
|
|
|
const nsString& aStorageName,
|
|
|
|
const nsString& aPath,
|
2014-01-17 21:46:41 +04:00
|
|
|
const nsCString& aReason) MOZ_OVERRIDE;
|
2012-12-15 04:01:34 +04:00
|
|
|
virtual bool RecvFileSystemUpdate(const nsString& aFsName,
|
2013-05-11 13:10:18 +04:00
|
|
|
const nsString& aVolumeName,
|
2012-12-15 04:01:34 +04:00
|
|
|
const int32_t& aState,
|
2013-08-23 03:12:25 +04:00
|
|
|
const int32_t& aMountGeneration,
|
|
|
|
const bool& aIsMediaPresent,
|
2013-12-03 13:32:56 +04:00
|
|
|
const bool& aIsSharing,
|
2014-05-14 02:48:04 +04:00
|
|
|
const bool& aIsFormatting,
|
2014-09-22 07:42:33 +04:00
|
|
|
const bool& aIsFake,
|
|
|
|
const bool& aIsUnmounting) MOZ_OVERRIDE;
|
2012-08-02 10:32:04 +04:00
|
|
|
|
2013-06-03 14:14:40 +04:00
|
|
|
virtual bool RecvNuwaFork() MOZ_OVERRIDE;
|
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool
|
|
|
|
RecvNotifyProcessPriorityChanged(const hal::ProcessPriority& aPriority) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvMinimizeMemoryUsage() MOZ_OVERRIDE;
|
2013-04-26 04:53:26 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI,
|
|
|
|
const uint32_t& aType) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvUnregisterSheet(const URIParams& aURI, const uint32_t& aType) MOZ_OVERRIDE;
|
2013-08-27 21:10:39 +04:00
|
|
|
|
2014-01-17 21:46:41 +04:00
|
|
|
virtual bool RecvNotifyPhoneStateChange(const nsString& state) MOZ_OVERRIDE;
|
2013-12-13 20:28:46 +04:00
|
|
|
|
|
|
|
void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
|
|
|
|
void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
|
|
|
|
virtual bool RecvNotifyIdleObserver(const uint64_t& aObserver,
|
|
|
|
const nsCString& aTopic,
|
2014-01-17 21:46:41 +04:00
|
|
|
const nsString& aData) MOZ_OVERRIDE;
|
2014-08-29 04:20:27 +04:00
|
|
|
|
|
|
|
virtual bool RecvOnAppThemeChanged() MOZ_OVERRIDE;
|
|
|
|
|
2014-11-18 20:50:25 +03:00
|
|
|
virtual bool RecvStartProfiler(const uint32_t& aEntries,
|
|
|
|
const double& aInterval,
|
|
|
|
const nsTArray<nsCString>& aFeatures,
|
|
|
|
const nsTArray<nsCString>& aThreadNameFilters) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvStopProfiler() MOZ_OVERRIDE;
|
|
|
|
virtual bool AnswerGetProfile(nsCString* aProfile) MOZ_OVERRIDE;
|
|
|
|
|
2010-11-24 21:22:40 +03:00
|
|
|
#ifdef ANDROID
|
|
|
|
gfxIntSize GetScreenSize() { return mScreenSize; }
|
|
|
|
#endif
|
|
|
|
|
2011-04-30 03:46:20 +04:00
|
|
|
// Get the directory for IndexedDB files. We query the parent for this and
|
|
|
|
// cache the value
|
|
|
|
nsString &GetIndexedDBPath();
|
|
|
|
|
2014-10-24 04:28:00 +04:00
|
|
|
ContentParentId GetID() { return mID; }
|
2011-09-30 11:00:48 +04:00
|
|
|
|
2013-01-11 15:19:02 +04:00
|
|
|
bool IsForApp() { return mIsForApp; }
|
|
|
|
bool IsForBrowser() { return mIsForBrowser; }
|
|
|
|
|
2014-06-11 09:44:06 +04:00
|
|
|
virtual PBlobChild*
|
|
|
|
SendPBlobConstructor(PBlobChild* actor,
|
|
|
|
const BlobConstructorParams& params) MOZ_OVERRIDE;
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2014-03-25 22:37:13 +04:00
|
|
|
virtual PFileDescriptorSetChild*
|
|
|
|
AllocPFileDescriptorSetChild(const FileDescriptor&) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPFileDescriptorSetChild(PFileDescriptorSetChild*) MOZ_OVERRIDE;
|
|
|
|
|
2014-06-11 09:44:06 +04:00
|
|
|
virtual bool SendPBrowserConstructor(PBrowserChild* actor,
|
2014-10-29 21:11:00 +03:00
|
|
|
const TabId& aTabId,
|
2014-06-11 09:44:06 +04:00
|
|
|
const IPCTabContext& context,
|
|
|
|
const uint32_t& chromeFlags,
|
2014-10-24 04:28:00 +04:00
|
|
|
const ContentParentId& aCpID,
|
2014-06-11 09:44:06 +04:00
|
|
|
const bool& aIsForApp,
|
|
|
|
const bool& aIsForBrowser) MOZ_OVERRIDE;
|
2014-06-11 09:44:13 +04:00
|
|
|
|
2014-06-04 01:15:27 +04:00
|
|
|
virtual bool RecvPBrowserConstructor(PBrowserChild* aCctor,
|
2014-10-29 21:11:00 +03:00
|
|
|
const TabId& aTabId,
|
2014-06-04 01:15:27 +04:00
|
|
|
const IPCTabContext& aContext,
|
|
|
|
const uint32_t& aChromeFlags,
|
2014-10-24 04:28:00 +04:00
|
|
|
const ContentParentId& aCpID,
|
2014-06-04 01:15:27 +04:00
|
|
|
const bool& aIsForApp,
|
|
|
|
const bool& aIsForBrowser) MOZ_OVERRIDE;
|
2014-03-08 01:35:19 +04:00
|
|
|
virtual PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) MOZ_OVERRIDE;
|
2013-02-23 08:24:28 +04:00
|
|
|
|
2014-10-03 18:52:37 +04:00
|
|
|
void GetAvailableDictionaries(InfallibleTArray<nsString>& aDictionaries);
|
|
|
|
|
2014-11-04 04:58:00 +03:00
|
|
|
PBrowserOrId
|
|
|
|
GetBrowserOrId(TabChild* aTabChild);
|
|
|
|
|
2014-11-13 03:31:00 +03:00
|
|
|
virtual POfflineCacheUpdateChild* AllocPOfflineCacheUpdateChild(
|
|
|
|
const URIParams& manifestURI,
|
|
|
|
const URIParams& documentURI,
|
|
|
|
const bool& stickDocument,
|
|
|
|
const TabId& aTabId) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate) MOZ_OVERRIDE;
|
|
|
|
|
2009-12-07 09:03:49 +03:00
|
|
|
private:
|
2012-07-18 03:59:45 +04:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
2009-12-07 09:03:49 +03:00
|
|
|
|
2012-07-18 03:59:45 +04:00
|
|
|
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
|
2010-08-21 03:24:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exit *now*. Do not shut down XPCOM, do not pass Go, do not run
|
|
|
|
* static destructors, do not collect $200.
|
|
|
|
*/
|
2011-12-18 01:45:29 +04:00
|
|
|
MOZ_NORETURN void QuickExit();
|
2010-08-21 03:24:40 +04:00
|
|
|
|
2010-11-09 05:49:00 +03:00
|
|
|
InfallibleTArray<nsAutoPtr<AlertObserver> > mAlertObservers;
|
2010-09-24 05:39:32 +04:00
|
|
|
nsRefPtr<ConsoleListener> mConsoleListener;
|
2009-08-13 04:32:50 +04:00
|
|
|
|
2014-04-21 21:18:53 +04:00
|
|
|
nsTHashtable<nsPtrHashKey<nsIObserver>> mIdleObservers;
|
|
|
|
|
2014-10-03 18:52:37 +04:00
|
|
|
InfallibleTArray<nsString> mAvailableDictionaries;
|
|
|
|
|
2011-09-30 11:00:48 +04: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.
|
|
|
|
*/
|
2014-10-24 04:28:00 +04:00
|
|
|
ContentParentId mID;
|
2011-09-30 11:00:48 +04:00
|
|
|
|
2012-04-25 20:35:58 +04:00
|
|
|
AppInfo mAppInfo;
|
|
|
|
|
2012-08-07 11:06:29 +04:00
|
|
|
#ifdef ANDROID
|
|
|
|
gfxIntSize mScreenSize;
|
|
|
|
#endif
|
|
|
|
|
2012-08-23 14:23:43 +04:00
|
|
|
bool mIsForApp;
|
|
|
|
bool mIsForBrowser;
|
2014-03-26 08:56:35 +04:00
|
|
|
bool mCanOverrideProcessName;
|
2014-10-14 01:28:00 +04:00
|
|
|
bool mIsAlive;
|
2012-10-06 01:54:54 +04:00
|
|
|
nsString mProcessName;
|
2012-08-23 14:23:43 +04:00
|
|
|
|
2010-07-21 22:42:32 +04:00
|
|
|
static ContentChild* sSingleton;
|
2010-05-26 04:13:47 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(ContentChild);
|
2009-08-12 20:18:08 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|