nsGUIEvents-allowonstack
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 162 3ae1ca70680d55840cbf5a60088ebaebfe2bddc5
permissions -rw-r--r--
State as of now

* * *

diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -1359,7 +1359,8 @@ nsEventListenerManager::FixContextMenuEv
     // the DOM event. Since we never call InitMouseEvent() on the event, 
     // the client X/Y will be 0,0. We can make use of that if the widget is null.
     if (contextMenuKey) {
-      aPresContext->GetViewManager()->GetWidget(getter_AddRefs(((nsGUIEvent*)aEvent)->widget));
+      // XXX need write barrier for aEvent->widget
+      aPresContext->GetViewManager()->GetWidget(&((nsGUIEvent*)aEvent)->widget);
       aEvent->refPoint.x = 0;
       aEvent->refPoint.y = 0;
     }
diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h
--- a/widget/public/nsGUIEvent.h
+++ b/widget/public/nsGUIEvent.h
@@ -415,7 +415,7 @@ enum nsWindowZ {
  * General event
  */
 
-class nsEvent
+class NS_FINALIZER_NOT_REQUIRED nsEvent : public XPCOMGCObject
 {
 protected:
   nsEvent(PRBool isTrusted, PRUint32 msg, PRUint8 structType)
@@ -495,7 +495,7 @@ public:
   }
 
   /// Originator of the event
-  nsCOMPtr<nsIWidget> widget;           
+  nsIWidget* widget;           
   /// Internal platform specific message.
   void* nativeMsg;        
 };
@@ -681,7 +681,7 @@ public:
   : nsInputEvent(isTrusted, msg, w, type), button(0) {}
 
   /// The possible related target
-  nsCOMPtr<nsISupports> relatedTarget;
+  nsISupports*          relatedTarget;
 
   PRInt16               button;
 };
@@ -1010,7 +1010,7 @@ public:
     command = aCommand;
   }
 
-  nsCOMPtr<nsIAtom> command;
+  nsIAtom* command;
 };
 
 /**
@@ -1072,7 +1072,8 @@ public:
   {
   }
 
-  nsCOMPtr<nsIDOMEvent> sourceEvent;
+  // XXX TODO: write barrier
+  nsIDOMEvent* sourceEvent;
 };
 
 /**