Bug 1235576 - Fix the indentation in dom/ipc, r=smaug

This commit is contained in:
Andrea Marchesini 2016-01-05 09:59:30 +00:00
Родитель 084b138ad2
Коммит 9b34c64d31
24 изменённых файлов: 7207 добавлений и 6720 удалений

Просмотреть файл

@ -14,13 +14,14 @@ class CPOWManager;
} /* namespace jsipc */ } /* namespace jsipc */
namespace dom { namespace dom {
class CPOWManagerGetter class CPOWManagerGetter
{ {
public: public:
virtual mozilla::jsipc::CPOWManager* GetCPOWManager() = 0; virtual mozilla::jsipc::CPOWManager* GetCPOWManager() = 0;
}; };
} /* namespace dom */
} /* namespace dom */
} /* namespace mozilla */ } /* namespace mozilla */
#endif /* mozilla_dom_CPOWManagerGetter_h */ #endif /* mozilla_dom_CPOWManagerGetter_h */

Просмотреть файл

@ -27,7 +27,7 @@ public:
virtual void ActorDestroy(ActorDestroyReason aWhy) override; virtual void ActorDestroy(ActorDestroyReason aWhy) override;
void DeferredDestroy(); void DeferredDestroy();
virtual bool IsContentBridgeParent() override { return true; } virtual bool IsContentBridgeParent() const override { return true; }
void NotifyTabDestroyed(); void NotifyTabDestroyed();
static ContentBridgeParent* static ContentBridgeParent*
@ -48,15 +48,15 @@ public:
jsipc::CPOWManager* GetCPOWManager() override; jsipc::CPOWManager* GetCPOWManager() override;
virtual ContentParentId ChildID() override virtual ContentParentId ChildID() const override
{ {
return mChildID; return mChildID;
} }
virtual bool IsForApp() override virtual bool IsForApp() const override
{ {
return mIsForApp; return mIsForApp;
} }
virtual bool IsForBrowser() override virtual bool IsForBrowser() const override
{ {
return mIsForBrowser; return mIsForBrowser;
} }
@ -68,27 +68,32 @@ protected:
{ {
mChildID = aId; mChildID = aId;
} }
void SetIsForApp(bool aIsForApp) void SetIsForApp(bool aIsForApp)
{ {
mIsForApp = aIsForApp; mIsForApp = aIsForApp;
} }
void SetIsForBrowser(bool aIsForBrowser) void SetIsForBrowser(bool aIsForBrowser)
{ {
mIsForBrowser = aIsForBrowser; mIsForBrowser = aIsForBrowser;
} }
protected: protected:
virtual bool RecvSyncMessage(const nsString& aMsg, virtual bool
RecvSyncMessage(const nsString& aMsg,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<jsipc::CpowEntry>&& aCpows, InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal, const IPC::Principal& aPrincipal,
nsTArray<StructuredCloneData>* aRetvals) override; nsTArray<StructuredCloneData>* aRetvals) override;
virtual bool RecvAsyncMessage(const nsString& aMsg, virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<jsipc::CpowEntry>&& aCpows, InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) override; const IPC::Principal& aPrincipal) override;
virtual jsipc::PJavaScriptParent* AllocPJavaScriptParent() override; virtual jsipc::PJavaScriptParent* AllocPJavaScriptParent() override;
virtual bool virtual bool
DeallocPJavaScriptParent(jsipc::PJavaScriptParent*) override; DeallocPJavaScriptParent(jsipc::PJavaScriptParent*) override;
@ -99,6 +104,7 @@ protected:
const ContentParentId& aCpID, const ContentParentId& aCpID,
const bool& aIsForApp, const bool& aIsForApp,
const bool& aIsForBrowser) override; const bool& aIsForBrowser) override;
virtual bool DeallocPBrowserParent(PBrowserParent*) override; virtual bool DeallocPBrowserParent(PBrowserParent*) override;
virtual PBlobParent* virtual PBlobParent*

Просмотреть файл

