Changeset 80072 in webkit


Ignore:
Timestamp:
Mar 1, 2011 5:23:44 PM (13 years ago)
Author:
jorlow@chromium.org
Message:

2011-03-01 Jeremy Orlow <jorlow@chromium.org>

Reviewed by James Robinson.

V8 code generator doesn't properly support a single SerializedScriptValue attribute
https://bugs.webkit.org/show_bug.cgi?id=55530

This is tested by the bindings tests changes.

  • bindings/scripts/CodeGeneratorV8.pm:
  • bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp: Added. (WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterfacePrivate::WebDOMTestSerializedScriptValueInterfacePrivate): (WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterface): (WebDOMTestSerializedScriptValueInterface::operator=): (WebDOMTestSerializedScriptValueInterface::impl): (WebDOMTestSerializedScriptValueInterface::~WebDOMTestSerializedScriptValueInterface): (WebDOMTestSerializedScriptValueInterface::value): (toWebCore): (toWebKit):
  • bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h: Added.
  • bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp: Added. (WebKit::kit): (webkit_dom_test_serialized_script_value_interface_get_value): (WebKit::core): (webkit_dom_test_serialized_script_value_interface_finalize): (webkit_dom_test_serialized_script_value_interface_set_property): (webkit_dom_test_serialized_script_value_interface_get_property): (webkit_dom_test_serialized_script_value_interface_constructed): (webkit_dom_test_serialized_script_value_interface_class_init): (webkit_dom_test_serialized_script_value_interface_init): (WebKit::wrapTestSerializedScriptValueInterface):
  • bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h: Added.
  • bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterfacePrivate.h: Added.
  • bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor): (WebCore::JSTestInterface::JSTestInterface):
  • bindings/scripts/test/JS/JSTestInterface.h:
  • bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor): (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener): (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
  • bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
  • bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::JSTestObjConstructor): (WebCore::JSTestObj::JSTestObj): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgs): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): (WebCore::jsTestObjPrototypeFunctionSerializedValue): (WebCore::jsTestObjPrototypeFunctionIdbKey): (WebCore::jsTestObjPrototypeFunctionOptionsObject): (WebCore::jsTestObjPrototypeFunctionCustomArgsAndException): (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndArg): (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg): (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture): (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): (WebCore::jsTestObjPrototypeFunctionClassMethodWithOptional):
  • bindings/scripts/test/JS/JSTestObj.h:
  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Added. (WebCore::JSTestSerializedScriptValueInterfaceConstructor::createStructure): (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor): (WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertySlot): (WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor): (WebCore::JSTestSerializedScriptValueInterfacePrototype::self): (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface): (WebCore::JSTestSerializedScriptValueInterface::createPrototype): (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertySlot): (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor): (WebCore::jsTestSerializedScriptValueInterfaceValue): (WebCore::jsTestSerializedScriptValueInterfaceConstructor): (WebCore::JSTestSerializedScriptValueInterface::getConstructor): (WebCore::toJS): (WebCore::toTestSerializedScriptValueInterface):
  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h. (WebCore::JSTestSerializedScriptValueInterface::createStructure): (WebCore::JSTestSerializedScriptValueInterface::impl): (WebCore::JSTestSerializedScriptValueInterfacePrototype::createStructure): (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
  • bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h: Added.
  • bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm: Added. (-[DOMTestSerializedScriptValueInterface dealloc]): (-[DOMTestSerializedScriptValueInterface finalize]): (-[DOMTestSerializedScriptValueInterface value]): (core): (kit):
  • bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterfaceInternal.h: Added.
  • bindings/scripts/test/TestSerializedScriptValueInterface.idl: Added.
  • bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::ConfigureV8TestInterfaceTemplate):
  • bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp. (WebCore::TestSerializedScriptValueInterfaceInternal::V8_USE): (WebCore::ConfigureV8TestSerializedScriptValueInterfaceTemplate): (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate): (WebCore::V8TestSerializedScriptValueInterface::GetTemplate): (WebCore::V8TestSerializedScriptValueInterface::HasInstance): (WebCore::V8TestSerializedScriptValueInterface::wrapSlow): (WebCore::V8TestSerializedScriptValueInterface::derefObject):
  • bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h: Added. (WebCore::V8TestSerializedScriptValueInterface::toNative): (WebCore::V8TestSerializedScriptValueInterface::wrap): (WebCore::toV8):
