Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 : * This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #include "ClientContainerLayer.h"
7 : #include "ClientLayerManager.h" // for ClientLayerManager, etc
8 : #include "mozilla/mozalloc.h" // for operator new
9 : #include "nsCOMPtr.h" // for already_AddRefed
10 : #include "nsISupportsImpl.h" // for Layer::AddRef, etc
11 :
12 : namespace mozilla {
13 : namespace layers {
14 :
15 : already_AddRefed<ContainerLayer>
16 4 : ClientLayerManager::CreateContainerLayer()
17 : {
18 4 : NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
19 : RefPtr<ClientContainerLayer> layer =
20 8 : new ClientContainerLayer(this);
21 4 : CREATE_SHADOW(Container);
22 8 : return layer.forget();
23 : }
24 :
25 : already_AddRefed<RefLayer>
26 1 : ClientLayerManager::CreateRefLayer()
27 : {
28 1 : NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
29 : RefPtr<ClientRefLayer> layer =
30 2 : new ClientRefLayer(this);
31 1 : CREATE_SHADOW(Ref);
32 2 : return layer.forget();
33 : }
34 :
35 : } // namespace layers
36 : } // namespace mozilla
|