[webkit-reviews] review granted: [Bug 178799] Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created : [Attachment 325138] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 27 08:59:25 PDT 2017


Brian Burg <bburg at apple.com> has granted Devin Rousso
<webkit at devinrousso.com>'s request for review:
Bug 178799: Web Inspector: Canvas Tab: no way to see backtrace of where a
canvas context was created
https://bugs.webkit.org/show_bug.cgi?id=178799

Attachment 325138: Patch

https://bugs.webkit.org/attachment.cgi?id=325138&action=review




--- Comment #4 from Brian Burg <bburg at apple.com> ---
Comment on attachment 325138
  --> https://bugs.webkit.org/attachment.cgi?id=325138
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325138&action=review

r=me

> Source/WebCore/inspector/InspectorCanvas.cpp:194
> +Ref<Inspector::Protocol::Canvas::Canvas>
InspectorCanvas::buildObjectForCanvas(InstrumentingAgents& instrumentingAgents,
bool captureBacktrace)

This sort of implicitly assumes this method is called underneath canvasAdded
and equivalent JS code that creates the context. Perhaps you should write this
into the description of the protocol parameter so that the semantics are more
clear. For example, "Backtrace that was captured when this canvas context is
created".

> Source/WebCore/inspector/InspectorCanvas.cpp:261
> +    if (captureBacktrace) {

It would be cool to extract common stack walking code. It could take a
lambda(ScriptCallFrame&) to perform the extraction (swizzled index or
buildInspectorObject()). Please re-EWS if you do that.

> Source/WebCore/inspector/InspectorCanvasAgent.cpp:395
> +	  
m_frontendDispatcher->canvasAdded(inspectorCanvas->buildObjectForCanvas(m_instr
umentingAgents, true));

I would remove the default parameter value and add 'false' to the other call
site just so it's explicit. (If we called this in dozens of places, my opinion
would be different.) Can you extract 'true' or 'false' into a local variable
with a better name?


More information about the webkit-reviews mailing list