1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "ClientContainerLayer.h"
8 #include "ClientLayerManager.h" // for ClientLayerManager, etc
9 #include "mozilla/mozalloc.h" // for operator new
10 #include "nsCOMPtr.h" // for already_AddRefed
11 #include "nsISupportsImpl.h" // for Layer::AddRef, etc
16 already_AddRefed
<ContainerLayer
> ClientLayerManager::CreateContainerLayer() {
17 NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
18 RefPtr
<ClientContainerLayer
> layer
= new ClientContainerLayer(this);
19 CREATE_SHADOW(Container
);
20 return layer
.forget();
23 already_AddRefed
<RefLayer
> ClientLayerManager::CreateRefLayer() {
24 NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
25 RefPtr
<ClientRefLayer
> layer
= new ClientRefLayer(this);
27 return layer
.forget();
31 } // namespace mozilla