dom/events/EventListenerService.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 /* -*- 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_EventListenerService_h_
     7 #define mozilla_EventListenerService_h_
     9 #include "jsapi.h"
    10 #include "mozilla/Attributes.h"
    11 #include "nsAutoPtr.h"
    12 #include "nsCycleCollectionParticipant.h"
    13 #include "nsIDOMEventListener.h"
    14 #include "nsIEventListenerService.h"
    15 #include "nsString.h"
    17 namespace mozilla {
    19 template<typename T>
    20 class Maybe;
    22 class EventListenerInfo MOZ_FINAL : public nsIEventListenerInfo
    23 {
    24 public:
    25   EventListenerInfo(const nsAString& aType,
    26                     already_AddRefed<nsIDOMEventListener> aListener,
    27                     bool aCapturing,
    28                     bool aAllowsUntrusted,
    29                     bool aInSystemEventGroup)
    30     : mType(aType)
    31     , mListener(aListener)
    32     , mCapturing(aCapturing)
    33     , mAllowsUntrusted(aAllowsUntrusted)
    34     , mInSystemEventGroup(aInSystemEventGroup)
    35   {
    36   }
    38   virtual ~EventListenerInfo() {}
    40   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    41   NS_DECL_CYCLE_COLLECTION_CLASS(EventListenerInfo)
    42   NS_DECL_NSIEVENTLISTENERINFO
    44 protected:
    45   bool GetJSVal(JSContext* aCx,
    46                 Maybe<JSAutoCompartment>& aAc,
    47                 JS::MutableHandle<JS::Value> aJSVal);
    49   nsString mType;
    50   // nsReftPtr because that is what nsListenerStruct uses too.
    51   nsRefPtr<nsIDOMEventListener> mListener;
    52   bool mCapturing;
    53   bool mAllowsUntrusted;
    54   bool mInSystemEventGroup;
    55 };
    57 class EventListenerService MOZ_FINAL : public nsIEventListenerService
    58 {
    59 public:
    60   NS_DECL_ISUPPORTS
    61   NS_DECL_NSIEVENTLISTENERSERVICE
    62 };
    64 } // namespace mozilla
    66 #endif // mozilla_EventListenerService_h_

mercurial