@ -240,6 +240,7 @@ public:
MemoryReportRequestChild(bool aAnonymize, MemoryReportRequestChild(bool aAnonymize,
const MaybeFileDesc& aDMDFile); const MaybeFileDesc& aDMDFile);
NS_IMETHOD Run() override; NS_IMETHOD Run() override;
private: private:
virtual ~MemoryReportRequestChild(); virtual ~MemoryReportRequestChild();
@ -251,7 +252,7 @@ NS_IMPL_ISUPPORTS(MemoryReportRequestChild, nsIRunnable)
MemoryReportRequestChild::MemoryReportRequestChild( MemoryReportRequestChild::MemoryReportRequestChild(
bool aAnonymize, const MaybeFileDesc& aDMDFile) bool aAnonymize, const MaybeFileDesc& aDMDFile)
: mAnonymize(aAnonymize) : mAnonymize(aAnonymize)
{ {
MOZ_COUNT_CTOR(MemoryReportRequestChild); MOZ_COUNT_CTOR(MemoryReportRequestChild);
if (aDMDFile.type() == MaybeFileDesc::TFileDescriptor) { if (aDMDFile.type() == MaybeFileDesc::TFileDescriptor) {
@ -381,8 +382,7 @@ public:
bool ShouldRemoveFrom(nsIObserver* aObserver, bool ShouldRemoveFrom(nsIObserver* aObserver,
const nsString& aData) const const nsString& aData) const
{ {
return (mObserver == aObserver && return (mObserver == aObserver && mData == aData);
mData == aData);
} }
bool Observes(const nsString& aData) const bool Observes(const nsString& aData) const
@ -422,8 +422,9 @@ NS_IMPL_ISUPPORTS(ConsoleListener, nsIConsoleListener)
NS_IMETHODIMP NS_IMETHODIMP
ConsoleListener::Observe(nsIConsoleMessage* aMessage) ConsoleListener::Observe(nsIConsoleMessage* aMessage)
{ {
if (!mChild) if (!mChild) {
return NS_OK; return NS_OK;
}
nsCOMPtr<nsIScriptError> scriptError = do_QueryInterface(aMessage); nsCOMPtr<nsIScriptError> scriptError = do_QueryInterface(aMessage);
if (scriptError) { if (scriptError) {
@ -483,12 +484,10 @@ public:
void SystemMessageHandledObserver::Init() void SystemMessageHandledObserver::Init()
{ {
nsCOMPtr<nsIObserverService> os = nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
mozilla::services::GetObserverService();
if (os) { if (os) {
os->AddObserver(this, "handle-system-messages-done", os->AddObserver(this, "handle-system-messages-done", /* ownsWeak */ false);
/* ownsWeak */ false);
} }
} }
@ -546,8 +545,7 @@ InitOnContentProcessCreated()
return; return;
} }
nsCOMPtr<nsIPermissionManager> permManager = nsCOMPtr<nsIPermissionManager> permManager = services::GetPermissionManager();
services::GetPermissionManager();
MOZ_ASSERT(permManager, "Unable to get permission manager"); MOZ_ASSERT(permManager, "Unable to get permission manager");
nsresult rv = permManager->RefreshPermission(); nsresult rv = permManager->RefreshPermission();
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
@ -587,15 +585,14 @@ ResetTransports(void* aUnused)
static void static void
ReinitTaskTracer(void* /*aUnused*/) ReinitTaskTracer(void* /*aUnused*/)
{ {
mozilla::tasktracer::InitTaskTracer( mozilla::tasktracer::InitTaskTracer(mozilla::tasktracer::FORKED_AFTER_NUWA);
mozilla::tasktracer::FORKED_AFTER_NUWA);
} }
#endif #endif
ContentChild::ContentChild() ContentChild::ContentChild()
: mID(uint64_t(-1)) : mID(uint64_t(-1))
#ifdef ANDROID #ifdef ANDROID
,mScreenSize(0, 0) , mScreenSize(0, 0)
#endif #endif
, mCanOverrideProcessName(true) , mCanOverrideProcessName(true)
, mIsAlive(true) , mIsAlive(true)
@ -726,7 +723,8 @@ ContentChild::SetProcessName(const nsAString& aName, bool aDontOverride)
if ((name = PR_GetEnv("MOZ_DEBUG_APP_PROCESS")) && if ((name = PR_GetEnv("MOZ_DEBUG_APP_PROCESS")) &&
aName.EqualsASCII(name)) { aName.EqualsASCII(name)) {
#ifdef OS_POSIX #ifdef OS_POSIX
printf_stderr("\n\nCHILDCHILDCHILDCHILD\n [%s] debug me @%d\n\n", name, getpid()); printf_stderr("\n\nCHILDCHILDCHILDCHILD\n [%s] debug me @%d\n\n", name,
getpid());
sleep(30); sleep(30);
#elif defined(OS_WIN) #elif defined(OS_WIN)
// Windows has a decent JIT debugging story, so NS_DebugBreak does the // Windows has a decent JIT debugging story, so NS_DebugBreak does the
@ -837,8 +835,8 @@ ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
if (aIframeMoz) { if (aIframeMoz) {
MOZ_ASSERT(aTabOpener); MOZ_ASSERT(aTabOpener);
newChild->SendBrowserFrameOpenWindow(aTabOpener, NS_ConvertUTF8toUTF16(url), name, newChild->SendBrowserFrameOpenWindow(aTabOpener, NS_ConvertUTF8toUTF16(url),
NS_ConvertUTF8toUTF16(features), name, NS_ConvertUTF8toUTF16(features),
aWindowIsNew); aWindowIsNew);
} else { } else {
nsAutoCString baseURIString; nsAutoCString baseURIString;
@ -919,19 +917,19 @@ ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
} }
void void
ContentChild::GetProcessName(nsAString& aName) ContentChild::GetProcessName(nsAString& aName) const
{ {
aName.Assign(mProcessName); aName.Assign(mProcessName);
} }
bool bool
ContentChild::IsAlive() ContentChild::IsAlive() const
{ {
return mIsAlive; return mIsAlive;
} }
void void
ContentChild::GetProcessName(nsACString& aName) ContentChild::GetProcessName(nsACString& aName) const
{ {
aName.Assign(NS_ConvertUTF16toUTF8(mProcessName)); aName.Assign(NS_ConvertUTF16toUTF8(mProcessName));
} }
@ -1054,8 +1052,7 @@ public:
const nsACString& aProcess) const nsACString& aProcess)
: mActor(aActor) : mActor(aActor)
, mProcess(aProcess) , mProcess(aProcess)
{ { }
}
NS_IMETHOD Callback(const nsACString& aProcess, const nsACString &aPath, NS_IMETHOD Callback(const nsACString& aProcess, const nsACString &aPath,
int32_t aKind, int32_t aUnits, int64_t aAmount, int32_t aKind, int32_t aUnits, int64_t aAmount,
@ -1073,6 +1070,7 @@ private:
RefPtr<MemoryReportRequestChild> mActor; RefPtr<MemoryReportRequestChild> mActor;
const nsCString mProcess; const nsCString mProcess;
}; };
NS_IMPL_ISUPPORTS( NS_IMPL_ISUPPORTS(
MemoryReportCallback MemoryReportCallback
, nsIMemoryReporterCallback , nsIMemoryReporterCallback
@ -1099,6 +1097,7 @@ private:
RefPtr<MemoryReportRequestChild> mActor; RefPtr<MemoryReportRequestChild> mActor;
}; };
NS_IMPL_ISUPPORTS( NS_IMPL_ISUPPORTS(
MemoryReportFinishedCallback MemoryReportFinishedCallback
, nsIFinishReportingCallback , nsIFinishReportingCallback
@ -1117,7 +1116,8 @@ ContentChild::RecvPMemoryReportRequestConstructor(
nsresult rv; nsresult rv;
if (aMinimizeMemoryUsage) { if (aMinimizeMemoryUsage) {
nsCOMPtr<nsIMemoryReporterManager> mgr = do_GetService("@mozilla.org/memory-reporter-manager;1"); nsCOMPtr<nsIMemoryReporterManager> mgr =
do_GetService("@mozilla.org/memory-reporter-manager;1");
rv = mgr->MinimizeMemoryUsage(actor); rv = mgr->MinimizeMemoryUsage(actor);
// mgr will eventually call actor->Run() // mgr will eventually call actor->Run()
} else { } else {
@ -1130,7 +1130,8 @@ ContentChild::RecvPMemoryReportRequestConstructor(
NS_IMETHODIMP MemoryReportRequestChild::Run() NS_IMETHODIMP MemoryReportRequestChild::Run()
{ {
ContentChild *child = static_cast<ContentChild*>(Manager()); ContentChild *child = static_cast<ContentChild*>(Manager());
nsCOMPtr<nsIMemoryReporterManager> mgr = do_GetService("@mozilla.org/memory-reporter-manager;1"); nsCOMPtr<nsIMemoryReporterManager> mgr =
do_GetService("@mozilla.org/memory-reporter-manager;1");
nsCString process; nsCString process;
child->GetProcessName(process); child->GetProcessName(process);
@ -2365,13 +2366,15 @@ ContentChild::RecvAsyncMessage(const nsString& aMsg,
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) const IPC::Principal& aPrincipal)
{ {
RefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::GetChildProcessManager(); RefPtr<nsFrameMessageManager> cpm =
nsFrameMessageManager::GetChildProcessManager();
if (cpm) { if (cpm) {
StructuredCloneData data; StructuredCloneData data;
ipc::UnpackClonedMessageDataForChild(aData, data); ipc::UnpackClonedMessageDataForChild(aData, data);
CrossProcessCpowHolder cpows(this, aCpows); CrossProcessCpowHolder cpows(this, aCpows);
cpm->ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(cpm.get()), nullptr, cpm->ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(cpm.get()),
aMsg, false, &data, &cpows, aPrincipal, nullptr); nullptr, aMsg, false, &data, &cpows, aPrincipal,
nullptr);
} }
return true; return true;
} }
@ -2379,7 +2382,8 @@ ContentChild::RecvAsyncMessage(const nsString& aMsg,
bool bool
ContentChild::RecvGeolocationUpdate(const GeoPosition& somewhere) ContentChild::RecvGeolocationUpdate(const GeoPosition& somewhere)
{ {
nsCOMPtr<nsIGeolocationUpdate> gs = do_GetService("@mozilla.org/geolocation/service;1"); nsCOMPtr<nsIGeolocationUpdate> gs =
do_GetService("@mozilla.org/geolocation/service;1");
if (!gs) { if (!gs) {
return true; return true;
} }
@ -2391,7 +2395,8 @@ ContentChild::RecvGeolocationUpdate(const GeoPosition& somewhere)
bool bool
ContentChild::RecvGeolocationError(const uint16_t& errorCode) ContentChild::RecvGeolocationError(const uint16_t& errorCode)
{ {
nsCOMPtr<nsIGeolocationUpdate> gs = do_GetService("@mozilla.org/geolocation/service;1"); nsCOMPtr<nsIGeolocationUpdate> gs =
do_GetService("@mozilla.org/geolocation/service;1");
if (!gs) { if (!gs) {
return true; return true;
} }
@ -2464,8 +2469,9 @@ ContentChild::RecvFlushMemory(const nsString& reason)
#endif #endif
nsCOMPtr<nsIObserverService> os = nsCOMPtr<nsIObserverService> os =
mozilla::services::GetObserverService(); mozilla::services::GetObserverService();
if (os) if (os) {
os->NotifyObservers(nullptr, "memory-pressure", reason.get()); os->NotifyObservers(nullptr, "memory-pressure", reason.get());
}
return true; return true;
} }
@ -2829,7 +2835,8 @@ ContentChild::RecvStartProfiler(const ProfilerInitParams& params)
profiler_start(params.entries(), params.interval(), profiler_start(params.entries(), params.interval(),
featureArray.Elements(), featureArray.Length(), featureArray.Elements(), featureArray.Length(),
threadNameFilterArray.Elements(), threadNameFilterArray.Length()); threadNameFilterArray.Elements(),
threadNameFilterArray.Length());
return true; return true;
} }
@ -2869,11 +2876,11 @@ ContentChild::RecvGatherProfile()
} }
bool bool
ContentChild::RecvLoadPluginResult(const uint32_t& aPluginId, const bool& aResult) ContentChild::RecvLoadPluginResult(const uint32_t& aPluginId,
const bool& aResult)
{ {
nsresult rv; nsresult rv;
bool finalResult = aResult && bool finalResult = aResult && SendConnectPluginBridge(aPluginId, &rv) &&
SendConnectPluginBridge(aPluginId, &rv) &&
NS_SUCCEEDED(rv); NS_SUCCEEDED(rv);
plugins::PluginModuleContentParent::OnLoadPluginResult(aPluginId, plugins::PluginModuleContentParent::OnLoadPluginResult(aPluginId,
finalResult); finalResult);
@ -2889,7 +2896,8 @@ ContentChild::RecvAssociatePluginId(const uint32_t& aPluginId,
} }
bool bool
ContentChild::RecvDomainSetChanged(const uint32_t& aSetType, const uint32_t& aChangeType, ContentChild::RecvDomainSetChanged(const uint32_t& aSetType,
const uint32_t& aChangeType,
const OptionalURIParams& aDomain) const OptionalURIParams& aDomain)
{ {
if (aChangeType == ACTIVATE_POLICY) { if (aChangeType == ACTIVATE_POLICY) {

Просмотреть файл

@ -92,29 +92,41 @@ public:
bool Init(MessageLoop* aIOLoop, bool Init(MessageLoop* aIOLoop,
base::ProcessId aParentPid, base::ProcessId aParentPid,
IPC::Channel* aChannel); IPC::Channel* aChannel);
void InitProcessAttributes(); void InitProcessAttributes();
void InitXPCOM(); void InitXPCOM();
void InitGraphicsDeviceData(); void InitGraphicsDeviceData();
static ContentChild* GetSingleton() { static ContentChild* GetSingleton()
{
return sSingleton; return sSingleton;
} }
const AppInfo& GetAppInfo() { const AppInfo& GetAppInfo()
{
return mAppInfo; return mAppInfo;
} }
void SetProcessName(const nsAString& aName, bool aDontOverride = false); void SetProcessName(const nsAString& aName, bool aDontOverride = false);
void GetProcessName(nsAString& aName);
void GetProcessName(nsACString& aName); void GetProcessName(nsAString& aName) const;
bool IsAlive();
void GetProcessName(nsACString& aName) const;
bool IsAlive() const;
static void AppendProcessId(nsACString& aName); static void AppendProcessId(nsACString& aName);
ContentBridgeParent* GetLastBridge() { ContentBridgeParent* GetLastBridge()
{
MOZ_ASSERT(mLastBridge); MOZ_ASSERT(mLastBridge);
ContentBridgeParent* parent = mLastBridge; ContentBridgeParent* parent = mLastBridge;
mLastBridge = nullptr; mLastBridge = nullptr;
return parent; return parent;
} }
RefPtr<ContentBridgeParent> mLastBridge; RefPtr<ContentBridgeParent> mLastBridge;
PPluginModuleParent * PPluginModuleParent *
@ -165,45 +177,55 @@ public:
const bool& aIsForApp, const bool& aIsForApp,
const bool& aIsForBrowser) const bool& aIsForBrowser)
override; override;
virtual bool DeallocPBrowserChild(PBrowserChild*) override; virtual bool DeallocPBrowserChild(PBrowserChild*) override;
virtual PDeviceStorageRequestChild* AllocPDeviceStorageRequestChild(const DeviceStorageParams&) virtual PDeviceStorageRequestChild*
override; AllocPDeviceStorageRequestChild(const DeviceStorageParams&) override;
virtual bool DeallocPDeviceStorageRequestChild(PDeviceStorageRequestChild*)
override;
virtual PFileSystemRequestChild* AllocPFileSystemRequestChild(const FileSystemParams&) virtual bool
override; DeallocPDeviceStorageRequestChild(PDeviceStorageRequestChild*) override;
virtual bool DeallocPFileSystemRequestChild(PFileSystemRequestChild*) override;
virtual PFileSystemRequestChild*
AllocPFileSystemRequestChild(const FileSystemParams&) override;
virtual bool
DeallocPFileSystemRequestChild(PFileSystemRequestChild*) override;
virtual PBlobChild*
AllocPBlobChild(const BlobConstructorParams& aParams) override;
virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams)
override;
virtual bool DeallocPBlobChild(PBlobChild* aActor) override; virtual bool DeallocPBlobChild(PBlobChild* aActor) override;
virtual PCrashReporterChild* virtual PCrashReporterChild*
AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id, AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
const uint32_t& processType) override; const uint32_t& processType) override;
virtual bool virtual bool
DeallocPCrashReporterChild(PCrashReporterChild*) override; DeallocPCrashReporterChild(PCrashReporterChild*) override;
virtual PHalChild* AllocPHalChild() override; virtual PHalChild* AllocPHalChild() override;
virtual bool DeallocPHalChild(PHalChild*) override; virtual bool DeallocPHalChild(PHalChild*) override;
virtual PHeapSnapshotTempFileHelperChild* AllocPHeapSnapshotTempFileHelperChild() override; virtual PHeapSnapshotTempFileHelperChild*
virtual bool DeallocPHeapSnapshotTempFileHelperChild(PHeapSnapshotTempFileHelperChild*) override; AllocPHeapSnapshotTempFileHelperChild() override;
virtual bool
DeallocPHeapSnapshotTempFileHelperChild(PHeapSnapshotTempFileHelperChild*) override;
PIccChild* PIccChild*
SendPIccConstructor(PIccChild* aActor, const uint32_t& aServiceId); SendPIccConstructor(PIccChild* aActor, const uint32_t& aServiceId);
virtual PIccChild*
AllocPIccChild(const uint32_t& aClientId) override; virtual PIccChild* AllocPIccChild(const uint32_t& aClientId) override;
virtual bool
DeallocPIccChild(PIccChild* aActor) override; virtual bool DeallocPIccChild(PIccChild* aActor) override;
virtual PMemoryReportRequestChild* virtual PMemoryReportRequestChild*
AllocPMemoryReportRequestChild(const uint32_t& aGeneration, AllocPMemoryReportRequestChild(const uint32_t& aGeneration,
const bool& aAnonymize, const bool& aAnonymize,
const bool& aMinimizeMemoryUsage, const bool& aMinimizeMemoryUsage,
const MaybeFileDesc& aDMDFile) override; const MaybeFileDesc& aDMDFile) override;
virtual bool virtual bool
DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor) override; DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor) override;
@ -218,55 +240,73 @@ public:
AllocPCycleCollectWithLogsChild(const bool& aDumpAllTraces, AllocPCycleCollectWithLogsChild(const bool& aDumpAllTraces,
const FileDescriptor& aGCLog, const FileDescriptor& aGCLog,
const FileDescriptor& aCCLog) override; const FileDescriptor& aCCLog) override;
virtual bool virtual bool
DeallocPCycleCollectWithLogsChild(PCycleCollectWithLogsChild* aActor) override; DeallocPCycleCollectWithLogsChild(PCycleCollectWithLogsChild* aActor) override;
virtual bool virtual bool
RecvPCycleCollectWithLogsConstructor(PCycleCollectWithLogsChild* aChild, RecvPCycleCollectWithLogsConstructor(PCycleCollectWithLogsChild* aChild,
const bool& aDumpAllTraces, const bool& aDumpAllTraces,
const FileDescriptor& aGCLog, const FileDescriptor& aGCLog,
const FileDescriptor& aCCLog) override; const FileDescriptor& aCCLog) override;
virtual PWebBrowserPersistDocumentChild* AllocPWebBrowserPersistDocumentChild(PBrowserChild* aBrowser, const uint64_t& aOuterWindowID) override; virtual PWebBrowserPersistDocumentChild*
virtual bool RecvPWebBrowserPersistDocumentConstructor(PWebBrowserPersistDocumentChild *aActor, AllocPWebBrowserPersistDocumentChild(PBrowserChild* aBrowser,
const uint64_t& aOuterWindowID) override;
virtual bool
RecvPWebBrowserPersistDocumentConstructor(PWebBrowserPersistDocumentChild *aActor,
PBrowserChild *aBrowser, PBrowserChild *aBrowser,
const uint64_t& aOuterWindowID) override; const uint64_t& aOuterWindowID) override;
virtual bool DeallocPWebBrowserPersistDocumentChild(PWebBrowserPersistDocumentChild* aActor) override;
virtual bool
DeallocPWebBrowserPersistDocumentChild(PWebBrowserPersistDocumentChild* aActor) override;
virtual bool virtual bool
RecvDataStoreNotify(const uint32_t& aAppId, const nsString& aName, RecvDataStoreNotify(const uint32_t& aAppId, const nsString& aName,
const nsString& aManifestURL) override; const nsString& aManifestURL) override;
virtual PTestShellChild* AllocPTestShellChild() override; virtual PTestShellChild* AllocPTestShellChild() override;
virtual bool DeallocPTestShellChild(PTestShellChild*) override; virtual bool DeallocPTestShellChild(PTestShellChild*) override;
virtual bool RecvPTestShellConstructor(PTestShellChild*) override; virtual bool RecvPTestShellConstructor(PTestShellChild*) override;
jsipc::CPOWManager* GetCPOWManager() override; jsipc::CPOWManager* GetCPOWManager() override;
PMobileConnectionChild* PMobileConnectionChild*
SendPMobileConnectionConstructor(PMobileConnectionChild* aActor, SendPMobileConnectionConstructor(PMobileConnectionChild* aActor,
const uint32_t& aClientId); const uint32_t& aClientId);
virtual PMobileConnectionChild* virtual PMobileConnectionChild*
AllocPMobileConnectionChild(const uint32_t& aClientId) override; AllocPMobileConnectionChild(const uint32_t& aClientId) override;
virtual bool virtual bool
DeallocPMobileConnectionChild(PMobileConnectionChild* aActor) override; DeallocPMobileConnectionChild(PMobileConnectionChild* aActor) override;
virtual PNeckoChild* AllocPNeckoChild() override; virtual PNeckoChild* AllocPNeckoChild() override;
virtual bool DeallocPNeckoChild(PNeckoChild*) override; virtual bool DeallocPNeckoChild(PNeckoChild*) override;
virtual PPrintingChild* AllocPPrintingChild() override; virtual PPrintingChild* AllocPPrintingChild() override;
virtual bool DeallocPPrintingChild(PPrintingChild*) override; virtual bool DeallocPPrintingChild(PPrintingChild*) override;
virtual PScreenManagerChild* virtual PScreenManagerChild*
AllocPScreenManagerChild(uint32_t* aNumberOfScreens, AllocPScreenManagerChild(uint32_t* aNumberOfScreens,
float* aSystemDefaultScale, float* aSystemDefaultScale,
bool* aSuccess) override; bool* aSuccess) override;
virtual bool DeallocPScreenManagerChild(PScreenManagerChild*) override; virtual bool DeallocPScreenManagerChild(PScreenManagerChild*) override;
virtual PPSMContentDownloaderChild* AllocPPSMContentDownloaderChild( virtual PPSMContentDownloaderChild*
const uint32_t& aCertType) override; AllocPPSMContentDownloaderChild( const uint32_t& aCertType) override;
virtual bool DeallocPPSMContentDownloaderChild(PPSMContentDownloaderChild* aDownloader) override;
virtual PExternalHelperAppChild *AllocPExternalHelperAppChild( virtual bool
const OptionalURIParams& uri, DeallocPPSMContentDownloaderChild(PPSMContentDownloaderChild* aDownloader) override;
virtual PExternalHelperAppChild*
AllocPExternalHelperAppChild(const OptionalURIParams& uri,
const nsCString& aMimeContentType, const nsCString& aMimeContentType,
const nsCString& aContentDisposition, const nsCString& aContentDisposition,
const uint32_t& aContentDispositionHint, const uint32_t& aContentDispositionHint,
@ -275,46 +315,65 @@ public:
const int64_t& aContentLength, const int64_t& aContentLength,
const OptionalURIParams& aReferrer, const OptionalURIParams& aReferrer,
PBrowserChild* aBrowser) override; PBrowserChild* aBrowser) override;
virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService) override;
virtual bool
DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService) override;
virtual PHandlerServiceChild* AllocPHandlerServiceChild() override; virtual PHandlerServiceChild* AllocPHandlerServiceChild() override;
virtual bool DeallocPHandlerServiceChild(PHandlerServiceChild*) override; virtual bool DeallocPHandlerServiceChild(PHandlerServiceChild*) override;
virtual PCellBroadcastChild* AllocPCellBroadcastChild() override; virtual PCellBroadcastChild* AllocPCellBroadcastChild() override;
PCellBroadcastChild* SendPCellBroadcastConstructor(PCellBroadcastChild* aActor); PCellBroadcastChild* SendPCellBroadcastConstructor(PCellBroadcastChild* aActor);
virtual bool DeallocPCellBroadcastChild(PCellBroadcastChild* aActor) override; virtual bool DeallocPCellBroadcastChild(PCellBroadcastChild* aActor) override;
virtual PSmsChild* AllocPSmsChild() override; virtual PSmsChild* AllocPSmsChild() override;
virtual bool DeallocPSmsChild(PSmsChild*) override; virtual bool DeallocPSmsChild(PSmsChild*) override;
virtual PTelephonyChild* AllocPTelephonyChild() override; virtual PTelephonyChild* AllocPTelephonyChild() override;
virtual bool DeallocPTelephonyChild(PTelephonyChild*) override; virtual bool DeallocPTelephonyChild(PTelephonyChild*) override;
virtual PVoicemailChild* AllocPVoicemailChild() override; virtual PVoicemailChild* AllocPVoicemailChild() override;
PVoicemailChild* SendPVoicemailConstructor(PVoicemailChild* aActor); PVoicemailChild* SendPVoicemailConstructor(PVoicemailChild* aActor);
virtual bool DeallocPVoicemailChild(PVoicemailChild*) override; virtual bool DeallocPVoicemailChild(PVoicemailChild*) override;
virtual PMediaChild* AllocPMediaChild() override; virtual PMediaChild* AllocPMediaChild() override;
virtual bool DeallocPMediaChild(PMediaChild* aActor) override; virtual bool DeallocPMediaChild(PMediaChild* aActor) override;
virtual PStorageChild* AllocPStorageChild() override; virtual PStorageChild* AllocPStorageChild() override;
virtual bool DeallocPStorageChild(PStorageChild* aActor) override; virtual bool DeallocPStorageChild(PStorageChild* aActor) override;
virtual PBluetoothChild* AllocPBluetoothChild() override; virtual PBluetoothChild* AllocPBluetoothChild() override;
virtual bool DeallocPBluetoothChild(PBluetoothChild* aActor) override; virtual bool DeallocPBluetoothChild(PBluetoothChild* aActor) override;
virtual PFMRadioChild* AllocPFMRadioChild() override; virtual PFMRadioChild* AllocPFMRadioChild() override;
virtual bool DeallocPFMRadioChild(PFMRadioChild* aActor) override; virtual bool DeallocPFMRadioChild(PFMRadioChild* aActor) override;
virtual PPresentationChild* AllocPPresentationChild() override; virtual PPresentationChild* AllocPPresentationChild() override;
virtual bool DeallocPPresentationChild(PPresentationChild* aActor) override; virtual bool DeallocPPresentationChild(PPresentationChild* aActor) override;
virtual bool RecvNotifyPresentationReceiverLaunched(PBrowserChild* aIframe,
virtual bool
RecvNotifyPresentationReceiverLaunched(PBrowserChild* aIframe,
const nsString& aSessionId) override; const nsString& aSessionId) override;
virtual bool RecvNotifyPresentationReceiverCleanUp(const nsString& aSessionId) override;
virtual bool
RecvNotifyPresentationReceiverCleanUp(const nsString& aSessionId) override;
virtual bool RecvNotifyGMPsChanged() override; virtual bool RecvNotifyGMPsChanged() override;
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() override; virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() override;
virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) override; virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) override;
virtual bool RecvRegisterChrome(InfallibleTArray<ChromePackage>&& packages, virtual bool RecvRegisterChrome(InfallibleTArray<ChromePackage>&& packages,
@ -325,11 +384,15 @@ public:
virtual bool RecvRegisterChromeItem(const ChromeRegistryItem& item) override; virtual bool RecvRegisterChromeItem(const ChromeRegistryItem& item) override;
virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() override; virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() override;
virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) override; virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) override;
virtual PRemoteSpellcheckEngineChild* AllocPRemoteSpellcheckEngineChild() override; virtual PRemoteSpellcheckEngineChild* AllocPRemoteSpellcheckEngineChild() override;
virtual bool DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild*) override; virtual bool DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild*) override;
virtual bool RecvSetOffline(const bool& offline) override; virtual bool RecvSetOffline(const bool& offline) override;
virtual bool RecvSetConnectivity(const bool& connectivity) override; virtual bool RecvSetConnectivity(const bool& connectivity) override;
virtual bool RecvSpeakerManagerNotify() override; virtual bool RecvSpeakerManagerNotify() override;
@ -337,6 +400,7 @@ public:
virtual bool RecvBidiKeyboardNotify(const bool& isLangRTL) override; virtual bool RecvBidiKeyboardNotify(const bool& isLangRTL) override;
virtual bool RecvNotifyVisited(const URIParams& aURI) override; virtual bool RecvNotifyVisited(const URIParams& aURI) override;
// auto remove when alertfinished is received. // auto remove when alertfinished is received.
nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver); nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver);
@ -347,9 +411,11 @@ public:
virtual bool RecvDataStoragePut(const nsString& aFilename, virtual bool RecvDataStoragePut(const nsString& aFilename,
const DataStorageItem& aItem) override; const DataStorageItem& aItem) override;
virtual bool RecvDataStorageRemove(const nsString& aFilename, virtual bool RecvDataStorageRemove(const nsString& aFilename,
const nsCString& aKey, const nsCString& aKey,
const DataStorageType& aType) override; const DataStorageType& aType) override;
virtual bool RecvDataStorageClear(const nsString& aFilename) override; virtual bool RecvDataStorageClear(const nsString& aFilename) override;
virtual bool RecvNotifyAlertsObserver(const nsCString& aType, virtual bool RecvNotifyAlertsObserver(const nsCString& aType,
@ -382,15 +448,18 @@ public:
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID, virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName, const nsCString& name, const nsCString& UAName,
const nsCString& ID, const nsCString& vendor) override; const nsCString& ID, const nsCString& vendor) override;
virtual bool RecvAppInit() override; virtual bool RecvAppInit() override;
virtual bool RecvLastPrivateDocShellDestroyed() override; virtual bool RecvLastPrivateDocShellDestroyed() override;
virtual bool RecvVolumes(InfallibleTArray<VolumeInfo>&& aVolumes) override; virtual bool RecvVolumes(InfallibleTArray<VolumeInfo>&& aVolumes) override;
virtual bool RecvFilePathUpdate(const nsString& aStorageType, virtual bool RecvFilePathUpdate(const nsString& aStorageType,
const nsString& aStorageName, const nsString& aStorageName,
const nsString& aPath, const nsString& aPath,
const nsCString& aReason) override; const nsCString& aReason) override;
virtual bool RecvFileSystemUpdate(const nsString& aFsName, virtual bool RecvFileSystemUpdate(const nsString& aFsName,
const nsString& aVolumeName, const nsString& aVolumeName,
const int32_t& aState, const int32_t& aState,
@ -402,20 +471,26 @@ public:
const bool& aIsUnmounting, const bool& aIsUnmounting,
const bool& aIsRemovable, const bool& aIsRemovable,
const bool& aIsHotSwappable) override; const bool& aIsHotSwappable) override;
virtual bool RecvVolumeRemoved(const nsString& aFsName) override; virtual bool RecvVolumeRemoved(const nsString& aFsName) override;
virtual bool virtual bool
RecvNotifyProcessPriorityChanged(const hal::ProcessPriority& aPriority) override; RecvNotifyProcessPriorityChanged(const hal::ProcessPriority& aPriority) override;
virtual bool RecvMinimizeMemoryUsage() override; virtual bool RecvMinimizeMemoryUsage() override;
virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI, virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI,
const uint32_t& aType) override; const uint32_t& aType) override;
virtual bool RecvUnregisterSheet(const URIParams& aURI, const uint32_t& aType) override;
virtual bool RecvNotifyPhoneStateChange(const nsString& state) override; virtual bool RecvUnregisterSheet(const URIParams& aURI,
const uint32_t& aType) override;
virtual bool RecvNotifyPhoneStateChange(const nsString& aState) override;
void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS); void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS); void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
virtual bool RecvNotifyIdleObserver(const uint64_t& aObserver, virtual bool RecvNotifyIdleObserver(const uint64_t& aObserver,
const nsCString& aTopic, const nsCString& aTopic,
const nsString& aData) override; const nsString& aData) override;
@ -424,23 +499,33 @@ public:
virtual bool RecvAssociatePluginId(const uint32_t& aPluginId, virtual bool RecvAssociatePluginId(const uint32_t& aPluginId,
const base::ProcessId& aProcessId) override; const base::ProcessId& aProcessId) override;
virtual bool RecvLoadPluginResult(const uint32_t& aPluginId, virtual bool RecvLoadPluginResult(const uint32_t& aPluginId,
const bool& aResult) override; const bool& aResult) override;
virtual bool RecvUpdateWindow(const uintptr_t& aChildId) override; virtual bool RecvUpdateWindow(const uintptr_t& aChildId) override;
virtual bool RecvStartProfiler(const ProfilerInitParams& params) override; virtual bool RecvStartProfiler(const ProfilerInitParams& params) override;
virtual bool RecvPauseProfiler(const bool& aPause) override; virtual bool RecvPauseProfiler(const bool& aPause) override;
virtual bool RecvStopProfiler() override; virtual bool RecvStopProfiler() override;
virtual bool RecvGatherProfile() override; virtual bool RecvGatherProfile() override;
virtual bool RecvDomainSetChanged(const uint32_t& aSetType, const uint32_t& aChangeType,
virtual bool RecvDomainSetChanged(const uint32_t& aSetType,
const uint32_t& aChangeType,
const OptionalURIParams& aDomain) override; const OptionalURIParams& aDomain) override;
virtual bool RecvShutdown() override; virtual bool RecvShutdown() override;
virtual bool virtual bool
RecvInvokeDragSession(nsTArray<IPCDataTransfer>&& aTransfers, RecvInvokeDragSession(nsTArray<IPCDataTransfer>&& aTransfers,
const uint32_t& aAction) override; const uint32_t& aAction) override;
virtual bool RecvEndDragSession(const bool& aDoneDrag, virtual bool RecvEndDragSession(const bool& aDoneDrag,
const bool& aUserCancelled) override; const bool& aUserCancelled) override;
#ifdef ANDROID #ifdef ANDROID
gfx::IntSize GetScreenSize() { return mScreenSize; } gfx::IntSize GetScreenSize() { return mScreenSize; }
#endif #endif
@ -449,10 +534,10 @@ public:
// cache the value // cache the value
nsString &GetIndexedDBPath(); nsString &GetIndexedDBPath();
ContentParentId GetID() { return mID; } ContentParentId GetID() const { return mID; }
bool IsForApp() { return mIsForApp; } bool IsForApp() const { return mIsForApp; }
bool IsForBrowser() { return mIsForBrowser; } bool IsForBrowser() const { return mIsForBrowser; }
virtual PBlobChild* virtual PBlobChild*
SendPBlobConstructor(PBlobChild* actor, SendPBlobConstructor(PBlobChild* actor,
@ -485,16 +570,18 @@ public:
PBrowserOrId PBrowserOrId
GetBrowserOrId(TabChild* aTabChild); GetBrowserOrId(TabChild* aTabChild);
virtual POfflineCacheUpdateChild* AllocPOfflineCacheUpdateChild( virtual POfflineCacheUpdateChild*
const URIParams& manifestURI, AllocPOfflineCacheUpdateChild(const URIParams& manifestURI,
const URIParams& documentURI, const URIParams& documentURI,
const PrincipalInfo& aLoadingPrincipalInfo, const PrincipalInfo& aLoadingPrincipalInfo,
const bool& stickDocument, const bool& stickDocument,
const TabId& aTabId) override; const TabId& aTabId) override;
virtual bool virtual bool
DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate) override; DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate) override;
virtual PWebrtcGlobalChild* AllocPWebrtcGlobalChild() override; virtual PWebrtcGlobalChild* AllocPWebrtcGlobalChild() override;
virtual bool DeallocPWebrtcGlobalChild(PWebrtcGlobalChild *aActor) override; virtual bool DeallocPWebrtcGlobalChild(PWebrtcGlobalChild *aActor) override;
virtual PContentPermissionRequestChild* virtual PContentPermissionRequestChild*
@ -563,4 +650,4 @@ NextWindowID();
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif #endif // mozilla_dom_ContentChild_h

