Bug 1283617 - remove QI call when constructing AsyncEventDispatchers from WidgetEvents; r=baku
authorNathan Froyd <froydnj@gmail.com>
Tue, 05 Jul 2016 18:49:06 -0400
changeset 303699 ac08e5118aefd91b5ae005225dbf2094bd8cd1bd
parent 303698 fe73f3d7e160498b6c27f876e0c12b79df2edaa6
child 303700 72e450d5e17bf090ba786bf330c46d5baf20339c
push id79144
push usernfroyd@mozilla.com
push dateTue, 05 Jul 2016 14:50:44 +0000
treeherdermozilla-inbound@92f2f41c5f7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1283617
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 1283617 - remove QI call when constructing AsyncEventDispatchers from WidgetEvents; r=baku The compiler can just as easily do this cast for us; we don't have to rely on QI, and doing the conversion this way even saves an AddRef/Release pair.
dom/events/AsyncEventDispatcher.cpp
--- a/dom/events/AsyncEventDispatcher.cpp
+++ b/dom/events/AsyncEventDispatcher.cpp
@@ -22,17 +22,17 @@ using namespace dom;
 
 AsyncEventDispatcher::AsyncEventDispatcher(EventTarget* aTarget,
                                            WidgetEvent& aEvent)
   : mTarget(aTarget)
 {
   MOZ_ASSERT(mTarget);
   RefPtr<Event> event =
     EventDispatcher::CreateEvent(aTarget, nullptr, &aEvent, EmptyString());
-  mEvent = do_QueryInterface(event);
+  mEvent = event.forget();
   NS_ASSERTION(mEvent, "Should never fail to create an event");
   mEvent->DuplicatePrivateData();
   mEvent->SetTrusted(aEvent.IsTrusted());
 }
 
 NS_IMETHODIMP
 AsyncEventDispatcher::Run()
 {