Location:
trunk/Source/WebCore
Files:
10 added
12 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80070 r80072  
     12011-03-01  Jeremy Orlow  <jorlow@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        V8 code generator doesn't properly support a single SerializedScriptValue attribute
     6        https://bugs.webkit.org/show_bug.cgi?id=55530
     7
     8        This is tested by the bindings tests changes.
     9
     10        * bindings/scripts/CodeGeneratorV8.pm:
     11        * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp: Added.
     12        (WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterfacePrivate::WebDOMTestSerializedScriptValueInterfacePrivate):
     13        (WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterface):
     14        (WebDOMTestSerializedScriptValueInterface::operator=):
     15        (WebDOMTestSerializedScriptValueInterface::impl):
     16        (WebDOMTestSerializedScriptValueInterface::~WebDOMTestSerializedScriptValueInterface):
     17        (WebDOMTestSerializedScriptValueInterface::value):
     18        (toWebCore):
     19        (toWebKit):
     20        * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h: Added.
     21        * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp: Added.
     22        (WebKit::kit):
     23        (webkit_dom_test_serialized_script_value_interface_get_value):
     24        (WebKit::core):
     25        (webkit_dom_test_serialized_script_value_interface_finalize):
     26        (webkit_dom_test_serialized_script_value_interface_set_property):
     27        (webkit_dom_test_serialized_script_value_interface_get_property):
     28        (webkit_dom_test_serialized_script_value_interface_constructed):
     29        (webkit_dom_test_serialized_script_value_interface_class_init):
     30        (webkit_dom_test_serialized_script_value_interface_init):
     31        (WebKit::wrapTestSerializedScriptValueInterface):
     32        * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h: Added.
     33        * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterfacePrivate.h: Added.
     34        * bindings/scripts/test/JS/JSTestInterface.cpp:
     35        (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
     36        (WebCore::JSTestInterface::JSTestInterface):
     37        * bindings/scripts/test/JS/JSTestInterface.h:
     38        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
     39        (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
     40        (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
     41        (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
     42        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
     43        * bindings/scripts/test/JS/JSTestObj.cpp:
     44        (WebCore::JSTestObjConstructor::JSTestObjConstructor):
     45        (WebCore::JSTestObj::JSTestObj):
     46        (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
     47        (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs):
     48        (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
     49        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgs):
     50        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
     51        (WebCore::jsTestObjPrototypeFunctionSerializedValue):
     52        (WebCore::jsTestObjPrototypeFunctionIdbKey):
     53        (WebCore::jsTestObjPrototypeFunctionOptionsObject):
     54        (WebCore::jsTestObjPrototypeFunctionCustomArgsAndException):
     55        (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndArg):
     56        (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg):
     57        (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture):
     58        (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD):
     59        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
     60        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
     61        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
     62        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
     63        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
     64        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
     65        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
     66        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
     67        (WebCore::jsTestObjPrototypeFunctionClassMethodWithOptional):
     68        * bindings/scripts/test/JS/JSTestObj.h:
     69        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Added.
     70        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::createStructure):
     71        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor):
     72        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertySlot):
     73        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor):
     74        (WebCore::JSTestSerializedScriptValueInterfacePrototype::self):
     75        (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
     76        (WebCore::JSTestSerializedScriptValueInterface::createPrototype):
     77        (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertySlot):
     78        (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor):
     79        (WebCore::jsTestSerializedScriptValueInterfaceValue):
     80        (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
     81        (WebCore::JSTestSerializedScriptValueInterface::getConstructor):
     82        (WebCore::toJS):
     83        (WebCore::toTestSerializedScriptValueInterface):
     84        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h.
     85        (WebCore::JSTestSerializedScriptValueInterface::createStructure):
     86        (WebCore::JSTestSerializedScriptValueInterface::impl):
     87        (WebCore::JSTestSerializedScriptValueInterfacePrototype::createStructure):
     88        (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
     89        * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h: Added.
     90        * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm: Added.
     91        (-[DOMTestSerializedScriptValueInterface dealloc]):
     92        (-[DOMTestSerializedScriptValueInterface finalize]):
     93        (-[DOMTestSerializedScriptValueInterface value]):
     94        (core):
     95        (kit):
     96        * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterfaceInternal.h: Added.
     97        * bindings/scripts/test/TestSerializedScriptValueInterface.idl: Added.
     98        * bindings/scripts/test/V8/V8TestInterface.cpp:
     99        (WebCore::ConfigureV8TestInterfaceTemplate):
     100        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp.
     101        (WebCore::TestSerializedScriptValueInterfaceInternal::V8_USE):
     102        (WebCore::ConfigureV8TestSerializedScriptValueInterfaceTemplate):
     103        (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate):
     104        (WebCore::V8TestSerializedScriptValueInterface::GetTemplate):
     105        (WebCore::V8TestSerializedScriptValueInterface::HasInstance):
     106        (WebCore::V8TestSerializedScriptValueInterface::wrapSlow):
     107        (WebCore::V8TestSerializedScriptValueInterface::derefObject):
     108        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h: Added.
     109        (WebCore::V8TestSerializedScriptValueInterface::toNative):
     110        (WebCore::V8TestSerializedScriptValueInterface::wrap):
     111        (WebCore::toV8):
     112
    11132011-03-01  Oliver Hunt  <oliver@apple.com>
    2114
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r79675 r80072  
    248248
    249249    foreach my $headerInclude (sort keys(%headerIncludes)) {
    250         push(@headerContent, "#include \"${headerInclude}\"\n");
     250        if ($headerInclude =~ /wtf/) {
     251            push(@headerContent, "#include \<${headerInclude}\>\n");
     252        } else {
     253            push(@headerContent, "#include \"${headerInclude}\"\n");
     254        }
    251255    }
    252256
     
    18311835
    18321836    my $has_attributes = 0;
    1833     if (@$attributes) {
     1837    if (@$attributes && (@$attributes > 1 || $$attributes[0]->signature->type ne "SerializedScriptValue")) {
    18341838        $has_attributes = 1;
    18351839        push(@implContent, "static const BatchedAttribute ${interfaceName}Attrs[] = {\n");
     
    19751979        push(@implContent, <<END);
    19761980        0, 0);
    1977 END
     1981    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
     1982END
     1983        $implIncludes{"wtf/UnusedParam.h"} = 1;
    19781984    }
    19791985
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r79132 r80072  
    8080};
    8181
    82 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", 0, &JSTestInterfaceConstructorTable, 0 };
     82const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 };
    8383
    8484JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
    8585    : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    8686{
    87     putDirect(exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
     87    ASSERT(inherits(&s_info));
     88    putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
    8889}
    8990
     
    126127#undef THUNK_GENERATOR
    127128static JSC_CONST_HASHTABLE HashTable JSTestInterfacePrototypeTable = { 1, 0, JSTestInterfacePrototypeTableValues, 0 };
    128 const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", 0, &JSTestInterfacePrototypeTable, 0 };
     129const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestInterfacePrototypeTable, 0 };
    129130
    130131JSObject* JSTestInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
     
    133134}
    134135
    135 const ClassInfo JSTestInterface::s_info = { "TestInterface", 0, &JSTestInterfaceTable, 0 };
     136const ClassInfo JSTestInterface::s_info = { "TestInterface", &DOMObjectWithGlobalPointer::s_info, &JSTestInterfaceTable, 0 };
    136137
    137138JSTestInterface::JSTestInterface(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
     
    139140    , m_impl(impl)
    140141{
    141 }
    142 
    143 JSTestInterface::~JSTestInterface()
    144 {
    145     forgetDOMObject(this, impl());
     142    ASSERT(inherits(&s_info));
    146143}
    147144
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h

    r79132 r80072  
    3737public:
    3838    JSTestInterface(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestInterface>);
    39     virtual ~JSTestInterface();
    4039    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    4140    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp

    r79132 r80072  
    7979};
    8080
    81 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", 0, &JSTestMediaQueryListListenerConstructorTable, 0 };
     81const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 };
    8282
    8383JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
    8484    : DOMConstructorObject(JSTestMediaQueryListListenerConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    8585{
    86     putDirect(exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     86    ASSERT(inherits(&s_info));
     87    putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
    8788}
    8889
     
    112113#undef THUNK_GENERATOR
    113114static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 };
    114 const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", 0, &JSTestMediaQueryListListenerPrototypeTable, 0 };
     115const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0 };
    115116
    116117JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
     
    129130}
    130131
    131 const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", 0, &JSTestMediaQueryListListenerTable, 0 };
     132const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &DOMObjectWithGlobalPointer::s_info, &JSTestMediaQueryListListenerTable, 0 };
    132133
    133134JSTestMediaQueryListListener::JSTestMediaQueryListListener(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
     
    135136    , m_impl(impl)
    136137{
    137 }
    138 
    139 JSTestMediaQueryListListener::~JSTestMediaQueryListListener()
    140 {
    141     forgetDOMObject(this, impl());
     138    ASSERT(inherits(&s_info));
    142139}
    143140
     
    175172    JSTestMediaQueryListListener* castedThis = static_cast<JSTestMediaQueryListListener*>(asObject(thisValue));
    176173    TestMediaQueryListListener* imp = static_cast<TestMediaQueryListListener*>(castedThis->impl());
    177     RefPtr<MediaQueryListListener> listener = MediaQueryListListener::create(exec->argument(0));
     174    RefPtr<MediaQueryListListener> listener(MediaQueryListListener::create(ScriptValue(exec->globalData(), exec->argument(0))));
    178175    if (exec->hadException())
    179176        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h

    r79132 r80072  
    3535public:
    3636    JSTestMediaQueryListListener(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestMediaQueryListListener>);
    37     virtual ~JSTestMediaQueryListListener();
    3837    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    3938    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r79132 r80072  
    158158};
    159159
    160 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", 0, &JSTestObjConstructorTable, 0 };
     160const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 };
    161161
    162162JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
    163163    : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject)
    164164{
    165     putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     165    ASSERT(inherits(&s_info));
     166    putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
    166167}
    167168
     
    237238#undef THUNK_GENERATOR
    238239static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 136, 127, JSTestObjPrototypeTableValues, 0 };
    239 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 };
     240const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestObjPrototypeTable, 0 };
    240241
    241242JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
     
    254255}
    255256
    256 const ClassInfo JSTestObj::s_info = { "TestObj", 0, &JSTestObjTable, 0 };
     257const ClassInfo JSTestObj::s_info = { "TestObj", &DOMObjectWithGlobalPointer::s_info, &JSTestObjTable, 0 };
    257258
    258259JSTestObj::JSTestObj(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
     
    260261    , m_impl(impl)
    261262{
    262 }
    263 
    264 JSTestObj::~JSTestObj()
    265 {
    266     forgetDOMObject(this, impl());
     263    ASSERT(inherits(&s_info));
    267264}
    268265
     
    852849    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    853850    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    854     int intArg = exec->argument(0).toInt32(exec);
    855     if (exec->hadException())
    856         return JSValue::encode(jsUndefined());
    857     const String& strArg = ustringToString(exec->argument(1).toString(exec));
    858     if (exec->hadException())
    859         return JSValue::encode(jsUndefined());
    860     TestObj* objArg = toTestObj(exec->argument(2));
     851    int intArg(exec->argument(0).toInt32(exec));
     852    if (exec->hadException())
     853        return JSValue::encode(jsUndefined());
     854    const String& strArg(ustringToString(exec->argument(1).toString(exec)));
     855    if (exec->hadException())
     856        return JSValue::encode(jsUndefined());
     857    TestObj* objArg(toTestObj(exec->argument(2)));
    861858    if (exec->hadException())
    862859        return JSValue::encode(jsUndefined());
     
    886883    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    887884    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    888     int intArg = exec->argument(0).toInt32(exec);
    889     if (exec->hadException())
    890         return JSValue::encode(jsUndefined());
    891     const String& strArg = ustringToString(exec->argument(1).toString(exec));
    892     if (exec->hadException())
    893         return JSValue::encode(jsUndefined());
    894     TestObj* objArg = toTestObj(exec->argument(2));
     885    int intArg(exec->argument(0).toInt32(exec));
     886    if (exec->hadException())
     887        return JSValue::encode(jsUndefined());
     888    const String& strArg(ustringToString(exec->argument(1).toString(exec)));
     889    if (exec->hadException())
     890        return JSValue::encode(jsUndefined());
     891    TestObj* objArg(toTestObj(exec->argument(2)));
    895892    if (exec->hadException())
    896893        return JSValue::encode(jsUndefined());
     
    921918    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    922919    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    923     int intArg = exec->argument(0).toInt32(exec);
    924     if (exec->hadException())
    925         return JSValue::encode(jsUndefined());
    926     const String& strArg = ustringToString(exec->argument(1).toString(exec));
    927     if (exec->hadException())
    928         return JSValue::encode(jsUndefined());
    929     TestObj* objArg = toTestObj(exec->argument(2));
     920    int intArg(exec->argument(0).toInt32(exec));
     921    if (exec->hadException())
     922        return JSValue::encode(jsUndefined());
     923    const String& strArg(ustringToString(exec->argument(1).toString(exec)));
     924    if (exec->hadException())
     925        return JSValue::encode(jsUndefined());
     926    TestObj* objArg(toTestObj(exec->argument(2)));
    930927    if (exec->hadException())
    931928        return JSValue::encode(jsUndefined());
     
    945942    if (exec->argumentCount() < 2)
    946943        return JSValue::encode(jsUndefined());
    947     const String& strArg = ustringToString(exec->argument(0).toString(exec));
    948     if (exec->hadException())
    949         return JSValue::encode(jsUndefined());
    950     TestObj* objArg = toTestObj(exec->argument(1));
     944    const String& strArg(ustringToString(exec->argument(0).toString(exec)));
     945    if (exec->hadException())
     946        return JSValue::encode(jsUndefined());
     947    TestObj* objArg(toTestObj(exec->argument(1)));
    951948    if (exec->hadException())
    952949        return JSValue::encode(jsUndefined());
     
    967964        return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
    968965    ExceptionCode ec = 0;
    969     const String& strArg = ustringToString(exec->argument(0).toString(exec));
    970     if (exec->hadException())
    971         return JSValue::encode(jsUndefined());
    972     TestObj* objArg = toTestObj(exec->argument(1));
     966    const String& strArg(ustringToString(exec->argument(0).toString(exec)));
     967    if (exec->hadException())
     968        return JSValue::encode(jsUndefined());
     969    TestObj* objArg(toTestObj(exec->argument(1)));
    973970    if (exec->hadException())
    974971        return JSValue::encode(jsUndefined());
     
    987984    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    988985    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    989     RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(exec, exec->argument(0));
     986    RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, exec->argument(0)));
    990987    if (exec->hadException())
    991988        return JSValue::encode(jsUndefined());
     
    1002999    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    10031000    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1004     RefPtr<IDBKey> key = createIDBKeyFromValue(exec, exec->argument(0));
     1001    RefPtr<IDBKey> key(createIDBKeyFromValue(exec, exec->argument(0)));
    10051002    if (exec->hadException())
    10061003        return JSValue::encode(jsUndefined());
     
    10171014    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    10181015    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1019     OptionsObject* oo = toOptionsObject(exec->argument(0));
     1016    OptionsObject* oo(toOptionsObject(exec->argument(0)));
    10201017    if (exec->hadException())
    10211018        return JSValue::encode(jsUndefined());
     
    10271024    }
    10281025
    1029     OptionsObject* ooo = toOptionsObject(exec->argument(1));
     1026    OptionsObject* ooo(toOptionsObject(exec->argument(1)));
    10301027    if (exec->hadException())
    10311028        return JSValue::encode(jsUndefined());
     
    10781075    size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1;
    10791076    RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize));
    1080     log* intArg = tolog(exec->argument(0));
     1077    log* intArg(tolog(exec->argument(0)));
    10811078    if (exec->hadException())
    10821079        return JSValue::encode(jsUndefined());
     
    11401137    if (!dynamicFrame)
    11411138        return JSValue::encode(jsUndefined());
    1142     int intArg = exec->argument(0).toInt32(exec);
     1139    int intArg(exec->argument(0).toInt32(exec));
    11431140    if (exec->hadException())
    11441141        return JSValue::encode(jsUndefined());
     
    11581155    if (!dynamicFrame)
    11591156        return JSValue::encode(jsUndefined());
    1160     int intArg = exec->argument(0).toInt32(exec);
     1157    int intArg(exec->argument(0).toInt32(exec));
    11611158    if (exec->hadException())
    11621159        return JSValue::encode(jsUndefined());
     
    11681165    }
    11691166
    1170     int optionalArg = exec->argument(1).toInt32(exec);
     1167    int optionalArg(exec->argument(1).toInt32(exec));
    11711168    if (exec->hadException())
    11721169        return JSValue::encode(jsUndefined());
     
    11861183    if (!dynamicFrame)
    11871184        return JSValue::encode(jsUndefined());
    1188     int intArg = exec->argument(0).toInt32(exec);
     1185    int intArg(exec->argument(0).toInt32(exec));
    11891186    if (exec->hadException())
    11901187        return JSValue::encode(jsUndefined());
     
    12041201    if (!dynamicFrame)
    12051202        return JSValue::encode(jsUndefined());
    1206     int intArg = exec->argument(0).toInt32(exec);
     1203    int intArg(exec->argument(0).toInt32(exec));
    12071204    if (exec->hadException())
    12081205        return JSValue::encode(jsUndefined());
     
    12141211    }
    12151212
    1216     int optionalArg = exec->argument(1).toInt32(exec);
     1213    int optionalArg(exec->argument(1).toInt32(exec));
    12171214    if (exec->hadException())
    12181215        return JSValue::encode(jsUndefined());
     
    13091306    }
    13101307
    1311     int opt = exec->argument(0).toInt32(exec);
     1308    int opt(exec->argument(0).toInt32(exec));
    13121309    if (exec->hadException())
    13131310        return JSValue::encode(jsUndefined());
     
    13241321    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    13251322    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1326     int nonOpt = exec->argument(0).toInt32(exec);
     1323    int nonOpt(exec->argument(0).toInt32(exec));
    13271324    if (exec->hadException())
    13281325        return JSValue::encode(jsUndefined());
     
    13341331    }
    13351332
    1336     int opt = exec->argument(1).toInt32(exec);
     1333    int opt(exec->argument(1).toInt32(exec));
    13371334    if (exec->hadException())
    13381335        return JSValue::encode(jsUndefined());
     
    13491346    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    13501347    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1351     int nonOpt = exec->argument(0).toInt32(exec);
     1348    int nonOpt(exec->argument(0).toInt32(exec));
    13521349    if (exec->hadException())
    13531350        return JSValue::encode(jsUndefined());
     
    13591356    }
    13601357
    1361     int opt1 = exec->argument(1).toInt32(exec);
    1362     if (exec->hadException())
    1363         return JSValue::encode(jsUndefined());
    1364     int opt2 = exec->argument(2).toInt32(exec);
     1358    int opt1(exec->argument(1).toInt32(exec));
     1359    if (exec->hadException())
     1360        return JSValue::encode(jsUndefined());
     1361    int opt2(exec->argument(2).toInt32(exec));
    13651362    if (exec->hadException())
    13661363        return JSValue::encode(jsUndefined());
     
    13941391    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    13951392    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1396     int nonCallback = exec->argument(0).toInt32(exec);
     1393    int nonCallback(exec->argument(0).toInt32(exec));
    13971394    if (exec->hadException())
    13981395        return JSValue::encode(jsUndefined());
     
    14341431    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    14351432    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1436     TestObj* objArg = toTestObj(exec->argument(0));
    1437     if (exec->hadException())
    1438         return JSValue::encode(jsUndefined());
    1439     const String& strArg = ustringToString(exec->argument(1).toString(exec));
     1433    TestObj* objArg(toTestObj(exec->argument(0)));
     1434    if (exec->hadException())
     1435        return JSValue::encode(jsUndefined());
     1436    const String& strArg(ustringToString(exec->argument(1).toString(exec)));
    14401437    if (exec->hadException())
    14411438        return JSValue::encode(jsUndefined());
     
    14521449    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    14531450    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1454     TestObj* objArg = toTestObj(exec->argument(0));
     1451    TestObj* objArg(toTestObj(exec->argument(0)));
    14551452    if (exec->hadException())
    14561453        return JSValue::encode(jsUndefined());
     
    14621459    }
    14631460
    1464     int intArg = exec->argument(1).toInt32(exec);
     1461    int intArg(exec->argument(1).toInt32(exec));
    14651462    if (exec->hadException())
    14661463        return JSValue::encode(jsUndefined());
     
    14771474    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    14781475    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1479     const String& strArg = ustringToString(exec->argument(0).toString(exec));
     1476    const String& strArg(ustringToString(exec->argument(0).toString(exec)));
    14801477    if (exec->hadException())
    14811478        return JSValue::encode(jsUndefined());
     
    14921489    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    14931490    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    1494     int intArg = exec->argument(0).toInt32(exec);
     1491    int intArg(exec->argument(0).toInt32(exec));
    14951492    if (exec->hadException())
    14961493        return JSValue::encode(jsUndefined());
     
    15591556    }
    15601557
    1561     int arg = exec->argument(0).toInt32(exec);
     1558    int arg(exec->argument(0).toInt32(exec));
    15621559    if (exec->hadException())
    15631560        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r79132 r80072  
    3535public:
    3636    JSTestObj(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestObj>);
    37     virtual ~JSTestObj();
    3837    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    3938    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h

    r80070 r80072  
    1919*/
    2020
    21 #ifndef JSTestInterface_h
    22 #define JSTestInterface_h
     21#ifndef JSTestSerializedScriptValueInterface_h
     22#define JSTestSerializedScriptValueInterface_h
    2323
    2424#if ENABLE(Condition1) || ENABLE(Condition2)
     
    3131namespace WebCore {
    3232
    33 class TestInterface;
     33class TestSerializedScriptValueInterface;
    3434
    35 class JSTestInterface : public DOMObjectWithGlobalPointer {
     35class JSTestSerializedScriptValueInterface : public DOMObjectWithGlobalPointer {
    3636    typedef DOMObjectWithGlobalPointer Base;
    3737public:
    38     JSTestInterface(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestInterface>);
    39     virtual ~JSTestInterface();
     38    JSTestSerializedScriptValueInterface(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestSerializedScriptValueInterface>);
    4039    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    4140    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     
    4948
    5049    static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
    51     TestInterface* impl() const { return m_impl.get(); }
     50    TestSerializedScriptValueInterface* impl() const { return m_impl.get(); }
    5251
    5352private:
    54     RefPtr<TestInterface> m_impl;
     53    RefPtr<TestSerializedScriptValueInterface> m_impl;
    5554protected:
    5655    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    5756};
    5857
    59 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
    60 TestInterface* toTestInterface(JSC::JSValue);
     58JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*);
     59TestSerializedScriptValueInterface* toTestSerializedScriptValueInterface(JSC::JSValue);
    6160
    62 class JSTestInterfacePrototype : public JSC::JSObjectWithGlobalObject {
     61class JSTestSerializedScriptValueInterfacePrototype : public JSC::JSObjectWithGlobalObject {
    6362    typedef JSC::JSObjectWithGlobalObject Base;
    6463public:
     
    6968        return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
    7069    }
    71     JSTestInterfacePrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { }
     70    JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { }
    7271protected:
    7372    static const unsigned StructureFlags = Base::StructureFlags;
     
    7675// Attributes
    7776
    78 JSC::JSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
     77JSC::JSValue jsTestSerializedScriptValueInterfaceValue(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
     78JSC::JSValue jsTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
    7979
    8080} // namespace WebCore
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp

    r67421 r80072  
    3030#include "V8IsolatedContext.h"
    3131#include "V8Proxy.h"
     32#include <wtf/UnusedParam.h>
    3233
    3334namespace WebCore {
     
    5152        0, 0,
    5253        0, 0);
     54    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    5355        desc->SetCallHandler(V8TestInterface::constructorCallback);
    5456   
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h

    r67421 r80072  
    2727#include "V8DOMWrapper.h"
    2828#include "WrapperTypeInfo.h"
    29 #include "wtf/text/StringHash.h"
     29#include <wtf/text/StringHash.h>
    3030#include <v8.h>
    3131#include <wtf/HashMap.h>
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h

    r70226 r80072  
    2525#include "V8DOMWrapper.h"
    2626#include "WrapperTypeInfo.h"
    27 #include "wtf/text/StringHash.h"
     27#include <wtf/text/StringHash.h>
    2828#include <v8.h>
    2929#include <wtf/HashMap.h>
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h

    r67421 r80072  
    2525#include "V8DOMWrapper.h"
    2626#include "WrapperTypeInfo.h"
    27 #include "wtf/text/StringHash.h"
     27#include <wtf/text/StringHash.h>
    2828#include <v8.h>
    2929#include <wtf/HashMap.h>
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp

    r80070 r80072  
    2020
    2121#include "config.h"
    22 #include "V8TestInterface.h"
     22#include "V8TestSerializedScriptValueInterface.h"
    2323
    2424#if ENABLE(Condition1) || ENABLE(Condition2)
    2525
    2626#include "RuntimeEnabledFeatures.h"
     27#include "SerializedScriptValue.h"
    2728#include "V8Binding.h"
    2829#include "V8BindingState.h"
     
    3031#include "V8IsolatedContext.h"
    3132#include "V8Proxy.h"
     33#include <wtf/UnusedParam.h>
    3234
    3335namespace WebCore {
    3436
    35 WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, 0 };
     37WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0 };
    3638
    37 namespace TestInterfaceInternal {
     39namespace TestSerializedScriptValueInterfaceInternal {
    3840
    3941template <typename T> void V8_USE(T) { }
    4042
    41 } // namespace TestInterfaceInternal
     43} // namespace TestSerializedScriptValueInterfaceInternal
    4244
    43 v8::Handle<v8::Value> V8TestInterface::constructorCallback(const v8::Arguments& args)
     45static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)
    4446{
    45     INC_STATS("DOM.TestInterface.Contructor");
    46     return V8Proxy::constructDOMObjectWithScriptExecutionContext<TestInterface>(args, &info);
    47 }
    48 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)
    49 {
    50     v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount,
     47    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestSerializedScriptValueInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestSerializedScriptValueInterface::internalFieldCount,
    5148        0, 0,
    5249        0, 0);
    53         desc->SetCallHandler(V8TestInterface::constructorCallback);
     50    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    5451   
    5552
     
    5956}
    6057
    61 v8::Persistent<v8::FunctionTemplate> V8TestInterface::GetRawTemplate()
     58v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetRawTemplate()
    6259{
    63     static v8::Persistent<v8::FunctionTemplate> V8TestInterfaceRawCache = createRawTemplate();
    64     return V8TestInterfaceRawCache;
     60    static v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterfaceRawCache = createRawTemplate();
     61    return V8TestSerializedScriptValueInterfaceRawCache;
    6562}
    6663
    67 v8::Persistent<v8::FunctionTemplate> V8TestInterface::GetTemplate()
     64v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetTemplate()
    6865{
    69     static v8::Persistent<v8::FunctionTemplate> V8TestInterfaceCache = ConfigureV8TestInterfaceTemplate(GetRawTemplate());
    70     return V8TestInterfaceCache;
     66    static v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterfaceCache = ConfigureV8TestSerializedScriptValueInterfaceTemplate(GetRawTemplate());
     67    return V8TestSerializedScriptValueInterfaceCache;
    7168}
    7269
    73 bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value)
     70bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> value)
    7471{
    7572    return GetRawTemplate()->HasInstance(value);
     
    7774
    7875
    79 v8::Handle<v8::Object> V8TestInterface::wrapSlow(TestInterface* impl)
     76v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(TestSerializedScriptValueInterface* impl)
    8077{
    8178    v8::Handle<v8::Object> wrapper;
     
    8683
    8784    impl->ref();
     85    SerializedScriptValue::deserializeAndSetProperty(wrapper, "value", static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), impl->value());
    8886    getDOMObjectMap().set(impl, v8::Persistent<v8::Object>::New(wrapper));
    8987    return wrapper;
    9088}
    9189
    92 void V8TestInterface::derefObject(void* object)
     90void V8TestSerializedScriptValueInterface::derefObject(void* object)
    9391{
    94     static_cast<TestInterface*>(object)->deref();
     92    static_cast<TestSerializedScriptValueInterface*>(object)->deref();
    9593}
    9694
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h

    r80070 r80072  
    2121#if ENABLE(Condition1) || ENABLE(Condition2)
    2222
    23 #ifndef V8TestInterface_h
    24 #define V8TestInterface_h
     23#ifndef V8TestSerializedScriptValueInterface_h
     24#define V8TestSerializedScriptValueInterface_h
    2525
    26 #include "TestInterface.h"
     26#include "TestSerializedScriptValueInterface.h"
    2727#include "V8DOMWrapper.h"
    2828#include "WrapperTypeInfo.h"
    29 #include "wtf/text/StringHash.h"
     29#include <wtf/text/StringHash.h>
    3030#include <v8.h>
    3131#include <wtf/HashMap.h>
     
    3333namespace WebCore {
    3434
    35 class V8TestInterface {
     35class V8TestSerializedScriptValueInterface {
    3636
    3737public:
     
    3939    static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
    4040    static v8::Persistent<v8::FunctionTemplate> GetTemplate();
    41     static TestInterface* toNative(v8::Handle<v8::Object> object)
     41    static TestSerializedScriptValueInterface* toNative(v8::Handle<v8::Object> object)
    4242    {
    43         return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
     43        return reinterpret_cast<TestSerializedScriptValueInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
    4444    }
    45     inline static v8::Handle<v8::Object> wrap(TestInterface*);
     45    inline static v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*);
    4646    static void derefObject(void*);
    4747    static WrapperTypeInfo info;
    48     static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
    4948    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
    5049private:
    51     static v8::Handle<v8::Object> wrapSlow(TestInterface*);
     50    static v8::Handle<v8::Object> wrapSlow(TestSerializedScriptValueInterface*);
    5251};
    5352
    5453
    55 v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
     54v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrap(TestSerializedScriptValueInterface* impl)
    5655{
    5756        v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
    5857        if (!wrapper.IsEmpty())
    5958            return wrapper;
    60     return V8TestInterface::wrapSlow(impl);
     59    return V8TestSerializedScriptValueInterface::wrapSlow(impl);
    6160}
    6261
    63 inline v8::Handle<v8::Value> toV8(TestInterface* impl)
     62inline v8::Handle<v8::Value> toV8(TestSerializedScriptValueInterface* impl)
    6463{
    6564    if (!impl)
    6665        return v8::Null();
    67     return V8TestInterface::wrap(impl);
     66    return V8TestSerializedScriptValueInterface::wrap(impl);
    6867}
    69 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl)
     68inline v8::Handle<v8::Value> toV8(PassRefPtr< TestSerializedScriptValueInterface > impl)
    7069{
    7170    return toV8(impl.get());
     
    7372}
    7473
    75 #endif // V8TestInterface_h
     74#endif // V8TestSerializedScriptValueInterface_h
    7675#endif // ENABLE(Condition1) || ENABLE(Condition2)
    7776
Note: See TracChangeset for help on using the changeset viewer.