Changeset 234578 in webkit
- Timestamp:
- Aug 4, 2018 2:02:44 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r234566 r234578 1 2018-08-03 Ryosuke Niwa <rniwa@webkit.org> 2 3 Properties set on window.customElements can disappear due to GC 4 https://bugs.webkit.org/show_bug.cgi?id=172575 5 <rdar://problem/32440668> 6 7 Reviewed by Saam Barati. 8 9 Added a regression test. 10 11 * fast/custom-elements/custom-element-registry-wrapper-should-stay-alive-expected.txt: Added. 12 * fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html: Added. 13 1 14 2018-08-03 Justin Fan <justin_fan@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r234577 r234578 1 2018-08-04 Ryosuke Niwa <rniwa@webkit.org> 2 3 Properties set on window.customElements can disappear due to GC 4 https://bugs.webkit.org/show_bug.cgi?id=172575 5 <rdar://problem/32440668> 6 7 Reviewed by Saam Barati. 8 9 Fixed the bug that JS wrapper of CustomElementsRegistry can erroneously get collected during GC 10 by keeping it alive as long as the global object is alive. 11 12 Test: fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html 13 14 * dom/CustomElementRegistry.cpp: 15 (WebCore::CustomElementRegistry::create): 16 (WebCore::CustomElementRegistry::CustomElementRegistry): 17 * dom/CustomElementRegistry.h: 18 (WebCore::CustomElementRegistry): Make this inherited from ContextDestructionObserver. 19 * dom/CustomElementRegistry.idl: Set GenerateIsReachable=ImplScriptExecutionContext in IDL. This will 20 make CustomElementRegistry reachable from the global object. 21 * page/DOMWindow.cpp: 22 (WebCore::DOMWindow::ensureCustomElementRegistry): 23 1 24 2018-08-03 Ryosuke Niwa <rniwa@webkit.org> 2 25 -
trunk/Source/WebCore/dom/CustomElementRegistry.cpp
r234507 r234578 42 42 namespace WebCore { 43 43 44 Ref<CustomElementRegistry> CustomElementRegistry::create(DOMWindow& window )44 Ref<CustomElementRegistry> CustomElementRegistry::create(DOMWindow& window, ScriptExecutionContext* scriptExecutionContext) 45 45 { 46 return adoptRef(*new CustomElementRegistry(window ));46 return adoptRef(*new CustomElementRegistry(window, scriptExecutionContext)); 47 47 } 48 48 49 CustomElementRegistry::CustomElementRegistry(DOMWindow& window) 50 : m_window(window) 49 CustomElementRegistry::CustomElementRegistry(DOMWindow& window, ScriptExecutionContext* scriptExecutionContext) 50 : ContextDestructionObserver(scriptExecutionContext) 51 , m_window(window) 51 52 { 52 53 } -
trunk/Source/WebCore/dom/CustomElementRegistry.h
r234507 r234578 26 26 #pragma once 27 27 28 #include "ContextDestructionObserver.h" 28 29 #include "QualifiedName.h" 29 30 #include <wtf/HashMap.h> … … 48 49 class QualifiedName; 49 50 50 class CustomElementRegistry : public RefCounted<CustomElementRegistry> {51 class CustomElementRegistry : public RefCounted<CustomElementRegistry>, public ContextDestructionObserver { 51 52 public: 52 static Ref<CustomElementRegistry> create(DOMWindow& );53 static Ref<CustomElementRegistry> create(DOMWindow&, ScriptExecutionContext*); 53 54 ~CustomElementRegistry(); 54 55 … … 69 70 70 71 private: 71 CustomElementRegistry(DOMWindow& );72 CustomElementRegistry(DOMWindow&, ScriptExecutionContext*); 72 73 73 74 DOMWindow& m_window; -
trunk/Source/WebCore/dom/CustomElementRegistry.idl
r234507 r234578 26 26 [ 27 27 EnabledAtRuntime=CustomElements, 28 ImplementationLacksVTable,29 28 JSGenerateToNativeObject, 29 GenerateIsReachable=ImplScriptExecutionContext 30 30 ] interface CustomElementRegistry { 31 31 [CEReactions, Custom] void define(DOMString name, Function constructor); -
trunk/Source/WebCore/page/DOMWindow.cpp
r233668 r234578 611 611 { 612 612 if (!m_customElementRegistry) 613 m_customElementRegistry = CustomElementRegistry::create(*this );613 m_customElementRegistry = CustomElementRegistry::create(*this, scriptExecutionContext()); 614 614 return *m_customElementRegistry; 615 615 }
Note: See TracChangeset
for help on using the changeset viewer.