Changeset 250434 in webkit
- Timestamp:
- Sep 27, 2019 10:54:22 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r250429 r250434 1 2019-09-27 Devin Rousso <drousso@apple.com> 2 3 Flaky Test: inspector/canvas/updateShader.html 4 https://bugs.webkit.org/show_bug.cgi?id=202186 5 <rdar://problem/55716053> 6 7 Reviewed by Joseph Pecoraro. 8 9 If the `WebGLProgram` outlives it's `WebGLRenderingContext`, the `ScriptExecutionContext*` 10 that was provided in the constructor won't be invalidated leading to the bad access crash. 11 12 Rather than pass the `ScriptExecutionContext*` directly, have `WebGLProgram` inherit from 13 `ContextDestructionObserver` so that it can propertly invalidate (and notify Web Inspector) 14 when the related context is about to be destroyed. 15 16 Test: inspector/canvas/updateShader.html 17 18 * html/canvas/WebGLProgram.h: 19 (WebCore::WebGLProgram::scriptExecutionContext const): Deleted. 20 * html/canvas/WebGLProgram.cpp: 21 (WebCore::WebGLProgram::WebGLProgram): 22 (WebCore::WebGLProgram::contextDestroyed): Added. 23 1 24 2019-09-27 Zalan Bujtas <zalan@apple.com> 2 25 -
trunk/Source/WebCore/html/canvas/WebGLProgram.cpp
r250386 r250434 63 63 WebGLProgram::WebGLProgram(WebGLRenderingContextBase& ctx) 64 64 : WebGLSharedObject(ctx) 65 , m_scriptExecutionContext(ctx.scriptExecutionContext())66 { 67 ASSERT( m_scriptExecutionContext);65 , ContextDestructionObserver(ctx.scriptExecutionContext()) 66 { 67 ASSERT(scriptExecutionContext()); 68 68 69 69 { … … 86 86 instances(lock).remove(this); 87 87 } 88 } 89 90 void WebGLProgram::contextDestroyed() 91 { 92 InspectorInstrumentation::willDestroyWebGLProgram(*this); 93 94 ContextDestructionObserver::contextDestroyed(); 88 95 } 89 96 -
trunk/Source/WebCore/html/canvas/WebGLProgram.h
r250386 r250434 28 28 #if ENABLE(WEBGL) 29 29 30 #include "ContextDestructionObserver.h" 30 31 #include "WebGLSharedObject.h" 31 32 #include <wtf/Forward.h> … … 37 38 class WebGLShader; 38 39 39 class WebGLProgram final : public WebGLSharedObject {40 class WebGLProgram final : public WebGLSharedObject, public ContextDestructionObserver { 40 41 public: 41 42 static Ref<WebGLProgram> create(WebGLRenderingContextBase&); … … 45 46 static Lock& instancesMutex(); 46 47 47 ScriptExecutionContext* scriptExecutionContext() const { return m_scriptExecutionContext; }48 void contextDestroyed() final; 48 49 49 50 unsigned numActiveAttribLocations(); … … 76 77 void cacheInfoIfNeeded(); 77 78 78 ScriptExecutionContext* m_scriptExecutionContext;79 80 79 Vector<GC3Dint> m_activeAttribLocations; 81 80
Note: See TracChangeset
for help on using the changeset viewer.