Bug 456099: outparamdel nsIPrivateDOMEvent r+sr=jst
authorTaras Glek <tglek@mozilla.com>
Thu, 09 Oct 2008 16:23:07 -0700
changeset 20234 650e6b065018f570a56f7448304f479fb4eb3321
parent 20233 f02d0b4fb198cc6344e5230b27bc3d226ac926c4
child 20235 ad837c22e1912743b56f1affe3411885568aa319
push idunknown
push userunknown
push dateunknown
bugs456099
milestone1.9.1b2pre
Bug 456099: outparamdel nsIPrivateDOMEvent r+sr=jst
content/base/src/nsContentUtils.cpp
content/base/src/nsDocument.cpp
content/base/src/nsXMLHttpRequest.h
content/events/public/nsIPrivateDOMEvent.h
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMEvent.h
content/events/src/nsEventDispatcher.cpp
content/xbl/src/nsXBLPrototypeHandler.cpp
content/xbl/src/nsXBLWindowKeyHandler.cpp
dom/src/base/nsGlobalWindow.cpp
dom/src/events/nsJSEventListener.cpp
layout/base/nsLayoutUtils.cpp
layout/forms/nsListControlFrame.cpp
layout/generic/nsObjectFrame.cpp
layout/xul/base/src/nsXULPopupManager.cpp
security/manager/ssl/src/nsSmartCardEvent.cpp
security/manager/ssl/src/nsSmartCardEvent.h
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -3943,19 +3943,17 @@ nsContentUtils::GetLocalizedEllipsis()
 
 //static
 nsEvent*
 nsContentUtils::GetNativeEvent(nsIDOMEvent* aDOMEvent)
 {
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aDOMEvent));
   if (!privateEvent)
     return nsnull;
