Changeset 126141 in webkit


Ignore:
Timestamp:
Aug 21, 2012 12:33:09 AM (12 years ago)
Author:
haraken@chromium.org
Message:

[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):

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126140 r126141  
     12012-08-21  Kentaro Hara  <haraken@chromium.org>
     2
     3        [V8] Remove String::New() from V8 binding (Part 1)
     4        https://bugs.webkit.org/show_bug.cgi?id=94574
     5
     6        Reviewed by Adam Barth.
     7
     8        Currently, V8 binding mixes String::New(), String::NewSymbol() and v8String().
     9        String::New() should be replaced with String::NewSymbol() or v8String(),
     10        depending on use cases:
     11
     12        - If it is a symbol (e.g. attribute name, constant string, etc),
     13        String::NewSymbol() should be used. Cache of created symbols is managed by V8.
     14
     15        - If it is not a symbol, v8String() should be used. Cache of created strings
     16        is managed by V8 binding (i.e. StringCache class).
     17
     18        This patch replaces String::New() for symbols with String::NewSymbol().
     19
     20        No tests. No change in behavior.
     21
     22        * bindings/scripts/CodeGeneratorV8.pm:
     23        (GenerateNamedConstructorCallback):
     24        (GenerateNonStandardFunction):
     25        (GenerateImplementation):
     26        * bindings/scripts/test/V8/V8Float64Array.cpp:
     27        (WebCore::ConfigureV8Float64ArrayTemplate):
     28        * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
     29        (WebCore::ConfigureV8TestActiveDOMObjectTemplate):
     30        * bindings/scripts/test/V8/V8TestEventTarget.cpp:
     31        (WebCore::ConfigureV8TestEventTargetTemplate):
     32        * bindings/scripts/test/V8/V8TestInterface.cpp:
     33        (WebCore::ConfigureV8TestInterfaceTemplate):
     34        * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
     35        (WebCore::V8TestNamedConstructorConstructor::GetTemplate):
     36        * bindings/scripts/test/V8/V8TestObj.cpp:
     37        (WebCore::ConfigureV8TestObjTemplate):
     38        (WebCore::V8TestObj::installPerContextProperties):
     39        * bindings/v8/V8DOMConfiguration.cpp:
     40        (WebCore::V8DOMConfiguration::batchConfigureConstants):
     41        (WebCore::V8DOMConfiguration::batchConfigureCallbacks):
     42        (WebCore::V8DOMConfiguration::configureTemplate):
     43        * bindings/v8/V8DOMConfiguration.h:
     44        (WebCore::V8DOMConfiguration::configureAttribute):
     45
    1462012-08-21  Sheriff Bot  <webkit.review.bot@gmail.com>
    247
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r125745 r126141  
    20992099    v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
    21002100    instance->SetInternalFieldCount(V8${implClassName}::internalFieldCount);
    2101     result->SetClassName(v8::String::New("${implClassName}"));
     2101    result->SetClassName(v8::String::NewSymbol("${implClassName}"));
    21022102    result->Inherit(V8${implClassName}::GetTemplate());
    21032103
     
    22992299
    23002300    // $commentInfo
    2301     ${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));
     2301    ${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));
    23022302END
    23032303        return;
     
    23302330    push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
    23312331
    2332     push(@implContent, "    ${conditional}$template->Set(v8::String::New(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n");
     2332    push(@implContent, "    ${conditional}$template->Set(v8::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n");
    23332333
    23342334    push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString;
     
    29522952    // For security reasons, these functions are on the instance instead
    29532953    // of on the prototype object to ensure that they cannot be overwritten.
    2954     instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
    2955     instance->SetAccessor(v8::String::New("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
    2956     instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
     2954    instance->SetAccessor(v8::String::NewSymbol("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
     2955    instance->SetAccessor(v8::String::NewSymbol("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
     2956    instance->SetAccessor(v8::String::NewSymbol("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
    29572957END
    29582958    }
     
    30413041                my $callback = GetFunctionTemplateCallbackName($runtimeFunc, $interfaceName);
    30423042                push(@implContent, <<END);
    3043         proto->Set(v8::String::New("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction());
     3043        proto->Set(v8::String::NewSymbol("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction());
    30443044END
    30453045                push(@implContent, "    }\n");
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp

    r125495 r126141  
    108108    v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8Float32Array::GetRawTemplate() };
    109109    v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, fooArgv);
    110     proto->Set(v8::String::New("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature));
     110    proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooCallback, v8Undefined(), fooSignature));
    111111
    112112    // Custom toString template
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp

    r125495 r126141  
    135135    v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8Node::GetRawTemplate() };
    136136    v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(desc, excitingFunctionArgc, excitingFunctionArgv);
    137     proto->Set(v8::String::New("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature));
     137    proto->Set(v8::String::NewSymbol("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionCallback, v8Undefined(), excitingFunctionSignature));
    138138
    139139    // Function 'postMessage' (ExtAttr: 'DoNotCheckSecurity')
    140     proto->SetAccessor(v8::String::New("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
     140    proto->SetAccessor(v8::String::NewSymbol("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttrGetter, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
    141141
    142142    // Custom toString template
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp

    r125495 r126141  
    132132    v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8Event::GetRawTemplate() };
    133133    v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
    134     proto->Set(v8::String::New("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature));
     134    proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventCallback, v8Undefined(), dispatchEventSignature));
    135135
    136136    // Custom toString template
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp

    r125495 r126141  
    296296    v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(desc, supplementalMethod2Argc, supplementalMethod2Argv);
    297297#if ENABLE(Condition11) || ENABLE(Condition12)
    298     proto->Set(v8::String::New("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature));
    299 #endif // ENABLE(Condition11) || ENABLE(Condition12)
    300 #if ENABLE(Condition11) || ENABLE(Condition12)
    301     desc->Set(v8::String::New("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>()));
     298    proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2Callback, v8Undefined(), supplementalMethod2Signature));
     299#endif // ENABLE(Condition11) || ENABLE(Condition12)
     300#if ENABLE(Condition11) || ENABLE(Condition12)
     301    desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4Callback, v8Undefined(), v8::Local<v8::Signature>()));
    302302#endif // ENABLE(Condition11) || ENABLE(Condition12)
    303303    V8DOMConfiguration::batchConfigureConstants(desc, proto, TestInterfaceConsts, WTF_ARRAY_LENGTH(TestInterfaceConsts));
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp

    r125495 r126141  
    9696    v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
    9797    instance->SetInternalFieldCount(V8TestNamedConstructor::internalFieldCount);
    98     result->SetClassName(v8::String::New("TestNamedConstructor"));
     98    result->SetClassName(v8::String::NewSymbol("TestNamedConstructor"));
    9999    result->Inherit(V8TestNamedConstructor::GetTemplate());
    100100
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r125495 r126141  
    21932193    v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
    21942194    v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
    2195     proto->Set(v8::String::New("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature));
     2195    proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsCallback, v8Undefined(), voidMethodWithArgsSignature));
    21962196
    21972197    // Custom Signature 'MethodWithArgs'
     
    21992199    v8::Handle<v8::FunctionTemplate> MethodWithArgsArgv[MethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
    22002200    v8::Handle<v8::Signature> MethodWithArgsSignature = v8::Signature::New(desc, MethodWithArgsArgc, MethodWithArgsArgv);
    2201     proto->Set(v8::String::New("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature));
     2201    proto->Set(v8::String::NewSymbol("MethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::MethodWithArgsCallback, v8Undefined(), MethodWithArgsSignature));
    22022202
    22032203    // Custom Signature 'objMethodWithArgs'
     
    22052205    v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
    22062206    v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
    2207     proto->Set(v8::String::New("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature));
     2207    proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsCallback, v8Undefined(), objMethodWithArgsSignature));
    22082208
    22092209    // Custom Signature 'methodWithSequenceArg'
     
    22112211    v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8sequence<ScriptProfile>::GetRawTemplate() };
    22122212    v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv);
    2213     proto->Set(v8::String::New("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature));
     2213    proto->Set(v8::String::NewSymbol("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgCallback, v8Undefined(), methodWithSequenceArgSignature));
    22142214
    22152215    // Custom Signature 'methodThatRequiresAllArgsAndThrows'
     
    22172217    v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
    22182218    v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
    2219     proto->Set(v8::String::New("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));
    2220     desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>()));
    2221     desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>()));
    2222     desc->Set(v8::String::New("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>()));
     2219    proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));
     2220    desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodCallback, v8Undefined(), v8::Local<v8::Signature>()));
     2221    desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalCallback, v8Undefined(), v8::Local<v8::Signature>()));
     2222    desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(V8TestObj::classMethod2Callback, v8Undefined(), v8::Local<v8::Signature>()));
    22232223#if ENABLE(Condition1)
    2224     desc->Set(v8::String::New("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>()));
     2224    desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1Callback, v8Undefined(), v8::Local<v8::Signature>()));
    22252225#endif // ENABLE(Condition1)
    22262226    if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
    2227         proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature));
     2227        proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1Callback, v8Undefined(), defaultSignature));
    22282228    if (RuntimeEnabledFeatures::featureNameEnabled())
    2229         proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature));
     2229        proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2Callback, v8Undefined(), defaultSignature));
    22302230
    22312231    // Custom Signature 'convert1'
     
    22332233    v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8a::GetRawTemplate() };
    22342234    v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
    2235     proto->Set(v8::String::New("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature));
     2235    proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1Callback, v8Undefined(), convert1Signature));
    22362236
    22372237    // Custom Signature 'convert2'
     
    22392239    v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8b::GetRawTemplate() };
    22402240    v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
    2241     proto->Set(v8::String::New("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));
     2241    proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2Callback, v8Undefined(), convert2Signature));
    22422242
    22432243    // Custom Signature 'convert4'
     
    22452245    v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() };
    22462246    v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv);
    2247     proto->Set(v8::String::New("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature));
     2247    proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4Callback, v8Undefined(), convert4Signature));
    22482248
    22492249    // Custom Signature 'convert5'
     
    22512251    v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8e::GetRawTemplate() };
    22522252    v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv);
    2253     proto->Set(v8::String::New("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature));
     2253    proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5Callback, v8Undefined(), convert5Signature));
    22542254    V8DOMConfiguration::batchConfigureConstants(desc, proto, TestObjConsts, WTF_ARRAY_LENGTH(TestObjConsts));
    22552255
     
    23112311    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    23122312    if (ContextFeatures::enabledPerContextMethod1Enabled(impl->document())) {
    2313         proto->Set(v8::String::New("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());
     2313        proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());
    23142314    }
    23152315    if (ContextFeatures::featureNameEnabled(impl->document())) {
    2316         proto->Set(v8::String::New("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction());
     2316        proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod2Callback, v8Undefined(), defaultSignature)->GetFunction());
    23172317    }
    23182318}
  • trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.cpp

    r125295 r126141  
    5050    for (size_t i = 0; i < constantCount; ++i) {
    5151        const BatchedConstant* constant = &constants[i];
    52         functionDescriptor->Set(v8::String::New(constant->name), v8Integer(constant->value), v8::ReadOnly);
    53         prototype->Set(v8::String::New(constant->name), v8Integer(constant->value), v8::ReadOnly);
     52        functionDescriptor->Set(v8::String::NewSymbol(constant->name), v8Integer(constant->value), v8::ReadOnly);
     53        prototype->Set(v8::String::NewSymbol(constant->name), v8Integer(constant->value), v8::ReadOnly);
    5454    }
    5555}
     
    6262{
    6363    for (size_t i = 0; i < callbackCount; ++i)
    64         prototype->Set(v8::String::New(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8Undefined(), signature), attributes);
     64        prototype->Set(v8::String::NewSymbol(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8Undefined(), signature), attributes);
    6565}
    6666
     
    7474                                                               size_t callbackCount)
    7575{
    76     functionDescriptor->SetClassName(v8::String::New(interfaceName));
     76    functionDescriptor->SetClassName(v8::String::NewSymbol(interfaceName));
    7777    v8::Local<v8::ObjectTemplate> instance = functionDescriptor->InstanceTemplate();
    7878    instance->SetInternalFieldCount(fieldCount);
  • trunk/Source/WebCore/bindings/v8/V8DOMConfiguration.h

    r125295 r126141  
    6464                                          const BatchedAttribute& attribute)
    6565    {
    66         (attribute.onPrototype ? prototype : instance)->SetAccessor(v8::String::New(attribute.name),
     66        (attribute.onPrototype ? prototype : instance)->SetAccessor(v8::String::NewSymbol(attribute.name),
    6767                                                                    attribute.getter,
    6868                                                                    attribute.setter,
Note: See TracChangeset for help on using the changeset viewer.