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

Unified Diff: Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

Issue 12377018: Revert 144157 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1425/
Patch Set: Created 7 years, 10 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 | Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
===================================================================
--- Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (revision 144312)
+++ Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (working copy)
@@ -2147,8 +2147,11 @@
}
}
+ my $maybeObserveFeature = GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"});
+
my @beforeArgumentList;
my @afterArgumentList;
+
my $toActiveDOMObject = "0";
if ($codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) {
$toActiveDOMObject = "${v8InterfaceName}::toActiveDOMObject";
@@ -2163,10 +2166,10 @@
push(@implContent, <<END);
WrapperTypeInfo ${v8InterfaceName}Constructor::info = { ${v8InterfaceName}Constructor::GetTemplate, ${v8InterfaceName}::derefObject, $toActiveDOMObject, $toEventTarget, 0, ${v8InterfaceName}::installPerContextPrototypeProperties, 0, WrapperTypeObjectPrototype };
-static v8::Handle<v8::Value> namedConstructor(const v8::Arguments& args)
+static v8::Handle<v8::Value> ${v8InterfaceName}ConstructorCallback(const v8::Arguments& args)
{
+ ${maybeObserveFeature}
END
- push(@implContent, GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"}));
push(@implContent, GenerateConstructorHeader());
push(@implContent, <<END);
Document* document = currentDocument(BindingState::instance());
@@ -2221,18 +2224,16 @@
V8DOMWrapper::associateObjectWithWrapper(impl.release(), &${v8InterfaceName}Constructor::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
return wrapper;
END
+
if ($raisesExceptions) {
push(@implContent, " fail:\n");
push(@implContent, " return setDOMException(ec, args.GetIsolate());\n");
}
+
+ push(@implContent, "}\n");
+
push(@implContent, <<END);
-}
-static v8::Handle<v8::Value> namedConstructorCallback(const v8::Arguments& args)
-{
- return namedConstructor(args);
-}
-
v8::Persistent<v8::FunctionTemplate> ${v8InterfaceName}Constructor::GetTemplate(v8::Isolate* isolate)
{
static v8::Persistent<v8::FunctionTemplate> cachedTemplate;
@@ -2240,7 +2241,7 @@
return cachedTemplate;
v8::HandleScope scope;
- v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(namedConstructorCallback);
+ v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(${v8InterfaceName}ConstructorCallback);
v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
instance->SetInternalFieldCount(${v8InterfaceName}::internalFieldCount);
« no previous file with comments | « no previous file | Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698