dom/alarm/AlarmHalService.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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