[webkit-reviews] review granted: [Bug 111971] [V8] Get rid of function-level static FunctionTemplates in generated bindings code : [Attachment 192476] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 11 18:21:32 PDT 2013


Kentaro Hara <haraken at chromium.org> has granted Marja Hölttä
<marja at chromium.org>'s request for review:
Bug 111971: [V8] Get rid of function-level static FunctionTemplates in
generated bindings code
https://bugs.webkit.org/show_bug.cgi?id=111971

Attachment 192476: Patch
https://bugs.webkit.org/attachment.cgi?id=192476&action=review

------- Additional Comments from Kentaro Hara <haraken at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=192476&action=review


> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:809
> +	   static String sharedTemplateUniqueKey = "${funcName}SharedTemplate";

> +	   v8::Persistent<v8::FunctionTemplate> sharedTemplate =
V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType,
&sharedTemplateUniqueKey, $newTemplateParams);

I understand that we need to use a different template from 'privateTemplate',
but still I don't understand why it is called 'sharedTemplate' (What does
'shared' mean?). We might want a more descriptive name.

Either way you can fix it in a follow-up patch.

> Source/WebCore/bindings/v8/V8PerIsolateData.h:68
> +    typedef HashMap<void*, v8::Persistent<v8::FunctionTemplate> >
TemplateMap;

Do you have a plan to use any key whose type is not a string? (Although we
discussed it offline, I forgot where we reached:-)

Otherwise, you can use a string key for safety. void* is hacky (and might be
vulnerable).


More information about the webkit-reviews mailing list