[Webkit-unassigned] [Bug 21122] Autogenerate JS event listeners

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 30 16:53:17 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=21122


eric at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23960|review?                     |review+
               Flag|                            |




------- Comment #4 from eric at webkit.org  2008-09-30 16:53 PDT -------
(From update of attachment 23960)
yay!  yay!  yay!

+    if (JSUnprotectedEventListener* listener =
static_cast<JSUnprotectedEventListener*>(m_impl->onchecking()))
+        listener->mark();
Should be a static inline function, IMO
markListener(m_impl->onchecking());
Seems such a static-inline probably should be in some JSBinding.h type header
since it could be used all over the place.  Then we could later add a
type-check in a single place to handle the obj-c bad static cast check.

If there is a way to set any of these via obj-c, it seems all of this code
would crash due to bad static_casts. :(

Can a frame ever not have a window object?  Even say, during destruction? 
Cause your code seems to assume that toJSDOMWindow() can never return NULL
(which may very well be the case).

It seems also given how common:
toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(exec, value, true)
is we might consider making that a static inline function in some
JSBinding.h-like header.
findOrCreateJSUnprotectedEventLisener(frame, exec, value) (I guess that only
really saves toJSDOMWindow(frame)-> and , true from typing... 

In terms of solving hte "obj-c listeners cause crash case) one could very
easily add a toUnprotectedEventListener() function which did the conversion and
was used by all the above proposed functions, as well as any case in this
existing code where one needs to do that cast.  

Otherwise looks great!


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list