Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
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