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/. */
7 #ifndef mozilla_dom_PositionError_h
8 #define mozilla_dom_PositionError_h
10 #include "nsWrapperCache.h"
11 #include "nsISupportsImpl.h"
12 #include "nsCycleCollectionParticipant.h"
13 #include "mozilla/dom/CallbackObject.h"
15 class nsIDOMGeoPositionErrorCallback
;
19 class PositionErrorCallback
;
21 typedef CallbackObjectHolder
<PositionErrorCallback
, nsIDOMGeoPositionErrorCallback
> GeoPositionErrorCallback
;
23 class PositionError final
: public nsWrapperCache
26 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PositionError
)
27 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PositionError
)
29 PositionError(Geolocation
* aParent
, int16_t aCode
);
31 nsWrapperCache
* GetParentObject() const;
33 virtual JSObject
* WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
;
35 int16_t Code() const {
39 void GetMessage(nsAString
& aMessage
) const;
41 void NotifyCallback(const GeoPositionErrorCallback
& callback
);
45 RefPtr
<Geolocation
> mParent
;
49 } // namespace mozilla
51 #endif /* mozilla_dom_PositionError_h */