Bug 771933 - Make nsDOMEvent::SetEventType return void; r=smaug
authorMs2ger <ms2ger@gmail.com>
Wed, 18 Jul 2012 12:36:08 +0200
changeset 99525 dc4e1fe03e92b6523b6c27435b69cb7ab581a77c
parent 99524 dcca069277d0deb5d5a7ff1ba354aad57a78fb72
child 99526 1d636b78f5f7b77e1544280e43cea5fc964b1242
push id932
push userttaubert@mozilla.com
push dateThu, 19 Jul 2012 14:38:53 +0000
treeherderfx-team@01929e390ba5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs771933
milestone17.0a1
Bug 771933 - Make nsDOMEvent::SetEventType return void; r=smaug
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMEvent.h
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -519,23 +519,22 @@ nsDOMEvent::PreventDefault()
         mEvent->flags |= NS_EVENT_FLAG_NO_DEFAULT_CALLED_IN_CONTENT;
       }
     }
   }
 
   return NS_OK;
 }
 
-nsresult
+void
 nsDOMEvent::SetEventType(const nsAString& aEventTypeArg)
 {
   mEvent->userType =
     nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->eventStructType,
                                       &(mEvent->message));
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMEvent::InitEvent(const nsAString& aEventTypeArg, bool aCanBubbleArg, bool aCancelableArg)
 {
   // Make sure this event isn't already being dispatched.
   NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(mEvent), NS_ERROR_INVALID_ARG);
 
@@ -546,17 +545,17 @@ nsDOMEvent::InitEvent(const nsAString& a
     nsContentUtils::GetSecurityManager()->
       IsCapabilityEnabled("UniversalXPConnect", &enabled);
 
     if (!enabled) {
       SetTrusted(false);
     }
   }
 
-  NS_ENSURE_SUCCESS(SetEventType(aEventTypeArg), NS_ERROR_FAILURE);
+  SetEventType(aEventTypeArg);
 
   if (aCanBubbleArg) {
     mEvent->flags &= ~NS_EVENT_FLAG_CANT_BUBBLE;
   } else {
     mEvent->flags |= NS_EVENT_FLAG_CANT_BUBBLE;
   }
 
   if (aCancelableArg) {
--- a/content/events/src/nsDOMEvent.h
+++ b/content/events/src/nsDOMEvent.h
@@ -219,17 +219,17 @@ public:
                                   nsIntPoint aPoint,
                                   nsIntPoint aDefaultPoint);
   static nsIntPoint GetScreenCoords(nsPresContext* aPresContext,
                                     nsEvent* aEvent,
                                     nsIntPoint aPoint);
 protected:
 
   // Internal helper functions
-  nsresult SetEventType(const nsAString& aEventTypeArg);
+  void SetEventType(const nsAString& aEventTypeArg);
   already_AddRefed<nsIContent> GetTargetFromFrame();
 
   nsEvent*                    mEvent;
   nsRefPtr<nsPresContext>     mPresContext;
   nsCOMPtr<nsIDOMEventTarget> mExplicitOriginalTarget;
   nsString                    mCachedType;
   bool                        mEventIsInternal;
   bool                        mPrivateDataDuplicated;