tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PortalLocationProvider.h (1501B)


      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 #ifndef PortalLocationProvider_h
      8 #define PortalLocationProvider_h
      9 
     10 #include <gio/gio.h>
     11 
     12 #include "Geolocation.h"
     13 #include "mozilla/GRefPtr.h"
     14 #include "mozilla/GUniquePtr.h"
     15 #include "nsCOMPtr.h"
     16 #include "nsIGeolocationProvider.h"
     17 
     18 class MLSFallback;
     19 
     20 namespace mozilla::dom {
     21 
     22 class PortalLocationProvider final : public nsIGeolocationProvider,
     23                                     public nsITimerCallback,
     24                                     public nsINamed {
     25  class MLSGeolocationUpdate;
     26 
     27 public:
     28  NS_DECL_ISUPPORTS
     29  NS_DECL_NSIGEOLOCATIONPROVIDER
     30  NS_DECL_NSITIMERCALLBACK
     31  NS_DECL_NSINAMED
     32 
     33  PortalLocationProvider();
     34 
     35  void Update(nsIDOMGeoPosition* aPosition);
     36  MOZ_CAN_RUN_SCRIPT_BOUNDARY
     37  void NotifyError(int aError);
     38 
     39 private:
     40  ~PortalLocationProvider();
     41  void SetRefreshTimer(int aDelay);
     42 
     43  RefPtr<GDBusProxy> mDBUSLocationProxy;
     44  gulong mDBUSSignalHandler = 0;
     45 
     46  GUniquePtr<gchar> mPortalSession;
     47  nsCOMPtr<nsIGeolocationUpdate> mCallback;
     48  RefPtr<MLSFallback> mMLSProvider;
     49  nsCOMPtr<nsIDOMGeoPositionCoords> mLastGeoPositionCoords;
     50  nsCOMPtr<nsITimer> mRefreshTimer;
     51 };
     52 
     53 }  // namespace mozilla::dom
     54 
     55 #endif /* GpsLocationProvider_h */