dom/gamepad/GamepadButton.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_gamepad_GamepadButton_h
     6 #define mozilla_dom_gamepad_GamepadButton_h
     8 #include <stdint.h>
     9 #include "nsCOMPtr.h"
    10 #include "nsWrapperCache.h"
    12 namespace mozilla {
    13 namespace dom {
    15 class GamepadButton : public nsISupports,
    16                       public nsWrapperCache
    17 {
    18 public:
    19   GamepadButton(nsISupports* aParent) : mParent(aParent),
    20                                         mPressed(false),
    21                                         mValue(0)
    22   {
    23     SetIsDOMBinding();
    24   }
    26   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    27   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GamepadButton)
    29   nsISupports* GetParentObject() const
    30   {
    31     return mParent;
    32   }
    34   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    36   void SetPressed(bool aPressed)
    37   {
    38     mPressed = aPressed;
    39   }
    41   void SetValue(double aValue)
    42   {
    43     mValue = aValue;
    44   }
    46   bool Pressed() const
    47   {
    48     return mPressed;
    49   }
    51   double Value() const
    52   {
    53     return mValue;
    54   }
    56 private:
    57   virtual ~GamepadButton() {}
    59 protected:
    60   nsCOMPtr<nsISupports> mParent;
    61   bool mPressed;
    62   double mValue;
    63 };
    65 } // namespace dom
    66 } // namespace mozilla
    68 #endif // mozilla_dom_gamepad_GamepadButton_h

mercurial