gecko/dom/events/nsPaintRequest.cpp

70 lines
1.9 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 04:12:37 -07:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsPaintRequest.h"
#include "mozilla/dom/PaintRequestBinding.h"
#include "mozilla/dom/PaintRequestListBinding.h"
#include "mozilla/dom/DOMRect.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequest, mParent)
NS_INTERFACE_TABLE_HEAD(nsPaintRequest)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_TABLE1(nsPaintRequest, nsIDOMPaintRequest)
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsPaintRequest)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequest)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequest)
/* virtual */ JSObject*
nsPaintRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
return PaintRequestBinding::Wrap(aCx, aScope, this);
}
already_AddRefed<DOMRect>
nsPaintRequest::ClientRect()
{
nsRefPtr<DOMRect> clientRect = new DOMRect(this);
clientRect->SetLayoutRect(mRequest.mRect);
return clientRect.forget();
}
NS_IMETHODIMP
nsPaintRequest::GetClientRect(nsIDOMClientRect** aResult)
{
nsRefPtr<DOMRect> clientRect = ClientRect();
clientRect.forget(aResult);
return NS_OK;
}
NS_IMETHODIMP
nsPaintRequest::GetXPCOMReason(nsAString& aResult)
{
GetReason(aResult);
return NS_OK;
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequestList, mParent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsPaintRequestList)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequestList)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequestList)
JSObject*
nsPaintRequestList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
return PaintRequestListBinding::Wrap(aCx, aScope, this);
}