Просмотреть файл

@ -370,8 +370,7 @@ private:
if (!strcmp(aTopic, "profile-after-change")) { if (!strcmp(aTopic, "profile-after-change")) {
if (mozilla::Preferences::GetBool("pbackground.testing", false)) { if (mozilla::Preferences::GetBool("pbackground.testing", false)) {
rv = observerService->AddObserver(this, "xpcom-shutdown", rv = observerService->AddObserver(this, "xpcom-shutdown", false);
false);
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
// Callback 1. // Callback 1.
@ -798,8 +797,7 @@ ContentParent::GetNewOrPreallocatedAppProcess(mozIApplication* aApp,
NS_ERROR("Failed to get manifest URL"); NS_ERROR("Failed to get manifest URL");
return nullptr; return nullptr;
} }
process->TransformPreallocatedIntoApp(aOpener, process->TransformPreallocatedIntoApp(aOpener, manifestURL);
manifestURL);
process->ForwardKnownInfo(); process->ForwardKnownInfo();
if (aTookPreAllocated) { if (aTookPreAllocated) {
@ -1004,8 +1002,7 @@ ContentParent::GetInitialProcessPriority(Element* aFrameElement)
return PROCESS_PRIORITY_FOREGROUND; return PROCESS_PRIORITY_FOREGROUND;
} }
nsCOMPtr<nsIMozBrowserFrame> browserFrame = nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(aFrameElement);
do_QueryInterface(aFrameElement);
if (!browserFrame) { if (!browserFrame) {
return PROCESS_PRIORITY_FOREGROUND; return PROCESS_PRIORITY_FOREGROUND;
} }
@ -1070,14 +1067,11 @@ ContentParent::RecvCreateChildProcess(const IPCTabContext& aContext,
nsCOMPtr<mozIApplication> ownApp = tc.GetTabContext().GetOwnApp(); nsCOMPtr<mozIApplication> ownApp = tc.GetTabContext().GetOwnApp();
if (ownApp) { if (ownApp) {
cp = GetNewOrPreallocatedAppProcess(ownApp, cp = GetNewOrPreallocatedAppProcess(ownApp, aPriority, this);
aPriority,
this);
} }
else { else {
cp = GetNewOrUsedBrowserProcess(/* isBrowserElement = */ true, cp = GetNewOrUsedBrowserProcess(/* isBrowserElement = */ true,
aPriority, aPriority, this);
this);
} }
if (!cp) { if (!cp) {
@ -1096,9 +1090,7 @@ ContentParent::RecvCreateChildProcess(const IPCTabContext& aContext,
if (cpm->AddGrandchildProcess(this->ChildID(), cp->ChildID())) { if (cpm->AddGrandchildProcess(this->ChildID(), cp->ChildID())) {
// Pre-allocate a TabId here to save one time IPC call at app startup. // Pre-allocate a TabId here to save one time IPC call at app startup.
*aTabId = AllocateTabId(aOpenerTabId, *aTabId = AllocateTabId(aOpenerTabId, aContext, cp->ChildID());
aContext,
cp->ChildID());
return (*aTabId != 0); return (*aTabId != 0);
} }
@ -1269,10 +1261,8 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
RefPtr<nsIContentParent> constructorSender; RefPtr<nsIContentParent> constructorSender;
if (isInContentProcess) { if (isInContentProcess) {
MOZ_ASSERT(aContext.IsBrowserElement()); MOZ_ASSERT(aContext.IsBrowserElement());
constructorSender = CreateContentBridgeParent(aContext, constructorSender = CreateContentBridgeParent(aContext, initialPriority,
initialPriority, openerTabId, &tabId);
openerTabId,
&tabId);
} else { } else {
if (aOpenerContentParent) { if (aOpenerContentParent) {
constructorSender = aOpenerContentParent; constructorSender = aOpenerContentParent;
@ -1320,10 +1310,10 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
tp->SetInitedByParent(); tp->SetInitedByParent();
tp->SetOwnerElement(aFrameElement); tp->SetOwnerElement(aFrameElement);
PBrowserParent* browser = constructorSender->SendPBrowserConstructor( PBrowserParent* browser =
constructorSender->SendPBrowserConstructor(
// DeallocPBrowserParent() releases this ref. // DeallocPBrowserParent() releases this ref.
tp.forget().take(), tp.forget().take(), tabId,
tabId,
aContext.AsIPCTabContext(), aContext.AsIPCTabContext(),
chromeFlags, chromeFlags,
constructorSender->ChildID(), constructorSender->ChildID(),
@ -1409,15 +1399,12 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
reused = !!p; reused = !!p;
if (!p) { if (!p) {
p = GetNewOrPreallocatedAppProcess(ownApp, p = GetNewOrPreallocatedAppProcess(ownApp, initialPriority, nullptr,
initialPriority,
nullptr,
&tookPreallocated); &tookPreallocated);
MOZ_ASSERT(p); MOZ_ASSERT(p);
sAppContentParents->Put(manifestURL, p); sAppContentParents->Put(manifestURL, p);
} }
tabId = AllocateTabId(openerTabId, tabId = AllocateTabId(openerTabId, aContext.AsIPCTabContext(),
aContext.AsIPCTabContext(),
p->ChildID()); p->ChildID());
parent = static_cast<nsIContentParent*>(p); parent = static_cast<nsIContentParent*>(p);
} }
@ -1461,8 +1448,7 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
// loop forever, because the next time through there will be no // loop forever, because the next time through there will be no
// preallocated process to take. // preallocated process to take.
if (tookPreallocated) { if (tookPreallocated) {
return ContentParent::CreateBrowserOrApp(aContext, return ContentParent::CreateBrowserOrApp(aContext, aFrameElement,
aFrameElement,
aOpenerContentParent); aOpenerContentParent);
} }
@ -1668,8 +1654,7 @@ public:
uint32_t timeoutSec = uint32_t timeoutSec =
Preferences::GetInt("dom.ipc.systemMessageCPULockTimeoutSec", 30); Preferences::GetInt("dom.ipc.systemMessageCPULockTimeoutSec", 30);
mTimer->InitWithCallback(this, timeoutSec * 1000, mTimer->InitWithCallback(this, timeoutSec * 1000, nsITimer::TYPE_ONE_SHOT);
nsITimer::TYPE_ONE_SHOT);
} }
NS_IMETHOD Notify(nsITimer* aTimer) override NS_IMETHOD Notify(nsITimer* aTimer) override
@ -2527,8 +2512,7 @@ ContentParent::ContentParent(ContentParent* aTemplate,
NS_ASSERTION(fd != nullptr, "IPC Channel for PContent is necessary!"); NS_ASSERTION(fd != nullptr, "IPC Channel for PContent is necessary!");
mSubprocess = new GeckoExistingProcessHost(GeckoProcessType_Content, mSubprocess = new GeckoExistingProcessHost(GeckoProcessType_Content,
aPid, aPid, *fd);
*fd);
mSubprocess->LaunchAndWaitForProcessHandle(); mSubprocess->LaunchAndWaitForProcessHandle();
@ -2696,8 +2680,7 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
sSandboxBrokerPolicyFactory->GetContentPolicy(Pid()); sSandboxBrokerPolicyFactory->GetContentPolicy(Pid());
if (policy) { if (policy) {
brokerFd = FileDescriptor(); brokerFd = FileDescriptor();
mSandboxBroker = SandboxBroker::Create(Move(policy), Pid(), mSandboxBroker = SandboxBroker::Create(Move(policy), Pid(), brokerFd);
brokerFd);
if (!mSandboxBroker) { if (!mSandboxBroker) {
KillHard("SandboxBroker::Create failed"); KillHard("SandboxBroker::Create failed");
return; return;
@ -2713,27 +2696,27 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
} }
bool bool
ContentParent::IsAlive() ContentParent::IsAlive() const
{ {
return mIsAlive; return mIsAlive;
} }
bool bool
ContentParent::IsForApp() ContentParent::IsForApp() const
{ {
return !mAppManifestURL.IsEmpty(); return !mAppManifestURL.IsEmpty();
} }
#ifdef MOZ_NUWA_PROCESS #ifdef MOZ_NUWA_PROCESS
bool bool
ContentParent::IsNuwaProcess() ContentParent::IsNuwaProcess() const
{ {
return mIsNuwaProcess; return mIsNuwaProcess;
} }
#endif #endif
int32_t int32_t
ContentParent::Pid() ContentParent::Pid() const
{ {
if (!mSubprocess || !mSubprocess->GetChildProcessHandle()) { if (!mSubprocess || !mSubprocess->GetChildProcessHandle()) {
return -1; return -1;
@ -2894,8 +2877,7 @@ ContentParent::RecvSetClipboard(const IPCDataTransfer& aDataTransfer,
rv = dataWrapper->SetData(text); rv = dataWrapper->SetData(text);
NS_ENSURE_SUCCESS(rv, true); NS_ENSURE_SUCCESS(rv, true);
rv = trans->SetTransferData(item.flavor().get(), dataWrapper, rv = trans->SetTransferData(item.flavor().get(), dataWrapper, text.Length());
text.Length());
NS_ENSURE_SUCCESS(rv, true); NS_ENSURE_SUCCESS(rv, true);
} }
@ -2965,7 +2947,8 @@ ContentParent::RecvClipboardHasType(nsTArray<nsCString>&& aTypes,
} }
bool bool
ContentParent::RecvGetSystemColors(const uint32_t& colorsCount, InfallibleTArray<uint32_t>* colors) ContentParent::RecvGetSystemColors(const uint32_t& colorsCount,
InfallibleTArray<uint32_t>* colors)
{ {
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available"); NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
@ -2984,7 +2967,9 @@ ContentParent::RecvGetSystemColors(const uint32_t& colorsCount, InfallibleTArray
} }
bool bool
ContentParent::RecvGetIconForExtension(const nsCString& aFileExt, const uint32_t& aIconSize, InfallibleTArray<uint8_t>* bits) ContentParent::RecvGetIconForExtension(const nsCString& aFileExt,
const uint32_t& aIconSize,
InfallibleTArray<uint8_t>* bits)
{ {
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available"); NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
@ -3030,8 +3015,7 @@ ContentParent::RecvAudioChannelChangeDefVolChannel(const int32_t& aChannel,
{ {
RefPtr<AudioChannelService> service = AudioChannelService::GetOrCreate(); RefPtr<AudioChannelService> service = AudioChannelService::GetOrCreate();
MOZ_ASSERT(service); MOZ_ASSERT(service);
service->SetDefaultVolumeControlChannelInternal(aChannel, service->SetDefaultVolumeControlChannelInternal(aChannel, aHidden, mChildID);
aHidden, mChildID);
return true; return true;
} }
@ -3118,7 +3102,6 @@ KeepNuwaSafeObserverTopics(ContentParent* aNuwaContentParent)
obs->RemoveObserver(aNuwaContentParent, sObserverTopics[i]); obs->RemoveObserver(aNuwaContentParent, sObserverTopics[i]);
} }
} }
} }
#endif #endif
@ -3721,7 +3704,7 @@ ContentParent::KillHard(const char* aReason)
} }
bool bool
ContentParent::IsPreallocated() ContentParent::IsPreallocated() const
{ {
return mAppManifestURL == MAGIC_PREALLOCATED_APP_MANIFEST_URL; return mAppManifestURL == MAGIC_PREALLOCATED_APP_MANIFEST_URL;
} }
@ -4539,7 +4522,9 @@ ContentParent::RecvFilePathUpdateNotify(const nsString& aType,
} }
static int32_t static int32_t
AddGeolocationListener(nsIDOMGeoPositionCallback* watcher, nsIDOMGeoPositionErrorCallback* errorCallBack, bool highAccuracy) AddGeolocationListener(nsIDOMGeoPositionCallback* watcher,
nsIDOMGeoPositionErrorCallback* errorCallBack,
bool highAccuracy)
{ {
nsCOMPtr<nsIDOMGeoGeolocation> geo = do_GetService("@mozilla.org/geolocation;1"); nsCOMPtr<nsIDOMGeoGeolocation> geo = do_GetService("@mozilla.org/geolocation;1");
if (!geo) { if (!geo) {
@ -4828,7 +4813,8 @@ ContentParent::SendPBrowserConstructor(PBrowserParent* aActor,
} }
bool bool
ContentParent::RecvCreateFakeVolume(const nsString& fsName, const nsString& mountPoint) ContentParent::RecvCreateFakeVolume(const nsString& fsName,
const nsString& mountPoint)
{ {
#ifdef MOZ_WIDGET_GONK #ifdef MOZ_WIDGET_GONK
nsresult rv; nsresult rv;
@ -4907,7 +4893,8 @@ ContentParent::RecvKeywordToURI(const nsCString& aKeyword,
bool bool
ContentParent::RecvNotifyKeywordSearchLoading(const nsString &aProvider, ContentParent::RecvNotifyKeywordSearchLoading(const nsString &aProvider,
const nsString &aKeyword) { const nsString &aKeyword)
{
#ifdef MOZ_TOOLKIT_SEARCH #ifdef MOZ_TOOLKIT_SEARCH
nsCOMPtr<nsIBrowserSearchService> searchSvc = do_GetService("@mozilla.org/browser/search-service;1"); nsCOMPtr<nsIBrowserSearchService> searchSvc = do_GetService("@mozilla.org/browser/search-service;1");
if (searchSvc) { if (searchSvc) {
@ -4995,7 +4982,8 @@ ContentParent::RecvGetGraphicsFeatureStatus(const int32_t& aFeature,
} }
bool bool
ContentParent::RecvAddIdleObserver(const uint64_t& aObserver, const uint32_t& aIdleTimeInS) ContentParent::RecvAddIdleObserver(const uint64_t& aObserver,
const uint32_t& aIdleTimeInS)
{ {
nsresult rv; nsresult rv;
nsCOMPtr<nsIIdleService> idleService = nsCOMPtr<nsIIdleService> idleService =
@ -5011,7 +4999,8 @@ ContentParent::RecvAddIdleObserver(const uint64_t& aObserver, const uint32_t& aI
} }
bool bool
ContentParent::RecvRemoveIdleObserver(const uint64_t& aObserver, const uint32_t& aIdleTimeInS) ContentParent::RecvRemoveIdleObserver(const uint64_t& aObserver,
const uint32_t& aIdleTimeInS)
{ {
RefPtr<ParentIdleListener> listener; RefPtr<ParentIdleListener> listener;
for (int32_t i = mIdleListeners.Length() - 1; i >= 0; --i) { for (int32_t i = mIdleListeners.Length() - 1; i >= 0; --i) {
@ -5202,12 +5191,9 @@ ContentParent::DeallocateTabId(const TabId& aTabId,
cp->NotifyTabDestroyed(aTabId, aMarkedDestroying); cp->NotifyTabDestroyed(aTabId, aMarkedDestroying);
ContentProcessManager::GetSingleton()->DeallocateTabId(aCpId, ContentProcessManager::GetSingleton()->DeallocateTabId(aCpId, aTabId);
aTabId); } else {
} ContentChild::GetSingleton()->SendDeallocateTabId(aTabId, aCpId,
else {
ContentChild::GetSingleton()->SendDeallocateTabId(aTabId,
aCpId,
aMarkedDestroying); aMarkedDestroying);
} }
} }
@ -5391,8 +5377,8 @@ ContentParent::AllocPContentPermissionRequestParent(const InfallibleTArray<Permi
const TabId& aTabId) const TabId& aTabId)
{ {
ContentProcessManager* cpm = ContentProcessManager::GetSingleton(); ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
RefPtr<TabParent> tp = cpm->GetTopLevelTabParentByProcessAndTabId(this->ChildID(), RefPtr<TabParent> tp =
aTabId); cpm->GetTopLevelTabParentByProcessAndTabId(this->ChildID(), aTabId);
if (!tp) { if (!tp) {
return nullptr; return nullptr;
} }
@ -5587,7 +5573,8 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab,
const char* features = aFeatures.IsVoid() ? nullptr : aFeatures.get(); const char* features = aFeatures.IsVoid() ? nullptr : aFeatures.get();
*aResult = pwwatch->OpenWindow2(parent, uri, name, features, aCalledFromJS, *aResult = pwwatch->OpenWindow2(parent, uri, name, features, aCalledFromJS,
false, false, thisTabParent, nullptr, getter_AddRefs(window)); false, false, thisTabParent, nullptr,
getter_AddRefs(window));
if (NS_WARN_IF(NS_FAILED(*aResult))) { if (NS_WARN_IF(NS_FAILED(*aResult))) {
return true; return true;
@ -5775,7 +5762,8 @@ ContentParent::RecvEndDriverCrashGuard(const uint32_t& aGuardType)
bool bool
ContentParent::RecvGetDeviceStorageLocation(const nsString& aType, ContentParent::RecvGetDeviceStorageLocation(const nsString& aType,
nsString* aPath) { nsString* aPath)
{
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
mozilla::AndroidBridge::GetExternalPublicDirectory(aType, *aPath); mozilla::AndroidBridge::GetExternalPublicDirectory(aType, *aPath);
return true; return true;
@ -5837,7 +5825,8 @@ ContentParent::StartProfiler(nsIProfilerStartParams* aParams)
NS_IMPL_ISUPPORTS(ParentIdleListener, nsIObserver) NS_IMPL_ISUPPORTS(ParentIdleListener, nsIObserver)
NS_IMETHODIMP NS_IMETHODIMP
ParentIdleListener::Observe(nsISupports*, const char* aTopic, const char16_t* aData) { ParentIdleListener::Observe(nsISupports*, const char* aTopic, const char16_t* aData)
{
mozilla::Unused << mParent->SendNotifyIdleObserver(mObserver, mozilla::Unused << mParent->SendNotifyIdleObserver(mObserver,
nsDependentCString(aTopic), nsDependentCString(aTopic),
nsDependentString(aData)); nsDependentString(aData));

Просмотреть файл

@ -92,22 +92,28 @@ class ContentParent final : public PContentParent
public: public:
#ifdef MOZ_NUWA_PROCESS #ifdef MOZ_NUWA_PROCESS
static int32_t NuwaPid() { static int32_t NuwaPid()
{
return sNuwaPid; return sNuwaPid;
} }
static bool IsNuwaReady() { static bool IsNuwaReady()
{
return sNuwaReady; return sNuwaReady;
} }
#endif #endif
virtual bool IsContentParent() override { return true; }
virtual bool IsContentParent() const override { return true; }
/** /**
* Start up the content-process machinery. This might include * Start up the content-process machinery. This might include
* scheduling pre-launch tasks. * scheduling pre-launch tasks.
*/ */
static void StartUp(); static void StartUp();
/** Shut down the content-process machinery. */ /** Shut down the content-process machinery. */
static void ShutDown(); static void ShutDown();
/** /**
* Ensure that all subprocesses are terminated and their OS * Ensure that all subprocesses are terminated and their OS
* resources have been reaped. This is synchronous and can be * resources have been reaped. This is synchronous and can be
@ -148,6 +154,7 @@ public:
ContentParent* aOpenerContentParent); ContentParent* aOpenerContentParent);
static void GetAll(nsTArray<ContentParent*>& aArray); static void GetAll(nsTArray<ContentParent*>& aArray);
static void GetAllEvenIfDead(nsTArray<ContentParent*>& aArray); static void GetAllEvenIfDead(nsTArray<ContentParent*>& aArray);
static bool IgnoreIPCPrincipal(); static bool IgnoreIPCPrincipal();
@ -166,7 +173,7 @@ public:
#endif #endif
// Let managees query if it is safe to send messages. // Let managees query if it is safe to send messages.
bool IsDestroyed() { return !mIPCOpen; } bool IsDestroyed() const { return !mIPCOpen; }
virtual bool RecvCreateChildProcess(const IPCTabContext& aContext, virtual bool RecvCreateChildProcess(const IPCTabContext& aContext,
const hal::ProcessPriority& aPriority, const hal::ProcessPriority& aPriority,
@ -175,21 +182,30 @@ public:
bool* aIsForApp, bool* aIsForApp,
bool* aIsForBrowser, bool* aIsForBrowser,
TabId* aTabId) override; TabId* aTabId) override;
virtual bool RecvBridgeToChildProcess(const ContentParentId& aCpId) override; virtual bool RecvBridgeToChildProcess(const ContentParentId& aCpId) override;
virtual bool RecvCreateGMPService() override; virtual bool RecvCreateGMPService() override;
virtual bool RecvGetGMPPluginVersionForAPI(const nsCString& aAPI, virtual bool RecvGetGMPPluginVersionForAPI(const nsCString& aAPI,
nsTArray<nsCString>&& aTags, nsTArray<nsCString>&& aTags,
bool* aHasPlugin, bool* aHasPlugin,
nsCString* aVersion) override; nsCString* aVersion) override;
virtual bool RecvIsGMPPresentOnDisk(const nsString& aKeySystem, virtual bool RecvIsGMPPresentOnDisk(const nsString& aKeySystem,
const nsCString& aVersion, const nsCString& aVersion,
bool* aIsPresent, bool* aIsPresent,
nsCString* aMessage) override; nsCString* aMessage) override;
virtual bool RecvLoadPlugin(const uint32_t& aPluginId, nsresult* aRv, uint32_t* aRunID) override; virtual bool RecvLoadPlugin(const uint32_t& aPluginId, nsresult* aRv,
virtual bool RecvConnectPluginBridge(const uint32_t& aPluginId, nsresult* aRv) override; uint32_t* aRunID) override;
virtual bool RecvGetBlocklistState(const uint32_t& aPluginId, uint32_t* aIsBlocklisted) override;
virtual bool RecvConnectPluginBridge(const uint32_t& aPluginId,
nsresult* aRv) override;
virtual bool RecvGetBlocklistState(const uint32_t& aPluginId,
uint32_t* aIsBlocklisted) override;
virtual bool RecvFindPlugins(const uint32_t& aPluginEpoch, virtual bool RecvFindPlugins(const uint32_t& aPluginEpoch,
nsresult* aRv, nsresult* aRv,
nsTArray<PluginTag>* aPlugins, nsTArray<PluginTag>* aPlugins,
@ -209,33 +225,44 @@ public:
*/ */
virtual bool DoLoadMessageManagerScript(const nsAString& aURL, virtual bool DoLoadMessageManagerScript(const nsAString& aURL,
bool aRunInGlobalScope) override; bool aRunInGlobalScope) override;
virtual nsresult DoSendAsyncMessage(JSContext* aCx, virtual nsresult DoSendAsyncMessage(JSContext* aCx,
const nsAString& aMessage, const nsAString& aMessage,
StructuredCloneData& aData, StructuredCloneData& aData,
JS::Handle<JSObject *> aCpows, JS::Handle<JSObject *> aCpows,
nsIPrincipal* aPrincipal) override; nsIPrincipal* aPrincipal) override;
virtual bool CheckPermission(const nsAString& aPermission) override; virtual bool CheckPermission(const nsAString& aPermission) override;
virtual bool CheckManifestURL(const nsAString& aManifestURL) override; virtual bool CheckManifestURL(const nsAString& aManifestURL) override;
virtual bool CheckAppHasPermission(const nsAString& aPermission) override; virtual bool CheckAppHasPermission(const nsAString& aPermission) override;
virtual bool CheckAppHasStatus(unsigned short aStatus) override; virtual bool CheckAppHasStatus(unsigned short aStatus) override;
virtual bool KillChild() override; virtual bool KillChild() override;
/** Notify that a tab is beginning its destruction sequence. */ /** Notify that a tab is beginning its destruction sequence. */
static void NotifyTabDestroying(const TabId& aTabId, static void NotifyTabDestroying(const TabId& aTabId,
const ContentParentId& aCpId); const ContentParentId& aCpId);
/** Notify that a tab was destroyed during normal operation. */ /** Notify that a tab was destroyed during normal operation. */
void NotifyTabDestroyed(const TabId& aTabId, void NotifyTabDestroyed(const TabId& aTabId,
bool aNotifiedDestroying); bool aNotifiedDestroying);
TestShellParent* CreateTestShell(); TestShellParent* CreateTestShell();
bool DestroyTestShell(TestShellParent* aTestShell); bool DestroyTestShell(TestShellParent* aTestShell);
TestShellParent* GetTestShellSingleton(); TestShellParent* GetTestShellSingleton();
jsipc::CPOWManager* GetCPOWManager() override; jsipc::CPOWManager* GetCPOWManager() override;
static TabId static TabId
AllocateTabId(const TabId& aOpenerTabId, AllocateTabId(const TabId& aOpenerTabId,
const IPCTabContext& aContext, const IPCTabContext& aContext,
const ContentParentId& aCpId); const ContentParentId& aCpId);
static void static void
DeallocateTabId(const TabId& aTabId, DeallocateTabId(const TabId& aTabId,
const ContentParentId& aCpId, const ContentParentId& aCpId,
@ -257,20 +284,25 @@ public:
GetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration& aConfig); GetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration& aConfig);
void ReportChildAlreadyBlocked(); void ReportChildAlreadyBlocked();
bool RequestRunToCompletion(); bool RequestRunToCompletion();
bool IsAlive(); bool IsAlive() const;
virtual bool IsForApp() override;
virtual bool IsForBrowser() override virtual bool IsForApp() const override;
virtual bool IsForBrowser() const override
{ {
return mIsForBrowser; return mIsForBrowser;
} }
#ifdef MOZ_NUWA_PROCESS #ifdef MOZ_NUWA_PROCESS
bool IsNuwaProcess(); bool IsNuwaProcess() const;
#endif #endif
// A shorthand for checking if the Nuwa process is ready. // A shorthand for checking if the Nuwa process is ready.
bool IsReadyNuwaProcess() { bool IsReadyNuwaProcess() const
{
#ifdef MOZ_NUWA_PROCESS #ifdef MOZ_NUWA_PROCESS
return IsNuwaProcess() && IsNuwaReady(); return IsNuwaProcess() && IsNuwaReady();
#else #else
@ -278,21 +310,25 @@ public:
#endif #endif
} }
GeckoChildProcessHost* Process() { GeckoChildProcessHost* Process() const
{
return mSubprocess; return mSubprocess;
} }
int32_t Pid(); int32_t Pid() const;
ContentParent* Opener() { ContentParent* Opener() const
{
return mOpener; return mOpener;
} }
bool NeedsPermissionsUpdate() const { bool NeedsPermissionsUpdate() const
{
return mSendPermissionUpdates; return mSendPermissionUpdates;
} }
bool NeedsDataStoreInfos() const { bool NeedsDataStoreInfos() const
{
return mSendDataStoreInfos; return mSendDataStoreInfos;
} }
@ -307,16 +343,20 @@ public:
* API for adding a crash reporter annotation that provides a reason * API for adding a crash reporter annotation that provides a reason
* for a listener request to abort the child. * for a listener request to abort the child.
*/ */
bool IsKillHardAnnotationSet() { return mKillHardAnnotation.IsEmpty(); } bool IsKillHardAnnotationSet() const { return mKillHardAnnotation.IsEmpty(); }
const nsCString& GetKillHardAnnotation() { return mKillHardAnnotation; }
void SetKillHardAnnotation(const nsACString& aReason) { const nsCString& GetKillHardAnnotation() const { return mKillHardAnnotation; }
void SetKillHardAnnotation(const nsACString& aReason)
{
mKillHardAnnotation = aReason; mKillHardAnnotation = aReason;
} }
ContentParentId ChildID() override { return mChildID; } ContentParentId ChildID() const override { return mChildID; }
const nsString& AppManifestURL() const { return mAppManifestURL; } const nsString& AppManifestURL() const { return mAppManifestURL; }
bool IsPreallocated(); bool IsPreallocated() const;
/** /**
* Get a user-friendly name for this ContentParent. We make no guarantees * Get a user-friendly name for this ContentParent. We make no guarantees
@ -331,28 +371,37 @@ public:
virtual PCrashReporterParent* virtual PCrashReporterParent*
AllocPCrashReporterParent(const NativeThreadId& tid, AllocPCrashReporterParent(const NativeThreadId& tid,
const uint32_t& processType) override; const uint32_t& processType) override;
virtual bool virtual bool
RecvPCrashReporterConstructor(PCrashReporterParent* actor, RecvPCrashReporterConstructor(PCrashReporterParent* actor,
const NativeThreadId& tid, const NativeThreadId& tid,
const uint32_t& processType) override; const uint32_t& processType) override;
virtual PNeckoParent* AllocPNeckoParent() override; virtual PNeckoParent* AllocPNeckoParent() override;
virtual bool RecvPNeckoConstructor(PNeckoParent* aActor) override {
virtual bool RecvPNeckoConstructor(PNeckoParent* aActor) override
{
return PContentParent::RecvPNeckoConstructor(aActor); return PContentParent::RecvPNeckoConstructor(aActor);
} }
virtual PPrintingParent* AllocPPrintingParent() override; virtual PPrintingParent* AllocPPrintingParent() override;
virtual bool RecvPPrintingConstructor(PPrintingParent* aActor) override; virtual bool RecvPPrintingConstructor(PPrintingParent* aActor) override;
virtual bool DeallocPPrintingParent(PPrintingParent* aActor) override; virtual bool DeallocPPrintingParent(PPrintingParent* aActor) override;
virtual PScreenManagerParent* virtual PScreenManagerParent*
AllocPScreenManagerParent(uint32_t* aNumberOfScreens, AllocPScreenManagerParent(uint32_t* aNumberOfScreens,
float* aSystemDefaultScale, float* aSystemDefaultScale,
bool* aSuccess) override; bool* aSuccess) override;
virtual bool DeallocPScreenManagerParent(PScreenManagerParent* aActor) override;
virtual bool
DeallocPScreenManagerParent(PScreenManagerParent* aActor) override;
virtual PHalParent* AllocPHalParent() override; virtual PHalParent* AllocPHalParent() override;
virtual bool RecvPHalConstructor(PHalParent* aActor) override {
virtual bool RecvPHalConstructor(PHalParent* aActor) override
{
return PContentParent::RecvPHalConstructor(aActor); return PContentParent::RecvPHalConstructor(aActor);
} }
@ -360,16 +409,21 @@ public:
AllocPHeapSnapshotTempFileHelperParent() override; AllocPHeapSnapshotTempFileHelperParent() override;
virtual PStorageParent* AllocPStorageParent() override; virtual PStorageParent* AllocPStorageParent() override;
virtual bool RecvPStorageConstructor(PStorageParent* aActor) override {
virtual bool RecvPStorageConstructor(PStorageParent* aActor) override
{
return PContentParent::RecvPStorageConstructor(aActor); return PContentParent::RecvPStorageConstructor(aActor);
} }
virtual PJavaScriptParent* virtual PJavaScriptParent*
AllocPJavaScriptParent() override; AllocPJavaScriptParent() override;
virtual bool virtual bool
RecvPJavaScriptConstructor(PJavaScriptParent* aActor) override { RecvPJavaScriptConstructor(PJavaScriptParent* aActor) override
{
return PContentParent::RecvPJavaScriptConstructor(aActor); return PContentParent::RecvPJavaScriptConstructor(aActor);
} }
virtual PRemoteSpellcheckEngineParent* AllocPRemoteSpellcheckEngineParent() override; virtual PRemoteSpellcheckEngineParent* AllocPRemoteSpellcheckEngineParent() override;
virtual bool RecvRecordingDeviceEvents(const nsString& aRecordingStatus, virtual bool RecvRecordingDeviceEvents(const nsString& aRecordingStatus,
@ -381,8 +435,8 @@ public:
nsICycleCollectorLogSink* aSink, nsICycleCollectorLogSink* aSink,
nsIDumpGCAndCCLogsCallback* aCallback); nsIDumpGCAndCCLogsCallback* aCallback);
virtual PBlobParent* SendPBlobConstructor( virtual PBlobParent*
PBlobParent* aActor, SendPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& aParams) override; const BlobConstructorParams& aParams) override;
virtual bool RecvAllocateTabId(const TabId& aOpenerTabId, virtual bool RecvAllocateTabId(const TabId& aOpenerTabId,
@ -405,6 +459,7 @@ public:
const PrincipalInfo& aLoadingPrincipalInfo, const PrincipalInfo& aLoadingPrincipalInfo,
const bool& aStickDocument, const bool& aStickDocument,
const TabId& aTabId) override; const TabId& aTabId) override;
virtual bool virtual bool
RecvPOfflineCacheUpdateConstructor(POfflineCacheUpdateParent* aActor, RecvPOfflineCacheUpdateConstructor(POfflineCacheUpdateParent* aActor,
const URIParams& aManifestURI, const URIParams& aManifestURI,
@ -412,6 +467,7 @@ public:
const PrincipalInfo& aLoadingPrincipal, const PrincipalInfo& aLoadingPrincipal,
const bool& stickDocument, const bool& stickDocument,
const TabId& aTabId) override; const TabId& aTabId) override;
virtual bool virtual bool
DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor) override; DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor) override;
@ -425,6 +481,7 @@ public:
AllocPContentPermissionRequestParent(const InfallibleTArray<PermissionRequest>& aRequests, AllocPContentPermissionRequestParent(const InfallibleTArray<PermissionRequest>& aRequests,
const IPC::Principal& aPrincipal, const IPC::Principal& aPrincipal,
const TabId& aTabId) override; const TabId& aTabId) override;
virtual bool virtual bool
DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor) override; DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor) override;
@ -433,6 +490,7 @@ public:
bool HasGamepadListener() const { return mHasGamepadListener; } bool HasGamepadListener() const { return mHasGamepadListener; }
void SetNuwaParent(NuwaParent* aNuwaParent) { mNuwaParent = aNuwaParent; } void SetNuwaParent(NuwaParent* aNuwaParent) { mNuwaParent = aNuwaParent; }
void ForkNewProcess(bool aBlocking); void ForkNewProcess(bool aBlocking);
virtual bool RecvCreateWindow(PBrowserParent* aThisTabParent, virtual bool RecvCreateWindow(PBrowserParent* aThisTabParent,
@ -452,7 +510,9 @@ public:
protected: protected:
void OnChannelConnected(int32_t pid) override; void OnChannelConnected(int32_t pid) override;
virtual void ActorDestroy(ActorDestroyReason why) override; virtual void ActorDestroy(ActorDestroyReason why) override;
void OnNuwaForkTimeout(); void OnNuwaForkTimeout();
bool ShouldContinueFromReplyTimeout() override; bool ShouldContinueFromReplyTimeout() override;
@ -560,7 +620,8 @@ private:
/** /**
* How we will shut down this ContentParent and its subprocess. * How we will shut down this ContentParent and its subprocess.
*/ */
enum ShutDownMethod { enum ShutDownMethod
{
// Send a shutdown message and wait for FinishShutdown call back. // Send a shutdown message and wait for FinishShutdown call back.
SEND_SHUTDOWN_MESSAGE, SEND_SHUTDOWN_MESSAGE,
// Close the channel ourselves and let the subprocess clean up itself. // Close the channel ourselves and let the subprocess clean up itself.
@ -594,9 +655,11 @@ private:
PGMPServiceParent* PGMPServiceParent*
AllocPGMPServiceParent(mozilla::ipc::Transport* aTransport, AllocPGMPServiceParent(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess) override; base::ProcessId aOtherProcess) override;
PCompositorParent* PCompositorParent*
AllocPCompositorParent(mozilla::ipc::Transport* aTransport, AllocPCompositorParent(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess) override; base::ProcessId aOtherProcess) override;
PImageBridgeParent* PImageBridgeParent*
AllocPImageBridgeParent(mozilla::ipc::Transport* aTransport, AllocPImageBridgeParent(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess) override; base::ProcessId aOtherProcess) override;
@ -604,6 +667,7 @@ private:
PSharedBufferManagerParent* PSharedBufferManagerParent*
AllocPSharedBufferManagerParent(mozilla::ipc::Transport* aTranport, AllocPSharedBufferManagerParent(mozilla::ipc::Transport* aTranport,
base::ProcessId aOtherProcess) override; base::ProcessId aOtherProcess) override;
PBackgroundParent* PBackgroundParent*
AllocPBackgroundParent(Transport* aTransport, ProcessId aOtherProcess) AllocPBackgroundParent(Transport* aTransport, ProcessId aOtherProcess)
override; override;
@ -619,7 +683,9 @@ private:
virtual bool RecvGetProcessAttributes(ContentParentId* aCpId, virtual bool RecvGetProcessAttributes(ContentParentId* aCpId,
bool* aIsForApp, bool* aIsForApp,
bool* aIsForBrowser) override; bool* aIsForBrowser) override;
virtual bool RecvGetXPCOMProcessAttributes(bool* aIsOffline,
virtual bool
RecvGetXPCOMProcessAttributes(bool* aIsOffline,
bool* aIsConnected, bool* aIsConnected,
bool* aIsLangRTL, bool* aIsLangRTL,
InfallibleTArray<nsString>* dictionaries, InfallibleTArray<nsString>* dictionaries,
@ -627,20 +693,26 @@ private:
DomainPolicyClone* domainPolicy, DomainPolicyClone* domainPolicy,
StructuredCloneData* initialData) override; StructuredCloneData* initialData) override;
virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*) override; virtual bool
DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*) override;
virtual bool
DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParent*) override;
virtual bool DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParent*) override;
virtual PBrowserParent* AllocPBrowserParent(const TabId& aTabId, virtual PBrowserParent* AllocPBrowserParent(const TabId& aTabId,
const IPCTabContext& aContext, const IPCTabContext& aContext,
const uint32_t& aChromeFlags, const uint32_t& aChromeFlags,
const ContentParentId& aCpId, const ContentParentId& aCpId,
const bool& aIsForApp, const bool& aIsForApp,
const bool& aIsForBrowser) override; const bool& aIsForBrowser) override;
virtual bool DeallocPBrowserParent(PBrowserParent* frame) override; virtual bool DeallocPBrowserParent(PBrowserParent* frame) override;
virtual PDeviceStorageRequestParent* virtual PDeviceStorageRequestParent*
AllocPDeviceStorageRequestParent(const DeviceStorageParams&) override; AllocPDeviceStorageRequestParent(const DeviceStorageParams&) override;
virtual bool DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent*) override;
virtual bool
DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent*) override;
virtual PFileSystemRequestParent* virtual PFileSystemRequestParent*
AllocPFileSystemRequestParent(const FileSystemParams&) override; AllocPFileSystemRequestParent(const FileSystemParams&) override;
@ -648,14 +720,17 @@ private:
virtual bool virtual bool
DeallocPFileSystemRequestParent(PFileSystemRequestParent*) override; DeallocPFileSystemRequestParent(PFileSystemRequestParent*) override;
virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams) virtual PBlobParent*
override; AllocPBlobParent(const BlobConstructorParams& aParams) override;
virtual bool DeallocPBlobParent(PBlobParent* aActor) override; virtual bool DeallocPBlobParent(PBlobParent* aActor) override;
virtual bool RecvPBlobConstructor(PBlobParent* aActor, virtual bool
RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& params) override; const BlobConstructorParams& params) override;
virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) override; virtual bool
DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) override;
virtual bool RecvGetRandomValues(const uint32_t& length, virtual bool RecvGetRandomValues(const uint32_t& length,
InfallibleTArray<uint8_t>* randomValues) override; InfallibleTArray<uint8_t>* randomValues) override;
@ -663,13 +738,16 @@ private:
virtual bool RecvIsSecureURI(const uint32_t& aType, const URIParams& aURI, virtual bool RecvIsSecureURI(const uint32_t& aType, const URIParams& aURI,
const uint32_t& aFlags, bool* aIsSecureURI) override; const uint32_t& aFlags, bool* aIsSecureURI) override;
virtual bool RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive) override; virtual bool RecvAccumulateMixedContentHSTS(const URIParams& aURI,
const bool& aActive) override;
virtual bool DeallocPHalParent(PHalParent*) override; virtual bool DeallocPHalParent(PHalParent*) override;
virtual bool DeallocPHeapSnapshotTempFileHelperParent(PHeapSnapshotTempFileHelperParent*) override; virtual bool
DeallocPHeapSnapshotTempFileHelperParent(PHeapSnapshotTempFileHelperParent*) override;
virtual PIccParent* AllocPIccParent(const uint32_t& aServiceId) override; virtual PIccParent* AllocPIccParent(const uint32_t& aServiceId) override;
virtual bool DeallocPIccParent(PIccParent* aActor) override; virtual bool DeallocPIccParent(PIccParent* aActor) override;
virtual PMemoryReportRequestParent* virtual PMemoryReportRequestParent*
@ -677,29 +755,36 @@ private:
const bool &aAnonymize, const bool &aAnonymize,
const bool &aMinimizeMemoryUsage, const bool &aMinimizeMemoryUsage,
const MaybeFileDesc &aDMDFile) override; const MaybeFileDesc &aDMDFile) override;
virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor) override;
virtual bool
DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor) override;
virtual PCycleCollectWithLogsParent* virtual PCycleCollectWithLogsParent*
AllocPCycleCollectWithLogsParent(const bool& aDumpAllTraces, AllocPCycleCollectWithLogsParent(const bool& aDumpAllTraces,
const FileDescriptor& aGCLog, const FileDescriptor& aGCLog,
const FileDescriptor& aCCLog) override; const FileDescriptor& aCCLog) override;
virtual bool virtual bool
DeallocPCycleCollectWithLogsParent(PCycleCollectWithLogsParent* aActor) override; DeallocPCycleCollectWithLogsParent(PCycleCollectWithLogsParent* aActor) override;
virtual PTestShellParent* AllocPTestShellParent() override; virtual PTestShellParent* AllocPTestShellParent() override;
virtual bool DeallocPTestShellParent(PTestShellParent* shell) override; virtual bool DeallocPTestShellParent(PTestShellParent* shell) override;
virtual PMobileConnectionParent* AllocPMobileConnectionParent(const uint32_t& aClientId) override; virtual PMobileConnectionParent* AllocPMobileConnectionParent(const uint32_t& aClientId) override;
virtual bool DeallocPMobileConnectionParent(PMobileConnectionParent* aActor) override; virtual bool DeallocPMobileConnectionParent(PMobileConnectionParent* aActor) override;
virtual bool DeallocPNeckoParent(PNeckoParent* necko) override; virtual bool DeallocPNeckoParent(PNeckoParent* necko) override;
virtual PPSMContentDownloaderParent* AllocPPSMContentDownloaderParent( virtual PPSMContentDownloaderParent*
const uint32_t& aCertType) override; AllocPPSMContentDownloaderParent(const uint32_t& aCertType) override;
virtual bool DeallocPPSMContentDownloaderParent(PPSMContentDownloaderParent* aDownloader) override;
virtual PExternalHelperAppParent* AllocPExternalHelperAppParent( virtual bool
const OptionalURIParams& aUri, DeallocPPSMContentDownloaderParent(PPSMContentDownloaderParent* aDownloader) override;
virtual PExternalHelperAppParent*
AllocPExternalHelperAppParent(const OptionalURIParams& aUri,
const nsCString& aMimeContentType, const nsCString& aMimeContentType,
const nsCString& aContentDisposition, const nsCString& aContentDisposition,
const uint32_t& aContentDispositionHint, const uint32_t& aContentDispositionHint,
@ -708,49 +793,73 @@ private:
const int64_t& aContentLength, const int64_t& aContentLength,
const OptionalURIParams& aReferrer, const OptionalURIParams& aReferrer,
PBrowserParent* aBrowser) override; PBrowserParent* aBrowser) override;
virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService) override;
virtual bool
DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService) override;
virtual PHandlerServiceParent* AllocPHandlerServiceParent() override; virtual PHandlerServiceParent* AllocPHandlerServiceParent() override;
virtual bool DeallocPHandlerServiceParent(PHandlerServiceParent*) override; virtual bool DeallocPHandlerServiceParent(PHandlerServiceParent*) override;
virtual PCellBroadcastParent* AllocPCellBroadcastParent() override; virtual PCellBroadcastParent* AllocPCellBroadcastParent() override;
virtual bool DeallocPCellBroadcastParent(PCellBroadcastParent*) override; virtual bool DeallocPCellBroadcastParent(PCellBroadcastParent*) override;
virtual bool RecvPCellBroadcastConstructor(PCellBroadcastParent* aActor) override; virtual bool RecvPCellBroadcastConstructor(PCellBroadcastParent* aActor) override;
virtual PSmsParent* AllocPSmsParent() override; virtual PSmsParent* AllocPSmsParent() override;
virtual bool DeallocPSmsParent(PSmsParent*) override; virtual bool DeallocPSmsParent(PSmsParent*) override;
virtual PTelephonyParent* AllocPTelephonyParent() override; virtual PTelephonyParent* AllocPTelephonyParent() override;
virtual bool DeallocPTelephonyParent(PTelephonyParent*) override; virtual bool DeallocPTelephonyParent(PTelephonyParent*) override;
virtual PVoicemailParent* AllocPVoicemailParent() override; virtual PVoicemailParent* AllocPVoicemailParent() override;
virtual bool RecvPVoicemailConstructor(PVoicemailParent* aActor) override; virtual bool RecvPVoicemailConstructor(PVoicemailParent* aActor) override;
virtual bool DeallocPVoicemailParent(PVoicemailParent* aActor) override; virtual bool DeallocPVoicemailParent(PVoicemailParent* aActor) override;
virtual PMediaParent* AllocPMediaParent() override; virtual PMediaParent* AllocPMediaParent() override;
virtual bool DeallocPMediaParent(PMediaParent* aActor) override; virtual bool DeallocPMediaParent(PMediaParent* aActor) override;
virtual bool DeallocPStorageParent(PStorageParent* aActor) override; virtual bool DeallocPStorageParent(PStorageParent* aActor) override;
virtual PBluetoothParent* AllocPBluetoothParent() override; virtual PBluetoothParent* AllocPBluetoothParent() override;
virtual bool DeallocPBluetoothParent(PBluetoothParent* aActor) override; virtual bool DeallocPBluetoothParent(PBluetoothParent* aActor) override;
virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor) override; virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor) override;
virtual PFMRadioParent* AllocPFMRadioParent() override; virtual PFMRadioParent* AllocPFMRadioParent() override;
virtual bool DeallocPFMRadioParent(PFMRadioParent* aActor) override; virtual bool DeallocPFMRadioParent(PFMRadioParent* aActor) override;
virtual PPresentationParent* AllocPPresentationParent() override; virtual PPresentationParent* AllocPPresentationParent() override;
virtual bool DeallocPPresentationParent(PPresentationParent* aActor) override; virtual bool DeallocPPresentationParent(PPresentationParent* aActor) override;
virtual bool RecvPPresentationConstructor(PPresentationParent* aActor) override; virtual bool RecvPPresentationConstructor(PPresentationParent* aActor) override;
virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent() override; virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent() override;
virtual bool DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor) override;
virtual bool RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor) override;
virtual PWebBrowserPersistDocumentParent* AllocPWebBrowserPersistDocumentParent(PBrowserParent* aBrowser, const uint64_t& aOuterWindowID) override; virtual bool
virtual bool DeallocPWebBrowserPersistDocumentParent(PWebBrowserPersistDocumentParent* aActor) override; DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor) override;
virtual bool
RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor) override;
virtual PWebBrowserPersistDocumentParent*
AllocPWebBrowserPersistDocumentParent(PBrowserParent* aBrowser,
const uint64_t& aOuterWindowID) override;
virtual bool
DeallocPWebBrowserPersistDocumentParent(PWebBrowserPersistDocumentParent* aActor) override;
virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs) override; virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs) override;
virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue) override; virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue) override;
virtual bool RecvReadDataStorageArray(const nsString& aFilename, virtual bool RecvReadDataStorageArray(const nsString& aFilename,
@ -761,19 +870,24 @@ private:
virtual bool RecvSetClipboard(const IPCDataTransfer& aDataTransfer, virtual bool RecvSetClipboard(const IPCDataTransfer& aDataTransfer,
const bool& aIsPrivateData, const bool& aIsPrivateData,
const int32_t& aWhichClipboard) override; const int32_t& aWhichClipboard) override;
virtual bool RecvGetClipboard(nsTArray<nsCString>&& aTypes, virtual bool RecvGetClipboard(nsTArray<nsCString>&& aTypes,
const int32_t& aWhichClipboard, const int32_t& aWhichClipboard,
IPCDataTransfer* aDataTransfer) override; IPCDataTransfer* aDataTransfer) override;
virtual bool RecvEmptyClipboard(const int32_t& aWhichClipboard) override; virtual bool RecvEmptyClipboard(const int32_t& aWhichClipboard) override;
virtual bool RecvClipboardHasType(nsTArray<nsCString>&& aTypes, virtual bool RecvClipboardHasType(nsTArray<nsCString>&& aTypes,
const int32_t& aWhichClipboard, const int32_t& aWhichClipboard,
bool* aHasType) override; bool* aHasType) override;
virtual bool RecvGetSystemColors(const uint32_t& colorsCount, virtual bool RecvGetSystemColors(const uint32_t& colorsCount,
InfallibleTArray<uint32_t>* colors) override; InfallibleTArray<uint32_t>* colors) override;
virtual bool RecvGetIconForExtension(const nsCString& aFileExt, virtual bool RecvGetIconForExtension(const nsCString& aFileExt,
const uint32_t& aIconSize, const uint32_t& aIconSize,
InfallibleTArray<uint8_t>* bits) override; InfallibleTArray<uint8_t>* bits) override;
virtual bool RecvGetShowPasswordSetting(bool* showPassword) override; virtual bool RecvGetShowPasswordSetting(bool* showPassword) override;
virtual bool RecvStartVisitedQuery(const URIParams& uri) override; virtual bool RecvStartVisitedQuery(const URIParams& uri) override;
@ -787,7 +901,8 @@ private:
bool HasNotificationPermission(const IPC::Principal& aPrincipal); bool HasNotificationPermission(const IPC::Principal& aPrincipal);
virtual bool RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle, virtual bool
RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle,
const nsString& aText, const bool& aTextClickable, const nsString& aText, const bool& aTextClickable,
const nsString& aCookie, const nsString& aName, const nsString& aCookie, const nsString& aName,
const nsString& aBidi, const nsString& aLang, const nsString& aBidi, const nsString& aLang,
@ -810,11 +925,13 @@ private:
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal, const IPC::Principal& aPrincipal,
nsTArray<StructuredCloneData>* aRetvals) override; nsTArray<StructuredCloneData>* aRetvals) override;
virtual bool RecvRpcMessage(const nsString& aMsg, virtual bool RecvRpcMessage(const nsString& aMsg,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal, const IPC::Principal& aPrincipal,
nsTArray<StructuredCloneData>* aRetvals) override; nsTArray<StructuredCloneData>* aRetvals) override;
virtual bool RecvAsyncMessage(const nsString& aMsg, virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
@ -828,9 +945,11 @@ private:
virtual bool RecvAddGeolocationListener(const IPC::Principal& aPrincipal, virtual bool RecvAddGeolocationListener(const IPC::Principal& aPrincipal,
const bool& aHighAccuracy) override; const bool& aHighAccuracy) override;
virtual bool RecvRemoveGeolocationListener() override; virtual bool RecvRemoveGeolocationListener() override;
virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable) override; virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable) override;
virtual bool RecvConsoleMessage(const nsString& aMessage) override; virtual bool RecvConsoleMessage(const nsString& aMessage) override;
virtual bool RecvScriptError(const nsString& aMessage, virtual bool RecvScriptError(const nsString& aMessage,
const nsString& aSourceName, const nsString& aSourceName,
const nsString& aSourceLine, const nsString& aSourceLine,
@ -871,9 +990,11 @@ private:
void OnNewProcessCreated(uint32_t aPid, void OnNewProcessCreated(uint32_t aPid,
UniquePtr<nsTArray<ProtocolFdMapping>>&& aFds); UniquePtr<nsTArray<ProtocolFdMapping>>&& aFds);
virtual bool RecvCreateFakeVolume(const nsString& fsName, const nsString& mountPoint) override; virtual bool RecvCreateFakeVolume(const nsString& aFsName,
const nsString& aMountPoint) override;
virtual bool RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) override; virtual bool RecvSetFakeVolumeState(const nsString& aFsName,
const int32_t& aFsState) override;
virtual bool RecvRemoveFakeVolume(const nsString& fsName) override; virtual bool RecvRemoveFakeVolume(const nsString& fsName) override;
@ -893,16 +1014,22 @@ private:
virtual void ProcessingError(Result aCode, const char* aMsgName) override; virtual void ProcessingError(Result aCode, const char* aMsgName) override;
virtual bool RecvAllocateLayerTreeId(uint64_t* aId) override; virtual bool RecvAllocateLayerTreeId(uint64_t* aId) override;
virtual bool RecvDeallocateLayerTreeId(const uint64_t& aId) override; virtual bool RecvDeallocateLayerTreeId(const uint64_t& aId) override;
virtual bool RecvGetGraphicsFeatureStatus(const int32_t& aFeature, virtual bool RecvGetGraphicsFeatureStatus(const int32_t& aFeature,
int32_t* aStatus, int32_t* aStatus,
bool* aSuccess) override; bool* aSuccess) override;
virtual bool RecvBeginDriverCrashGuard(const uint32_t& aGuardType, bool* aOutCrashed) override;
virtual bool
RecvBeginDriverCrashGuard(const uint32_t& aGuardType,
bool* aOutCrashed) override;
virtual bool RecvEndDriverCrashGuard(const uint32_t& aGuardType) override; virtual bool RecvEndDriverCrashGuard(const uint32_t& aGuardType) override;
virtual bool RecvAddIdleObserver(const uint64_t& observerId, virtual bool RecvAddIdleObserver(const uint64_t& observerId,
const uint32_t& aIdleTimeInS) override; const uint32_t& aIdleTimeInS) override;
virtual bool RecvRemoveIdleObserver(const uint64_t& observerId, virtual bool RecvRemoveIdleObserver(const uint64_t& observerId,
const uint32_t& aIdleTimeInS) override; const uint32_t& aIdleTimeInS) override;
@ -937,12 +1064,17 @@ private:
virtual bool RecvUpdateDropEffect(const uint32_t& aDragAction, virtual bool RecvUpdateDropEffect(const uint32_t& aDragAction,
const uint32_t& aDropEffect) override; const uint32_t& aDropEffect) override;
virtual bool RecvGetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration* aConfig) override; virtual bool RecvGetBrowserConfiguration(const nsCString& aURI,
BrowserConfiguration* aConfig) override;
virtual bool RecvGamepadListenerAdded() override; virtual bool RecvGamepadListenerAdded() override;
virtual bool RecvGamepadListenerRemoved() override; virtual bool RecvGamepadListenerRemoved() override;
virtual bool RecvProfile(const nsCString& aProfile) override; virtual bool RecvProfile(const nsCString& aProfile) override;
virtual bool RecvGetGraphicsDeviceInitData(DeviceInitData* aOut) override; virtual bool RecvGetGraphicsDeviceInitData(DeviceInitData* aOut) override;
void StartProfiler(nsIProfilerStartParams* aParams); void StartProfiler(nsIProfilerStartParams* aParams);
virtual bool RecvGetDeviceStorageLocation(const nsString& aType, virtual bool RecvGetDeviceStorageLocation(const nsString& aType,
@ -1051,21 +1183,25 @@ private:
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
class ParentIdleListener : public nsIObserver { class ParentIdleListener : public nsIObserver
{
friend class mozilla::dom::ContentParent; friend class mozilla::dom::ContentParent;
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER NS_DECL_NSIOBSERVER
ParentIdleListener(mozilla::dom::ContentParent* aParent, uint64_t aObserver, uint32_t aTime) ParentIdleListener(mozilla::dom::ContentParent* aParent,
uint64_t aObserver, uint32_t aTime)
: mParent(aParent), mObserver(aObserver), mTime(aTime) : mParent(aParent), mObserver(aObserver), mTime(aTime)
{} {}
private: private:
virtual ~ParentIdleListener() {} virtual ~ParentIdleListener() {}
RefPtr<mozilla::dom::ContentParent> mParent; RefPtr<mozilla::dom::ContentParent> mParent;
uint64_t mObserver; uint64_t mObserver;
uint32_t mTime; uint32_t mTime;
}; };
#endif #endif // mozilla_dom_ContentParent_h

Просмотреть файл

@ -74,8 +74,9 @@ public:
/** /**
* Allocate a tab id for the given content process's id. * Allocate a tab id for the given content process's id.
* Used when a content process wants to create a new tab. aOpenerTabId and * Used when a content process wants to create a new tab. aOpenerTabId and
* aContext are saved in RemoteFrameInfo, which is a part of ContentProcessInfo. * aContext are saved in RemoteFrameInfo, which is a part of
* We can use the tab id and process id to locate the TabContext for future use. * ContentProcessInfo. We can use the tab id and process id to locate the
* TabContext for future use.
*/ */
TabId AllocateTabId(const TabId& aOpenerTabId, TabId AllocateTabId(const TabId& aOpenerTabId,
const IPCTabContext& aContext, const IPCTabContext& aContext,
@ -162,4 +163,4 @@ private:
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif #endif // mozilla_dom_ContentProcessManager_h

Просмотреть файл

@ -11,10 +11,11 @@
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
class CrashReporterChild : class CrashReporterChild :
public PCrashReporterChild public PCrashReporterChild
{ {
public: public:
CrashReporterChild() { CrashReporterChild() {
MOZ_COUNT_CTOR(CrashReporterChild); MOZ_COUNT_CTOR(CrashReporterChild);
} }

Просмотреть файл

@ -101,8 +101,10 @@ bool
CrashReporterParent::GenerateCrashReportForMinidump(nsIFile* minidump, CrashReporterParent::GenerateCrashReportForMinidump(nsIFile* minidump,
const AnnotationTable* processNotes) const AnnotationTable* processNotes)
{ {
if (!CrashReporter::GetIDFromMinidump(minidump, mChildDumpID)) if (!CrashReporter::GetIDFromMinidump(minidump, mChildDumpID)) {
return false; return false;
}
bool result = GenerateChildData(processNotes); bool result = GenerateChildData(processNotes);
FinalizeChildData(); FinalizeChildData();
return result; return result;

Просмотреть файл

@ -18,8 +18,7 @@
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
class CrashReporterParent : class CrashReporterParent : public PCrashReporterParent
public PCrashReporterParent
{ {
#ifdef MOZ_CRASHREPORTER #ifdef MOZ_CRASHREPORTER
typedef CrashReporter::AnnotationTable AnnotationTable; typedef CrashReporter::AnnotationTable AnnotationTable;
@ -137,7 +136,7 @@ public:
* Returns the ID of the child minidump. * Returns the ID of the child minidump.
* GeneratePairedMinidump or GenerateCrashReport must be called first. * GeneratePairedMinidump or GenerateCrashReport must be called first.
*/ */
const nsString& ChildDumpID() { const nsString& ChildDumpID() const {
return mChildDumpID; return mChildDumpID;
} }
@ -147,18 +146,20 @@ public:
* the notes will get dropped. * the notes will get dropped.
*/ */
void void
AnnotateCrashReport(const nsCString& key, const nsCString& data); AnnotateCrashReport(const nsCString& aKey, const nsCString& aData);
protected: protected:
virtual void ActorDestroy(ActorDestroyReason aWhy) override; virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual bool virtual bool RecvAnnotateCrashReport(const nsCString& aKey,
RecvAnnotateCrashReport(const nsCString& key, const nsCString& data) override { const nsCString& aData) override
AnnotateCrashReport(key, data); {
AnnotateCrashReport(aKey, aData);
return true; return true;
} }
virtual bool
RecvAppendAppNotes(const nsCString& data) override; virtual bool RecvAppendAppNotes(const nsCString& aData) override;
virtual mozilla::ipc::IProtocol* virtual mozilla::ipc::IProtocol*
CloneProtocol(Channel* aChannel, CloneProtocol(Channel* aChannel,
mozilla::ipc::ProtocolCloneContext *aCtx) override; mozilla::ipc::ProtocolCloneContext *aCtx) override;
@ -217,7 +218,8 @@ CrashReporterParent::GenerateMinidumpAndPair(Toplevel* aTopLevel,
#ifdef XP_MACOSX #ifdef XP_MACOSX
childHandle = aTopLevel->Process()->GetChildTask(); childHandle = aTopLevel->Process()->GetChildTask();
#else #else
if (!base::OpenPrivilegedProcessHandle(aTopLevel->OtherPid(), &childHandle.rwget())) { if (!base::OpenPrivilegedProcessHandle(aTopLevel->OtherPid(),
&childHandle.rwget())) {
NS_WARNING("Failed to open child process handle."); NS_WARNING("Failed to open child process handle.");
return false; return false;
} }

Просмотреть файл

@ -68,7 +68,8 @@ class FilePickerParent : public PFilePickerParent
nsCOMPtr<nsIEventTarget> mEventTarget; nsCOMPtr<nsIEventTarget> mEventTarget;
public: public:
FileSizeAndDateRunnable(FilePickerParent *aFPParent, nsTArray<RefPtr<BlobImpl>>& aBlobs); FileSizeAndDateRunnable(FilePickerParent *aFPParent,
nsTArray<RefPtr<BlobImpl>>& aBlobs);
bool Dispatch(); bool Dispatch();
NS_IMETHOD Run(); NS_IMETHOD Run();
void Destroy(); void Destroy();
@ -86,4 +87,4 @@ class FilePickerParent : public PFilePickerParent
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif #endif // mozilla_dom_FilePickerParent_h

Просмотреть файл

@ -22,7 +22,6 @@ class TabParent;
template<typename T> template<typename T>
class IdType class IdType
{ {
friend struct IPC::ParamTraits<IdType<T>>; friend struct IPC::ParamTraits<IdType<T>>;
public: public:
@ -71,4 +70,4 @@ struct ParamTraits<mozilla::dom::IdType<T>>
} // namespace IPC } // namespace IPC
#endif #endif // mozilla_dom_IdType_h

Просмотреть файл

@ -30,5 +30,4 @@ private:
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif #endif // mozilla_dom_NuwaChild_h

Просмотреть файл

@ -70,4 +70,4 @@ private:
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif #endif // mozilla_dom_NuwaParent_h

Просмотреть файл

@ -13,12 +13,19 @@
namespace IPC { namespace IPC {
class Principal { class Principal
{
friend struct ParamTraits<Principal>; friend struct ParamTraits<Principal>;
public: public:
Principal() : mPrincipal(nullptr) {} Principal()
explicit Principal(nsIPrincipal* aPrincipal) : mPrincipal(aPrincipal) {} : mPrincipal(nullptr)
{}
explicit Principal(nsIPrincipal* aPrincipal)
: mPrincipal(aPrincipal)
{}
operator nsIPrincipal*() const { return mPrincipal.get(); } operator nsIPrincipal*() const { return mPrincipal.get(); }
private: private:

Просмотреть файл

@ -1210,7 +1210,7 @@ TabChild::SetProcessNameToAppName()
} }
bool bool
TabChild::IsRootContentDocument() TabChild::IsRootContentDocument() const
{ {
// A TabChild is a "root content document" if it's // A TabChild is a "root content document" if it's
// //

Просмотреть файл

@ -162,10 +162,10 @@ protected:
TabChild* mTabChild; TabChild* mTabChild;
}; };
// This is base clase which helps to share Viewport and touch related functionality // This is base clase which helps to share Viewport and touch related
// between b2g/android FF/embedlite clients implementation. // functionality between b2g/android FF/embedlite clients implementation.
// It make sense to place in this class all helper functions, and functionality which could be shared between // It make sense to place in this class all helper functions, and functionality
// Cross-process/Cross-thread implmentations. // which could be shared between Cross-process/Cross-thread implmentations.
class TabChildBase : public nsISupports, class TabChildBase : public nsISupports,
public nsMessageManagerScriptExecutor, public nsMessageManagerScriptExecutor,
public ipc::MessageManagerCallback public ipc::MessageManagerCallback
@ -259,12 +259,16 @@ public:
/** Return a TabChild with the given attributes. */ /** Return a TabChild with the given attributes. */
static already_AddRefed<TabChild> static already_AddRefed<TabChild>
Create(nsIContentChild* aManager, const TabId& aTabId, const TabContext& aContext, uint32_t aChromeFlags); Create(nsIContentChild* aManager, const TabId& aTabId,
const TabContext& aContext, uint32_t aChromeFlags);
bool IsRootContentDocument() const;
bool IsRootContentDocument();
// Let managees query if it is safe to send messages. // Let managees query if it is safe to send messages.
bool IsDestroyed() { return mDestroyed; } bool IsDestroyed() const{ return mDestroyed; }
const TabId GetTabId() const {
const TabId GetTabId() const
{
MOZ_ASSERT(mUniqueId != 0); MOZ_ASSERT(mUniqueId != 0);
return mUniqueId; return mUniqueId;
} }
@ -290,54 +294,81 @@ public:
nsIPrincipal* aPrincipal, nsIPrincipal* aPrincipal,
nsTArray<StructuredCloneData>* aRetVal, nsTArray<StructuredCloneData>* aRetVal,
bool aIsSync) override; bool aIsSync) override;
virtual nsresult DoSendAsyncMessage(JSContext* aCx, virtual nsresult DoSendAsyncMessage(JSContext* aCx,
const nsAString& aMessage, const nsAString& aMessage,
StructuredCloneData& aData, StructuredCloneData& aData,
JS::Handle<JSObject *> aCpows, JS::Handle<JSObject *> aCpows,
nsIPrincipal* aPrincipal) override; nsIPrincipal* aPrincipal) override;
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
virtual bool
DoUpdateZoomConstraints(const uint32_t& aPresShellId,
const ViewID& aViewId, const ViewID& aViewId,
const Maybe<ZoomConstraints>& aConstraints) override; const Maybe<ZoomConstraints>& aConstraints) override;
virtual bool RecvLoadURL(const nsCString& aURI, virtual bool RecvLoadURL(const nsCString& aURI,
const BrowserConfiguration& aConfiguration, const BrowserConfiguration& aConfiguration,
const ShowInfo& aInfo) override; const ShowInfo& aInfo) override;
virtual bool RecvOpenURI(const URIParams& aURI, virtual bool RecvOpenURI(const URIParams& aURI,
const uint32_t& aFlags) override; const uint32_t& aFlags) override;
virtual bool RecvCacheFileDescriptor(const nsString& aPath, virtual bool RecvCacheFileDescriptor(const nsString& aPath,
const FileDescriptor& aFileDescriptor) const FileDescriptor& aFileDescriptor)
override; override;
virtual bool RecvShow(const ScreenIntSize& aSize,
virtual bool
RecvShow(const ScreenIntSize& aSize,
const ShowInfo& aInfo, const ShowInfo& aInfo,
const TextureFactoryIdentifier& aTextureFactoryIdentifier, const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId, const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame, PRenderFrameChild* aRenderFrame,
const bool& aParentIsActive) override; const bool& aParentIsActive) override;
virtual bool RecvUpdateDimensions(const CSSRect& rect,
const CSSSize& size, virtual bool
const nsSizeMode& sizeMode, RecvUpdateDimensions(const CSSRect& aRect,
const ScreenOrientationInternal& orientation, const CSSSize& aSize,
const LayoutDeviceIntPoint& chromeDisp) override; const nsSizeMode& aSizeMode,
virtual bool RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override; const ScreenOrientationInternal& aOrientation,
virtual bool RecvRequestFlingSnap(const ViewID& aScrollId, const LayoutDeviceIntPoint& aChromeDisp) override;
virtual bool
RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override;
virtual bool
RecvRequestFlingSnap(const ViewID& aScrollId,
const CSSPoint& aDestination) override; const CSSPoint& aDestination) override;
virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
virtual bool
RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
const uint32_t& aScrollGeneration) override; const uint32_t& aScrollGeneration) override;
virtual bool RecvHandleDoubleTap(const CSSPoint& aPoint,
virtual bool
RecvHandleDoubleTap(const CSSPoint& aPoint,
const Modifiers& aModifiers, const Modifiers& aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid) override; const mozilla::layers::ScrollableLayerGuid& aGuid) override;
virtual bool RecvHandleSingleTap(const CSSPoint& aPoint,
virtual bool
RecvHandleSingleTap(const CSSPoint& aPoint,
const Modifiers& aModifiers, const Modifiers& aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid) override; const mozilla::layers::ScrollableLayerGuid& aGuid) override;
virtual bool RecvHandleLongTap(const CSSPoint& aPoint,
virtual bool
RecvHandleLongTap(const CSSPoint& aPoint,
const Modifiers& aModifiers, const Modifiers& aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid, const mozilla::layers::ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId) override; const uint64_t& aInputBlockId) override;
virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId, virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId,
const APZStateChange& aChange, const APZStateChange& aChange,
const int& aArg) override; const int& aArg) override;
virtual bool RecvNotifyFlushComplete() override; virtual bool RecvNotifyFlushComplete() override;
virtual bool RecvActivate() override; virtual bool RecvActivate() override;
virtual bool RecvDeactivate() override; virtual bool RecvDeactivate() override;
virtual bool RecvMouseEvent(const nsString& aType, virtual bool RecvMouseEvent(const nsString& aType,
const float& aX, const float& aX,
const float& aY, const float& aY,
@ -345,96 +376,131 @@ public:
const int32_t& aClickCount, const int32_t& aClickCount,
const int32_t& aModifiers, const int32_t& aModifiers,
const bool& aIgnoreRootScrollFrame) override; const bool& aIgnoreRootScrollFrame) override;
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& event,
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId) override; const uint64_t& aInputBlockId) override;
virtual bool RecvSynthMouseMoveEvent(const mozilla::WidgetMouseEvent& event,
virtual bool RecvSynthMouseMoveEvent(const mozilla::WidgetMouseEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId) override; const uint64_t& aInputBlockId) override;
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& event,
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId) override; const uint64_t& aInputBlockId) override;
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent, virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
const uint32_t& aDragAction, const uint32_t& aDragAction,
const uint32_t& aDropEffect) override; const uint32_t& aDropEffect) override;
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event,
virtual bool
RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& aEvent,
const MaybeNativeKeyBinding& aBindings) override; const MaybeNativeKeyBinding& aBindings) override;
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event,
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId) override; const uint64_t& aInputBlockId) override;
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent, virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId, const uint64_t& aInputBlockId,
const nsEventStatus& aApzResponse) override; const nsEventStatus& aApzResponse) override;
virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
virtual bool
RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId, const uint64_t& aInputBlockId,
const nsEventStatus& aApzResponse) override; const nsEventStatus& aApzResponse) override;
virtual bool RecvKeyEvent(const nsString& aType, virtual bool RecvKeyEvent(const nsString& aType,
const int32_t& aKeyCode, const int32_t& aKeyCode,
const int32_t& aCharCode, const int32_t& aCharCode,
const int32_t& aModifiers, const int32_t& aModifiers,
const bool& aPreventDefault) override; const bool& aPreventDefault) override;
virtual bool RecvMouseScrollTestEvent(const FrameMetrics::ViewID& aScrollId, virtual bool RecvMouseScrollTestEvent(const FrameMetrics::ViewID& aScrollId,
const nsString& aEvent) override; const nsString& aEvent) override;
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId, virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
const nsCString& aResponse) override; const nsCString& aResponse) override;
virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override; virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override;
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) override;
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) override; virtual bool
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) override; RecvCompositionEvent(const mozilla::WidgetCompositionEvent& aEvent) override;
virtual bool
RecvSelectionEvent(const mozilla::WidgetSelectionEvent& aEvent) override;
virtual bool
RecvActivateFrameEvent(const nsString& aType, const bool& aCapture) override;
virtual bool RecvLoadRemoteScript(const nsString& aURL, virtual bool RecvLoadRemoteScript(const nsString& aURL,
const bool& aRunInGlobalScope) override; const bool& aRunInGlobalScope) override;
virtual bool RecvAsyncMessage(const nsString& aMessage, virtual bool RecvAsyncMessage(const nsString& aMessage,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) override; const IPC::Principal& aPrincipal) override;
virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) override; virtual bool RecvAppOfflineStatus(const uint32_t& aId,
const bool& aOffline) override;
virtual bool RecvSwappedWithOtherRemoteLoader() override; virtual bool RecvSwappedWithOtherRemoteLoader() override;
virtual PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*, virtual PDocAccessibleChild*
const uint64_t&) AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&) override;
override;
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override; virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
virtual PDocumentRendererChild* virtual PDocumentRendererChild*
AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform, AllocPDocumentRendererChild(const nsRect& aDocumentRect,
const nsString& bgcolor, const gfx::Matrix& aTransform,
const uint32_t& renderFlags, const bool& flushLayout, const nsString& aBggcolor,
const nsIntSize& renderSize) override; const uint32_t& aRenderFlags,
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor) override; const bool& aFlushLayout,
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor, const nsIntSize& arenderSize) override;
const nsRect& documentRect,
const gfx::Matrix& transform, virtual bool
const nsString& bgcolor, DeallocPDocumentRendererChild(PDocumentRendererChild* aCctor) override;
const uint32_t& renderFlags,
const bool& flushLayout, virtual bool
const nsIntSize& renderSize) override; RecvPDocumentRendererConstructor(PDocumentRendererChild* aActor,
const nsRect& aDocumentRect,
const gfx::Matrix& aTransform,
const nsString& aBgcolor,
const uint32_t& aRenderFlags,
const bool& aFlushLayout,
const nsIntSize& aRenderSize) override;
virtual PColorPickerChild* virtual PColorPickerChild*
AllocPColorPickerChild(const nsString& title, const nsString& initialColor) override; AllocPColorPickerChild(const nsString& aTitle,
virtual bool DeallocPColorPickerChild(PColorPickerChild* actor) override; const nsString& aInitialColor) override;
virtual bool DeallocPColorPickerChild(PColorPickerChild* aActor) override;
virtual PFilePickerChild* virtual PFilePickerChild*
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override; AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
virtual bool virtual bool
DeallocPFilePickerChild(PFilePickerChild* actor) override; DeallocPFilePickerChild(PFilePickerChild* aActor) override;
virtual PIndexedDBPermissionRequestChild* virtual PIndexedDBPermissionRequestChild*
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal) AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal) override;
override;
virtual bool virtual bool
DeallocPIndexedDBPermissionRequestChild( DeallocPIndexedDBPermissionRequestChild(PIndexedDBPermissionRequestChild* aActor) override;
PIndexedDBPermissionRequestChild* aActor)
override; virtual nsIWebNavigation* WebNavigation() const override
{
return mWebNav;
}
virtual nsIWebNavigation* WebNavigation() const override { return mWebNav; }
virtual PuppetWidget* WebWidget() override { return mPuppetWidget; } virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
/** Return the DPI of the widget this TabChild draws to. */ /** Return the DPI of the widget this TabChild draws to. */
void GetDPI(float* aDPI); void GetDPI(float* aDPI);
void GetDefaultScale(double *aScale); void GetDefaultScale(double *aScale);
void GetMaxTouchPoints(uint32_t* aTouchPoints); void GetMaxTouchPoints(uint32_t* aTouchPoints);
@ -465,9 +531,9 @@ public:
const nsAString& aPath, const nsAString& aPath,
nsICachedFileDescriptorListener* aCallback); nsICachedFileDescriptorListener* aCallback);
nsIContentChild* Manager() { return mManager; } nsIContentChild* Manager() const { return mManager; }
bool GetUpdateHitRegion() { return mUpdateHitRegion; } bool GetUpdateHitRegion() const { return mUpdateHitRegion; }
void UpdateHitRegion(const nsRegion& aRegion); void UpdateHitRegion(const nsRegion& aRegion);
@ -484,22 +550,24 @@ public:
void DidComposite(uint64_t aTransactionId, void DidComposite(uint64_t aTransactionId,
const TimeStamp& aCompositeStart, const TimeStamp& aCompositeStart,
const TimeStamp& aCompositeEnd); const TimeStamp& aCompositeEnd);
void DidRequestComposite(const TimeStamp& aCompositeReqStart, void DidRequestComposite(const TimeStamp& aCompositeReqStart,
const TimeStamp& aCompositeReqEnd); const TimeStamp& aCompositeReqEnd);
void ClearCachedResources(); void ClearCachedResources();
static inline TabChild* static inline TabChild* GetFrom(nsIDOMWindow* aWindow)
GetFrom(nsIDOMWindow* aWindow)
{ {
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow); nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav); nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
return GetFrom(docShell); return GetFrom(docShell);
} }
virtual bool RecvUIResolutionChanged(const float& aDpi, const double& aScale) override; virtual bool RecvUIResolutionChanged(const float& aDpi,
const double& aScale) override;
virtual bool RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override; virtual bool
RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
virtual bool RecvHandleAccessKey(nsTArray<uint32_t>&& aCharCodes, virtual bool RecvHandleAccessKey(nsTArray<uint32_t>&& aCharCodes,
const bool& aIsTrusted, const bool& aIsTrusted,
@ -513,18 +581,21 @@ public:
* Native widget remoting protocol for use with windowed plugins with e10s. * Native widget remoting protocol for use with windowed plugins with e10s.
*/ */
PPluginWidgetChild* AllocPPluginWidgetChild() override; PPluginWidgetChild* AllocPPluginWidgetChild() override;
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override; bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override;
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut); nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
LayoutDeviceIntPoint GetChromeDisplacement() { return mChromeDisp; }; LayoutDeviceIntPoint GetChromeDisplacement() const { return mChromeDisp; };
bool IPCOpen() { return mIPCOpen; } bool IPCOpen() const { return mIPCOpen; }
bool ParentIsActive() bool ParentIsActive() const
{ {
return mParentIsActive; return mParentIsActive;
} }
bool AsyncPanZoomEnabled() { return mAsyncPanZoomEnabled; }
bool AsyncPanZoomEnabled() const { return mAsyncPanZoomEnabled; }
virtual ScreenIntSize GetInnerSize() override; virtual ScreenIntSize GetInnerSize() override;
@ -538,11 +609,18 @@ protected:
virtual ~TabChild(); virtual ~TabChild();
virtual PRenderFrameChild* AllocPRenderFrameChild() override; virtual PRenderFrameChild* AllocPRenderFrameChild() override;
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override; virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
virtual bool RecvDestroy() override; virtual bool RecvDestroy() override;
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override; virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
virtual bool RecvSetDocShellIsActive(const bool& aIsActive, const bool& aIsHidden) override;
virtual bool RecvNavigateByKey(const bool& aForward, const bool& aForDocumentNavigation) override; virtual bool RecvSetDocShellIsActive(const bool& aIsActive,
const bool& aIsHidden) override;
virtual bool RecvNavigateByKey(const bool& aForward,
const bool& aForDocumentNavigation) override;
virtual bool RecvRequestNotifyAfterRemotePaint() override; virtual bool RecvRequestNotifyAfterRemotePaint() override;
@ -551,6 +629,7 @@ protected:
virtual bool RecvParentActivated(const bool& aActivated) override; virtual bool RecvParentActivated(const bool& aActivated) override;
virtual bool RecvStopIMEStateManagement() override; virtual bool RecvStopIMEStateManagement() override;
virtual bool RecvMenuKeyboardListenerInstalled( virtual bool RecvMenuKeyboardListenerInstalled(
const bool& aInstalled) override; const bool& aInstalled) override;
@ -569,11 +648,15 @@ private:
void ActorDestroy(ActorDestroyReason why) override; void ActorDestroy(ActorDestroyReason why) override;
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS }; enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS); bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier, bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId, const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame); PRenderFrameChild* aRenderFrame);
void DestroyWindow(); void DestroyWindow();
void SetProcessNameToAppName(); void SetProcessNameToAppName();
void ApplyShowInfo(const ShowInfo& aInfo); void ApplyShowInfo(const ShowInfo& aInfo);
@ -584,7 +667,8 @@ private:
ScreenIntRect GetOuterRect(); ScreenIntRect GetOuterRect();
void SetUnscaledInnerSize(const CSSSize& aSize) { void SetUnscaledInnerSize(const CSSSize& aSize)
{
mUnscaledInnerSize = aSize; mUnscaledInnerSize = aSize;
} }

