Bug 1494333 - index crons just like artifacts r=Callek
[gecko.git] / dom / geolocation / PositionError.h
blob2f7de5bf376a584fcbd07d5b9de95925dec19a60
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;
17 namespace mozilla {
18 namespace dom {
19 class PositionErrorCallback;
20 class Geolocation;
21 typedef CallbackObjectHolder<PositionErrorCallback, nsIDOMGeoPositionErrorCallback> GeoPositionErrorCallback;
23 class PositionError final : public nsWrapperCache
25 public:
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 {
36 return mCode;
39 void GetMessage(nsAString& aMessage) const;
41 void NotifyCallback(const GeoPositionErrorCallback& callback);
42 private:
43 ~PositionError();
44 int16_t mCode;
45 RefPtr<Geolocation> mParent;
48 } // namespace dom
49 } // namespace mozilla
51 #endif /* mozilla_dom_PositionError_h */