[Webkit-unassigned] [Bug 57770] Factoring the creation of 'FunctionOnly' callbacks in JavaScriptCore

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 5 09:40:43 PDT 2011


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





--- Comment #5 from Steve Block <steveblock at google.com>  2011-04-05 09:40:43 PST ---
(From update of attachment 88244)
View in context: https://bugs.webkit.org/attachment.cgi?id=88244&action=review

>> Source/WebCore/bindings/js/CallbackUtilities.h:42
>> +// 'FunctionOnly' is assumed for the created callback. Callable objects created via JSC API are disallowed.
> 
> Comments need to answer the question “why?” and this no longer makes it clear that the “callable objects are disallowed” behavior is possibly a bug. I know we still have FIXMEs at the call site, but it seems wrong to make a function that has behavior that’s probably not helpful anywhere, but comment on it in a way that makes it seem deliberate.
> 
> So I’d like to see a comment that’s more clear on this point. And I think that having a FIXME at each call site is not really all that helpful. There’s some slight chance that some day we might change one call site and not others, but it’s more likely we’ll fix things in this central location.
> 
> Also, I’m something of an expert on this, but I don’t understand what FunctionOnly means. Is this a reference to something in a specification somewhere?

'FunctionOnly' is a WebIDL tag used by Geolocation and MediaStream. There's ongoing discussion as to how we should handle this in https://bugs.webkit.org/show_bug.cgi?id=40012.

I agree that the FIXME should be in this new helper, not at each call site. The helper creates a FunctionOnly callback, and that won't change, the question is how to do this.

> Source/WebCore/bindings/js/JSGeolocationCustom.cpp:118
> +        static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0), CallbackAllowFunction);

There's no maximum line length, so there's no need to break this line.

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


More information about the webkit-unassigned mailing list