Bug 1350638 - Remove sync GetCompositorOptions call in TabChild::InitRenderingState. r=dvander

The goal of this patch is to remove the call to the sync IPC
GetCompositorOptions message from TabChild::InitRenderingState. In order
to this, we have InitRenderingState take the CompositorOptions as an
argument instead, and propagate that backwards through the call sites.
Eventually we can propagate it back to a set of already-sync IPC
messages in PCompositorBridge that are used during layers id
registration (NotifyChildCreated, NotifyChildRecreated, etc.). Therefore
this patch effectively piggybacks the CompositorOptions sync IPC onto
these pre-existing sync IPC messages.

The one exception is when we propagate it back to the AdoptChild call.
If this message were sync we could just use it like the others and have
it return a CompositorOptions. However, it is async, so instead we add
another call to GetCompositorOptions here temporarily. This will be
removed in the next patch.

MozReview-Commit-ID: AtdYOuXmHu4
This commit is contained in:
Kartikaya Gupta
2017-04-09 17:30:27 -04:00
parent 97aa38e1ee
commit 1bcda612ce
20 changed files with 91 additions and 41 deletions

View File

@@ -250,7 +250,8 @@ CrossProcessCompositorBridgeParent::DeallocPWebRenderBridgeParent(PWebRenderBrid
}
mozilla::ipc::IPCResult
CrossProcessCompositorBridgeParent::RecvNotifyChildCreated(const uint64_t& child)
CrossProcessCompositorBridgeParent::RecvNotifyChildCreated(const uint64_t& child,
CompositorOptions* aOptions)
{
MonitorAutoLock lock(*sIndirectLayerTreesLock);
for (LayerTreeMap::iterator it = sIndirectLayerTrees.begin();
@@ -258,6 +259,7 @@ CrossProcessCompositorBridgeParent::RecvNotifyChildCreated(const uint64_t& child
CompositorBridgeParent::LayerTreeState* lts = &it->second;
if (lts->mParent && lts->mCrossProcessParent == this) {
lts->mParent->NotifyChildCreated(child);
*aOptions = lts->mParent->GetOptions();
return IPC_OK();
}
}
@@ -265,7 +267,9 @@ CrossProcessCompositorBridgeParent::RecvNotifyChildCreated(const uint64_t& child
}
mozilla::ipc::IPCResult
CrossProcessCompositorBridgeParent::RecvMapAndNotifyChildCreated(const uint64_t& child, const base::ProcessId& pid)
CrossProcessCompositorBridgeParent::RecvMapAndNotifyChildCreated(const uint64_t& child,
const base::ProcessId& pid,
CompositorOptions* aOptions)
{
// This can only be called from the browser process, as the mapping
// ensures proper window ownership of layer trees.