Changeset 110641 in webkit
- Timestamp:
- Mar 13, 2012 4:56:45 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110640 r110641 1 2012-03-13 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 * platform/chromium/test_expectations.txt: 9 1 10 2012-03-13 Jacky Jiang <zhajiang@rim.com> 2 11 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r110637 r110641 618 618 BUGWK66377 : fast/dom/StyleSheet/gc-parent-stylesheet.html = TEXT 619 619 BUGWK66377 : fast/dom/StyleSheet/gc-rule-children-wrappers.html = TEXT 620 BUGWK66377 : fast/dom/StyleSheet/gc-styleheet-wrapper.xhtml = TEXT621 620 622 621 // ----------------------------------------------------------------- … … 3422 3421 BUGWK66953 : transitions/default-timing-function.html = PASS FAIL 3423 3422 3424 BUGWK73865 : media/track/tracklist-is-reachable.html = TEXT CRASH3425 3423 BUGWK73865 : media/track/text-track-cue-is-reachable.html = TEXT CRASH 3426 3424 BUGWK73865 : media/track/text-track-is-reachable.html = TEXT CRASH -
trunk/Source/WebCore/ChangeLog
r110640 r110641 1 2012-03-13 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 Second try. This time with an added include in TextTrackList.cpp. 19 20 No new tests. Covered by existing tests. 21 22 * Target.pri: 23 * UseV8.cmake: 24 * WebCore.gypi: 25 * bindings/scripts/CodeGeneratorJS.pm: 26 (GetGenerateIsReachable): 27 (GetCustomIsReachable): 28 (GenerateHeader): 29 (GenerateImplementation): 30 * bindings/scripts/CodeGeneratorV8.pm: 31 (NeedsToVisitDOMWrapper): 32 (GetGenerateIsReachable): 33 (GetCustomIsReachable): 34 (GenerateVisitDOMWrapper): 35 (GenerateHeader): 36 (GenerateNamedConstructorCallback): 37 (GenerateImplementation): 38 * bindings/scripts/IDLAttributes.txt: 39 * bindings/scripts/test/V8/V8Float64Array.cpp: 40 (WebCore): 41 * bindings/scripts/test/V8/V8Float64Array.h: 42 (V8Float64Array): 43 * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: 44 (WebCore): 45 * bindings/scripts/test/V8/V8TestActiveDOMObject.h: 46 (V8TestActiveDOMObject): 47 * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: 48 (WebCore): 49 * bindings/scripts/test/V8/V8TestCustomNamedGetter.h: 50 (V8TestCustomNamedGetter): 51 * bindings/scripts/test/V8/V8TestEventConstructor.cpp: 52 (WebCore): 53 * bindings/scripts/test/V8/V8TestEventConstructor.h: 54 (V8TestEventConstructor): 55 * bindings/scripts/test/V8/V8TestEventTarget.cpp: 56 (WebCore): 57 * bindings/scripts/test/V8/V8TestEventTarget.h: 58 (V8TestEventTarget): 59 * bindings/scripts/test/V8/V8TestInterface.cpp: 60 (WebCore): 61 * bindings/scripts/test/V8/V8TestInterface.h: 62 (V8TestInterface): 63 * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: 64 (WebCore): 65 * bindings/scripts/test/V8/V8TestMediaQueryListListener.h: 66 (V8TestMediaQueryListListener): 67 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: 68 (WebCore): 69 * bindings/scripts/test/V8/V8TestNamedConstructor.h: 70 (V8TestNamedConstructor): 71 * bindings/scripts/test/V8/V8TestObj.cpp: 72 (WebCore): 73 * bindings/scripts/test/V8/V8TestObj.h: 74 (V8TestObj): 75 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: 76 (WebCore): 77 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h: 78 (V8TestSerializedScriptValueInterface): 79 * bindings/v8/NPV8Object.cpp: 80 (WebCore::npObjectTypeInfo): 81 * bindings/v8/V8GCController.cpp: 82 (WebCore::GrouperVisitor::visitDOMWrapper): 83 * bindings/v8/WrapperTypeInfo.h: 84 (WebCore): 85 (WrapperTypeInfo): 86 * bindings/v8/custom/V8CSSStyleSheetCustom.cpp: Removed. 87 * bindings/v8/custom/V8DOMStringMapCustom.cpp: 88 * bindings/v8/custom/V8DOMTokenListCustom.cpp: Removed. 89 * bindings/v8/custom/V8HTMLImageElementConstructor.cpp: 90 (WebCore): 91 * bindings/v8/custom/V8NamedNodeMapCustom.cpp: 92 * bindings/v8/custom/V8StyleSheetCustom.cpp: 93 (WebCore::toV8): 94 * css/CSSStyleSheet.idl: 95 * css/StyleSheet.idl: 96 * dom/DOMStringMap.idl: 97 * dom/NamedNodeMap.idl: 98 * html/DOMTokenList.idl: 99 * html/track/TextTrackList.cpp: 100 * html/track/TextTrackList.idl: 101 1 102 2012-03-13 Jacky Jiang <zhajiang@rim.com> 2 103 -
trunk/Source/WebCore/Target.pri
r110639 r110641 161 161 bindings/v8/custom/V8CSSRuleCustom.cpp \ 162 162 bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \ 163 bindings/v8/custom/V8CSSStyleSheetCustom.cpp \164 163 bindings/v8/custom/V8CSSValueCustom.cpp \ 165 164 bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \ … … 171 170 bindings/v8/custom/V8InjectedScriptManager.cpp \ 172 171 bindings/v8/custom/V8InspectorFrontendHostCustom.cpp \ 173 bindings/v8/custom/V8DOMStringMapCustom.cpp \ 174 bindings/v8/custom/V8DOMTokenListCustom.cpp 172 bindings/v8/custom/V8DOMStringMapCustom.cpp 175 173 176 174 SOURCES += \ -
trunk/Source/WebCore/UseV8.cmake
r110547 r110641 74 74 bindings/v8/custom/V8CSSRuleCustom.cpp 75 75 bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp 76 bindings/v8/custom/V8CSSStyleSheetCustom.cpp77 76 bindings/v8/custom/V8CSSValueCustom.cpp 78 77 bindings/v8/custom/V8CanvasPixelArrayCustom.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 -
trunk/Source/WebCore/WebCore.gypi
r110639 r110641 2011 2011 'bindings/v8/custom/V8CSSRuleCustom.cpp', 2012 2012 'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp', 2013 'bindings/v8/custom/V8CSSStyleSheetCustom.cpp',2014 2013 'bindings/v8/custom/V8CSSValueCustom.cpp', 2015 2014 'bindings/v8/custom/V8CanvasPixelArrayCustom.cpp', … … 2025 2024 'bindings/v8/custom/V8DOMFormDataCustom.cpp', 2026 2025 'bindings/v8/custom/V8DOMStringMapCustom.cpp', 2027 'bindings/v8/custom/V8DOMTokenListCustom.cpp',2028 2026 'bindings/v8/custom/V8DOMWindowCustom.cpp', 2029 2027 'bindings/v8/custom/V8DataViewCustom.cpp', -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r110547 r110641 382 382 } 383 383 384 sub GetGenerateIsReachable 385 { 386 my $dataNode = shift; 387 return $dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"JSGenerateIsReachable"}; 388 } 389 390 sub GetCustomIsReachable 391 { 392 my $dataNode = shift; 393 return $dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"JSCustomIsReachable"}; 394 } 395 384 396 sub GenerateConditionalString 385 397 { … … 981 993 982 994 if (!$hasParent || 983 $dataNode->extendedAttributes->{"JSGenerateIsReachable"} ||984 $dataNode->extendedAttributes->{"JSCustomIsReachable"} ||995 GetGenerateIsReachable($dataNode) || 996 GetCustomIsReachable($dataNode) || 985 997 $dataNode->extendedAttributes->{"JSCustomFinalize"} || 986 998 $dataNode->extendedAttributes->{"ActiveDOMObject"}) { … … 2269 2281 } 2270 2282 2271 if ((!$hasParent && ! $dataNode->extendedAttributes->{"JSCustomIsReachable"})|| $dataNode->extendedAttributes->{"JSGenerateIsReachable"}|| $dataNode->extendedAttributes->{"ActiveDOMObject"}) {2283 if ((!$hasParent && !GetCustomIsReachable($dataNode))|| GetGenerateIsReachable($dataNode) || $dataNode->extendedAttributes->{"ActiveDOMObject"}) { 2272 2284 push(@implContent, "static inline bool isObservable(JS${implClassName}* js${implClassName})\n"); 2273 2285 push(@implContent, "{\n"); … … 2297 2309 push(@implContent, " if (!isObservable(js${implClassName}))\n"); 2298 2310 push(@implContent, " return false;\n"); 2299 if ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}) {2311 if (GetGenerateIsReachable($dataNode)) { 2300 2312 my $rootString; 2301 if ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "Impl") {2313 if (GetGenerateIsReachable($dataNode) eq "Impl") { 2302 2314 $rootString = " ${implType}* root = js${implClassName}->impl();\n"; 2303 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplContext") {2315 } elsif (GetGenerateIsReachable($dataNode) eq "ImplContext") { 2304 2316 $rootString = " WebGLRenderingContext* root = js${implClassName}->impl()->context();\n"; 2305 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplFrame") {2317 } elsif (GetGenerateIsReachable($dataNode) eq "ImplFrame") { 2306 2318 $rootString = " Frame* root = js${implClassName}->impl()->frame();\n"; 2307 2319 $rootString .= " if (!root)\n"; 2308 2320 $rootString .= " return false;\n"; 2309 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplDocument") {2321 } elsif (GetGenerateIsReachable($dataNode) eq "ImplDocument") { 2310 2322 $rootString = " Document* root = js${implClassName}->impl()->document();\n"; 2311 2323 $rootString .= " if (!root)\n"; 2312 2324 $rootString .= " return false;\n"; 2313 } elsif ( $dataNode->extendedAttributes->{"JSGenerateIsReachable"}eq "ImplElementRoot") {2325 } elsif (GetGenerateIsReachable($dataNode) eq "ImplElementRoot") { 2314 2326 $rootString = " Element* element = js${implClassName}->impl()->element();\n"; 2315 2327 $rootString .= " if (!element)\n"; … … 2335 2347 if (!$dataNode->extendedAttributes->{"JSCustomFinalize"} && 2336 2348 (!$hasParent || 2337 $dataNode->extendedAttributes->{"JSGenerateIsReachable"}||2338 $dataNode->extendedAttributes->{"JSCustomIsReachable"}||2349 GetGenerateIsReachable($dataNode) || 2350 GetCustomIsReachable($dataNode) || 2339 2351 $dataNode->extendedAttributes->{"ActiveDOMObject"})) { 2340 2352 push(@implContent, "void JS${implClassName}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n"); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r110547 r110641 193 193 } 194 194 195 sub NeedsToVisitDOMWrapper 196 { 197 my $dataNode = shift; 198 return GetGenerateIsReachable($dataNode) || GetCustomIsReachable($dataNode); 199 } 200 201 sub GetGenerateIsReachable 202 { 203 my $dataNode = shift; 204 return $dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"V8GenerateIsReachable"} || "" 205 } 206 207 sub GetCustomIsReachable 208 { 209 my $dataNode = shift; 210 return $dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"V8CustomIsReachable"}; 211 } 212 213 sub GenerateVisitDOMWrapper 214 { 215 my ($dataNode, $implClassName) = @_; 216 217 if (GetCustomIsReachable($dataNode)) { 218 return; 219 } 220 221 push(@implContent, <<END); 222 void V8${implClassName}::visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper) 223 { 224 ${implClassName}* impl = static_cast<${implClassName}*>(object); 225 END 226 if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot" || 227 GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot" || 228 GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot") { 229 230 my $methodName; 231 $methodName = "element" if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot"); 232 $methodName = "owner" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot"); 233 $methodName = "ownerNode" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot"); 234 235 push(@implContent, <<END); 236 if (Node* owner = impl->${methodName}()) { 237 v8::Persistent<v8::Object> ownerWrapper = getDOMNodeMap().get(owner); 238 if (!ownerWrapper.IsEmpty()) { 239 v8::Persistent<v8::Value> value = wrapper; 240 v8::V8::AddImplicitReferences(ownerWrapper, &value, 1); 241 } 242 } 243 END 244 } 245 246 push(@implContent, <<END); 247 } 248 249 END 250 } 251 195 252 sub GetSVGPropertyTypes 196 253 { … … 247 304 $codeGenerator->LinkOverloadedFunctions($dataNode); 248 305 249 my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || $dataNode->extendedAttributes->{"ActiveDOMObject"} || $className =~ /SVG/; 306 my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || $dataNode->extendedAttributes->{"ActiveDOMObject"} 307 || GetGenerateIsReachable($dataNode) || $className =~ /SVG/; 250 308 if (!$hasDependentLifetime) { 251 309 foreach (@{$dataNode->parents}) { … … 341 399 inline static v8::Handle<v8::Object> wrap(${nativeType}*${forceNewObjectParameter}); 342 400 static void derefObject(void*); 401 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 343 402 static WrapperTypeInfo info; 344 403 END … … 1797 1856 if ($dataNode->extendedAttributes->{"ActiveDOMObject"}) { 1798 1857 push(@implContent, <<END); 1799 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, V8${implClassName}::derefObject, V8${implClassName}::toActiveDOMObject, 0 };1858 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, V8${implClassName}::derefObject, V8${implClassName}::toActiveDOMObject, 0, 0 }; 1800 1859 1801 1860 END 1802 1861 } else { 1803 1862 push(@implContent, <<END); 1804 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, 0, 0, 0 };1863 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, 0, 0, 0, 0 }; 1805 1864 1806 1865 END … … 2247 2306 2248 2307 my $toActive = $dataNode->extendedAttributes->{"ActiveDOMObject"} ? "${className}::toActiveDOMObject" : "0"; 2308 my $domVisitor = NeedsToVisitDOMWrapper($dataNode) ? "${className}::visitDOMWrapper" : "0"; 2249 2309 2250 2310 # Find the super descriptor. … … 2263 2323 push(@implContentDecls, "namespace WebCore {\n\n"); 2264 2324 my $parentClassInfo = $parentClass ? "&${parentClass}::info" : "0"; 2265 push(@implContentDecls, "WrapperTypeInfo ${className}::info = { ${className}::GetTemplate, ${className}::derefObject, ${toActive}, ${ parentClassInfo} };\n\n");2325 push(@implContentDecls, "WrapperTypeInfo ${className}::info = { ${className}::GetTemplate, ${className}::derefObject, ${toActive}, ${domVisitor}, ${parentClassInfo} };\n\n"); 2266 2326 push(@implContentDecls, "namespace ${interfaceName}Internal {\n\n"); 2267 2327 push(@implContentDecls, "template <typename T> void V8_USE(T) { }\n\n"); … … 2314 2374 if ($hasConstructors) { 2315 2375 GenerateConstructorGetter($dataNode, $implClassName); 2376 } 2377 2378 if (NeedsToVisitDOMWrapper($dataNode)) { 2379 GenerateVisitDOMWrapper($dataNode, $implClassName); 2316 2380 } 2317 2381 -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt
r110537 r110641 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 … … 105 107 V8CustomConstructor 106 108 V8CustomGetter 109 V8CustomIsReachable 107 110 V8CustomSetter 108 111 V8CustomToJSObject … … 110 113 V8DoNotCheckSignature 111 114 V8EnabledAtRuntime=* 115 V8GenerateIsReachable=|ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot 112 116 V8ReadOnly 113 117 V8Unforgeable -
trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
r110537 r110641 43 43 namespace WebCore { 44 44 45 WrapperTypeInfo V8Float64Array::info = { V8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, &V8ArrayBufferView::info };45 WrapperTypeInfo V8Float64Array::info = { V8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, 0, &V8ArrayBufferView::info }; 46 46 47 47 namespace Float64ArrayInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h
r110537 r110641 44 44 inline static v8::Handle<v8::Object> wrap(Float64Array*); 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/V8TestActiveDOMObject.cpp
r110537 r110641 35 35 namespace WebCore { 36 36 37 WrapperTypeInfo V8TestActiveDOMObject::info = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0 };37 WrapperTypeInfo V8TestActiveDOMObject::info = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0, 0 }; 38 38 39 39 namespace TestActiveDOMObjectInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
r110537 r110641 43 43 inline static v8::Handle<v8::Object> wrap(TestActiveDOMObject*); 44 44 static void derefObject(void*); 45 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 45 46 static WrapperTypeInfo info; 46 47 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
r110537 r110641 34 34 namespace WebCore { 35 35 36 WrapperTypeInfo V8TestCustomNamedGetter::info = { V8TestCustomNamedGetter::GetTemplate, V8TestCustomNamedGetter::derefObject, 0, 0 };36 WrapperTypeInfo V8TestCustomNamedGetter::info = { V8TestCustomNamedGetter::GetTemplate, V8TestCustomNamedGetter::derefObject, 0, 0, 0 }; 37 37 38 38 namespace TestCustomNamedGetterInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h
r110537 r110641 43 43 inline static v8::Handle<v8::Object> wrap(TestCustomNamedGetter*); 44 44 static void derefObject(void*); 45 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 45 46 static WrapperTypeInfo info; 46 47 static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
r110547 r110641 34 34 namespace WebCore { 35 35 36 WrapperTypeInfo V8TestEventConstructor::info = { V8TestEventConstructor::GetTemplate, V8TestEventConstructor::derefObject, 0, 0 };36 WrapperTypeInfo V8TestEventConstructor::info = { V8TestEventConstructor::GetTemplate, V8TestEventConstructor::derefObject, 0, 0, 0 }; 37 37 38 38 namespace TestEventConstructorInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h
r110547 r110641 44 44 inline static v8::Handle<v8::Object> wrap(TestEventConstructor*); 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/V8TestEventTarget.cpp
r110537 r110641 37 37 namespace WebCore { 38 38 39 WrapperTypeInfo V8TestEventTarget::info = { V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, 0 };39 WrapperTypeInfo V8TestEventTarget::info = { V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, 0, 0 }; 40 40 41 41 namespace TestEventTargetInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
r110537 r110641 43 43 inline static v8::Handle<v8::Object> wrap(TestEventTarget*); 44 44 static void derefObject(void*); 45 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 45 46 static WrapperTypeInfo info; 46 47 static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t, const v8::AccessorInfo&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r110537 r110641 42 42 namespace WebCore { 43 43 44 WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0 };44 WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, 0 }; 45 45 46 46 namespace TestInterfaceInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
r110537 r110641 45 45 inline static v8::Handle<v8::Object> wrap(TestInterface*); 46 46 static void derefObject(void*); 47 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 47 48 static WrapperTypeInfo info; 48 49 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
r110537 r110641 35 35 namespace WebCore { 36 36 37 WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0, 0 };37 WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0, 0, 0 }; 38 38 39 39 namespace TestMediaQueryListListenerInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
r110537 r110641 43 43 inline static v8::Handle<v8::Object> wrap(TestMediaQueryListListener*); 44 44 static void derefObject(void*); 45 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 45 46 static WrapperTypeInfo info; 46 47 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
r110537 r110641 34 34 namespace WebCore { 35 35 36 WrapperTypeInfo V8TestNamedConstructor::info = { V8TestNamedConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0 };36 WrapperTypeInfo V8TestNamedConstructor::info = { V8TestNamedConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0 }; 37 37 38 38 namespace TestNamedConstructorInternal { … … 42 42 } // namespace TestNamedConstructorInternal 43 43 44 WrapperTypeInfo V8TestNamedConstructorConstructor::info = { V8TestNamedConstructorConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0 };44 WrapperTypeInfo V8TestNamedConstructorConstructor::info = { V8TestNamedConstructorConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0 }; 45 45 46 46 static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8::Arguments& args) -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h
r110537 r110641 49 49 inline static v8::Handle<v8::Object> wrap(TestNamedConstructor*); 50 50 static void derefObject(void*); 51 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 51 52 static WrapperTypeInfo info; 52 53 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r110547 r110641 72 72 namespace WebCore { 73 73 74 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0, 0 };74 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0, 0, 0 }; 75 75 76 76 namespace TestObjInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
r110537 r110641 43 43 inline static v8::Handle<v8::Object> wrap(TestObj*); 44 44 static void derefObject(void*); 45 static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>); 45 46 static WrapperTypeInfo info; 46 47 static v8::Handle<v8::Value> customMethodCallback(const v8::Arguments&); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r110537 r110641 37 37 namespace WebCore { 38 38 39 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0 };39 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0, 0 }; 40 40 41 41 namespace TestSerializedScriptValueInterfaceInternal { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
r110537 r110641 45 45 inline static v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*); 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/v8/NPV8Object.cpp
r110537 r110641 54 54 WrapperTypeInfo* npObjectTypeInfo() 55 55 { 56 static WrapperTypeInfo typeInfo = { 0, 0, 0, 0 };56 static WrapperTypeInfo typeInfo = { 0, 0, 0, 0, 0 }; 57 57 return &typeInfo; 58 58 } -
trunk/Source/WebCore/bindings/v8/V8GCController.cpp
r110537 r110641 337 337 void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper) 338 338 { 339 WrapperTypeInfo* info = V8DOMWrapper::domWrapperType(wrapper); 340 if (info->domWrapperVisitorFunction) 341 info->domWrapperVisitorFunction(store, object, wrapper); 339 342 } 340 343 -
trunk/Source/WebCore/bindings/v8/WrapperTypeInfo.h
r110537 r110641 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 // This struct provides a way to store a bunch of information that is helpful when unwrapping … … 92 94 const DerefObjectFunction derefObjectFunction; 93 95 const ToActiveDOMObjectFunction toActiveDOMObjectFunction; 96 const DOMWrapperVisitorFunction domWrapperVisitorFunction; 94 97 const WrapperTypeInfo* parentClass; 95 98 }; -
trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
r110537 r110641 85 85 } 86 86 87 v8::Handle<v8::Value> toV8(DOMStringMap* impl)88 {89 if (!impl)90 return v8::Null();91 v8::Handle<v8::Object> wrapper = V8DOMStringMap::wrap(impl);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);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
r110537 r110641 45 45 namespace WebCore { 46 46 47 WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, 0, 0 };47 WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, 0, 0, 0 }; 48 48 49 49 static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arguments& args) -
trunk/Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp
r110537 r110641 72 72 } 73 73 74 v8::Handle<v8::Value> toV8(NamedNodeMap* impl)75 {76 if (!impl)77 return v8::Null();78 v8::Handle<v8::Object> wrapper = V8NamedNodeMap::wrap(impl);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));83 return wrapper;84 }85 86 74 } // namespace WebCore -
trunk/Source/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp
r110537 r110641 44 44 if (impl->isCSSStyleSheet()) 45 45 return toV8(static_cast<CSSStyleSheet*>(impl)); 46 v8::Handle<v8::Object> wrapper = V8StyleSheet::wrap(impl); 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)); 51 return wrapper; 46 return V8StyleSheet::wrap(impl); 52 47 } 53 48 -
trunk/Source/WebCore/css/CSSStyleSheet.idl
r110537 r110641 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
r110537 r110641 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
r110537 r110641 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
r110537 r110641 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
r110537 r110641 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.cpp
r108241 r110641 31 31 32 32 #include "EventNames.h" 33 #include "HTMLMediaElement.h" 33 34 #include "LoadableTextTrack.h" 34 35 #include "ScriptExecutionContext.h" -
trunk/Source/WebCore/html/track/TextTrackList.idl
r110537 r110641 32 32 EventTarget, 33 33 JSCustomMarkFunction, 34 JSCustomIsReachable 34 JSCustomIsReachable, 35 V8GenerateIsReachable=ImplOwnerRoot 35 36 ] TextTrackList { 36 37 readonly attribute unsigned long length;
Note: See TracChangeset
for help on using the changeset viewer.