content/base/src/DOMPoint.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/src/DOMPoint.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "mozilla/dom/DOMPoint.h"
    1.10 +
    1.11 +#include "mozilla/dom/DOMPointBinding.h"
    1.12 +#include "mozilla/dom/BindingDeclarations.h"
    1.13 +#include "nsAutoPtr.h"
    1.14 +
    1.15 +using namespace mozilla;
    1.16 +using namespace mozilla::dom;
    1.17 +
    1.18 +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMPoint, mParent)
    1.19 +
    1.20 +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPoint, AddRef)
    1.21 +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPoint, Release)
    1.22 +
    1.23 +already_AddRefed<DOMPoint>
    1.24 +DOMPoint::Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams,
    1.25 +                      ErrorResult& aRV)
    1.26 +{
    1.27 +  nsRefPtr<DOMPoint> obj =
    1.28 +    new DOMPoint(aGlobal.GetAsSupports(), aParams.mX, aParams.mY,
    1.29 +                 aParams.mZ, aParams.mW);
    1.30 +  return obj.forget();
    1.31 +}
    1.32 +
    1.33 +already_AddRefed<DOMPoint>
    1.34 +DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY,
    1.35 +                      double aZ, double aW, ErrorResult& aRV)
    1.36 +{
    1.37 +  nsRefPtr<DOMPoint> obj =
    1.38 +    new DOMPoint(aGlobal.GetAsSupports(), aX, aY, aZ, aW);
    1.39 +  return obj.forget();
    1.40 +}
    1.41 +
    1.42 +JSObject*
    1.43 +DOMPoint::WrapObject(JSContext* aCx)
    1.44 +{
    1.45 +  return DOMPointBinding::Wrap(aCx, this);
    1.46 +}

mercurial