Просмотреть файл

@ -104,8 +104,8 @@ public:
bool HasOwnOrContainingApp() const; bool HasOwnOrContainingApp() const;
/** /**
* OriginAttributesRef() returns the DocShellOriginAttributes of this frame to the * OriginAttributesRef() returns the DocShellOriginAttributes of this frame to
* caller. This is used to store any attribute associated with the frame's * the caller. This is used to store any attribute associated with the frame's
* docshell, such as the AppId. * docshell, such as the AppId.
*/ */
const DocShellOriginAttributes& OriginAttributesRef() const; const DocShellOriginAttributes& OriginAttributesRef() const;
@ -196,7 +196,8 @@ public:
return TabContext::SetTabContext(aContext); return TabContext::SetTabContext(aContext);
} }
bool SetTabContext(mozIApplication* aOwnApp, bool
SetTabContext(mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp, mozIApplication* aAppFrameOwnerApp,
const DocShellOriginAttributes& aOriginAttributes, const DocShellOriginAttributes& aOriginAttributes,
const nsACString& aSignedPkgOriginNoSuffix = EmptyCString()) const nsACString& aSignedPkgOriginNoSuffix = EmptyCString())

Просмотреть файл

@ -64,16 +64,19 @@ struct ParamTraits<mozilla::dom::AudioChannel>
{ {
typedef mozilla::dom::AudioChannel paramType; typedef mozilla::dom::AudioChannel paramType;
static bool IsLegalValue(const paramType &aValue) { static bool IsLegalValue(const paramType &aValue)
{
return aValue <= mozilla::dom::AudioChannel::Publicnotification; return aValue <= mozilla::dom::AudioChannel::Publicnotification;
} }
static void Write(Message* aMsg, const paramType& aValue) { static void Write(Message* aMsg, const paramType& aValue)
{
MOZ_ASSERT(IsLegalValue(aValue)); MOZ_ASSERT(IsLegalValue(aValue));
WriteParam(aMsg, (uint32_t)aValue); WriteParam(aMsg, (uint32_t)aValue);
} }
static bool Read(const Message* aMsg, void** aIter, paramType* aResult) { static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
uint32_t value; uint32_t value;
if(!ReadParam(aMsg, aIter, &value) || if(!ReadParam(aMsg, aIter, &value) ||
!IsLegalValue(paramType(value))) { !IsLegalValue(paramType(value))) {
@ -84,8 +87,7 @@ struct ParamTraits<mozilla::dom::AudioChannel>
} }
static void Log(const paramType& aParam, std::wstring* aLog) static void Log(const paramType& aParam, std::wstring* aLog)
{ {}
}
}; };
template <> template <>
@ -93,15 +95,15 @@ struct ParamTraits<nsEventStatus>
: public ContiguousEnumSerializer<nsEventStatus, : public ContiguousEnumSerializer<nsEventStatus,
nsEventStatus_eIgnore, nsEventStatus_eIgnore,
nsEventStatus_eSentinel> nsEventStatus_eSentinel>
{ }; {};
template<> template<>
struct ParamTraits<nsSizeMode> struct ParamTraits<nsSizeMode>
: public ContiguousEnumSerializer<nsSizeMode, : public ContiguousEnumSerializer<nsSizeMode,
nsSizeMode_Normal, nsSizeMode_Normal,
nsSizeMode_Invalid> nsSizeMode_Invalid>
{ }; {};
} // namespace IPC } // namespace IPC
#endif #endif // TABMESSAGE_UTILS_H

