Bug 1356289 - Part 2. Make gfx use the new SharedMemory::SetHandle API. r=jrmuizel

This commit is contained in:
Andrew Osmond 2017-04-18 12:25:00 -04:00
Родитель 5c88ddfaa2
Коммит 164b45b6a8
1 изменённых файлов: 5 добавлений и 3 удалений

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

@ -654,7 +654,7 @@ CompositorBridgeChild::SharedFrameMetricsData::SharedFrameMetricsData(
, mAPZCId(aAPZCId)
{
mBuffer = new ipc::SharedMemoryBasic;
mBuffer->SetHandle(metrics);
mBuffer->SetHandle(metrics, ipc::SharedMemory::RightsReadOnly);
mBuffer->Map(sizeof(FrameMetrics));
mMutex = new CrossProcessMutex(handle);
MOZ_COUNT_CTOR(SharedFrameMetricsData);
@ -672,7 +672,8 @@ CompositorBridgeChild::SharedFrameMetricsData::~SharedFrameMetricsData()
void
CompositorBridgeChild::SharedFrameMetricsData::CopyFrameMetrics(FrameMetrics* aFrame)
{
FrameMetrics* frame = static_cast<FrameMetrics*>(mBuffer->memory());
const FrameMetrics* frame =
static_cast<const FrameMetrics*>(mBuffer->memory());
MOZ_ASSERT(frame);
mMutex->Lock();
*aFrame = *frame;
@ -682,7 +683,8 @@ CompositorBridgeChild::SharedFrameMetricsData::CopyFrameMetrics(FrameMetrics* aF
FrameMetrics::ViewID
CompositorBridgeChild::SharedFrameMetricsData::GetViewID()
{
FrameMetrics* frame = static_cast<FrameMetrics*>(mBuffer->memory());
const FrameMetrics* frame =
static_cast<const FrameMetrics*>(mBuffer->memory());
MOZ_ASSERT(frame);
// Not locking to read of mScrollId since it should not change after being
// initially set.