WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
196324
Web Inspector: Canvas: unbinding a canvas should always remove the agent as an observer
https://bugs.webkit.org/show_bug.cgi?id=196324
Summary
Web Inspector: Canvas: unbinding a canvas should always remove the agent as a...
Devin Rousso
Reported
2019-03-27 15:42:58 PDT
`InspectorCanvasAgent::unbindCanvas` is currently called in two places: - `InspectorCanvasAgent::frameNavigated`, right after the `InspectorCanvasAgent` removes itself as an observer from the canvas in question - `InspectorCanvasAgent::canvasDestroyed`, which is called on all observers when the canvas is about to be destructed Previously, in order to avoid modification-while-iterating, we wouldn't remove the `InspectorCanvasAgent` from the canvas inside `InspectorCanvasAgent::canvasDestroyed`, since the canvas is about to be destructed anyways. This isn't a very good practice, and should be "corrected" (e.g. the observer shouldn't have any idea about the specifics of how the canvas treats/notifies its observers).
Attachments
Patch
(3.80 KB, patch)
2019-03-27 15:51 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-03-27 15:47:57 PDT
<
rdar://problem/49357109
>
Devin Rousso
Comment 2
2019-03-27 15:51:48 PDT
Created
attachment 366119
[details]
Patch
Matt Baker
Comment 3
2019-03-27 18:10:24 PDT
Comment on
attachment 366119
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=366119&action=review
r=me
> Source/WebCore/html/CanvasBase.cpp:74 > observer->canvasChanged(*this, rect);
I noticed this is a widely used pattern in WebKit. Is it to safeguard against m_observers mutating during iteration?
Devin Rousso
Comment 4
2019-03-28 10:38:41 PDT
Comment on
attachment 366119
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=366119&action=review
>> Source/WebCore/html/CanvasBase.cpp:74 >> observer->canvasChanged(*this, rect); > > I noticed this is a widely used pattern in WebKit. Is it to safeguard against m_observers mutating during iteration?
Yup!
WebKit Commit Bot
Comment 5
2019-03-28 11:08:10 PDT
Comment on
attachment 366119
[details]
Patch Clearing flags on attachment: 366119 Committed
r243611
: <
https://trac.webkit.org/changeset/243611
>
WebKit Commit Bot
Comment 6
2019-03-28 11:08:11 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug