Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3983)

Unified Diff: bindings/scripts/CodeGeneratorV8.pm

Issue 160590: A patch for http://crbug.com/17400... (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bindings/v8/V8AbstractEventListener.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bindings/scripts/CodeGeneratorV8.pm
===================================================================
--- bindings/scripts/CodeGeneratorV8.pm (revision 46639)
+++ bindings/scripts/CodeGeneratorV8.pm (working copy)
@@ -334,13 +334,14 @@
return $result;
}
-sub IsNodeSubType
+sub IsSubTypeOf
{
my $dataNode = shift;
- return 1 if ($dataNode->name eq "Node");
+ my $superType = shift;
+ return 1 if ($dataNode->name eq $superType);
foreach (@allParents) {
my $parent = $codeGenerator->StripModule($_);
- return 1 if $parent eq "Node";
+ return 1 if $parent eq $superType;
}
return 0;
}
@@ -351,7 +352,7 @@
my $implClassName = shift;
my $classIndex = shift;
- if (IsNodeSubType($dataNode)) {
+ if (IsSubTypeOf($dataNode, "Node")) {
push(@implContentDecls, <<END);
$implClassName* imp = V8DOMWrapper::convertDOMWrapperToNode<$implClassName>(holder);
END
@@ -960,8 +961,8 @@
$getter = "V8Custom::v8DOMWindowEventHandlerAccessorGetter";
$setter = "V8Custom::v8DOMWindowEventHandlerAccessorSetter";
} elsif ($interfaceName eq "Element" || $interfaceName eq "Document" || $interfaceName eq "HTMLBodyElement" || $interfaceName eq "SVGElementInstance" || $interfaceName eq "HTMLFrameSetElement") {
- $getter = "V8Custom::v8ElementEventHandlerAccessorGetter";
- $setter = "V8Custom::v8ElementEventHandlerAccessorSetter";
+ $getter = "V8Custom::v8NodeEventHandlerAccessorGetter";
+ $setter = "V8Custom::v8NodeEventHandlerAccessorSetter";
} else {
$getter = "V8Custom::v8${customAccessor}AccessorGetter";
if ($interfaceName eq "WorkerContext" and $attrName eq "self") {
@@ -1239,7 +1240,18 @@
push(@implContent, <<END);
static v8::Persistent<v8::FunctionTemplate> Configure${className}Template(v8::Persistent<v8::FunctionTemplate> desc) {
v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
- instance->SetInternalFieldCount(2);
+END
+ if (IsSubTypeOf($dataNode, "Node")) {
+ push(@implContent, <<END);
+ instance->SetInternalFieldCount(V8Custom::kNodeMinimumInternalFieldCount);
+END
+ } else {
+ push(@implContent, <<END);
+ instance->SetInternalFieldCount(V8Custom::kDefaultWrapperInternalFieldCount);
+END
+ }
+
+ push(@implContent, <<END);
v8::Local<v8::Signature> default_signature = v8::Signature::New(desc);
v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
$access_check
« no previous file with comments | « no previous file | bindings/v8/V8AbstractEventListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698