Bug 1287706 part 2 - Remove useless runtime check of EventListenerManager::Listener. r=smaug
authorXidorn Quan <me@upsuper.org>
Thu, 28 Jul 2016 12:00:06 +1000
changeset 306977 ee0b27b208d1e275ea1b24ea9770b85d4d9c4d4c
parent 306976 003da22902a615be6b8f48d00f36331cbae17f5c
child 306978 b858cd9f95fbb4ea370e3f3c4f93c5fce845f2c9
push id30502
push usercbook@mozilla.com
push dateThu, 28 Jul 2016 15:43:16 +0000
treeherdermozilla-central@9ec789c0ee5b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1287706
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1287706 part 2 - Remove useless runtime check of EventListenerManager::Listener. r=smaug MozReview-Commit-ID: 3XEfeF03Umx
dom/events/EventListenerManager.h
--- a/dom/events/EventListenerManager.h
+++ b/dom/events/EventListenerManager.h
@@ -184,39 +184,34 @@ public:
     EventMessage mEventMessage;
 
     enum ListenerType : uint8_t
     {
       eNativeListener = 0,
       eJSEventListener,
       eWrappedJSListener,
       eWebIDLListener,
-      eListenerTypeCount
     };
-    uint8_t mListenerType;
+    ListenerType mListenerType;
 
     bool mListenerIsHandler : 1;
     bool mHandlerIsString : 1;
     bool mAllEvents : 1;
     bool mIsChrome : 1;
 
     EventListenerFlags mFlags;
 
     JSEventHandler* GetJSEventHandler() const
     {
       return (mListenerType == eJSEventListener) ?
         static_cast<JSEventHandler*>(mListener.GetXPCOMCallback()) :
         nullptr;
     }
 
-    Listener()
-    {
-      MOZ_ASSERT(sizeof(mListenerType) == 1);
-      MOZ_ASSERT(eListenerTypeCount < 255);
-    }
+    Listener() = default;
 
     ~Listener()
     {
       if ((mListenerType == eJSEventListener) && mListener) {
         static_cast<JSEventHandler*>(
           mListener.GetXPCOMCallback())->Disconnect();
       }
     }