dom/smil/TimeEvent.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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef mozilla_dom_TimeEvent_h_
     7 #define mozilla_dom_TimeEvent_h_
     9 #include "mozilla/dom/Event.h"
    10 #include "mozilla/dom/TimeEventBinding.h"
    11 #include "nsIDOMTimeEvent.h"
    13 namespace mozilla {
    14 namespace dom {
    16 class TimeEvent MOZ_FINAL : public Event,
    17                             public nsIDOMTimeEvent
    18 {
    19 public:
    20   TimeEvent(EventTarget* aOwner,
    21             nsPresContext* aPresContext,
    22             WidgetEvent* aEvent);
    24   // nsISupports interface:
    25   NS_DECL_ISUPPORTS_INHERITED
    26   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TimeEvent, Event)
    28   // nsIDOMTimeEvent interface:
    29   NS_DECL_NSIDOMTIMEEVENT
    31   // Forward to base class
    32   NS_FORWARD_TO_EVENT
    34   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
    35   {
    36     return TimeEventBinding::Wrap(aCx, this);
    37   }
    39   int32_t Detail() const
    40   {
    41     return mDetail;
    42   }
    44   nsIDOMWindow* GetView() const
    45   {
    46     return mView;
    47   }
    49   void InitTimeEvent(const nsAString& aType, nsIDOMWindow* aView,
    50                      int32_t aDetail, ErrorResult& aRv)
    51   {
    52     aRv = InitTimeEvent(aType, aView, aDetail);
    53   }
    55 private:
    56   nsCOMPtr<nsIDOMWindow> mView;
    57   int32_t mDetail;
    58 };
    60 } // namespace dom
    61 } // namespace mozilla
    63 #endif // mozilla_dom_TimeEvent_h_

mercurial