Bug 1388309 P3 - pass the decodeVideoOnGPUProcess info through PContent actors;
MozReview-Commit-ID: FSgAvIr2Coy
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1271,42 +1271,45 @@ ContentChild::RecvInitProcessHangMonitor
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentChild::RecvInitRendering(Endpoint<PCompositorManagerChild>&& aCompositor,
Endpoint<PImageBridgeChild>&& aImageBridge,
Endpoint<PVRManagerChild>&& aVRBridge,
Endpoint<PVideoDecoderManagerChild>&& aVideoManager,
- nsTArray<uint32_t>&& namespaces)
+ nsTArray<uint32_t>&& namespaces,
+ const bool& aDecodeVideoOnGpuProcess)
{
MOZ_ASSERT(namespaces.Length() == 3);
if (!CompositorManagerChild::Init(Move(aCompositor), namespaces[0])) {
return IPC_FAIL_NO_REASON(this);
}
if (!CompositorManagerChild::CreateContentCompositorBridge(namespaces[1])) {
return IPC_FAIL_NO_REASON(this);
}
if (!ImageBridgeChild::InitForContent(Move(aImageBridge), namespaces[2])) {
return IPC_FAIL_NO_REASON(this);
}
if (!gfx::VRManagerChild::InitForContent(Move(aVRBridge))) {
return IPC_FAIL_NO_REASON(this);
}
- VideoDecoderManagerChild::InitForContent(Move(aVideoManager));
+ VideoDecoderManagerChild::InitForContent(Move(aVideoManager),
+ aDecodeVideoOnGpuProcess);
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentChild::RecvReinitRendering(Endpoint<PCompositorManagerChild>&& aCompositor,
Endpoint<PImageBridgeChild>&& aImageBridge,
Endpoint<PVRManagerChild>&& aVRBridge,
Endpoint<PVideoDecoderManagerChild>&& aVideoManager,
- nsTArray<uint32_t>&& namespaces)
+ nsTArray<uint32_t>&& namespaces,
+ const bool& aDecodeVideoOnGpuProcess)
{
MOZ_ASSERT(namespaces.Length() == 3);
nsTArray<RefPtr<TabChild>> tabs = TabChild::GetAll();
// Zap all the old layer managers we have lying around.
for (const auto& tabChild : tabs) {
if (tabChild->LayersId()) {
tabChild->InvalidateLayers();
@@ -1330,17 +1333,18 @@ ContentChild::RecvReinitRendering(Endpoi
// Establish new PLayerTransactions.
for (const auto& tabChild : tabs) {
if (tabChild->LayersId()) {
tabChild->ReinitRendering();
}
}
- VideoDecoderManagerChild::InitForContent(Move(aVideoManager));
+ VideoDecoderManagerChild::InitForContent(Move(aVideoManager),
+ aDecodeVideoOnGpuProcess);
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentChild::RecvAudioDefaultDeviceChange()
{
#ifdef XP_WIN
audio::AudioNotificationReceiver::NotifyDefaultDeviceChanged();
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -179,25 +179,27 @@ public:
RecvInitProcessHangMonitor(Endpoint<PProcessHangMonitorChild>&& aHangMonitor) override;
mozilla::ipc::IPCResult
RecvInitRendering(
Endpoint<PCompositorManagerChild>&& aCompositor,
Endpoint<PImageBridgeChild>&& aImageBridge,
Endpoint<PVRManagerChild>&& aVRBridge,
Endpoint<PVideoDecoderManagerChild>&& aVideoManager,
- nsTArray<uint32_t>&& namespaces) override;
+ nsTArray<uint32_t>&& namespaces,
+ const bool& aDecodeVideoOnGpuProcess) override;
mozilla::ipc::IPCResult
RecvReinitRendering(
Endpoint<PCompositorManagerChild>&& aCompositor,
Endpoint<PImageBridgeChild>&& aImageBridge,
Endpoint<PVRManagerChild>&& aVRBridge,
Endpoint<PVideoDecoderManagerChild>&& aVideoManager,
- nsTArray<uint32_t>&& namespaces) override;
+ nsTArray<uint32_t>&& namespaces,
+ const bool& aDecodeVideoOnGpuProcess) override;
virtual mozilla::ipc::IPCResult RecvAudioDefaultDeviceChange() override;
mozilla::ipc::IPCResult RecvReinitRenderingForDeviceReset() override;
virtual mozilla::ipc::IPCResult RecvSetProcessSandbox(const MaybeFileDesc& aBroker) override;
virtual PBrowserChild* AllocPBrowserChild(const TabId& aTabId,
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2316,17 +2316,18 @@ ContentParent::InitInternal(ProcessPrior
&namespaces);
MOZ_ASSERT(opened);
Unused << SendInitRendering(
Move(compositor),
Move(imageBridge),
Move(vrBridge),
Move(videoManager),
- namespaces);
+ namespaces,
+ gpm->DecodeVideoOnGpuProcess());
gpm->AddListener(this);
}
}
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
if (sheetService) {
// This looks like a lot of work, but in a normal browser session we just
@@ -2483,17 +2484,18 @@ ContentParent::OnCompositorUnexpectedShu
&namespaces);
MOZ_ASSERT(opened);
Unused << SendReinitRendering(
Move(compositor),
Move(imageBridge),
Move(vrBridge),
Move(videoManager),
- namespaces);
+ namespaces,
+ gpm->DecodeVideoOnGpuProcess());
}
void
ContentParent::OnCompositorDeviceReset()
{
Unused << SendReinitRenderingForDeviceReset();
}
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -344,27 +344,29 @@ child:
async InitProfiler(Endpoint<PProfilerChild> aEndpoint);
// Give the content process its endpoints to the compositor.
async InitRendering(
Endpoint<PCompositorManagerChild> compositor,
Endpoint<PImageBridgeChild> imageBridge,
Endpoint<PVRManagerChild> vr,
Endpoint<PVideoDecoderManagerChild> video,
- uint32_t[] namespaces);
+ uint32_t[] namespaces,
+ bool decodeVideoOnGpuProcess);
// Re-create the rendering stack using the given endpoints. This is sent
// after the compositor process has crashed. The new endpoints may be to a
// newly launched GPU process, or the compositor thread of the UI process.
async ReinitRendering(
Endpoint<PCompositorManagerChild> compositor,
Endpoint<PImageBridgeChild> bridge,
Endpoint<PVRManagerChild> vr,
Endpoint<PVideoDecoderManagerChild> video,
- uint32_t[] namespaces);
+ uint32_t[] namespaces,
+ bool decodeVideoOnGpuProcess);
async AudioDefaultDeviceChange();
// Re-create the rendering stack for a device reset.
async ReinitRenderingForDeviceReset();
/**
* Enable system-level sandboxing features, if available. Can