Diff
Modified: trunk/Source/WebCore/ChangeLog (126140 => 126141)
--- trunk/Source/WebCore/ChangeLog 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/ChangeLog 2012-08-21 07:33:09 UTC (rev 126141)
@@ -1,3 +1,48 @@
+2012-08-21 Kentaro Hara <[email protected]>
+
+ [V8] Remove String::New() from V8 binding (Part 1)
+ https://bugs.webkit.org/show_bug.cgi?id=94574
+
+ Reviewed by Adam Barth.
+
+ Currently, V8 binding mixes String::New(), String::NewSymbol() and v8String().
+ String::New() should be replaced with String::NewSymbol() or v8String(),
+ depending on use cases:
+
+ - If it is a symbol (e.g. attribute name, constant string, etc),
+ String::NewSymbol() should be used. Cache of created symbols is managed by V8.
+
+ - If it is not a symbol, v8String() should be used. Cache of created strings
+ is managed by V8 binding (i.e. StringCache class).
+
+ This patch replaces String::New() for symbols with String::NewSymbol().
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateNamedConstructorCallback):
+ (GenerateNonStandardFunction):
+ (GenerateImplementation):
+ * bindings/scripts/test/V8/V8Float64Array.cpp:
+ (WebCore::ConfigureV8Float64ArrayTemplate):
+ * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
+ (WebCore::ConfigureV8TestActiveDOMObjectTemplate):
+ * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+ (WebCore::ConfigureV8TestEventTargetTemplate):
+ * bindings/scripts/test/V8/V8TestInterface.cpp:
+ (WebCore::ConfigureV8TestInterfaceTemplate):
+ * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
+ (WebCore::V8TestNamedConstructorConstructor::GetTemplate):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::ConfigureV8TestObjTemplate):
+ (WebCore::V8TestObj::installPerContextProperties):
+ * bindings/v8/V8DOMConfiguration.cpp:
+ (WebCore::V8DOMConfiguration::batchConfigureConstants):
+ (WebCore::V8DOMConfiguration::batchConfigureCallbacks):
+ (WebCore::V8DOMConfiguration::configureTemplate):
+ * bindings/v8/V8DOMConfiguration.h:
+ (WebCore::V8DOMConfiguration::configureAttribute):
+
2012-08-21 Sheriff Bot <[email protected]>
Unreviewed, rolling out r126028.
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (126140 => 126141)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-21 07:33:09 UTC (rev 126141)
@@ -2098,7 +2098,7 @@
v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
instance->SetInternalFieldCount(V8${implClassName}::internalFieldCount);
- result->SetClassName(v8::String::New("${implClassName}"));
+ result->SetClassName(v8::String::NewSymbol("${implClassName}"));
result->Inherit(V8${implClassName}::GetTemplate());
cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
@@ -2298,7 +2298,7 @@
push(@implContent, <<END);
// $commentInfo
- ${conditional}$template->SetAccessor(v8::String::New("$name"), ${interfaceName}V8Internal::${name}AttrGetter, ${interfaceName}V8Internal::${interfaceName}DomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
+ ${conditional}$template->SetAccessor(v8::String::NewSymbol("$name"), ${interfaceName}V8Internal::${name}AttrGetter, ${interfaceName}V8Internal::${interfaceName}DomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
END
return;
}
@@ -2329,7 +2329,7 @@
my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature);
push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
- push(@implContent, " ${conditional}$template->Set(v8::String::New(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n");
+ push(@implContent, " ${conditional}$template->Set(v8::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n");
push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString;
}
@@ -2951,9 +2951,9 @@
// For security reasons, these functions are on the instance instead
// of on the prototype object to ensure that they cannot be overwritten.
- instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
- instance->SetAccessor(v8::String::New("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
- instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::NewSymbol("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::NewSymbol("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::NewSymbol("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
END
}
@@ -3040,7 +3040,7 @@
my $name = $runtimeFunc->signature->name;
my $callback = GetFunctionTemplateCallbackName($runtimeFunc, $interfaceName);
push(@implContent, <<END);
- proto->Set(v8::String::New("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction());
+ proto->Set(v8::String::NewSymbol("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction());
END
push(@implContent, " }\n");
push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString;
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp (126140 => 126141)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp 2012-08-21 07:33:09 UTC (rev 126141)
@@ -107,7 +107,7 @@
const int fooArgc = 1;
v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8Float32Array::GetRawTemplate() };
v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, fooArgv);
- proto->Set(v8::String::New("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature));
+ proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature));
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp (126140 => 126141)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp 2012-08-21 07:33:09 UTC (rev 126141)
@@ -134,10 +134,10 @@
const int excitingFunctionArgc = 1;
v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8Node::GetRawTemplate() };
v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(desc, excitingFunctionArgc, excitingFunctionArgv);
- proto->Set(v8::String::New("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature));
+ proto->Set(v8::String::NewSymbol("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature));
// Function 'postMessage' (ExtAttr: 'DoNotCheckSecurity')
- proto->SetAccessor(v8::String::New("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
+ proto->SetAccessor(v8::String::NewSymbol("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp (126140 => 126141)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp 2012-08-21 07:33:09 UTC (rev 126141)
@@ -131,7 +131,7 @@
const int dispatchEventArgc = 1;
v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8Event::GetRawTemplate() };
v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
- proto->Set(v8::String::New("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature));
+ proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature));
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (126140 => 126141)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-08-21 07:33:09 UTC (rev 126141)
@@ -295,10 +295,10 @@
v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(desc, supplementalMethod2Argc, supplementalMethod2Argv);
#if ENABLE(Condition11) || ENABLE(Condition12)
- proto->Set(v8::String::New("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature));
+ proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature));
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
- desc->Set(v8::String::New("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>()));
#endif // ENABLE(Condition11) || ENABLE(Condition12)
V8DOMConfiguration::batchConfigureConstants(desc, proto, TestInterfaceConsts, WTF_ARRAY_LENGTH(TestInterfaceConsts));
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp (126140 => 126141)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp 2012-08-21 07:33:09 UTC (rev 126141)
@@ -95,7 +95,7 @@
v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
instance->SetInternalFieldCount(V8TestNamedConstructor::internalFieldCount);
- result->SetClassName(v8::String::New("TestNamedConstructor"));
+ result->SetClassName(v8::String::NewSymbol("TestNamedConstructor"));
result->Inherit(V8TestNamedConstructor::GetTemplate());
cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (126140 => 126141)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-08-21 07:33:09 UTC (rev 126141)
@@ -2192,65 +2192,65 @@
const int voidMethodWithArgsArgc = 3;
v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
- proto->Set(v8::String::New("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature));
+ proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature));
// Custom Signature 'MethodWithArgs'
const int MethodWithArgsArgc = 3;
v8::Handle<v8::FunctionTemplate> MethodWithArgsArgv[MethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> MethodWithArgsSignature = v8::Signature::New(desc, MethodWithArgsArgc, MethodWithArgsArgv);
- proto->Set(v8::String::New("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature));
+ proto->Set(v8::String::NewSymbol("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature));
// Custom Signature 'objMethodWithArgs'
const int objMethodWithArgsArgc = 3;
v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
- proto->Set(v8::String::New("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature));
+ proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature));
// Custom Signature 'methodWithSequenceArg'
const int methodWithSequenceArgArgc = 1;
v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8sequence<ScriptProfile>::GetRawTemplate() };
v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv);
- proto->Set(v8::String::New("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature));
+ proto->Set(v8::String::NewSymbol("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature));
// Custom Signature 'methodThatRequiresAllArgsAndThrows'
const int methodThatRequiresAllArgsAndThrowsArgc = 2;
v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
- proto->Set(v8::String::New("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));
- desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>()));
- desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>()));
- desc->Set(v8::String::New("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>()));
+ proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));
+ desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>()));
#if ENABLE(Condition1)
- desc->Set(v8::String::New("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>()));
+ desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>()));
#endif // ENABLE(Condition1)
if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
- proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature));
+ proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature));
if (RuntimeEnabledFeatures::featureNameEnabled())
- proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature));
+ proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature));
// Custom Signature 'convert1'
const int convert1Argc = 1;
v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8a::GetRawTemplate() };
v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
- proto->Set(v8::String::New("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature));
+ proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature));
// Custom Signature 'convert2'
const int convert2Argc = 1;
v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8b::GetRawTemplate() };
v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
- proto->Set(v8::String::New("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));
+ proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));
// Custom Signature 'convert4'
const int convert4Argc = 1;
v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() };
v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv);
- proto->Set(v8::String::New("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature));
+ proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature));
// Custom Signature 'convert5'
const int convert5Argc = 1;
v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8e::GetRawTemplate() };
v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv);
- proto->Set(v8::String::New("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature));
+ proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature));
V8DOMConfiguration::batchConfigureConstants(desc, proto, TestObjConsts, WTF_ARRAY_LENGTH(TestObjConsts));
// Custom toString template
@@ -2310,10 +2310,10 @@
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate());
UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
if (ContextFeatures::enabledPerContextMethod1Enabled(impl->document())) {
- proto->Set(v8::String::New("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());
+ proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());
}
if (ContextFeatures::featureNameEnabled(impl->document())) {
- proto->Set(v8::String::New("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction());
+ proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction());
}
}
Modified: trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp (126140 => 126141)
--- trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp 2012-08-21 07:33:09 UTC (rev 126141)
@@ -49,8 +49,8 @@
{
for (size_t i = 0; i < constantCount; ++i) {
const BatchedConstant* constant = &constants[i];
- functionDescriptor->Set(v8::String::New(constant->name), v8Integer(constant->value), v8::ReadOnly);
- prototype->Set(v8::String::New(constant->name), v8Integer(constant->value), v8::ReadOnly);
+ functionDescriptor->Set(v8::String::NewSymbol(constant->name), v8Integer(constant->value), v8::ReadOnly);
+ prototype->Set(v8::String::NewSymbol(constant->name), v8Integer(constant->value), v8::ReadOnly);
}
}
@@ -61,7 +61,7 @@
size_t callbackCount)
{
for (size_t i = 0; i < callbackCount; ++i)
- prototype->Set(v8::String::New(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8Undefined(), signature), attributes);
+ prototype->Set(v8::String::NewSymbol(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8Undefined(), signature), attributes);
}
v8::Local<v8::Signature> V8DOMConfiguration::configureTemplate(v8::Persistent<v8::FunctionTemplate> functionDescriptor,
@@ -73,7 +73,7 @@
const BatchedCallback* callbacks,
size_t callbackCount)
{
- functionDescriptor->SetClassName(v8::String::New(interfaceName));
+ functionDescriptor->SetClassName(v8::String::NewSymbol(interfaceName));
v8::Local<v8::ObjectTemplate> instance = functionDescriptor->InstanceTemplate();
instance->SetInternalFieldCount(fieldCount);
if (!parentClass.IsEmpty())
Modified: trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.h (126140 => 126141)
--- trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.h 2012-08-21 07:24:05 UTC (rev 126140)
+++ trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.h 2012-08-21 07:33:09 UTC (rev 126141)
@@ -63,7 +63,7 @@
v8::Handle<ObjectOrTemplate> prototype,
const BatchedAttribute& attribute)
{
- (attribute.onPrototype ? prototype : instance)->SetAccessor(v8::String::New(attribute.name),
+ (attribute.onPrototype ? prototype : instance)->SetAccessor(v8::String::NewSymbol(attribute.name),
attribute.getter,
attribute.setter,
v8::External::Wrap(attribute.data),