Просмотреть файл

@ -438,7 +438,7 @@ TabParent::GetAppType(nsAString& aOut)
} }
bool bool
TabParent::IsVisible() TabParent::IsVisible() const
{ {
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader(); RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
if (!frameLoader) { if (!frameLoader) {

Просмотреть файл

@ -107,7 +107,9 @@ public:
const TabId& aTabId, const TabId& aTabId,
const TabContext& aContext, const TabContext& aContext,
uint32_t aChromeFlags); uint32_t aChromeFlags);
Element* GetOwnerElement() const { return mFrameElement; } Element* GetOwnerElement() const { return mFrameElement; }
void SetOwnerElement(Element* aElement); void SetOwnerElement(Element* aElement);
void CacheFrameLoader(nsFrameLoader* aFrameLoader); void CacheFrameLoader(nsFrameLoader* aFrameLoader);
@ -123,85 +125,128 @@ public:
* The frameloader's visibility can be independent of e.g. its docshell's * The frameloader's visibility can be independent of e.g. its docshell's
* visibility. * visibility.
*/ */
bool IsVisible(); bool IsVisible() const;
nsIBrowserDOMWindow *GetBrowserDOMWindow() { return mBrowserDOMWindow; } nsIBrowserDOMWindow *GetBrowserDOMWindow() const { return mBrowserDOMWindow; }
void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserDOMWindow) {
void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserDOMWindow)
{
mBrowserDOMWindow = aBrowserDOMWindow; mBrowserDOMWindow = aBrowserDOMWindow;
} }
void SetHasContentOpener(bool aHasContentOpener); void SetHasContentOpener(bool aHasContentOpener);
void SwapFrameScriptsFrom(nsTArray<FrameScriptInfo>& aFrameScripts) { void SwapFrameScriptsFrom(nsTArray<FrameScriptInfo>& aFrameScripts)
{
aFrameScripts.SwapElements(mDelayedFrameScripts); aFrameScripts.SwapElements(mDelayedFrameScripts);
} }
already_AddRefed<nsILoadContext> GetLoadContext(); already_AddRefed<nsILoadContext> GetLoadContext();
already_AddRefed<nsIWidget> GetTopLevelWidget(); already_AddRefed<nsIWidget> GetTopLevelWidget();
nsIXULBrowserWindow* GetXULBrowserWindow(); nsIXULBrowserWindow* GetXULBrowserWindow();
void Destroy(); void Destroy();
void Detach(); void Detach();
void Attach(nsFrameLoader* aFrameLoader); void Attach(nsFrameLoader* aFrameLoader);
void RemoveWindowListeners(); void RemoveWindowListeners();
void AddWindowListeners(); void AddWindowListeners();
void DidRefresh() override; void DidRefresh() override;
virtual bool RecvMoveFocus(const bool& aForward, virtual bool RecvMoveFocus(const bool& aForward,
const bool& aForDocumentNavigation) override; const bool& aForDocumentNavigation) override;
virtual bool RecvEvent(const RemoteDOMEvent& aEvent) override; virtual bool RecvEvent(const RemoteDOMEvent& aEvent) override;
virtual bool RecvReplyKeyEvent(const WidgetKeyboardEvent& aEvent) override; virtual bool RecvReplyKeyEvent(const WidgetKeyboardEvent& aEvent) override;
virtual bool RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent) override;
virtual bool
RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent) override;
virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener, virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
const nsString& aURL, const nsString& aURL,
const nsString& aName, const nsString& aName,
const nsString& aFeatures, const nsString& aFeatures,
bool* aOutWindowOpened) override; bool* aOutWindowOpened) override;
virtual bool RecvSyncMessage(const nsString& aMessage,
virtual bool
RecvSyncMessage(const nsString& aMessage,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal, const IPC::Principal& aPrincipal,
nsTArray<ipc::StructuredCloneData>* aRetVal) override; nsTArray<ipc::StructuredCloneData>* aRetVal) override;
virtual bool RecvRpcMessage(const nsString& aMessage,
virtual bool
RecvRpcMessage(const nsString& aMessage,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal, const IPC::Principal& aPrincipal,
nsTArray<ipc::StructuredCloneData>* aRetVal) override; nsTArray<ipc::StructuredCloneData>* aRetVal) override;
virtual bool RecvAsyncMessage(const nsString& aMessage, virtual bool RecvAsyncMessage(const nsString& aMessage,
const ClonedMessageData& aData, const ClonedMessageData& aData,
InfallibleTArray<CpowEntry>&& aCpows, InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) override; const IPC::Principal& aPrincipal) override;
virtual bool RecvNotifyIMEFocus(const ContentCache& aContentCache,
virtual bool
RecvNotifyIMEFocus(const ContentCache& aContentCache,
const widget::IMENotification& aEventMessage, const widget::IMENotification& aEventMessage,
nsIMEUpdatePreference* aPreference) nsIMEUpdatePreference* aPreference) override;
override;
virtual bool RecvNotifyIMETextChange(const ContentCache& aContentCache, virtual bool
RecvNotifyIMETextChange(const ContentCache& aContentCache,
const widget::IMENotification& aEventMessage) override; const widget::IMENotification& aEventMessage) override;
virtual bool RecvNotifyIMECompositionUpdate(const ContentCache& aContentCache,
virtual bool
RecvNotifyIMECompositionUpdate(const ContentCache& aContentCache,
const widget::IMENotification& aEventMessage) override; const widget::IMENotification& aEventMessage) override;
virtual bool RecvNotifyIMESelection(const ContentCache& aContentCache,
virtual bool
RecvNotifyIMESelection(const ContentCache& aContentCache,
const widget::IMENotification& aEventMessage) override; const widget::IMENotification& aEventMessage) override;
virtual bool RecvUpdateContentCache(const ContentCache& aContentCache) override;
virtual bool RecvNotifyIMEMouseButtonEvent(const widget::IMENotification& aEventMessage, virtual bool
RecvUpdateContentCache(const ContentCache& aContentCache) override;
virtual bool
RecvNotifyIMEMouseButtonEvent(const widget::IMENotification& aEventMessage,
bool* aConsumedByIME) override; bool* aConsumedByIME) override;
virtual bool RecvNotifyIMEPositionChange(const ContentCache& aContentCache,
virtual bool
RecvNotifyIMEPositionChange(const ContentCache& aContentCache,
const widget::IMENotification& aEventMessage) override; const widget::IMENotification& aEventMessage) override;
virtual bool RecvOnEventNeedingAckHandled(const EventMessage& aMessage) override;
virtual bool RecvRequestIMEToCommitComposition(const bool& aCancel, virtual bool
RecvOnEventNeedingAckHandled(const EventMessage& aMessage) override;
virtual bool
RecvRequestIMEToCommitComposition(const bool& aCancel,
bool* aIsCommitted, bool* aIsCommitted,
nsString* aCommittedString) override; nsString* aCommittedString) override;
virtual bool RecvStartPluginIME(const WidgetKeyboardEvent& aKeyboardEvent,
virtual bool
RecvStartPluginIME(const WidgetKeyboardEvent& aKeyboardEvent,
const int32_t& aPanelX, const int32_t& aPanelX,
const int32_t& aPanelY, const int32_t& aPanelY,
nsString* aCommitted) override; nsString* aCommitted) override;
virtual bool RecvSetPluginFocused(const bool& aFocused) override; virtual bool RecvSetPluginFocused(const bool& aFocused) override;
virtual bool RecvSetCandidateWindowForPlugin(const int32_t& aX, virtual bool RecvSetCandidateWindowForPlugin(const int32_t& aX,
const int32_t& aY) override; const int32_t& aY) override;
virtual bool RecvDefaultProcOfPluginEvent(
const WidgetPluginEvent& aEvent) override; virtual bool
RecvDefaultProcOfPluginEvent(const WidgetPluginEvent& aEvent) override;
virtual bool RecvGetInputContext(int32_t* aIMEEnabled, virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
int32_t* aIMEOpen) override; int32_t* aIMEOpen) override;
virtual bool RecvSetInputContext(const int32_t& aIMEEnabled, virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
const int32_t& aIMEOpen, const int32_t& aIMEOpen,
const nsString& aType, const nsString& aType,
@ -209,11 +254,17 @@ public:
const nsString& aActionHint, const nsString& aActionHint,
const int32_t& aCause, const int32_t& aCause,
const int32_t& aFocusChange) override; const int32_t& aFocusChange) override;
virtual bool RecvRequestFocus(const bool& aCanRaise) override; virtual bool RecvRequestFocus(const bool& aCanRaise) override;
virtual bool RecvEnableDisableCommands(const nsString& aAction,
virtual bool
RecvEnableDisableCommands(const nsString& aAction,
nsTArray<nsCString>&& aEnabledCommands, nsTArray<nsCString>&& aEnabledCommands,
nsTArray<nsCString>&& aDisabledCommands) override; nsTArray<nsCString>&& aDisabledCommands) override;
virtual bool RecvSetCursor(const uint32_t& aValue, const bool& aForce) override;
virtual bool
RecvSetCursor(const uint32_t& aValue, const bool& aForce) override;
virtual bool RecvSetCustomCursor(const nsCString& aUri, virtual bool RecvSetCustomCursor(const nsCString& aUri,
const uint32_t& aWidth, const uint32_t& aWidth,
const uint32_t& aHeight, const uint32_t& aHeight,
@ -222,43 +273,78 @@ public:
const uint32_t& aHotspotX, const uint32_t& aHotspotX,
const uint32_t& aHotspotY, const uint32_t& aHotspotY,
const bool& aForce) override; const bool& aForce) override;
virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) override;
virtual bool RecvSetStatus(const uint32_t& aType,
const nsString& aStatus) override;
virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible) override; virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible) override;
virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip) override;
virtual bool RecvShowTooltip(const uint32_t& aX,
const uint32_t& aY,
const nsString& aTooltip) override;
virtual bool RecvHideTooltip() override; virtual bool RecvHideTooltip() override;
virtual bool RecvGetDPI(float* aValue) override; virtual bool RecvGetDPI(float* aValue) override;
virtual bool RecvGetDefaultScale(double* aValue) override; virtual bool RecvGetDefaultScale(double* aValue) override;
virtual bool RecvGetMaxTouchPoints(uint32_t* aTouchPoints) override; virtual bool RecvGetMaxTouchPoints(uint32_t* aTouchPoints) override;
virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) override; virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) override;
virtual bool RecvSetNativeChildOfShareableWindow(const uintptr_t& childWindow) override; virtual bool RecvSetNativeChildOfShareableWindow(const uintptr_t& childWindow) override;
virtual bool RecvDispatchFocusToTopLevelWindow() override; virtual bool RecvDispatchFocusToTopLevelWindow() override;
virtual bool RecvZoomToRect(const uint32_t& aPresShellId, virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
const ViewID& aViewId, const ViewID& aViewId,
const CSSRect& aRect) override; const CSSRect& aRect) override;
virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
virtual bool
RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
const ViewID& aViewId, const ViewID& aViewId,
const MaybeZoomConstraints& aConstraints) override; const MaybeZoomConstraints& aConstraints) override;
virtual bool RecvRespondStartSwipeEvent(const uint64_t& aInputBlockId, virtual bool RecvRespondStartSwipeEvent(const uint64_t& aInputBlockId,
const bool& aStartSwipe) override; const bool& aStartSwipe) override;
virtual bool RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
virtual bool
RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId, const uint64_t& aInputBlockId,
const bool& aPreventDefault) override; const bool& aPreventDefault) override;
virtual bool RecvSetTargetAPZC(const uint64_t& aInputBlockId, virtual bool RecvSetTargetAPZC(const uint64_t& aInputBlockId,
nsTArray<ScrollableLayerGuid>&& aTargets) override; nsTArray<ScrollableLayerGuid>&& aTargets) override;
virtual bool RecvSetAllowedTouchBehavior(const uint64_t& aInputBlockId,
virtual bool
RecvSetAllowedTouchBehavior(const uint64_t& aInputBlockId,
nsTArray<TouchBehaviorFlags>&& aTargets) override; nsTArray<TouchBehaviorFlags>&& aTargets) override;
virtual bool RecvDispatchWheelEvent(const mozilla::WidgetWheelEvent& aEvent) override;
virtual bool RecvDispatchMouseEvent(const mozilla::WidgetMouseEvent& aEvent) override; virtual bool
virtual bool RecvDispatchKeyboardEvent(const mozilla::WidgetKeyboardEvent& aEvent) override; RecvDispatchWheelEvent(const mozilla::WidgetWheelEvent& aEvent) override;
virtual bool RecvStartScrollbarDrag(const AsyncDragMetrics& aDragMetrics) override;
virtual bool
RecvDispatchMouseEvent(const mozilla::WidgetMouseEvent& aEvent) override;
virtual bool
RecvDispatchKeyboardEvent(const mozilla::WidgetKeyboardEvent& aEvent) override;
virtual bool
RecvStartScrollbarDrag(const AsyncDragMetrics& aDragMetrics) override;
virtual PColorPickerParent* virtual PColorPickerParent*
AllocPColorPickerParent(const nsString& aTitle, const nsString& aInitialColor) override; AllocPColorPickerParent(const nsString& aTitle,
virtual bool DeallocPColorPickerParent(PColorPickerParent* aColorPicker) override; const nsString& aInitialColor) override;
virtual bool
DeallocPColorPickerParent(PColorPickerParent* aColorPicker) override;
virtual PDocAccessibleParent* virtual PDocAccessibleParent*
AllocPDocAccessibleParent(PDocAccessibleParent*, const uint64_t&) override; AllocPDocAccessibleParent(PDocAccessibleParent*, const uint64_t&) override;
virtual bool DeallocPDocAccessibleParent(PDocAccessibleParent*) override; virtual bool DeallocPDocAccessibleParent(PDocAccessibleParent*) override;
virtual bool virtual bool
RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc, RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc,
PDocAccessibleParent* aParentDoc, PDocAccessibleParent* aParentDoc,
@ -270,59 +356,87 @@ public:
a11y::DocAccessibleParent* GetTopLevelDocAccessible() const; a11y::DocAccessibleParent* GetTopLevelDocAccessible() const;
void LoadURL(nsIURI* aURI); void LoadURL(nsIURI* aURI);
// XXX/cjones: it's not clear what we gain by hiding these // XXX/cjones: it's not clear what we gain by hiding these
// message-sending functions under a layer of indirection and // message-sending functions under a layer of indirection and
// eating the return values // eating the return values
void Show(const ScreenIntSize& size, bool aParentIsActive); void Show(const ScreenIntSize& aSize, bool aParentIsActive);
void UpdateDimensions(const nsIntRect& rect, const ScreenIntSize& size);
void UpdateDimensions(const nsIntRect& aRect, const ScreenIntSize& aSize);
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics); void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
void UIResolutionChanged(); void UIResolutionChanged();
void ThemeChanged(); void ThemeChanged();
void HandleAccessKey(nsTArray<uint32_t>& aCharCodes, void HandleAccessKey(nsTArray<uint32_t>& aCharCodes,
const bool& aIsTrusted, const bool& aIsTrusted,
const int32_t& aModifierMask); const int32_t& aModifierMask);
void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId,
const mozilla::CSSPoint& aDestination); const mozilla::CSSPoint& aDestination);
void AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration);
void AcknowledgeScrollUpdate(const ViewID& aScrollId,
const uint32_t& aScrollGeneration);
void HandleDoubleTap(const CSSPoint& aPoint, void HandleDoubleTap(const CSSPoint& aPoint,
Modifiers aModifiers, Modifiers aModifiers,
const ScrollableLayerGuid& aGuid); const ScrollableLayerGuid& aGuid);
void HandleSingleTap(const CSSPoint& aPoint, void HandleSingleTap(const CSSPoint& aPoint,
Modifiers aModifiers, Modifiers aModifiers,
const ScrollableLayerGuid& aGuid); const ScrollableLayerGuid& aGuid);
void HandleLongTap(const CSSPoint& aPoint, void HandleLongTap(const CSSPoint& aPoint,
Modifiers aModifiers, Modifiers aModifiers,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId); uint64_t aInputBlockId);
void NotifyAPZStateChange(ViewID aViewId, void NotifyAPZStateChange(ViewID aViewId,
APZStateChange aChange, APZStateChange aChange,
int aArg); int aArg);
void NotifyMouseScrollTestEvent(const ViewID& aScrollId, const nsString& aEvent);
void NotifyMouseScrollTestEvent(const ViewID& aScrollId,
const nsString& aEvent);
void NotifyFlushComplete(); void NotifyFlushComplete();
void Activate(); void Activate();
void Deactivate(); void Deactivate();
bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent); bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent);
void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset, void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset,
mozilla::WidgetEvent* aEvent); mozilla::WidgetEvent* aEvent);
LayoutDeviceToCSSScale GetLayoutDeviceToCSSScale(); LayoutDeviceToCSSScale GetLayoutDeviceToCSSScale();
virtual bool RecvRequestNativeKeyBindings(const mozilla::WidgetKeyboardEvent& aEvent, virtual bool
RecvRequestNativeKeyBindings(const mozilla::WidgetKeyboardEvent& aEvent,
MaybeNativeKeyBinding* aBindings) override; MaybeNativeKeyBinding* aBindings) override;
virtual bool RecvSynthesizeNativeKeyEvent(const int32_t& aNativeKeyboardLayout, virtual bool
RecvSynthesizeNativeKeyEvent(const int32_t& aNativeKeyboardLayout,
const int32_t& aNativeKeyCode, const int32_t& aNativeKeyCode,
const uint32_t& aModifierFlags, const uint32_t& aModifierFlags,
const nsString& aCharacters, const nsString& aCharacters,
const nsString& aUnmodifiedCharacters, const nsString& aUnmodifiedCharacters,
const uint64_t& aObserverId) override; const uint64_t& aObserverId) override;
virtual bool RecvSynthesizeNativeMouseEvent(const LayoutDeviceIntPoint& aPoint,
virtual bool
RecvSynthesizeNativeMouseEvent(const LayoutDeviceIntPoint& aPoint,
const uint32_t& aNativeMessage, const uint32_t& aNativeMessage,
const uint32_t& aModifierFlags, const uint32_t& aModifierFlags,
const uint64_t& aObserverId) override; const uint64_t& aObserverId) override;
virtual bool RecvSynthesizeNativeMouseMove(const LayoutDeviceIntPoint& aPoint,
virtual bool
RecvSynthesizeNativeMouseMove(const LayoutDeviceIntPoint& aPoint,
const uint64_t& aObserverId) override; const uint64_t& aObserverId) override;
virtual bool RecvSynthesizeNativeMouseScrollEvent(const LayoutDeviceIntPoint& aPoint,
virtual bool
RecvSynthesizeNativeMouseScrollEvent(const LayoutDeviceIntPoint& aPoint,
const uint32_t& aNativeMessage, const uint32_t& aNativeMessage,
const double& aDeltaX, const double& aDeltaX,
const double& aDeltaY, const double& aDeltaY,
@ -330,32 +444,55 @@ public:
const uint32_t& aModifierFlags, const uint32_t& aModifierFlags,
const uint32_t& aAdditionalFlags, const uint32_t& aAdditionalFlags,
const uint64_t& aObserverId) override; const uint64_t& aObserverId) override;
virtual bool RecvSynthesizeNativeTouchPoint(const uint32_t& aPointerId,
virtual bool
RecvSynthesizeNativeTouchPoint(const uint32_t& aPointerId,
const TouchPointerState& aPointerState, const TouchPointerState& aPointerState,
const ScreenIntPoint& aPointerScreenPoint, const ScreenIntPoint& aPointerScreenPoint,
const double& aPointerPressure, const double& aPointerPressure,
const uint32_t& aPointerOrientation, const uint32_t& aPointerOrientation,
const uint64_t& aObserverId) override; const uint64_t& aObserverId) override;
virtual bool RecvSynthesizeNativeTouchTap(const ScreenIntPoint& aPointerScreenPoint,
virtual bool
RecvSynthesizeNativeTouchTap(const ScreenIntPoint& aPointerScreenPoint,
const bool& aLongTap, const bool& aLongTap,
const uint64_t& aObserverId) override; const uint64_t& aObserverId) override;
virtual bool RecvClearNativeTouchSequence(const uint64_t& aObserverId) override;
virtual bool
RecvClearNativeTouchSequence(const uint64_t& aObserverId) override;
void SendMouseEvent(const nsAString& aType, float aX, float aY, void SendMouseEvent(const nsAString& aType, float aX, float aY,
int32_t aButton, int32_t aClickCount, int32_t aButton, int32_t aClickCount,
int32_t aModifiers, bool aIgnoreRootScrollFrame); int32_t aModifiers, bool aIgnoreRootScrollFrame);
void SendKeyEvent(const nsAString& aType, int32_t aKeyCode, void SendKeyEvent(const nsAString& aType, int32_t aKeyCode,
int32_t aCharCode, int32_t aModifiers, int32_t aCharCode, int32_t aModifiers,
bool aPreventDefault); bool aPreventDefault);
bool SendRealMouseEvent(mozilla::WidgetMouseEvent& event); bool SendRealMouseEvent(mozilla::WidgetMouseEvent& event);
bool SendRealDragEvent(mozilla::WidgetDragEvent& aEvent, uint32_t aDragAction,
bool SendRealDragEvent(mozilla::WidgetDragEvent& aEvent,
uint32_t aDragAction,
uint32_t aDropEffect); uint32_t aDropEffect);
bool SendMouseWheelEvent(mozilla::WidgetWheelEvent& event); bool SendMouseWheelEvent(mozilla::WidgetWheelEvent& event);
bool SendRealKeyEvent(mozilla::WidgetKeyboardEvent& event); bool SendRealKeyEvent(mozilla::WidgetKeyboardEvent& event);
bool SendRealTouchEvent(WidgetTouchEvent& event); bool SendRealTouchEvent(WidgetTouchEvent& event);
bool SendHandleSingleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
bool SendHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId); bool SendHandleSingleTap(const CSSPoint& aPoint,
bool SendHandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid); const Modifiers& aModifiers,
const ScrollableLayerGuid& aGuid);
bool SendHandleLongTap(const CSSPoint& aPoint,
const Modifiers& aModifiers,
const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId);
bool SendHandleDoubleTap(const CSSPoint& aPoint,
const Modifiers& aModifiers,
const ScrollableLayerGuid& aGuid);
virtual PDocumentRendererParent* virtual PDocumentRendererParent*
AllocPDocumentRendererParent(const nsRect& documentRect, AllocPDocumentRendererParent(const nsRect& documentRect,
@ -364,16 +501,18 @@ public:
const uint32_t& renderFlags, const uint32_t& renderFlags,
const bool& flushLayout, const bool& flushLayout,
const nsIntSize& renderSize) override; const nsIntSize& renderSize) override;
virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor) override;
virtual bool
DeallocPDocumentRendererParent(PDocumentRendererParent* actor) override;
virtual PFilePickerParent* virtual PFilePickerParent*
AllocPFilePickerParent(const nsString& aTitle, AllocPFilePickerParent(const nsString& aTitle,
const int16_t& aMode) override; const int16_t& aMode) override;
virtual bool DeallocPFilePickerParent(PFilePickerParent* actor) override; virtual bool DeallocPFilePickerParent(PFilePickerParent* actor) override;
virtual PIndexedDBPermissionRequestParent* virtual PIndexedDBPermissionRequestParent*
AllocPIndexedDBPermissionRequestParent(const Principal& aPrincipal) AllocPIndexedDBPermissionRequestParent(const Principal& aPrincipal) override;
override;
virtual bool virtual bool
RecvPIndexedDBPermissionRequestConstructor( RecvPIndexedDBPermissionRequestConstructor(
@ -394,17 +533,24 @@ public:
NS_DECL_NSIWEBBROWSERPERSISTABLE NS_DECL_NSIWEBBROWSERPERSISTABLE
bool HandleQueryContentEvent(mozilla::WidgetQueryContentEvent& aEvent); bool HandleQueryContentEvent(mozilla::WidgetQueryContentEvent& aEvent);
bool SendCompositionEvent(mozilla::WidgetCompositionEvent& event); bool SendCompositionEvent(mozilla::WidgetCompositionEvent& event);
bool SendSelectionEvent(mozilla::WidgetSelectionEvent& event); bool SendSelectionEvent(mozilla::WidgetSelectionEvent& event);
static TabParent* GetFrom(nsFrameLoader* aFrameLoader); static TabParent* GetFrom(nsFrameLoader* aFrameLoader);
static TabParent* GetFrom(nsIFrameLoader* aFrameLoader); static TabParent* GetFrom(nsIFrameLoader* aFrameLoader);
static TabParent* GetFrom(nsITabParent* aTabParent); static TabParent* GetFrom(nsITabParent* aTabParent);
static TabParent* GetFrom(PBrowserParent* aTabParent); static TabParent* GetFrom(PBrowserParent* aTabParent);
static TabParent* GetFrom(nsIContent* aContent); static TabParent* GetFrom(nsIContent* aContent);
static TabId GetTabIdFrom(nsIDocShell* docshell); static TabId GetTabIdFrom(nsIDocShell* docshell);
nsIContentParent* Manager() { return mManager; } nsIContentParent* Manager() const { return mManager; }
/** /**
* Let managees query if Destroy() is already called so they don't send out * Let managees query if Destroy() is already called so they don't send out
@ -425,9 +571,12 @@ public:
* Native widget remoting protocol for use with windowed plugins with e10s. * Native widget remoting protocol for use with windowed plugins with e10s.
*/ */
virtual PPluginWidgetParent* AllocPPluginWidgetParent() override; virtual PPluginWidgetParent* AllocPPluginWidgetParent() override;
virtual bool DeallocPPluginWidgetParent(PPluginWidgetParent* aActor) override;
virtual bool
DeallocPPluginWidgetParent(PPluginWidgetParent* aActor) override;
void SetInitedByParent() { mInitedByParent = true; } void SetInitedByParent() { mInitedByParent = true; }
bool IsInitedByParent() const { return mInitedByParent; } bool IsInitedByParent() const { return mInitedByParent; }
static TabParent* GetNextTabParent(); static TabParent* GetNextTabParent();
@ -437,8 +586,11 @@ public:
// See nsIFrameLoader requestNotifyLayerTreeReady. // See nsIFrameLoader requestNotifyLayerTreeReady.
bool RequestNotifyLayerTreeReady(); bool RequestNotifyLayerTreeReady();
bool RequestNotifyLayerTreeCleared(); bool RequestNotifyLayerTreeCleared();
bool LayerTreeUpdate(bool aActive); bool LayerTreeUpdate(bool aActive);
void SwapLayerTreeObservers(TabParent* aOther); void SwapLayerTreeObservers(TabParent* aOther);
virtual bool virtual bool
@ -453,6 +605,7 @@ public:
void TakeDragVisualization(RefPtr<mozilla::gfx::SourceSurface>& aSurface, void TakeDragVisualization(RefPtr<mozilla::gfx::SourceSurface>& aSurface,
int32_t& aDragAreaX, int32_t& aDragAreaY); int32_t& aDragAreaX, int32_t& aDragAreaY);
layout::RenderFrameParent* GetRenderFrame(); layout::RenderFrameParent* GetRenderFrame();
// Called by HttpChannelParent. The function may use a new process to // Called by HttpChannelParent. The function may use a new process to
@ -485,6 +638,7 @@ protected:
nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow; nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
virtual PRenderFrameParent* AllocPRenderFrameParent() override; virtual PRenderFrameParent* AllocPRenderFrameParent() override;
virtual bool DeallocPRenderFrameParent(PRenderFrameParent* aFrame) override; virtual bool DeallocPRenderFrameParent(PRenderFrameParent* aFrame) override;
virtual bool RecvRemotePaintIsReady() override; virtual bool RecvRemotePaintIsReady() override;
@ -519,7 +673,10 @@ protected:
private: private:
void DestroyInternal(); void DestroyInternal();
already_AddRefed<nsFrameLoader> GetFrameLoader(bool aUseCachedFrameLoaderAfterDestroy = false) const;
already_AddRefed<nsFrameLoader>
GetFrameLoader(bool aUseCachedFrameLoaderAfterDestroy = false) const;
RefPtr<nsIContentParent> mManager; RefPtr<nsIContentParent> mManager;
void TryCacheDPIAndScale(); void TryCacheDPIAndScale();
@ -542,6 +699,7 @@ private:
void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid, void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId, uint64_t* aOutInputBlockId,
nsEventStatus* aOutApzResponse); nsEventStatus* aOutApzResponse);
// When true, we've initiated normal shutdown and notified our managing PContent. // When true, we've initiated normal shutdown and notified our managing PContent.
bool mMarkedDestroying; bool mMarkedDestroying;
// When true, the TabParent is invalid and we should not send IPC messages anymore. // When true, the TabParent is invalid and we should not send IPC messages anymore.
@ -645,6 +803,7 @@ private:
DebugOnly<int32_t> mActiveSupressDisplayportCount; DebugOnly<int32_t> mActiveSupressDisplayportCount;
ShowInfo GetShowInfo(); ShowInfo GetShowInfo();
private: private:
// This is used when APZ needs to find the TabParent associated with a layer // This is used when APZ needs to find the TabParent associated with a layer
// to dispatch events. // to dispatch events.
@ -652,6 +811,7 @@ private:
static LayerToTabParentTable* sLayerToTabParentTable; static LayerToTabParentTable* sLayerToTabParentTable;
static void AddTabParentToTable(uint64_t aLayersId, TabParent* aTabParent); static void AddTabParentToTable(uint64_t aLayersId, TabParent* aTabParent);
static void RemoveTabParentFromTable(uint64_t aLayersId); static void RemoveTabParentFromTable(uint64_t aLayersId);
public: public:
@ -693,4 +853,4 @@ private:
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif #endif // mozilla_tabs_TabParent_h

