Flaky Test: inspector/canvas/updateShader.html
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2019 17:54:22 +0000 (17:54 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2019 17:54:22 +0000 (17:54 +0000)
commitcc0da33d0708e16834b56e1ec7a0192ea7d5b34d
tree51370a240128e27205cada738c26b93e184a0113
parent3d93e43373b2db42abc945bd603e15bbba42a114
Flaky Test: inspector/canvas/updateShader.html
https://bugs.webkit.org/show_bug.cgi?id=202186
<rdar://problem/55716053>

Reviewed by Joseph Pecoraro.

If the `WebGLProgram` outlives it's `WebGLRenderingContext`, the `ScriptExecutionContext*`
that was provided in the constructor won't be invalidated leading to the bad access crash.

Rather than pass the `ScriptExecutionContext*` directly, have `WebGLProgram` inherit from
`ContextDestructionObserver` so that it can propertly invalidate (and notify Web Inspector)
when the related context is about to be destroyed.

Test: inspector/canvas/updateShader.html

* html/canvas/WebGLProgram.h:
(WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::contextDestroyed): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLProgram.cpp
Source/WebCore/html/canvas/WebGLProgram.h