Bug 1260713 - Fix RefCounted.h:106:50: error: no member named 'typeSize' in 'mozilla::KeyboardInfo' 0:22.21 uint32_t size = static_cast<const T*>(this)->typeSize(). r=smaug
authorChun-Min Chang <cchang@mozilla.com>
Wed, 30 Mar 2016 22:07:07 +0800
changeset 291208 3c89bafeec3b23f9a5f5707b1ddd3bc985d20ed0
parent 291207 3713e22cafec9aa6cf0c39d279d22eca355a84f8
child 291209 7511231503fbee1ad7f1a936e531192f25efa262
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1260713
milestone48.0a1
Bug 1260713 - Fix RefCounted.h:106:50: error: no member named 'typeSize' in 'mozilla::KeyboardInfo' 0:22.21 uint32_t size = static_cast<const T*>(this)->typeSize(). r=smaug
dom/inputmethod/HardwareKeyHandler.cpp
dom/inputmethod/HardwareKeyHandler.h
--- a/dom/inputmethod/HardwareKeyHandler.cpp
+++ b/dom/inputmethod/HardwareKeyHandler.cpp
@@ -258,17 +258,16 @@ HardwareKeyHandler::OnHandledByInputMeth
 }
 
 bool
 HardwareKeyHandler::DispatchKeyPress(nsINode* aTarget,
                                      WidgetKeyboardEvent& aEvent,
                                      nsEventStatus& aStatus)
 {
   MOZ_ASSERT(aTarget, "No target provided");
-  MOZ_ASSERT(aEvent, "No event provided");
   MOZ_ASSERT(aEvent.mMessage == eKeyPress, "Event is not keypress");
 
   // No need to dispatch keypress to the event target
   // if the keydown event is consumed by the input-method-app.
   if (mLatestKeyDownInfo &&
       mLatestKeyDownInfo->mEvent.mFlags.mDefaultPrevented) {
     return false;
   }
@@ -298,17 +297,16 @@ HardwareKeyHandler::DispatchKeyPress(nsI
   return ret;
 }
 
 void
 HardwareKeyHandler::DispatchAfterKeyEvent(nsINode* aTarget,
                                           WidgetKeyboardEvent& aEvent)
 {
   MOZ_ASSERT(aTarget, "No target provided");
-  MOZ_ASSERT(aEvent, "No event provided");
 
   if (!PresShell::BeforeAfterKeyboardEventEnabled() ||
       aEvent.mMessage == eKeyPress) {
     return;
   }
 
   nsCOMPtr<nsIPresShell> presShell = GetPresShell(aTarget);
   if (NS_WARN_IF(presShell)) {
@@ -319,17 +317,16 @@ HardwareKeyHandler::DispatchAfterKeyEven
 }
 
 bool
 HardwareKeyHandler::DispatchToTargetApp(nsINode* aTarget,
                                         WidgetKeyboardEvent& aEvent,
                                         nsEventStatus& aStatus)
 {
   MOZ_ASSERT(aTarget, "No target provided");
-  MOZ_ASSERT(aEvent, "No event provided");
 
   // Get current focused element as the event target
   nsCOMPtr<nsIContent> currentTarget = GetCurrentTarget();
   if (NS_WARN_IF(!currentTarget)) {
     return false;
   }
 
   // The event target should be set to the current focused element.
@@ -416,17 +413,16 @@ HardwareKeyHandler::DispatchToCrossProce
 }
 
 void
 HardwareKeyHandler::PostHandleKeyboardEvent(nsINode* aTarget,
                                             WidgetKeyboardEvent& aEvent,
                                             nsEventStatus& aStatus)
 {
   MOZ_ASSERT(aTarget, "No target provided");
-  MOZ_ASSERT(aEvent, "No event provided");
 
   nsPresContext* presContext = GetPresContext(aTarget);
 
   RefPtr<mozilla::EventStateManager> esm = presContext->EventStateManager();
   bool dispatchedToChildProcess = PresShell::IsTargetIframe(aTarget);
   esm->PostHandleKeyboardEvent(&aEvent, aStatus, dispatchedToChildProcess);
 }
 
--- a/dom/inputmethod/HardwareKeyHandler.h
+++ b/dom/inputmethod/HardwareKeyHandler.h
@@ -24,16 +24,18 @@ class nsPresContext;
 namespace mozilla {
 
 // This module will copy the events' data into its event queue for reuse
 // after receiving input-method-app's reply, so we use the following struct
 // for storing these information.
 // RefCounted<T> is a helper class for adding reference counting mechanism.
 struct KeyboardInfo : public RefCounted<KeyboardInfo>
 {
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(KeyboardInfo)
+
   nsINode* mTarget;
   WidgetKeyboardEvent mEvent;
   nsEventStatus mStatus;
 
   KeyboardInfo(nsINode* aTarget,
                WidgetKeyboardEvent& aEvent,
                nsEventStatus aStatus)
     : mTarget(aTarget)