1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/layers/ipc/PLayer.ipdl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * vim: sw=2 ts=8 et : 1.6 + */ 1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +include protocol PLayerTransaction; 1.12 + 1.13 +namespace mozilla { 1.14 +namespace layers { 1.15 + 1.16 +/** 1.17 + * PLayer represents a layer shared across thread contexts. 1.18 + */ 1.19 + 1.20 +async protocol PLayer { 1.21 + manager PLayerTransaction; 1.22 + 1.23 + /** 1.24 + * OWNERSHIP MODEL 1.25 + * 1.26 + * Roughly speaking, the child side "actually owns" a Layer. This 1.27 + * is because the parent side is the "shadow"; when the child 1.28 + * releases a Layer, the parent's shadow is no longer meaningful. 1.29 + * 1.30 + * To implement this model, the concrete PLayerParent keeps a 1.31 + * strong ref to its Layer, so the Layer's lifetime is bound to 1.32 + * the PLayerParent's. Then, when the Layer's refcount hits 0 on 1.33 + * the child side, we send __delete__() from the child to parent. 1.34 + * The parent then releases its Layer, which results in the Layer 1.35 + * being deleted "soon" (usually immediately). 1.36 + */ 1.37 +parent: 1.38 + async __delete__(); 1.39 +}; 1.40 + 1.41 +} // layers 1.42 +} // mozilla