WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
35245
[V8] Clean up V8DOMWrapper::getEventListener()
https://bugs.webkit.org/show_bug.cgi?id=35245
Summary
[V8] Clean up V8DOMWrapper::getEventListener()
Nate Chapin
Reported
2010-02-22 09:42:58 PST
We currently have 10 variants of V8DOMWrapper::getEventListener(). There's no reason we can't reduce that to 1. This cleanup will also make it feasible to generate most of V8's addEventListener and removeEventListener callbacks. The exception is DOMWindow, which has some additional security restrictions on its add/remove functions.
Attachments
patch
(58.65 KB, patch)
2010-02-22 10:17 PST
,
Nate Chapin
dglazkov
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Nate Chapin
Comment 1
2010-02-22 10:17:01 PST
Created
attachment 49224
[details]
patch
Dimitri Glazkov (Google)
Comment 2
2010-02-22 10:46:36 PST
Comment on
attachment 49224
[details]
patch Awesome, with comments:
> + static v8::Handle<v8::Value> ${functionName}EventListenerCallback(const v8::Arguments& args) > + { > + INC_STATS("DOM.${implClassName}.${functionName}EventListener()"); > + RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFind${lookupType}); > + if (listener) { > + V8${implClassName}::toNative(args.Holder())->${functionName}EventListener(v8ValueToAtomicWebCoreString(args[0]), listener${passRefPtrHandling}, args[2]->BooleanValue()); > + ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], V8${implClassName}::cacheIndex); > + } > + return v8::Undefined(); > + }
Can haz proper 4-space indent here? I know we seem to generate 2-spacers, but that should change too.
> + if (WorkerContextExecutionProxy::retrieve()) > + return V8EventListenerList::findOrCreateWrapper<V8WorkerContextEventListener>(value, isAttribute);
Can we not get rid of this using your new fancy trick? Or is this already using it?
Nate Chapin
Comment 3
2010-02-22 10:52:10 PST
> > + if (WorkerContextExecutionProxy::retrieve()) > > + return V8EventListenerList::findOrCreateWrapper<V8WorkerContextEventListener>(value, isAttribute); > > Can we not get rid of this using your new fancy trick? Or is this already using > it?
I'm already using it above, so I think this may be redundant. I think that the only case where we would have no WorkerContextExecutionProxy and no V8Proxy would be the early exit case due to there being no current v8::Context. Does that seem right?
Dimitri Glazkov (Google)
Comment 4
2010-02-22 10:53:11 PST
(In reply to
comment #3
)
> > > + if (WorkerContextExecutionProxy::retrieve()) > > > + return V8EventListenerList::findOrCreateWrapper<V8WorkerContextEventListener>(value, isAttribute); > > > > Can we not get rid of this using your new fancy trick? Or is this already using > > it? > > I'm already using it above, so I think this may be redundant. I think that the > only case where we would have no WorkerContextExecutionProxy and no V8Proxy > would be the early exit case due to there being no current v8::Context. Does > that seem right?
Sure.
anton muhin
Comment 5
2010-02-24 05:19:06 PST
Sorry for being late---we were on holidays Mon/Tue here. Vitaly (
vitalyr@chromium.org
) worked with event listeners, Vitaly, any comments? Nice cleanup, btw, Nate.
Nate Chapin
Comment 6
2010-02-24 09:06:07 PST
(In reply to
comment #5
)
> Sorry for being late---we were on holidays Mon/Tue here. > > Vitaly (
vitalyr@chromium.org
) worked with event listeners, Vitaly, any > comments? > > Nice cleanup, btw, Nate.
Thanks! :) This was landed in
http://trac.webkit.org/changeset/55096
, sorry for not updating the bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug