Changeset 80072 in webkit
- Timestamp:
- Mar 1, 2011 5:23:44 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 added
- 12 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80070 r80072 1 2011-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 1 113 2011-03-01 Oliver Hunt <oliver@apple.com> 2 114 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r79675 r80072 248 248 249 249 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 } 251 255 } 252 256 … … 1831 1835 1832 1836 my $has_attributes = 0; 1833 if (@$attributes ) {1837 if (@$attributes && (@$attributes > 1 || $$attributes[0]->signature->type ne "SerializedScriptValue")) { 1834 1838 $has_attributes = 1; 1835 1839 push(@implContent, "static const BatchedAttribute ${interfaceName}Attrs[] = {\n"); … … 1975 1979 push(@implContent, <<END); 1976 1980 0, 0); 1977 END 1981 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 1982 END 1983 $implIncludes{"wtf/UnusedParam.h"} = 1; 1978 1984 } 1979 1985 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r79132 r80072 80 80 }; 81 81 82 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", 0, &JSTestInterfaceConstructorTable, 0 };82 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 }; 83 83 84 84 JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) 85 85 : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject) 86 86 { 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); 88 89 } 89 90 … … 126 127 #undef THUNK_GENERATOR 127 128 static JSC_CONST_HASHTABLE HashTable JSTestInterfacePrototypeTable = { 1, 0, JSTestInterfacePrototypeTableValues, 0 }; 128 const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", 0, &JSTestInterfacePrototypeTable, 0 };129 const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestInterfacePrototypeTable, 0 }; 129 130 130 131 JSObject* JSTestInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject) … … 133 134 } 134 135 135 const ClassInfo JSTestInterface::s_info = { "TestInterface", 0, &JSTestInterfaceTable, 0 };136 const ClassInfo JSTestInterface::s_info = { "TestInterface", &DOMObjectWithGlobalPointer::s_info, &JSTestInterfaceTable, 0 }; 136 137 137 138 JSTestInterface::JSTestInterface(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl) … … 139 140 , m_impl(impl) 140 141 { 141 } 142 143 JSTestInterface::~JSTestInterface() 144 { 145 forgetDOMObject(this, impl()); 142 ASSERT(inherits(&s_info)); 146 143 } 147 144 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
r79132 r80072 37 37 public: 38 38 JSTestInterface(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestInterface>); 39 virtual ~JSTestInterface();40 39 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 41 40 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r79132 r80072 79 79 }; 80 80 81 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", 0, &JSTestMediaQueryListListenerConstructorTable, 0 };81 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 }; 82 82 83 83 JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) 84 84 : DOMConstructorObject(JSTestMediaQueryListListenerConstructor::createStructure(globalObject->objectPrototype()), globalObject) 85 85 { 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); 87 88 } 88 89 … … 112 113 #undef THUNK_GENERATOR 113 114 static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 }; 114 const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", 0, &JSTestMediaQueryListListenerPrototypeTable, 0 };115 const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0 }; 115 116 116 117 JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject) … … 129 130 } 130 131 131 const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", 0, &JSTestMediaQueryListListenerTable, 0 };132 const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &DOMObjectWithGlobalPointer::s_info, &JSTestMediaQueryListListenerTable, 0 }; 132 133 133 134 JSTestMediaQueryListListener::JSTestMediaQueryListListener(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl) … … 135 136 , m_impl(impl) 136 137 { 137 } 138 139 JSTestMediaQueryListListener::~JSTestMediaQueryListListener() 140 { 141 forgetDOMObject(this, impl()); 138 ASSERT(inherits(&s_info)); 142 139 } 143 140 … … 175 172 JSTestMediaQueryListListener* castedThis = static_cast<JSTestMediaQueryListListener*>(asObject(thisValue)); 176 173 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)))); 178 175 if (exec->hadException()) 179 176 return JSValue::encode(jsUndefined()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
r79132 r80072 35 35 public: 36 36 JSTestMediaQueryListListener(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestMediaQueryListListener>); 37 virtual ~JSTestMediaQueryListListener();38 37 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 39 38 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r79132 r80072 158 158 }; 159 159 160 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", 0, &JSTestObjConstructorTable, 0 };160 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 }; 161 161 162 162 JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) 163 163 : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject) 164 164 { 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); 166 167 } 167 168 … … 237 238 #undef THUNK_GENERATOR 238 239 static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 136, 127, JSTestObjPrototypeTableValues, 0 }; 239 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 };240 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestObjPrototypeTable, 0 }; 240 241 241 242 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject) … … 254 255 } 255 256 256 const ClassInfo JSTestObj::s_info = { "TestObj", 0, &JSTestObjTable, 0 };257 const ClassInfo JSTestObj::s_info = { "TestObj", &DOMObjectWithGlobalPointer::s_info, &JSTestObjTable, 0 }; 257 258 258 259 JSTestObj::JSTestObj(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl) … … 260 261 , m_impl(impl) 261 262 { 262 } 263 264 JSTestObj::~JSTestObj() 265 { 266 forgetDOMObject(this, impl()); 263 ASSERT(inherits(&s_info)); 267 264 } 268 265 … … 852 849 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 853 850 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))); 861 858 if (exec->hadException()) 862 859 return JSValue::encode(jsUndefined()); … … 886 883 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 887 884 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))); 895 892 if (exec->hadException()) 896 893 return JSValue::encode(jsUndefined()); … … 921 918 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 922 919 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))); 930 927 if (exec->hadException()) 931 928 return JSValue::encode(jsUndefined()); … … 945 942 if (exec->argumentCount() < 2) 946 943 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))); 951 948 if (exec->hadException()) 952 949 return JSValue::encode(jsUndefined()); … … 967 964 return throwVMError(exec, createSyntaxError(exec, "Not enough arguments")); 968 965 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))); 973 970 if (exec->hadException()) 974 971 return JSValue::encode(jsUndefined()); … … 987 984 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 988 985 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))); 990 987 if (exec->hadException()) 991 988 return JSValue::encode(jsUndefined()); … … 1002 999 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1003 1000 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))); 1005 1002 if (exec->hadException()) 1006 1003 return JSValue::encode(jsUndefined()); … … 1017 1014 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1018 1015 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1019 OptionsObject* oo = toOptionsObject(exec->argument(0));1016 OptionsObject* oo(toOptionsObject(exec->argument(0))); 1020 1017 if (exec->hadException()) 1021 1018 return JSValue::encode(jsUndefined()); … … 1027 1024 } 1028 1025 1029 OptionsObject* ooo = toOptionsObject(exec->argument(1));1026 OptionsObject* ooo(toOptionsObject(exec->argument(1))); 1030 1027 if (exec->hadException()) 1031 1028 return JSValue::encode(jsUndefined()); … … 1078 1075 size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1; 1079 1076 RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize)); 1080 log* intArg = tolog(exec->argument(0));1077 log* intArg(tolog(exec->argument(0))); 1081 1078 if (exec->hadException()) 1082 1079 return JSValue::encode(jsUndefined()); … … 1140 1137 if (!dynamicFrame) 1141 1138 return JSValue::encode(jsUndefined()); 1142 int intArg = exec->argument(0).toInt32(exec);1139 int intArg(exec->argument(0).toInt32(exec)); 1143 1140 if (exec->hadException()) 1144 1141 return JSValue::encode(jsUndefined()); … … 1158 1155 if (!dynamicFrame) 1159 1156 return JSValue::encode(jsUndefined()); 1160 int intArg = exec->argument(0).toInt32(exec);1157 int intArg(exec->argument(0).toInt32(exec)); 1161 1158 if (exec->hadException()) 1162 1159 return JSValue::encode(jsUndefined()); … … 1168 1165 } 1169 1166 1170 int optionalArg = exec->argument(1).toInt32(exec);1167 int optionalArg(exec->argument(1).toInt32(exec)); 1171 1168 if (exec->hadException()) 1172 1169 return JSValue::encode(jsUndefined()); … … 1186 1183 if (!dynamicFrame) 1187 1184 return JSValue::encode(jsUndefined()); 1188 int intArg = exec->argument(0).toInt32(exec);1185 int intArg(exec->argument(0).toInt32(exec)); 1189 1186 if (exec->hadException()) 1190 1187 return JSValue::encode(jsUndefined()); … … 1204 1201 if (!dynamicFrame) 1205 1202 return JSValue::encode(jsUndefined()); 1206 int intArg = exec->argument(0).toInt32(exec);1203 int intArg(exec->argument(0).toInt32(exec)); 1207 1204 if (exec->hadException()) 1208 1205 return JSValue::encode(jsUndefined()); … … 1214 1211 } 1215 1212 1216 int optionalArg = exec->argument(1).toInt32(exec);1213 int optionalArg(exec->argument(1).toInt32(exec)); 1217 1214 if (exec->hadException()) 1218 1215 return JSValue::encode(jsUndefined()); … … 1309 1306 } 1310 1307 1311 int opt = exec->argument(0).toInt32(exec);1308 int opt(exec->argument(0).toInt32(exec)); 1312 1309 if (exec->hadException()) 1313 1310 return JSValue::encode(jsUndefined()); … … 1324 1321 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1325 1322 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1326 int nonOpt = exec->argument(0).toInt32(exec);1323 int nonOpt(exec->argument(0).toInt32(exec)); 1327 1324 if (exec->hadException()) 1328 1325 return JSValue::encode(jsUndefined()); … … 1334 1331 } 1335 1332 1336 int opt = exec->argument(1).toInt32(exec);1333 int opt(exec->argument(1).toInt32(exec)); 1337 1334 if (exec->hadException()) 1338 1335 return JSValue::encode(jsUndefined()); … … 1349 1346 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1350 1347 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1351 int nonOpt = exec->argument(0).toInt32(exec);1348 int nonOpt(exec->argument(0).toInt32(exec)); 1352 1349 if (exec->hadException()) 1353 1350 return JSValue::encode(jsUndefined()); … … 1359 1356 } 1360 1357 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)); 1365 1362 if (exec->hadException()) 1366 1363 return JSValue::encode(jsUndefined()); … … 1394 1391 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1395 1392 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1396 int nonCallback = exec->argument(0).toInt32(exec);1393 int nonCallback(exec->argument(0).toInt32(exec)); 1397 1394 if (exec->hadException()) 1398 1395 return JSValue::encode(jsUndefined()); … … 1434 1431 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1435 1432 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))); 1440 1437 if (exec->hadException()) 1441 1438 return JSValue::encode(jsUndefined()); … … 1452 1449 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1453 1450 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1454 TestObj* objArg = toTestObj(exec->argument(0));1451 TestObj* objArg(toTestObj(exec->argument(0))); 1455 1452 if (exec->hadException()) 1456 1453 return JSValue::encode(jsUndefined()); … … 1462 1459 } 1463 1460 1464 int intArg = exec->argument(1).toInt32(exec);1461 int intArg(exec->argument(1).toInt32(exec)); 1465 1462 if (exec->hadException()) 1466 1463 return JSValue::encode(jsUndefined()); … … 1477 1474 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1478 1475 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))); 1480 1477 if (exec->hadException()) 1481 1478 return JSValue::encode(jsUndefined()); … … 1492 1489 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1493 1490 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1494 int intArg = exec->argument(0).toInt32(exec);1491 int intArg(exec->argument(0).toInt32(exec)); 1495 1492 if (exec->hadException()) 1496 1493 return JSValue::encode(jsUndefined()); … … 1559 1556 } 1560 1557 1561 int arg = exec->argument(0).toInt32(exec);1558 int arg(exec->argument(0).toInt32(exec)); 1562 1559 if (exec->hadException()) 1563 1560 return JSValue::encode(jsUndefined()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r79132 r80072 35 35 public: 36 36 JSTestObj(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestObj>); 37 virtual ~JSTestObj();38 37 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 39 38 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
r80070 r80072 19 19 */ 20 20 21 #ifndef JSTest Interface_h22 #define JSTest Interface_h21 #ifndef JSTestSerializedScriptValueInterface_h 22 #define JSTestSerializedScriptValueInterface_h 23 23 24 24 #if ENABLE(Condition1) || ENABLE(Condition2) … … 31 31 namespace WebCore { 32 32 33 class Test Interface;33 class TestSerializedScriptValueInterface; 34 34 35 class JSTest Interface : public DOMObjectWithGlobalPointer {35 class JSTestSerializedScriptValueInterface : public DOMObjectWithGlobalPointer { 36 36 typedef DOMObjectWithGlobalPointer Base; 37 37 public: 38 JSTestInterface(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestInterface>); 39 virtual ~JSTestInterface(); 38 JSTestSerializedScriptValueInterface(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestSerializedScriptValueInterface>); 40 39 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 41 40 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); … … 49 48 50 49 static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); 51 Test Interface* impl() const { return m_impl.get(); }50 TestSerializedScriptValueInterface* impl() const { return m_impl.get(); } 52 51 53 52 private: 54 RefPtr<Test Interface> m_impl;53 RefPtr<TestSerializedScriptValueInterface> m_impl; 55 54 protected: 56 55 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; 57 56 }; 58 57 59 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Test Interface*);60 Test Interface* toTestInterface(JSC::JSValue);58 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*); 59 TestSerializedScriptValueInterface* toTestSerializedScriptValueInterface(JSC::JSValue); 61 60 62 class JSTest InterfacePrototype : public JSC::JSObjectWithGlobalObject {61 class JSTestSerializedScriptValueInterfacePrototype : public JSC::JSObjectWithGlobalObject { 63 62 typedef JSC::JSObjectWithGlobalObject Base; 64 63 public: … … 69 68 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 70 69 } 71 JSTest InterfacePrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { }70 JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { } 72 71 protected: 73 72 static const unsigned StructureFlags = Base::StructureFlags; … … 76 75 // Attributes 77 76 78 JSC::JSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); 77 JSC::JSValue jsTestSerializedScriptValueInterfaceValue(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); 78 JSC::JSValue jsTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); 79 79 80 80 } // namespace WebCore -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r67421 r80072 30 30 #include "V8IsolatedContext.h" 31 31 #include "V8Proxy.h" 32 #include <wtf/UnusedParam.h> 32 33 33 34 namespace WebCore { … … 51 52 0, 0, 52 53 0, 0); 54 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 53 55 desc->SetCallHandler(V8TestInterface::constructorCallback); 54 56 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
r67421 r80072 27 27 #include "V8DOMWrapper.h" 28 28 #include "WrapperTypeInfo.h" 29 #include "wtf/text/StringHash.h"29 #include <wtf/text/StringHash.h> 30 30 #include <v8.h> 31 31 #include <wtf/HashMap.h> -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
r70226 r80072 25 25 #include "V8DOMWrapper.h" 26 26 #include "WrapperTypeInfo.h" 27 #include "wtf/text/StringHash.h"27 #include <wtf/text/StringHash.h> 28 28 #include <v8.h> 29 29 #include <wtf/HashMap.h> -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
r67421 r80072 25 25 #include "V8DOMWrapper.h" 26 26 #include "WrapperTypeInfo.h" 27 #include "wtf/text/StringHash.h"27 #include <wtf/text/StringHash.h> 28 28 #include <v8.h> 29 29 #include <wtf/HashMap.h> -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r80070 r80072 20 20 21 21 #include "config.h" 22 #include "V8Test Interface.h"22 #include "V8TestSerializedScriptValueInterface.h" 23 23 24 24 #if ENABLE(Condition1) || ENABLE(Condition2) 25 25 26 26 #include "RuntimeEnabledFeatures.h" 27 #include "SerializedScriptValue.h" 27 28 #include "V8Binding.h" 28 29 #include "V8BindingState.h" … … 30 31 #include "V8IsolatedContext.h" 31 32 #include "V8Proxy.h" 33 #include <wtf/UnusedParam.h> 32 34 33 35 namespace WebCore { 34 36 35 WrapperTypeInfo V8Test Interface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, 0 };37 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0 }; 36 38 37 namespace Test InterfaceInternal {39 namespace TestSerializedScriptValueInterfaceInternal { 38 40 39 41 template <typename T> void V8_USE(T) { } 40 42 41 } // namespace Test InterfaceInternal43 } // namespace TestSerializedScriptValueInterfaceInternal 42 44 43 v8::Handle<v8::Value> V8TestInterface::constructorCallback(const v8::Arguments& args)45 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc) 44 46 { 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, 51 48 0, 0, 52 49 0, 0); 53 desc->SetCallHandler(V8TestInterface::constructorCallback);50 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 54 51 55 52 … … 59 56 } 60 57 61 v8::Persistent<v8::FunctionTemplate> V8Test Interface::GetRawTemplate()58 v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetRawTemplate() 62 59 { 63 static v8::Persistent<v8::FunctionTemplate> V8Test InterfaceRawCache = createRawTemplate();64 return V8Test InterfaceRawCache;60 static v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterfaceRawCache = createRawTemplate(); 61 return V8TestSerializedScriptValueInterfaceRawCache; 65 62 } 66 63 67 v8::Persistent<v8::FunctionTemplate> V8Test Interface::GetTemplate()64 v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetTemplate() 68 65 { 69 static v8::Persistent<v8::FunctionTemplate> V8Test InterfaceCache = ConfigureV8TestInterfaceTemplate(GetRawTemplate());70 return V8Test InterfaceCache;66 static v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterfaceCache = ConfigureV8TestSerializedScriptValueInterfaceTemplate(GetRawTemplate()); 67 return V8TestSerializedScriptValueInterfaceCache; 71 68 } 72 69 73 bool V8Test Interface::HasInstance(v8::Handle<v8::Value> value)70 bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> value) 74 71 { 75 72 return GetRawTemplate()->HasInstance(value); … … 77 74 78 75 79 v8::Handle<v8::Object> V8Test Interface::wrapSlow(TestInterface* impl)76 v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(TestSerializedScriptValueInterface* impl) 80 77 { 81 78 v8::Handle<v8::Object> wrapper; … … 86 83 87 84 impl->ref(); 85 SerializedScriptValue::deserializeAndSetProperty(wrapper, "value", static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), impl->value()); 88 86 getDOMObjectMap().set(impl, v8::Persistent<v8::Object>::New(wrapper)); 89 87 return wrapper; 90 88 } 91 89 92 void V8Test Interface::derefObject(void* object)90 void V8TestSerializedScriptValueInterface::derefObject(void* object) 93 91 { 94 static_cast<Test Interface*>(object)->deref();92 static_cast<TestSerializedScriptValueInterface*>(object)->deref(); 95 93 } 96 94 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
r80070 r80072 21 21 #if ENABLE(Condition1) || ENABLE(Condition2) 22 22 23 #ifndef V8Test Interface_h24 #define V8Test Interface_h23 #ifndef V8TestSerializedScriptValueInterface_h 24 #define V8TestSerializedScriptValueInterface_h 25 25 26 #include "Test Interface.h"26 #include "TestSerializedScriptValueInterface.h" 27 27 #include "V8DOMWrapper.h" 28 28 #include "WrapperTypeInfo.h" 29 #include "wtf/text/StringHash.h"29 #include <wtf/text/StringHash.h> 30 30 #include <v8.h> 31 31 #include <wtf/HashMap.h> … … 33 33 namespace WebCore { 34 34 35 class V8Test Interface {35 class V8TestSerializedScriptValueInterface { 36 36 37 37 public: … … 39 39 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); 40 40 static v8::Persistent<v8::FunctionTemplate> GetTemplate(); 41 static Test Interface* toNative(v8::Handle<v8::Object> object)41 static TestSerializedScriptValueInterface* toNative(v8::Handle<v8::Object> object) 42 42 { 43 return reinterpret_cast<Test Interface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));43 return reinterpret_cast<TestSerializedScriptValueInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex)); 44 44 } 45 inline static v8::Handle<v8::Object> wrap(Test Interface*);45 inline static v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*); 46 46 static void derefObject(void*); 47 47 static WrapperTypeInfo info; 48 static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);49 48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; 50 49 private: 51 static v8::Handle<v8::Object> wrapSlow(Test Interface*);50 static v8::Handle<v8::Object> wrapSlow(TestSerializedScriptValueInterface*); 52 51 }; 53 52 54 53 55 v8::Handle<v8::Object> V8Test Interface::wrap(TestInterface* impl)54 v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrap(TestSerializedScriptValueInterface* impl) 56 55 { 57 56 v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl); 58 57 if (!wrapper.IsEmpty()) 59 58 return wrapper; 60 return V8Test Interface::wrapSlow(impl);59 return V8TestSerializedScriptValueInterface::wrapSlow(impl); 61 60 } 62 61 63 inline v8::Handle<v8::Value> toV8(Test Interface* impl)62 inline v8::Handle<v8::Value> toV8(TestSerializedScriptValueInterface* impl) 64 63 { 65 64 if (!impl) 66 65 return v8::Null(); 67 return V8Test Interface::wrap(impl);66 return V8TestSerializedScriptValueInterface::wrap(impl); 68 67 } 69 inline v8::Handle<v8::Value> toV8(PassRefPtr< Test Interface > impl)68 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestSerializedScriptValueInterface > impl) 70 69 { 71 70 return toV8(impl.get()); … … 73 72 } 74 73 75 #endif // V8Test Interface_h74 #endif // V8TestSerializedScriptValueInterface_h 76 75 #endif // ENABLE(Condition1) || ENABLE(Condition2) 77 76
Note: See TracChangeset
for help on using the changeset viewer.