dom/events/WheelEvent.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=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 file,
     5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_dom_WheelEvent_h_
     8 #define mozilla_dom_WheelEvent_h_
    10 #include "nsIDOMWheelEvent.h"
    11 #include "mozilla/dom/MouseEvent.h"
    12 #include "mozilla/dom/WheelEventBinding.h"
    13 #include "mozilla/EventForwards.h"
    15 namespace mozilla {
    16 namespace dom {
    18 class WheelEvent : public MouseEvent,
    19                    public nsIDOMWheelEvent
    20 {
    21 public:
    22   WheelEvent(EventTarget* aOwner,
    23              nsPresContext* aPresContext,
    24              WidgetWheelEvent* aWheelEvent);
    26   NS_DECL_ISUPPORTS_INHERITED
    28   // nsIDOMWheelEvent Interface
    29   NS_DECL_NSIDOMWHEELEVENT
    31   // Forward to base class
    32   NS_FORWARD_TO_MOUSEEVENT
    34   static
    35   already_AddRefed<WheelEvent> Constructor(const GlobalObject& aGlobal,
    36                                            const nsAString& aType,
    37                                            const WheelEventInit& aParam,
    38                                            ErrorResult& aRv);
    40   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
    41   {
    42     return WheelEventBinding::Wrap(aCx, this);
    43   }
    45   // NOTE: DeltaX(), DeltaY() and DeltaZ() return CSS pixels when deltaMode is
    46   //       DOM_DELTA_PIXEL. (The internal event's delta values are device pixels
    47   //       if it's dispatched by widget)
    48   double DeltaX();
    49   double DeltaY();
    50   double DeltaZ();
    51   uint32_t DeltaMode();
    53 private:
    54   int32_t mAppUnitsPerDevPixel;
    55 };
    57 } // namespace dom
    58 } // namespace mozilla
    60 #endif // mozilla_dom_WheelEvent_h_

mercurial