dom/alarm/AlarmHalService.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef mozilla_dom_alarm_AlarmHalService_h
     6 #define mozilla_dom_alarm_AlarmHalService_h
     8 #include "base/basictypes.h"
     9 #include "mozilla/ClearOnShutdown.h"
    10 #include "mozilla/StaticPtr.h"
    11 #include "mozilla/Hal.h"
    12 #include "mozilla/Services.h"
    13 #include "nsIAlarmHalService.h"
    14 #include "nsIObserver.h"
    15 #include "nsIObserverService.h"
    17 namespace mozilla {
    18 namespace dom {
    19 namespace alarm {
    21 typedef Observer<void_t> AlarmObserver;
    22 typedef Observer<hal::SystemTimezoneChangeInformation> SystemTimezoneChangeObserver;
    24 class AlarmHalService : public nsIAlarmHalService, 
    25                         public AlarmObserver,
    26                         public SystemTimezoneChangeObserver
    27 {
    28 public:
    29   NS_DECL_ISUPPORTS
    30   NS_DECL_NSIALARMHALSERVICE
    32   void Init();
    33   virtual ~AlarmHalService();
    35   static already_AddRefed<AlarmHalService> GetInstance();
    37   // Implementing hal::AlarmObserver
    38   void Notify(const void_t& aVoid);
    40   // Implementing hal::SystemTimezoneChangeObserver
    41   void Notify(const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo);
    43 private:
    44   bool mAlarmEnabled;
    45   static StaticRefPtr<AlarmHalService> sSingleton;
    47   nsCOMPtr<nsIAlarmFiredCb> mAlarmFiredCb;
    48   nsCOMPtr<nsITimezoneChangedCb> mTimezoneChangedCb;
    49 };
    51 } // namespace alarm
    52 } // namespace dom
    53 } // namespace mozilla
    55 #endif // mozilla_dom_alarm_AlarmHalService_h

mercurial