-  nsEvent* nativeEvent;
-  privateEvent->GetInternalNSEvent(&nativeEvent);
-  return nativeEvent;
+  return privateEvent->GetInternalNSEvent();
 }
 
 //static
 PRBool
 nsContentUtils::DOMEventToNativeKeyEvent(nsIDOMEvent* aDOMEvent,
                                          nsNativeKeyEvent* aNativeEvent,
                                          PRBool aGetCharCode)
 {
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -3868,18 +3868,17 @@ nsDocument::DispatchContentLoadedEvents(
         privateEvent->SetTrusted(PR_TRUE);
 
         // To dispatch this event we must manually call
         // nsEventDispatcher::Dispatch() on the ancestor document since the
         // target is not in the same document, so the event would never reach
         // the ancestor document if we used the normal event
         // dispatching code.
 
-        nsEvent* innerEvent;
-        privateEvent->GetInternalNSEvent(&innerEvent);
+        nsEvent* innerEvent = privateEvent->GetInternalNSEvent();
         if (innerEvent) {
           nsEventStatus status = nsEventStatus_eIgnore;
 
           nsIPresShell *shell = parent->GetPrimaryShell();
           if (shell) {
             nsCOMPtr<nsPresContext> context = shell->GetPresContext();
 
             if (context) {
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -482,27 +482,27 @@ public:
   NS_IMETHOD SetCurrentTarget(nsIDOMEventTarget* aTarget)
   {
     return mInner->SetCurrentTarget(aTarget);
   }
   NS_IMETHOD SetOriginalTarget(nsIDOMEventTarget* aTarget)
   {
     return mInner->SetOriginalTarget(aTarget);
   }
-  NS_IMETHOD IsDispatchStopped(PRBool* aIsDispatchPrevented)
+  NS_IMETHOD_(PRBool) IsDispatchStopped()
   {
-    return mInner->IsDispatchStopped(aIsDispatchPrevented);
+    return mInner->IsDispatchStopped();
   }
-  NS_IMETHOD GetInternalNSEvent(nsEvent** aNSEvent)
+  NS_IMETHOD_(nsEvent*) GetInternalNSEvent()
   {
-    return mInner->GetInternalNSEvent(aNSEvent);
+    return mInner->GetInternalNSEvent();
   }
-  NS_IMETHOD HasOriginalTarget(PRBool* aResult)
+  NS_IMETHOD_(PRBool) HasOriginalTarget()
   {
-    return mInner->HasOriginalTarget(aResult);
+    return mInner->HasOriginalTarget();
   }
   NS_IMETHOD SetTrusted(PRBool aTrusted)
   {
     return mInner->SetTrusted(aTrusted);
   }
 
 protected:
   // Use nsDOMProgressEvent so that we can forward
--- a/content/events/public/nsIPrivateDOMEvent.h
+++ b/content/events/public/nsIPrivateDOMEvent.h
@@ -59,20 +59,20 @@ class nsIPrivateDOMEvent : public nsISup
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRIVATEDOMEVENT_IID)
 
   NS_IMETHOD DuplicatePrivateData() = 0;
   NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget) = 0;
   NS_IMETHOD SetCurrentTarget(nsIDOMEventTarget* aTarget) = 0;
   NS_IMETHOD SetOriginalTarget(nsIDOMEventTarget* aTarget) = 0;
-  NS_IMETHOD IsDispatchStopped(PRBool* aIsDispatchPrevented) = 0;
-  NS_IMETHOD GetInternalNSEvent(nsEvent** aNSEvent) = 0;
-  NS_IMETHOD HasOriginalTarget(PRBool* aResult)=0;
-  NS_IMETHOD SetTrusted(PRBool aTrusted)=0;
+  NS_IMETHOD_(PRBool) IsDispatchStopped() = 0;
+  NS_IMETHOD_(nsEvent*) GetInternalNSEvent() = 0;
+  NS_IMETHOD_(PRBool) HasOriginalTarget() = 0;
+  NS_IMETHOD SetTrusted(PRBool aTrusted) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrivateDOMEvent, NS_IPRIVATEDOMEVENT_IID)
 
 nsresult
 NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent *aEvent);
 nsresult
 NS_NewDOMDataContainerEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent *aEvent);
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -323,21 +323,20 @@ nsDOMEvent::GetOriginalTarget(nsIDOMEven
 {
   if (mEvent->originalTarget) {
     return GetDOMEventTarget(mEvent->originalTarget, aOriginalTarget);
   }
 
   return GetTarget(aOriginalTarget);
 }
 
-NS_IMETHODIMP
-nsDOMEvent::HasOriginalTarget(PRBool* aResult)
+NS_IMETHODIMP_(PRBool)
+nsDOMEvent::HasOriginalTarget()
 {
-  *aResult = !!(mEvent->originalTarget);
-  return NS_OK;
+  return !!mEvent->originalTarget;
 }
 
 NS_IMETHODIMP
 nsDOMEvent::SetTrusted(PRBool aTrusted)
 {
   if (aTrusted) {
     mEvent->flags |= NS_EVENT_FLAG_TRUSTED;
   } else {
@@ -1047,33 +1046,26 @@ NS_METHOD nsDOMEvent::SetOriginalTarget(
                  "Uh, inner window set as event target!");
   }
 #endif
 
   mEvent->originalTarget = aOriginalTarget;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsDOMEvent::IsDispatchStopped(PRBool* aIsDispatchStopped)
+NS_IMETHODIMP_(PRBool)
+nsDOMEvent::IsDispatchStopped()
 {
-  if (mEvent->flags & NS_EVENT_FLAG_STOP_DISPATCH) {
-    *aIsDispatchStopped = PR_TRUE;
-  } else {
-    *aIsDispatchStopped = PR_FALSE;
-  }
-  return NS_OK;
+  return !!(mEvent->flags & NS_EVENT_FLAG_STOP_DISPATCH);
 }
 
-NS_IMETHODIMP
-nsDOMEvent::GetInternalNSEvent(nsEvent** aNSEvent)
+NS_IMETHODIMP_(nsEvent*)
+nsDOMEvent::GetInternalNSEvent()
 {
-  NS_ENSURE_ARG_POINTER(aNSEvent);
-  *aNSEvent = mEvent;
-  return NS_OK;
+  return mEvent;
 }
 
 // return true if eventName is contained within events, delimited by
 // spaces
 static PRBool
 PopupAllowedForEvent(const char *eventName)
 {
   if (!sPopupAllowedEvents) {
--- a/content/events/src/nsDOMEvent.h
+++ b/content/events/src/nsDOMEvent.h
@@ -176,19 +176,19 @@ public:
   // nsIDOMNSEvent Interface
   NS_DECL_NSIDOMNSEVENT
 
   // nsIPrivateDOMEvent interface
   NS_IMETHOD    DuplicatePrivateData();
   NS_IMETHOD    SetTarget(nsIDOMEventTarget* aTarget);
   NS_IMETHOD    SetCurrentTarget(nsIDOMEventTarget* aCurrentTarget);
   NS_IMETHOD    SetOriginalTarget(nsIDOMEventTarget* aOriginalTarget);
-  NS_IMETHOD    IsDispatchStopped(PRBool* aIsDispatchStopped);
-  NS_IMETHOD    GetInternalNSEvent(nsEvent** aNSEvent);
-  NS_IMETHOD    HasOriginalTarget(PRBool* aResult);
+  NS_IMETHOD_(PRBool)    IsDispatchStopped();
+  NS_IMETHOD_(nsEvent*)    GetInternalNSEvent();
+  NS_IMETHOD_(PRBool)    HasOriginalTarget();
   NS_IMETHOD    SetTrusted(PRBool aTrusted);
 
   static PopupControlState GetEventPopupControlState(nsEvent *aEvent);
 
   static void PopupAllowedEventsChanged();
 
   static void Shutdown();
 
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -411,18 +411,17 @@ nsEventDispatcher::Dispatch(nsISupports*
   NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(aEvent),
                  NS_ERROR_ILLEGAL_VALUE);
 
   nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(aTarget);
 #ifdef DEBUG
   if (aDOMEvent) {
     nsCOMPtr<nsIPrivateDOMEvent> privEvt(do_QueryInterface(aDOMEvent));
     if (privEvt) {
-      nsEvent* innerEvent = nsnull;
-      privEvt->GetInternalNSEvent(&innerEvent);
+      nsEvent* innerEvent = privEvt->GetInternalNSEvent();
       NS_ASSERTION(innerEvent == aEvent,
                     "The inner event of aDOMEvent is not the same as aEvent!");
     }
   }
 #endif
 
   nsresult rv = NS_OK;
   PRBool externalDOMEvent = !!(aDOMEvent);
@@ -550,18 +549,17 @@ nsEventDispatcher::DispatchDOMEvent(nsIS
                                     nsEvent* aEvent,
                                     nsIDOMEvent* aDOMEvent,
                                     nsPresContext* aPresContext,
                                     nsEventStatus* aEventStatus)
 {
   if (aDOMEvent) {
     nsCOMPtr<nsIPrivateDOMEvent> privEvt(do_QueryInterface(aDOMEvent));
     if (privEvt) {
-      nsEvent* innerEvent = nsnull;
-      privEvt->GetInternalNSEvent(&innerEvent);
+      nsEvent* innerEvent = privEvt->GetInternalNSEvent();
       NS_ENSURE_TRUE(innerEvent, NS_ERROR_ILLEGAL_VALUE);
 
       PRBool dontResetTrusted = PR_FALSE;
       if (innerEvent->flags & NS_EVENT_DISPATCHED) {
         innerEvent->target = nsnull;
         innerEvent->originalTarget = nsnull;
       }
       else {
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -399,18 +399,17 @@ nsXBLPrototypeHandler::DispatchXBLComman
   if (nsUIEvent)
     nsUIEvent->GetPreventDefault(&preventDefault);
 
   if (preventDefault)
     return NS_OK;
 
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent = do_QueryInterface(aEvent);
   if (privateEvent) {
-    PRBool dispatchStopped;
-    privateEvent->IsDispatchStopped(&dispatchStopped);
+    PRBool dispatchStopped = privateEvent->IsDispatchStopped();
     if (dispatchStopped)
       return NS_OK;
   }
 
   // Instead of executing JS, let's get the controller for the bound
   // element and call doCommand on it.
   nsCOMPtr<nsIController> controller;
   nsCOMPtr<nsIFocusController> focusController;
--- a/content/xbl/src/nsXBLWindowKeyHandler.cpp
+++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp
@@ -514,18 +514,17 @@ nsXBLWindowKeyHandler::WalkHandlersAndEx
                                               PRBool aIgnoreShiftKey)
 {
   nsresult rv;
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aKeyEvent));
 
   // Try all of the handlers until we find one that matches the event.
   for (nsXBLPrototypeHandler *currHandler = aHandler; currHandler;
        currHandler = currHandler->GetNextHandler()) {
-    PRBool stopped;
-    privateEvent->IsDispatchStopped(&stopped);
+    PRBool stopped = privateEvent->IsDispatchStopped();
     if (stopped) {
       // The event is finished, don't execute any more handlers
       return NS_OK;
     }
 
     if (!EventMatched(currHandler, aEventType, aKeyEvent,
                       aCharCode, aIgnoreShiftKey))
       continue;  // try the next one
--- a/dom/src/base/nsGlobalWindow.cpp
+++ b/dom/src/base/nsGlobalWindow.cpp
@@ -5196,20 +5196,19 @@ PostMessageEvent::Run()
   // happen because then untrusted content can call postMessage on a chrome
   // window if it can get a reference to it.
 
   nsIPresShell *shell = targetWindow->mDoc->GetPrimaryShell();
   nsRefPtr<nsPresContext> presContext;
   if (shell)
     presContext = shell->GetPresContext();
 
-  nsEvent* internalEvent;
   nsCOMPtr<nsIPrivateDOMEvent> privEvent = do_QueryInterface(message);
   privEvent->SetTrusted(mTrustedCaller);
-  privEvent->GetInternalNSEvent(&internalEvent);
+  nsEvent *internalEvent = privEvent->GetInternalNSEvent();
 
   nsEventStatus status = nsEventStatus_eIgnore;
   nsEventDispatcher::Dispatch(static_cast<nsPIDOMWindow*>(mTargetWindow),
                               presContext,
                               internalEvent,
                               message,
                               &status);
   return NS_OK;
--- a/dom/src/events/nsJSEventListener.cpp
+++ b/dom/src/events/nsJSEventListener.cpp
@@ -178,18 +178,17 @@ nsJSEventListener::HandleEvent(nsIDOMEve
   if (!funcval)
     return NS_OK;
 
   PRBool handledScriptError = PR_FALSE;
   if (eventString.EqualsLiteral("onerror")) {
     nsCOMPtr<nsIPrivateDOMEvent> priv(do_QueryInterface(aEvent));
     NS_ENSURE_TRUE(priv, NS_ERROR_UNEXPECTED);
 
-    nsEvent* event;
-    priv->GetInternalNSEvent(&event);
+    nsEvent *event = priv->GetInternalNSEvent();
     if (event->message == NS_LOAD_ERROR &&
         event->eventStructType == NS_SCRIPT_ERROR_EVENT) {
       nsScriptErrorEvent *scriptEvent =
         static_cast<nsScriptErrorEvent*>(event);
       // Create a temp argv for the error event.
       nsCOMPtr<nsIMutableArray> tempargv = 
         do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
       if (NS_FAILED(rv)) return rv;
@@ -250,18 +249,17 @@ nsJSEventListener::HandleEvent(nsIDOMEve
   if (NS_SUCCEEDED(rv)) {
     PRUint16 dataType = nsIDataType::VTYPE_VOID;
     if (vrv)
       vrv->GetDataType(&dataType);
     if (eventString.EqualsLiteral("onbeforeunload")) {
       nsCOMPtr<nsIPrivateDOMEvent> priv(do_QueryInterface(aEvent));
       NS_ENSURE_TRUE(priv, NS_ERROR_UNEXPECTED);
 
-      nsEvent* event;
-      priv->GetInternalNSEvent(&event);
+      nsEvent *event = priv->GetInternalNSEvent();
       NS_ENSURE_TRUE(event && event->message == NS_BEFORE_PAGE_UNLOAD,
                      NS_ERROR_UNEXPECTED);
 
       nsBeforePageUnloadEvent *beforeUnload =
         static_cast<nsBeforePageUnloadEvent *>(event);
 
       if (dataType != nsIDataType::VTYPE_VOID) {
         aEvent->PreventDefault();
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -616,19 +616,18 @@ nsLayoutUtils::GetNearestScrollingView(n
 
 nsPoint
 nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(nsIDOMEvent* aDOMEvent, nsIFrame* aFrame)
 {
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aDOMEvent));
   NS_ASSERTION(privateEvent, "bad implementation");
   if (!privateEvent)
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
-  nsEvent* event;
-  nsresult rv = privateEvent->GetInternalNSEvent(&event);
-  if (NS_FAILED(rv))
+  nsEvent *event = privateEvent->GetInternalNSEvent();
+  if (!event)
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
   return GetEventCoordinatesRelativeTo(event, aFrame);
 }
 
 nsPoint
 nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent, nsIFrame* aFrame)
 {
   if (!aEvent || (aEvent->eventStructType != NS_MOUSE_EVENT && 
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -2005,17 +2005,17 @@ nsListControlFrame::MouseUp(nsIDOMEvent*
     // and then up outside of the select
     // the EventStateManager tracks the content of the mouse down and the mouse up
     // to make sure they are the same, and the onclick is sent in the PostHandleEvent
     // depeneding on whether the clickCount is non-zero.
     // So we cheat here by either setting or unsetting the clcikCount in the native event
     // so the right thing happens for the onclick event
     nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
     nsMouseEvent * mouseEvent;
-    privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
+    mouseEvent = (nsMouseEvent *) privateEvent->GetInternalNSEvent();
 
     PRInt32 selectedIndex;
     if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, selectedIndex))) {
       // If it's disabled, disallow the click and leave.
       PRBool isDisabled = PR_FALSE;
       IsOptionDisabled(selectedIndex, isDisabled);
       if (isDisabled) {
         aMouseEvent->PreventDefault();
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -3280,18 +3280,17 @@ nsresult nsPluginInstanceOwner::Dispatch
   if (!mPluginWindow || nsPluginWindowType_Window == mPluginWindow->type) {
     // continue only for cases without child window
     return aFocusEvent->PreventDefault(); // consume event
   }
 #endif
 
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aFocusEvent));
   if (privateEvent) {
-    nsEvent * theEvent;
-    privateEvent->GetInternalNSEvent(&theEvent);
+    nsEvent * theEvent = privateEvent->GetInternalNSEvent();
     if (theEvent) {
       // we only care about the message in ProcessEvent
       nsGUIEvent focusEvent(NS_IS_TRUSTED_EVENT(theEvent), theEvent->message,
                             nsnull);
       nsEventStatus rv = ProcessEvent(focusEvent);
       if (nsEventStatus_eConsumeNoDefault == rv) {
         aFocusEvent->PreventDefault();
         aFocusEvent->StopPropagation();
@@ -3399,18 +3398,17 @@ nsresult nsPluginInstanceOwner::KeyPress
 {
 #ifdef XP_MACOSX // send KeyPress events only on Mac
 
   // KeyPress events are really synthesized keyDown events.
   // Here we check the native message of the event so that
   // we won't send the plugin two keyDown events.
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aKeyEvent));
   if (privateEvent) {
-    nsEvent *theEvent;
-    privateEvent->GetInternalNSEvent(&theEvent);
+    nsEvent *theEvent = privateEvent->GetInternalNSEvent();
     const nsGUIEvent *guiEvent = (nsGUIEvent*)theEvent;
     const EventRecord *ev = (EventRecord*)(guiEvent->nativeMsg); 
     if (guiEvent &&
         guiEvent->message == NS_KEY_PRESS &&
         ev &&
         ev->what == keyDown)
       return aKeyEvent->PreventDefault(); // consume event
   }
@@ -3445,18 +3443,17 @@ nsresult nsPluginInstanceOwner::Dispatch
   if (!mPluginWindow || nsPluginWindowType_Window == mPluginWindow->type)
     return aKeyEvent->PreventDefault(); // consume event
   // continue only for cases without child window
 #endif
 
   if (mInstance) {
     nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aKeyEvent));
     if (privateEvent) {
-      nsKeyEvent* keyEvent = nsnull;
-      privateEvent->GetInternalNSEvent((nsEvent**)&keyEvent);
+      nsKeyEvent *keyEvent = (nsKeyEvent *) privateEvent->GetInternalNSEvent();
       if (keyEvent) {
         nsEventStatus rv = ProcessEvent(*keyEvent);
         if (nsEventStatus_eConsumeNoDefault == rv) {
           aKeyEvent->PreventDefault();
           aKeyEvent->StopPropagation();
         }
       }
       else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchKeyToPlugin failed, keyEvent null");   
@@ -3479,18 +3476,17 @@ nsPluginInstanceOwner::MouseMove(nsIDOME
 #endif
 
   // don't send mouse events if we are hidden
   if (!mWidgetVisible)
     return NS_OK;
 
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
   if (privateEvent) {
-    nsMouseEvent* mouseEvent = nsnull;
-    privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
+    nsMouseEvent* mouseEvent = (nsMouseEvent *) privateEvent->GetInternalNSEvent();
     if (mouseEvent) {
       nsEventStatus rv = ProcessEvent(*mouseEvent);
       if (nsEventStatus_eConsumeNoDefault == rv) {
         return aMouseEvent->PreventDefault(); // consume event
       }
     }
     else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseMove failed, mouseEvent null");   
   }
@@ -3514,18 +3510,17 @@ nsPluginInstanceOwner::MouseDown(nsIDOME
   // otherwise, we might not get key events
   if (mOwner && mPluginWindow &&
       mPluginWindow->type == nsPluginWindowType_Drawable) {
     mContent->SetFocus(mOwner->PresContext());
   }
 
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
   if (privateEvent) {
-    nsMouseEvent* mouseEvent = nsnull;
-    privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
+    nsMouseEvent* mouseEvent = (nsMouseEvent *) privateEvent->GetInternalNSEvent();
     if (mouseEvent) {
       nsEventStatus rv = ProcessEvent(*mouseEvent);
       if (nsEventStatus_eConsumeNoDefault == rv) {
         return aMouseEvent->PreventDefault(); // consume event
       }
     }
     else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseDown failed, mouseEvent null");   
   }
@@ -3573,18 +3568,17 @@ nsresult nsPluginInstanceOwner::Dispatch
 #endif
 
   // don't send mouse events if we are hidden
   if (!mWidgetVisible)
     return NS_OK;
 
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
   if (privateEvent) {
-    nsMouseEvent* mouseEvent = nsnull;
-    privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
+    nsMouseEvent* mouseEvent = (nsMouseEvent *) privateEvent->GetInternalNSEvent();
     if (mouseEvent) {
       nsEventStatus rv = ProcessEvent(*mouseEvent);
       if (nsEventStatus_eConsumeNoDefault == rv) {
         aMouseEvent->PreventDefault();
         aMouseEvent->StopPropagation();
       }
     }
     else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchMouseToPlugin failed, mouseEvent null");   
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -316,18 +316,18 @@ nsXULPopupManager::SetTriggerEvent(nsIDO
     uiEvent->GetRangeOffset(&mRangeOffset);
 
     // get the event coordinates relative to the root frame of the document
     // containing the popup.
     nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aEvent));
     if (privateEvent) {
       NS_ASSERTION(aPopup, "Expected a popup node");
       nsEvent* event;
-      nsresult rv = privateEvent->GetInternalNSEvent(&event);
-      if (NS_SUCCEEDED(rv) && event) {
+      event = privateEvent->GetInternalNSEvent();
+      if (event) {
         nsIDocument* doc = aPopup->GetCurrentDoc();
         if (doc) {
           nsIPresShell* presShell = doc->GetPrimaryShell();
           if (presShell && presShell->GetPresContext()) {
             nsPresContext* presContext = presShell->GetPresContext();
             nsIFrame* rootFrame = presShell->GetRootFrame();
             if ((event->eventStructType == NS_MOUSE_EVENT || 
                  event->eventStructType == NS_MOUSE_SCROLL_EVENT) &&
--- a/security/manager/ssl/src/nsSmartCardEvent.cpp
+++ b/security/manager/ssl/src/nsSmartCardEvent.cpp
@@ -113,32 +113,38 @@ NS_IMETHODIMP nsSmartCardEvent::SetCurre
 }
 
 NS_IMETHODIMP nsSmartCardEvent::SetOriginalTarget(nsIDOMEventTarget *aTarget)
 {
   NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
   return mPrivate->SetOriginalTarget(aTarget);
 }
 
-NS_IMETHODIMP nsSmartCardEvent::IsDispatchStopped(PRBool *aIsDispatchPrevented)
+NS_IMETHODIMP_(PRBool ) nsSmartCardEvent::IsDispatchStopped()
 {
+  PRBool  isDispatchPrevented = nsnull;
+  PRBool * aIsDispatchPrevented = &isDispatchPrevented;
   NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
-  return mPrivate->IsDispatchStopped(aIsDispatchPrevented);
+  return mPrivate->IsDispatchStopped();
 }
 
-NS_IMETHODIMP nsSmartCardEvent::GetInternalNSEvent(nsEvent** aNSEvent)
+NS_IMETHODIMP_(nsEvent*) nsSmartCardEvent::GetInternalNSEvent()
 {
+  nsEvent* nSEvent = nsnull;
+  nsEvent** aNSEvent = &nSEvent;
   NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
-  return mPrivate->GetInternalNSEvent(aNSEvent);
+  return mPrivate->GetInternalNSEvent();
 }
 
-NS_IMETHODIMP nsSmartCardEvent::HasOriginalTarget(PRBool *aResult)
+NS_IMETHODIMP_(PRBool ) nsSmartCardEvent::HasOriginalTarget()
 {
+  PRBool  result = nsnull;
+  PRBool * aResult = &result;
   NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
-  return mPrivate->HasOriginalTarget(aResult);
+  return mPrivate->HasOriginalTarget();
 }
 
 NS_IMETHODIMP nsSmartCardEvent::SetTrusted(PRBool aResult)
 {
   NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
   return mPrivate->SetTrusted(aResult);
 }
 
--- a/security/manager/ssl/src/nsSmartCardEvent.h
+++ b/security/manager/ssl/src/nsSmartCardEvent.h
@@ -60,19 +60,19 @@ public:
   NS_DECL_NSIDOMSMARTCARDEVENT
   NS_DECL_NSIDOMNSEVENT
 
   //NS_DECL_NSIPRIVATEDOMEEVENT
   NS_IMETHOD DuplicatePrivateData();
   NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget);
   NS_IMETHOD SetCurrentTarget(nsIDOMEventTarget *aTarget);
   NS_IMETHOD SetOriginalTarget(nsIDOMEventTarget *aTarget);
-  NS_IMETHOD GetInternalNSEvent(nsEvent** aNSEvent);
-  NS_IMETHOD IsDispatchStopped(PRBool *aIsDispatchPrevented);
-  NS_IMETHOD HasOriginalTarget(PRBool *aResult);
+  NS_IMETHOD_(nsEvent*) GetInternalNSEvent();
+  NS_IMETHOD_(PRBool ) IsDispatchStopped();
+  NS_IMETHOD_(PRBool ) HasOriginalTarget();
   NS_IMETHOD SetTrusted(PRBool aResult);
 
   NS_DECL_NSIDOMEVENT
 
 protected:
   nsCOMPtr<nsIDOMEvent> mInner;
   nsCOMPtr<nsIPrivateDOMEvent> mPrivate;
   nsCOMPtr<nsIDOMNSEvent> mNSEvent;