Просмотреть файл

@ -51,8 +51,8 @@ public:
BlobChild* GetOrCreateActorForBlob(Blob* aBlob); BlobChild* GetOrCreateActorForBlob(Blob* aBlob);
BlobChild* GetOrCreateActorForBlobImpl(BlobImpl* aImpl); BlobChild* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
virtual PBlobChild* SendPBlobConstructor( virtual PBlobChild*
PBlobChild* aActor, SendPBlobConstructor(PBlobChild* aActor,
const BlobConstructorParams& aParams) = 0; const BlobConstructorParams& aParams) = 0;
virtual bool virtual bool

Просмотреть файл

@ -55,18 +55,16 @@ public:
BlobParent* GetOrCreateActorForBlob(Blob* aBlob); BlobParent* GetOrCreateActorForBlob(Blob* aBlob);
BlobParent* GetOrCreateActorForBlobImpl(BlobImpl* aImpl); BlobParent* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
virtual ContentParentId ChildID() = 0; virtual ContentParentId ChildID() const = 0;
virtual bool IsForApp() = 0; virtual bool IsForApp() const = 0;
virtual bool IsForBrowser() = 0; virtual bool IsForBrowser() const = 0;
MOZ_WARN_UNUSED_RESULT MOZ_WARN_UNUSED_RESULT virtual PBlobParent*
virtual PBlobParent* SendPBlobConstructor( SendPBlobConstructor(PBlobParent* aActor,
PBlobParent* aActor,
const BlobConstructorParams& aParams) = 0; const BlobConstructorParams& aParams) = 0;
MOZ_WARN_UNUSED_RESULT MOZ_WARN_UNUSED_RESULT virtual PBrowserParent*
virtual PBrowserParent* SendPBrowserConstructor( SendPBrowserConstructor(PBrowserParent* actor,
PBrowserParent* actor,
const TabId& aTabId, const TabId& aTabId,
const IPCTabContext& context, const IPCTabContext& context,
const uint32_t& chromeFlags, const uint32_t& chromeFlags,
@ -74,9 +72,12 @@ public:
const bool& aIsForApp, const bool& aIsForApp,
const bool& aIsForBrowser) = 0; const bool& aIsForBrowser) = 0;
virtual bool IsContentParent() { return false; } virtual bool IsContentParent() const { return false; }
ContentParent* AsContentParent(); ContentParent* AsContentParent();
virtual bool IsContentBridgeParent() { return false; }
virtual bool IsContentBridgeParent() const { return false; }
ContentBridgeParent* AsContentBridgeParent(); ContentBridgeParent* AsContentBridgeParent();
protected: // methods protected: // methods