Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "mozilla/dom/DOMPoint.h"
8 #include "mozilla/dom/DOMPointBinding.h"
9 #include "mozilla/dom/BindingDeclarations.h"
10 #include "nsAutoPtr.h"
12 using namespace mozilla;
13 using namespace mozilla::dom;
15 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMPoint, mParent)
17 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPoint, AddRef)
18 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPoint, Release)
20 already_AddRefed<DOMPoint>
21 DOMPoint::Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams,
22 ErrorResult& aRV)
23 {
24 nsRefPtr<DOMPoint> obj =
25 new DOMPoint(aGlobal.GetAsSupports(), aParams.mX, aParams.mY,
26 aParams.mZ, aParams.mW);
27 return obj.forget();
28 }
30 already_AddRefed<DOMPoint>
31 DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY,
32 double aZ, double aW, ErrorResult& aRV)
33 {
34 nsRefPtr<DOMPoint> obj =
35 new DOMPoint(aGlobal.GetAsSupports(), aX, aY, aZ, aW);
36 return obj.forget();
37 }
39 JSObject*
40 DOMPoint::WrapObject(JSContext* aCx)
41 {
42 return DOMPointBinding::Wrap(aCx, this);
43 }