Line data Source code
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/. */
6 :
7 : #include "mozilla/dom/PaintRequest.h"
8 :
9 : #include "mozilla/dom/PaintRequestBinding.h"
10 : #include "mozilla/dom/PaintRequestListBinding.h"
11 : #include "mozilla/dom/DOMRect.h"
12 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : /******************************************************************************
17 : * mozilla::dom::PaintRequest
18 : *****************************************************************************/
19 :
20 0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PaintRequest, mParent)
21 :
22 0 : NS_INTERFACE_TABLE_HEAD(PaintRequest)
23 0 : NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
24 0 : NS_INTERFACE_TABLE(PaintRequest, nsIDOMPaintRequest)
25 0 : NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(PaintRequest)
26 0 : NS_INTERFACE_MAP_END
27 :
28 0 : NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequest)
29 0 : NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequest)
30 :
31 : /* virtual */ JSObject*
32 0 : PaintRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
33 : {
34 0 : return PaintRequestBinding::Wrap(aCx, this, aGivenProto);
35 : }
36 :
37 : already_AddRefed<DOMRect>
38 0 : PaintRequest::ClientRect()
39 : {
40 0 : RefPtr<DOMRect> clientRect = new DOMRect(this);
41 0 : clientRect->SetLayoutRect(mRequest);
42 0 : return clientRect.forget();
43 : }
44 :
45 : NS_IMETHODIMP
46 0 : PaintRequest::GetClientRect(nsIDOMClientRect** aResult)
47 : {
48 0 : RefPtr<DOMRect> clientRect = ClientRect();
49 0 : clientRect.forget(aResult);
50 0 : return NS_OK;
51 : }
52 :
53 : NS_IMETHODIMP
54 0 : PaintRequest::GetXPCOMReason(nsAString& aResult)
55 : {
56 0 : GetReason(aResult);
57 0 : return NS_OK;
58 : }
59 :
60 : /******************************************************************************
61 : * mozilla::dom::PaintRequestList
62 : *****************************************************************************/
63 :
64 0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PaintRequestList, mParent)
65 :
66 0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PaintRequestList)
67 0 : NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
68 0 : NS_INTERFACE_MAP_ENTRY(nsISupports)
69 0 : NS_INTERFACE_MAP_END
70 :
71 0 : NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequestList)
72 0 : NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequestList)
73 :
74 : JSObject*
75 0 : PaintRequestList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
76 : {
77 0 : return PaintRequestListBinding::Wrap(aCx, this, aGivenProto);
78 : }
79 :
80 : } // namespace dom
81 9 : } // namespace mozilla
|