michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "ClientContainerLayer.h" michael@0: #include "ClientLayerManager.h" // for ClientLayerManager, etc michael@0: #include "mozilla/mozalloc.h" // for operator new michael@0: #include "nsAutoPtr.h" // for nsRefPtr michael@0: #include "nsCOMPtr.h" // for already_AddRefed michael@0: #include "nsISupportsImpl.h" // for Layer::AddRef, etc michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: michael@0: already_AddRefed michael@0: ClientLayerManager::CreateContainerLayer() michael@0: { michael@0: NS_ASSERTION(InConstruction(), "Only allowed in construction phase"); michael@0: nsRefPtr layer = michael@0: new ClientContainerLayer(this); michael@0: CREATE_SHADOW(Container); michael@0: return layer.forget(); michael@0: } michael@0: michael@0: already_AddRefed michael@0: ClientLayerManager::CreateRefLayer() michael@0: { michael@0: NS_ASSERTION(InConstruction(), "Only allowed in construction phase"); michael@0: nsRefPtr layer = michael@0: new ClientRefLayer(this); michael@0: CREATE_SHADOW(Ref); michael@0: return layer.forget(); michael@0: } michael@0: michael@0: } michael@0: }