Changeset 120968 in webkit
- Timestamp:
- Jun 21, 2012 3:34:26 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 deleted
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r120967 r120968 1 2012-06-21 Erik Arvidsson <arv@chromium.org> 2 3 [V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue 4 https://bugs.webkit.org/show_bug.cgi?id=80880 5 6 Reviewed by Adam Barth. 7 8 We used to add a hidden property in the getter to the returned wrapper. 9 With this patch we instead handle the liveness of the wrapper in the GC phase by 10 calling v8::V8::AddHiddenReference. 11 12 To reduce the amount of custom code we need, the V8 code generator now supports 13 GenerateIsReachable (as well as CustomIsReachable) which, even though different 14 from the JSC attribute, is used in the same cases and takes the same values (even though 15 at the moment not all JSC values are supported by V8). Interfaces that have *IsReachable 16 also have a dependent life time (just like if V8DependentLifetime was present). 17 18 No new tests. Covered by existing tests. 19 20 * Target.pri: 21 * UseV8.cmake: 22 * WebCore.gypi: 23 * bindings/scripts/CodeGeneratorJS.pm: 24 (GetGenerateIsReachable): Abstracted GenerateIsReachable and JSGenerateIsReachable. 25 (GetCustomIsReachable): Ditto. 26 (GenerateHeader): 27 (GenerateImplementation): 28 * bindings/scripts/CodeGeneratorV8.pm: 29 (NeedsToVisitDOMWrapper): 30 (GetGenerateIsReachable): 31 (GetCustomIsReachable): 32 (GenerateVisitDOMWrapper): 33 (GenerateHeader): 34 (GenerateNamedConstructorCallback): 35 (GenerateImplementation): 36 * bindings/scripts/IDLAttributes.txt: 37 * bindings/scripts/test/V8/V8Float64Array.cpp: 38 (WebCore): 39 * bindings/scripts/test/V8/V8Float64Array.h: 40 (V8Float64Array): 41 * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: 42 (WebCore): 43 * bindings/scripts/test/V8/V8TestActiveDOMObject.h: 44 (V8TestActiveDOMObject): 45 * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: 46 (WebCore): 47 * bindings/scripts/test/V8/V8TestCustomNamedGetter.h: 48 (V8TestCustomNamedGetter): 49 * bindings/scripts/test/V8/V8TestEventConstructor.cpp: 50 (WebCore): 51 * bindings/scripts/test/V8/V8TestEventConstructor.h: 52 (V8TestEventConstructor): 53 * bindings/scripts/test/V8/V8TestEventTarget.cpp: 54 (WebCore): 55 * bindings/scripts/test/V8/V8TestEventTarget.h: 56 (V8TestEventTarget): 57 * bindings/scripts/test/V8/V8TestException.cpp: 58 (WebCore): 59 * bindings/scripts/test/V8/V8TestException.h: 60 (V8TestException): 61 * bindings/scripts/test/V8/V8TestInterface.cpp: 62 (WebCore): 63 * bindings/scripts/test/V8/V8TestInterface.h: 64 (V8TestInterface): 65 * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: 66 (WebCore): 67 * bindings/scripts/test/V8/V8TestMediaQueryListListener.h: 68 (V8TestMediaQueryListListener): 69 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: 70 (WebCore): 71 * bindings/scripts/test/V8/V8TestNamedConstructor.h: 72 (V8TestNamedConstructor): 73 * bindings/scripts/test/V8/V8TestNode.cpp: 74 (WebCore): 75 * bindings/scripts/test/V8/V8TestNode.h: 76 (V8TestNode): 77 * bindings/scripts/test/V8/V8TestObj.cpp: 78 (WebCore): 79 * bindings/scripts/test/V8/V8TestObj.h: 80 (V8TestObj): 81 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: 82 (WebCore): 83 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h: 84 (V8TestSerializedScriptValueInterface): 85 * bindings/v8/NPV8Object.cpp: 86 (WebCore::npObjectTypeInfo): 87 * bindings/v8/V8GCController.cpp: 88 (WebCore::GrouperVisitor::visitDOMWrapper): 89 * bindings/v8/WrapperTypeInfo.h: 90 (WebCore): 91 (WrapperTypeInfo): 92 * bindings/v8/custom/V8CSSStyleSheetCustom.cpp: Removed. 93 * bindings/v8/custom/V8DOMStringMapCustom.cpp: 94 * bindings/v8/custom/V8DOMTokenListCustom.cpp: Removed. 95 * bindings/v8/custom/V8HTMLImageElementConstructor.cpp: 96 (WebCore): 97 * bindings/v8/custom/V8NamedNodeMapCustom.cpp: 98 * bindings/v8/custom/V8StyleSheetCustom.cpp: 99 (WebCore::toV8): 100 * bindings/v8/custom/V8TextTrackListCustom.cpp: Removed. 101 * css/CSSStyleSheet.idl: 102 * css/StyleSheet.idl: 103 * dom/DOMStringMap.idl: 104 * dom/NamedNodeMap.idl: 105 * html/DOMTokenList.idl: 106 * html/track/TextTrackList.idl: 107 1 108 2012-06-21 Alec Flett <alecflett@chromium.org> 2 109 -
trunk/Source/WebCore/Target.pri
r120962 r120968 159 159 bindings/v8/custom/V8CSSRuleCustom.cpp \ 160 160 bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \ 161 bindings/v8/custom/V8CSSStyleSheetCustom.cpp \162 161 bindings/v8/custom/V8CSSValueCustom.cpp \ 163 162 bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \ … … 168 167 bindings/v8/custom/V8InjectedScriptManager.cpp \ 169 168 bindings/v8/custom/V8InspectorFrontendHostCustom.cpp \ 170 bindings/v8/custom/V8DOMStringMapCustom.cpp \ 171 bindings/v8/custom/V8DOMTokenListCustom.cpp 169 bindings/v8/custom/V8DOMStringMapCustom.cpp 172 170 173 171 SOURCES += \ … … 217 215 bindings/v8/custom/V8StyleSheetCustom.cpp \ 218 216 bindings/v8/custom/V8StyleSheetListCustom.cpp \ 219 bindings/v8/custom/V8TextTrackListCustom.cpp \220 217 bindings/v8/custom/V8WebKitAnimationCustom.cpp \ 221 218 bindings/v8/custom/V8WebKitMutationObserverCustom.cpp \ -
trunk/Source/WebCore/UseV8.cmake
r120962 r120968 75 75 bindings/v8/custom/V8CSSRuleCustom.cpp 76 76 bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp 77 bindings/v8/custom/V8CSSStyleSheetCustom.cpp78 77 bindings/v8/custom/V8CSSValueCustom.cpp 79 78 bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp … … 86 85 bindings/v8/custom/V8DOMFormDataCustom.cpp 87 86 bindings/v8/custom/V8DOMStringMapCustom.cpp 88 bindings/v8/custom/V8DOMTokenListCustom.cpp89 87 bindings/v8/custom/V8DOMWindowCustom.cpp 90 88 bindings/v8/custom/V8DataViewCustom.cpp … … 149 147 bindings/v8/custom/V8StyleSheetCustom.cpp 150 148 bindings/v8/custom/V8StyleSheetListCustom.cpp 151 bindings/v8/custom/V8TextTrackListCustom.cpp152 149 bindings/v8/custom/V8Uint16ArrayCustom.cpp 153 150 bindings/v8/custom/V8Uint32ArrayCustom.cpp -
trunk/Source/WebCore/WebCore.gypi
r120962 r120968 2264 2264 'bindings/v8/custom/V8CSSRuleCustom.cpp', 2265 2265 'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp', 2266 'bindings/v8/custom/V8CSSStyleSheetCustom.cpp',2267 2266 'bindings/v8/custom/V8CSSValueCustom.cpp', 2268 2267 'bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp', … … 2277 2276 'bindings/v8/custom/V8DOMFormDataCustom.cpp', 2278 2277 'bindings/v8/custom/V8DOMStringMapCustom.cpp', 2279 'bindings/v8/custom/V8DOMTokenListCustom.cpp',2280 2278 'bindings/v8/custom/V8DOMWindowCustom.cpp', 2281 2279 'bindings/v8/custom/V8DataViewCustom.cpp', … … 2351 2349 'bindings/v8/custom/V8StyleSheetCustom.cpp', 2352 2350 'bindings/v8/custom/V8StyleSheetListCustom.cpp', 2353 'bindings/v8/custom/V8TextTrackListCustom.cpp',2354 2351 'bindings/v8/custom/V8TrackEventCustom.cpp', 2355 2352 'bindings/v8/custom/V8Uint16ArrayCustom.cpp', -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r120866 r120968 385 385 } 386 386 387 sub GetGenerateIsReachable 388 { 389 my $dataNode = shift; 390 return $dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"JSGenerateIsReachable"}; 391 } 392 393 sub GetCustomIsReachable 394 { 395 my $dataNode = shift; 396 return $dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"JSCustomIsReachable"}; 397 } 398 387 399 sub GenerateGetOwnPropertySlotBody 388 400 { … … 994 1006 995 1007 if (!$hasParent || 996 $dataNode->extendedAttributes->{"JSGenerateIsReachable"} ||997 $dataNode->extendedAttributes->{"JSCustomIsReachable"} ||1008 GetGenerateIsReachable($dataNode) || 1009 GetCustomIsReachable($dataNode) || 998 1010 $dataNode->extendedAttributes->{"JSCustomFinalize"} || 999 1011 $dataNode->extendedAttributes->{"ActiveDOMObject"}) { … … 2286 2298 } 2287 2299 2288 if ((!$hasParent && ! $dataNode->extendedAttributes->{"JSCustomIsReachable"})|| $dataNode->extendedAttributes->{"JSGenerateIsReachable"}|| $dataNode->extendedAttributes->{"ActiveDOMObject"}) {2300 if ((!$hasParent && !GetCustomIsReachable($dataNode))|| GetGenerateIsReachable($dataNode) || $dataNode->extendedAttributes->{"ActiveDOMObject"}) { 2289 2301 push(@implContent, "static inline bool isObservable(JS${implClassName}* js${implClassName})\n"); 2290 2302 push(@implContent, "{\n"); … … 2314 2326 push(@implContent, " if (!isObservable(js${implClassName}))\n"); 2315 2327 push(@implContent, " return false;\n"); 2316 if ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}) {2328 if (GetGenerateIsReachable($dataNode)) { 2317 2329 my $rootString; 2318 if ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "Impl") {2330 if (GetGenerateIsReachable($dataNode) eq "Impl") { 2319 2331 $rootString = " ${implType}* root = js${implClassName}->impl();\n"; 2320 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplContext") {2332 } elsif (GetGenerateIsReachable($dataNode) eq "ImplContext") { 2321 2333 $rootString = " WebGLRenderingContext* root = js${implClassName}->impl()->context();\n"; 2322 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplFrame") {2334 } elsif (GetGenerateIsReachable($dataNode) eq "ImplFrame") { 2323 2335 $rootString = " Frame* root = js${implClassName}->impl()->frame();\n"; 2324 2336 $rootString .= " if (!root)\n"; 2325 2337 $rootString .= " return false;\n"; 2326 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplDocument") {2338 } elsif (GetGenerateIsReachable($dataNode) eq "ImplDocument") { 2327 2339 $rootString = " Document* root = js${implClassName}->impl()->document();\n"; 2328 2340 $rootString .= " if (!root)\n"; 2329 2341 $rootString .= " return false;\n"; 2330 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplElementRoot") {2342 } elsif (GetGenerateIsReachable($dataNode) eq "ImplElementRoot") { 2331 2343 $rootString = " Element* element = js${implClassName}->impl()->element();\n"; 2332 2344 $rootString .= " if (!element)\n"; … … 2352 2364 if (!$dataNode->extendedAttributes->{"JSCustomFinalize"} && 2353 2365 (!$hasParent || 2354 $dataNode->extendedAttributes->{"JSGenerateIsReachable"}||2355 $dataNode->extendedAttributes->{"JSCustomIsReachable"}||2366 GetGenerateIsReachable($dataNode) || 2367 GetCustomIsReachable($dataNode) || 2356 2368 $dataNode->extendedAttributes->{"ActiveDOMObject"})) { 2357 2369 push(@implContent, "void JS${implClassName}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n"); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r120866 r120968 182 182 } 183 183 184 sub NeedsToVisitDOMWrapper 185 { 186 my $dataNode = shift; 187 return GetGenerateIsReachable($dataNode) || GetCustomIsReachable($dataNode); 188 } 189 190 sub GetGenerateIsReachable 191 { 192 my $dataNode = shift; 193 return $dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"V8GenerateIsReachable"} || "" 194 } 195 196 sub GetCustomIsReachable 197 { 198 my $dataNode = shift; 199 return $dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"V8CustomIsReachable"}; 200 } 201 202 sub GenerateVisitDOMWrapper 203 { 204 my ($dataNode, $implClassName) = @_; 205 206 if (GetCustomIsReachable($dataNode)) { 207 return; 208 } 209 210 push(@implContent, <<END); 211 void V8${implClassName}::visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper) 212 { 213 ${implClassName}* impl = static_cast<${implClassName}*>(object); 214 END 215 if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot" || 216 GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot" || 217 GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot") { 218 219 my $methodName; 220 $methodName = "element" if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot"); 221 $methodName = "owner" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot"); 222 $methodName = "ownerNode" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot"); 223 224 push(@implContent, <<END); 225 if (Node* owner = impl->${methodName}()) { 226 v8::Persistent<v8::Object> ownerWrapper = store->domNodeMap().get(owner); 227 if (!ownerWrapper.IsEmpty()) { 228 v8::Persistent<v8::Value> value = wrapper; 229 v8::V8::AddImplicitReferences(ownerWrapper, &value, 1); 230 } 231 } 232 END 233 } 234 235 push(@implContent, <<END); 236 } 237 238 END 239 } 240 184 241 sub GetSVGPropertyTypes 185 242 { … … 236 293 $codeGenerator->LinkOverloadedFunctions($dataNode); 237 294 238 my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || $dataNode->extendedAttributes->{"ActiveDOMObject"} || $className =~ /SVG/; 295 my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || $dataNode->extendedAttributes->{"ActiveDOMObject"} 296 || GetGenerateIsReachable($dataNode) || $className =~ /SVG/; 239 297 if (!$hasDependentLifetime) { 240 298 foreach (@{$dataNode->parents}) { … … 330 388 inline static v8::Handle<v8::Object> wrap(${nativeType}*, v8::Isolate* = 0${forceNewObjectParameter}); 331 389 static void derefObject(void*); 390 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 332 391 static WrapperTypeInfo info; 333 392 END … … 1872 1931 if ($dataNode->extendedAttributes->{"ActiveDOMObject"}) { 1873 1932 push(@implContent, <<END); 1874 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, V8${implClassName}::derefObject, V8${implClassName}::toActiveDOMObject, 0, WrapperTypeObjectPrototype };1933 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, V8${implClassName}::derefObject, V8${implClassName}::toActiveDOMObject, 0, 0, WrapperTypeObjectPrototype }; 1875 1934 1876 1935 END 1877 1936 } else { 1878 1937 push(@implContent, <<END); 1879 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, 0, 0, 0, WrapperTypeObjectPrototype };1938 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, 0, 0, 0, 0, WrapperTypeObjectPrototype }; 1880 1939 1881 1940 END … … 2429 2488 2430 2489 my $toActive = $dataNode->extendedAttributes->{"ActiveDOMObject"} ? "${className}::toActiveDOMObject" : "0"; 2490 my $domVisitor = NeedsToVisitDOMWrapper($dataNode) ? "${className}::visitDOMWrapper" : "0"; 2431 2491 2432 2492 # Find the super descriptor. … … 2448 2508 my $WrapperTypePrototype = $dataNode->isException ? "WrapperTypeErrorPrototype" : "WrapperTypeObjectPrototype"; 2449 2509 2450 push(@implContentDecls, "WrapperTypeInfo ${className}::info = { ${className}::GetTemplate, ${className}::derefObject, $toActive, $ parentClassInfo, $WrapperTypePrototype };\n\n");2510 push(@implContentDecls, "WrapperTypeInfo ${className}::info = { ${className}::GetTemplate, ${className}::derefObject, $toActive, $domVisitor, $parentClassInfo, $WrapperTypePrototype };\n\n"); 2451 2511 push(@implContentDecls, "namespace ${interfaceName}V8Internal {\n\n"); 2452 2512 … … 2500 2560 if ($hasConstructors) { 2501 2561 GenerateConstructorGetter($dataNode, $implClassName); 2562 } 2563 2564 if (NeedsToVisitDOMWrapper($dataNode)) { 2565 GenerateVisitDOMWrapper($dataNode, $implClassName); 2502 2566 } 2503 2567 -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt
r120866 r120968 39 39 CustomGetter 40 40 CustomIndexedSetter 41 CustomIsReachable 41 42 CustomNamedGetter 42 43 CustomNamedSetter … … 52 53 EventTarget 53 54 ExtendsDOMGlobalObject 55 GenerateIsReachable=|Impl|ImplContext|ImplDocument|ImplElementRoot|ImplFrame 54 56 Immutable 55 57 ImplementedAs=* 56 58 IndexedGetter 59 InitializedByEventConstructor 57 60 InterfaceName=* 58 InitializedByEventConstructor59 61 IsIndex 60 62 IsWorkerContext … … 108 110 V8CustomConstructor 109 111 V8CustomGetter 112 V8CustomIsReachable 110 113 V8CustomSetter 111 114 V8CustomToJSObject … … 114 117 V8EnabledAtRuntime=* 115 118 V8EnabledPerContext=* 119 V8GenerateIsReachable=|ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot 116 120 V8ReadOnly 117 121 V8Unforgeable -
trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
r120866 r120968 44 44 namespace WebCore { 45 45 46 WrapperTypeInfo V8Float64Array::info = { V8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, &V8ArrayBufferView::info, WrapperTypeObjectPrototype };46 WrapperTypeInfo V8Float64Array::info = { V8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, 0, &V8ArrayBufferView::info, WrapperTypeObjectPrototype }; 47 47 48 48 namespace Float64ArrayV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h
r120866 r120968 45 45 inline static v8::Handle<v8::Object> wrap(Float64Array*, v8::Isolate* = 0); 46 46 static void derefObject(void*); 47 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 47 48 static WrapperTypeInfo info; 48 49 static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
r120866 r120968 36 36 namespace WebCore { 37 37 38 WrapperTypeInfo V8TestActiveDOMObject::info = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0, WrapperTypeObjectPrototype };38 WrapperTypeInfo V8TestActiveDOMObject::info = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0, 0, WrapperTypeObjectPrototype }; 39 39 40 40 namespace TestActiveDOMObjectV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
r120866 r120968 44 44 inline static v8::Handle<v8::Object> wrap(TestActiveDOMObject*, v8::Isolate* = 0); 45 45 static void derefObject(void*); 46 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 46 47 static WrapperTypeInfo info; 47 48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
r120866 r120968 35 35 namespace WebCore { 36 36 37 WrapperTypeInfo V8TestCustomNamedGetter::info = { V8TestCustomNamedGetter::GetTemplate, V8TestCustomNamedGetter::derefObject, 0, 0, WrapperTypeObjectPrototype };37 WrapperTypeInfo V8TestCustomNamedGetter::info = { V8TestCustomNamedGetter::GetTemplate, V8TestCustomNamedGetter::derefObject, 0, 0, 0, WrapperTypeObjectPrototype }; 38 38 39 39 namespace TestCustomNamedGetterV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h
r120866 r120968 44 44 inline static v8::Handle<v8::Object> wrap(TestCustomNamedGetter*, v8::Isolate* = 0); 45 45 static void derefObject(void*); 46 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 46 47 static WrapperTypeInfo info; 47 48 static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
r120866 r120968 35 35 namespace WebCore { 36 36 37 WrapperTypeInfo V8TestEventConstructor::info = { V8TestEventConstructor::GetTemplate, V8TestEventConstructor::derefObject, 0, 0, WrapperTypeObjectPrototype };37 WrapperTypeInfo V8TestEventConstructor::info = { V8TestEventConstructor::GetTemplate, V8TestEventConstructor::derefObject, 0, 0, 0, WrapperTypeObjectPrototype }; 38 38 39 39 namespace TestEventConstructorV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h
r120866 r120968 45 45 inline static v8::Handle<v8::Object> wrap(TestEventConstructor*, v8::Isolate* = 0); 46 46 static void derefObject(void*); 47 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 47 48 static WrapperTypeInfo info; 48 49 static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
r120866 r120968 38 38 namespace WebCore { 39 39 40 WrapperTypeInfo V8TestEventTarget::info = { V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, 0, WrapperTypeObjectPrototype };40 WrapperTypeInfo V8TestEventTarget::info = { V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, 0, 0, WrapperTypeObjectPrototype }; 41 41 42 42 namespace TestEventTargetV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
r120866 r120968 44 44 inline static v8::Handle<v8::Object> wrap(TestEventTarget*, v8::Isolate* = 0); 45 45 static void derefObject(void*); 46 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 46 47 static WrapperTypeInfo info; 47 48 static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t, const v8::AccessorInfo&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
r120866 r120968 33 33 namespace WebCore { 34 34 35 WrapperTypeInfo V8TestException::info = { V8TestException::GetTemplate, V8TestException::derefObject, 0, 0, WrapperTypeErrorPrototype };35 WrapperTypeInfo V8TestException::info = { V8TestException::GetTemplate, V8TestException::derefObject, 0, 0, 0, WrapperTypeErrorPrototype }; 36 36 37 37 namespace TestExceptionV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.h
r120866 r120968 44 44 inline static v8::Handle<v8::Object> wrap(TestException*, v8::Isolate* = 0); 45 45 static void derefObject(void*); 46 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 46 47 static WrapperTypeInfo info; 47 48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r120866 r120968 43 43 namespace WebCore { 44 44 45 WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, WrapperTypeObjectPrototype };45 WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, 0, WrapperTypeObjectPrototype }; 46 46 47 47 namespace TestInterfaceV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
r120866 r120968 46 46 inline static v8::Handle<v8::Object> wrap(TestInterface*, v8::Isolate* = 0); 47 47 static void derefObject(void*); 48 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 48 49 static WrapperTypeInfo info; 49 50 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
r120866 r120968 36 36 namespace WebCore { 37 37 38 WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0, 0, WrapperTypeObjectPrototype };38 WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0, 0, 0, WrapperTypeObjectPrototype }; 39 39 40 40 namespace TestMediaQueryListListenerV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
r120866 r120968 44 44 inline static v8::Handle<v8::Object> wrap(TestMediaQueryListListener*, v8::Isolate* = 0); 45 45 static void derefObject(void*); 46 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 46 47 static WrapperTypeInfo info; 47 48 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
r120866 r120968 35 35 namespace WebCore { 36 36 37 WrapperTypeInfo V8TestNamedConstructor::info = { V8TestNamedConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, WrapperTypeObjectPrototype };37 WrapperTypeInfo V8TestNamedConstructor::info = { V8TestNamedConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, WrapperTypeObjectPrototype }; 38 38 39 39 namespace TestNamedConstructorV8Internal { … … 43 43 } // namespace TestNamedConstructorV8Internal 44 44 45 WrapperTypeInfo V8TestNamedConstructorConstructor::info = { V8TestNamedConstructorConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, WrapperTypeObjectPrototype };45 WrapperTypeInfo V8TestNamedConstructorConstructor::info = { V8TestNamedConstructorConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, WrapperTypeObjectPrototype }; 46 46 47 47 static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8::Arguments& args) -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h
r120866 r120968 50 50 inline static v8::Handle<v8::Object> wrap(TestNamedConstructor*, v8::Isolate* = 0); 51 51 static void derefObject(void*); 52 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 52 53 static WrapperTypeInfo info; 53 54 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
r120866 r120968 34 34 namespace WebCore { 35 35 36 WrapperTypeInfo V8TestNode::info = { V8TestNode::GetTemplate, V8TestNode::derefObject, 0, &V8Node::info, WrapperTypeObjectPrototype };36 WrapperTypeInfo V8TestNode::info = { V8TestNode::GetTemplate, V8TestNode::derefObject, 0, 0, &V8Node::info, WrapperTypeObjectPrototype }; 37 37 38 38 namespace TestNodeV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h
r120866 r120968 44 44 inline static v8::Handle<v8::Object> wrap(TestNode*, v8::Isolate* = 0); 45 45 static void derefObject(void*); 46 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 46 47 static WrapperTypeInfo info; 47 48 static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r120866 r120968 77 77 namespace WebCore { 78 78 79 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0, 0, WrapperTypeObjectPrototype };79 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0, 0, 0, WrapperTypeObjectPrototype }; 80 80 81 81 namespace TestObjV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
r120866 r120968 44 44 inline static v8::Handle<v8::Object> wrap(TestObj*, v8::Isolate* = 0); 45 45 static void derefObject(void*); 46 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 46 47 static WrapperTypeInfo info; 47 48 static v8::Handle<v8::Value> customMethodCallback(const v8::Arguments&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r120866 r120968 41 41 namespace WebCore { 42 42 43 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0, WrapperTypeObjectPrototype };43 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0, 0, WrapperTypeObjectPrototype }; 44 44 45 45 namespace TestSerializedScriptValueInterfaceV8Internal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
r120866 r120968 46 46 inline static v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*, v8::Isolate* = 0); 47 47 static void derefObject(void*); 48 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 48 49 static WrapperTypeInfo info; 49 50 static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); -
trunk/Source/WebCore/bindings/v8/NPV8Object.cpp
r120866 r120968 54 54 WrapperTypeInfo* npObjectTypeInfo() 55 55 { 56 static WrapperTypeInfo typeInfo = { 0, 0, 0, 0, WrapperTypeObjectPrototype };56 static WrapperTypeInfo typeInfo = { 0, 0, 0, 0, 0, WrapperTypeObjectPrototype }; 57 57 return &typeInfo; 58 58 } -
trunk/Source/WebCore/bindings/v8/V8GCController.cpp
r120866 r120968 341 341 void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper) 342 342 { 343 WrapperTypeInfo* info = V8DOMWrapper::domWrapperType(wrapper); 344 if (info->domWrapperVisitorFunction) 345 info->domWrapperVisitorFunction(store, object, wrapper); 343 346 } 344 347 -
trunk/Source/WebCore/bindings/v8/WrapperTypeInfo.h
r120866 r120968 37 37 38 38 class ActiveDOMObject; 39 class DOMDataStore; 39 40 40 41 static const int v8DOMWrapperTypeIndex = 0; … … 47 48 typedef void (*DerefObjectFunction)(void*); 48 49 typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>); 50 typedef void (*DOMWrapperVisitorFunction)(DOMDataStore*, void*, v8::Persistent<v8::Object>); 49 51 50 52 enum WrapperTypePrototype { … … 97 99 const DerefObjectFunction derefObjectFunction; 98 100 const ToActiveDOMObjectFunction toActiveDOMObjectFunction; 101 const DOMWrapperVisitorFunction domWrapperVisitorFunction; 99 102 const WrapperTypeInfo* parentClass; 100 103 const WrapperTypePrototype wrapperTypePrototype; -
trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
r120866 r120968 85 85 } 86 86 87 v8::Handle<v8::Value> toV8(DOMStringMap* impl, v8::Isolate* isolate)88 {89 if (!impl)90 return v8NullWithCheck(isolate);91 v8::Handle<v8::Object> wrapper = V8DOMStringMap::wrap(impl, isolate);92 // Add a hidden reference from the element to the DOMStringMap.93 Element* element = impl->element();94 if (!wrapper.IsEmpty() && element) {95 v8::Handle<v8::Value> elementValue = toV8(element, isolate);96 if (!elementValue.IsEmpty() && elementValue->IsObject())97 elementValue.As<v8::Object>()->SetHiddenValue(V8HiddenPropertyName::domStringMap(), wrapper);98 }99 return wrapper;100 }101 102 87 } // namespace WebCore -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
r120866 r120968 45 45 namespace WebCore { 46 46 47 WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, 0, 0, WrapperTypeObjectPrototype };47 WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, 0, 0, 0, WrapperTypeObjectPrototype }; 48 48 49 49 static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arguments& args) -
trunk/Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp
r120866 r120968 72 72 } 73 73 74 v8::Handle<v8::Value> toV8(NamedNodeMap* impl, v8::Isolate* isolate)75 {76 if (!impl)77 return v8NullWithCheck(isolate);78 v8::Handle<v8::Object> wrapper = V8NamedNodeMap::wrap(impl, isolate);79 // Add a hidden reference from named node map to its owner node.80 Element* element = impl->element();81 if (!wrapper.IsEmpty() && element)82 wrapper->SetHiddenValue(V8HiddenPropertyName::ownerNode(), toV8(element, isolate));83 return wrapper;84 }85 86 74 } // namespace WebCore -
trunk/Source/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp
r120866 r120968 43 43 return v8NullWithCheck(isolate); 44 44 if (impl->isCSSStyleSheet()) 45 return toV8(static_cast<CSSStyleSheet*>(impl), isolate); 46 v8::Handle<v8::Object> wrapper = V8StyleSheet::wrap(impl, isolate); 47 // Add a hidden reference from stylesheet object to its owner node. 48 Node* ownerNode = impl->ownerNode(); 49 if (ownerNode && !wrapper.IsEmpty()) 50 V8DOMWrapper::setNamedHiddenReference(wrapper, "ownerNode", toV8(ownerNode, isolate)); 51 return wrapper; 45 return toV8(static_cast<CSSStyleSheet*>(impl)); 46 return V8StyleSheet::wrap(impl, isolate); 52 47 } 53 48 -
trunk/Source/WebCore/css/CSSStyleSheet.idl
r120866 r120968 23 23 // Introduced in DOM Level 2: 24 24 interface [ 25 V8 CustomToJSObject25 V8GenerateIsReachable=ImplOwnerNodeRoot 26 26 ] CSSStyleSheet : StyleSheet { 27 27 readonly attribute CSSRule ownerRule; -
trunk/Source/WebCore/css/StyleSheet.idl
r120866 r120968 27 27 CustomToJSObject, 28 28 ObjCPolymorphic, 29 V8 DependentLifetime29 V8GenerateIsReachable=ImplOwnerNodeRoot 30 30 ] StyleSheet { 31 31 readonly attribute [TreatReturnedNullStringAs=Null] DOMString type; -
trunk/Source/WebCore/dom/DOMStringMap.idl
r120866 r120968 27 27 28 28 interface [ 29 JSGenerateIsReachable=ImplElementRoot,29 GenerateIsReachable=ImplElementRoot, 30 30 NamedGetter, 31 31 CustomDeleteProperty, 32 32 CustomEnumerateProperty, 33 CustomNamedSetter, 34 V8CustomToJSObject 33 CustomNamedSetter 35 34 ] DOMStringMap { 36 35 }; -
trunk/Source/WebCore/dom/NamedNodeMap.idl
r120866 r120968 22 22 23 23 interface [ 24 JSGenerateIsReachable=ImplElementRoot, 24 GenerateIsReachable=ImplElementRoot, 25 IndexedGetter, 25 26 JSCustomMarkFunction, 26 IndexedGetter, 27 NamedGetter, 28 V8CustomToJSObject 27 NamedGetter 29 28 ] NamedNodeMap { 30 29 -
trunk/Source/WebCore/html/DOMTokenList.idl
r120866 r120968 26 26 27 27 interface [ 28 JSGenerateIsReachable=ImplElementRoot, 29 IndexedGetter, 30 V8CustomToJSObject 28 GenerateIsReachable=ImplElementRoot, 29 IndexedGetter 31 30 ] DOMTokenList { 32 31 readonly attribute unsigned long length; -
trunk/Source/WebCore/html/track/TextTrackList.idl
r120866 r120968 29 29 Conditional=VIDEO_TRACK, 30 30 V8EnabledAtRuntime=webkitVideoTrack, 31 V8CustomToJSObject,32 31 IndexedGetter, 33 32 EventTarget, 34 33 JSCustomMarkFunction, 35 JSCustomIsReachable 34 JSCustomIsReachable, 35 V8GenerateIsReachable=ImplOwnerRoot 36 36 ] TextTrackList { 37 37 readonly attribute unsigned long length;
Note: See TracChangeset
for help on using the changeset viewer.