layout/ipc/RenderFrameChild.cpp

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim: sw=2 ts=8 et :
michael@0 3 */
michael@0 4 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 7
michael@0 8 #include "RenderFrameChild.h"
michael@0 9 #include "mozilla/layers/LayerTransactionChild.h"
michael@0 10
michael@0 11 using mozilla::layers::PLayerTransactionChild;
michael@0 12 using mozilla::layers::LayerTransactionChild;
michael@0 13
michael@0 14 namespace mozilla {
michael@0 15 namespace layout {
michael@0 16
michael@0 17 void
michael@0 18 RenderFrameChild::Destroy()
michael@0 19 {
michael@0 20 size_t numChildren = ManagedPLayerTransactionChild().Length();
michael@0 21 NS_ABORT_IF_FALSE(0 == numChildren || 1 == numChildren,
michael@0 22 "render frame must only have 0 or 1 layer forwarder");
michael@0 23
michael@0 24 if (numChildren) {
michael@0 25 LayerTransactionChild* layers =
michael@0 26 static_cast<LayerTransactionChild*>(ManagedPLayerTransactionChild()[0]);
michael@0 27 layers->Destroy();
michael@0 28 // |layers| was just deleted, take care
michael@0 29 }
michael@0 30
michael@0 31 Send__delete__(this);
michael@0 32 // WARNING: |this| is dead, hands off
michael@0 33 }
michael@0 34
michael@0 35 PLayerTransactionChild*
michael@0 36 RenderFrameChild::AllocPLayerTransactionChild()
michael@0 37 {
michael@0 38 LayerTransactionChild* c = new LayerTransactionChild();
michael@0 39 c->AddIPDLReference();
michael@0 40 return c;
michael@0 41 }
michael@0 42
michael@0 43 bool
michael@0 44 RenderFrameChild::DeallocPLayerTransactionChild(PLayerTransactionChild* aLayers)
michael@0 45 {
michael@0 46 static_cast<LayerTransactionChild*>(aLayers)->ReleaseIPDLReference();
michael@0 47 return true;
michael@0 48 }
michael@0 49
michael@0 50 } // namespace layout
michael@0 51 } // namespace mozilla

mercurial