layout/ipc/RenderFrameChild.cpp

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial