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 "mozilla/dom/PaintRequest.h" michael@0: michael@0: #include "mozilla/dom/PaintRequestBinding.h" michael@0: #include "mozilla/dom/PaintRequestListBinding.h" michael@0: #include "mozilla/dom/DOMRect.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: /****************************************************************************** michael@0: * mozilla::dom::PaintRequest michael@0: *****************************************************************************/ michael@0: michael@0: NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(PaintRequest, mParent) michael@0: michael@0: NS_INTERFACE_TABLE_HEAD(PaintRequest) michael@0: NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY michael@0: NS_INTERFACE_TABLE(PaintRequest, nsIDOMPaintRequest) michael@0: NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(PaintRequest) michael@0: NS_INTERFACE_MAP_END michael@0: michael@0: NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequest) michael@0: NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequest) michael@0: michael@0: /* virtual */ JSObject* michael@0: PaintRequest::WrapObject(JSContext* aCx) michael@0: { michael@0: return PaintRequestBinding::Wrap(aCx, this); michael@0: } michael@0: michael@0: already_AddRefed michael@0: PaintRequest::ClientRect() michael@0: { michael@0: nsRefPtr clientRect = new DOMRect(this); michael@0: clientRect->SetLayoutRect(mRequest.mRect); michael@0: return clientRect.forget(); michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: PaintRequest::GetClientRect(nsIDOMClientRect** aResult) michael@0: { michael@0: nsRefPtr clientRect = ClientRect(); michael@0: clientRect.forget(aResult); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: PaintRequest::GetXPCOMReason(nsAString& aResult) michael@0: { michael@0: GetReason(aResult); michael@0: return NS_OK; michael@0: } michael@0: michael@0: /****************************************************************************** michael@0: * mozilla::dom::PaintRequestList michael@0: *****************************************************************************/ michael@0: michael@0: NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(PaintRequestList, mParent) michael@0: michael@0: NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PaintRequestList) michael@0: NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY michael@0: NS_INTERFACE_MAP_ENTRY(nsISupports) michael@0: NS_INTERFACE_MAP_END michael@0: michael@0: NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequestList) michael@0: NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequestList) michael@0: michael@0: JSObject* michael@0: PaintRequestList::WrapObject(JSContext* aCx) michael@0: { michael@0: return PaintRequestListBinding::Wrap(aCx, this); michael@0: } michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla