Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cbb066bf78fcae67972061fdf371e376a5aec3c6
      
https://github.com/WebKit/WebKit/commit/cbb066bf78fcae67972061fdf371e376a5aec3c6
  Author: Claudio Saavedra <[email protected]>
  Date:   2026-04-30 (Thu, 30 Apr 2026)

  Changed paths:
    M Source/WebCore/html/canvas/CanvasRenderingContext.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext.h
    M Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp

  Log Message:
  -----------
  REGRESSION(309800@main): inspector/canvas/create-context-2d.html crashes due 
to WeakRef assertion in WebCore::InspectorCanvasAgent::internalEnable()
https://bugs.webkit.org/show_bug.cgi?id=313643

Reviewed by Devin Rousso and Chris Dumez.

309800@main added a threading assertion to WeakRef::get(),
which uncovers that internalEnable() is dereferencing
a CanvasBase weak reference from the wrong thread.

We can fix this by keeping track in CanvasRenderingContext
of the creation thread and only dereference the weak pointer
when this one matches the current thread.

* Source/WebCore/html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::CanvasRenderingContext):
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isContextThread const):
* Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::internalEnable):

Canonical link: https://commits.webkit.org/312362@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to