[webkit-reviews] review denied: [Bug 173569] Web Inspector: Support getting the content of WebGL/WebGL2 contexts : [Attachment 314513] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 3 17:01:59 PDT 2017


Joseph Pecoraro <joepeck at webkit.org> has denied Devin Rousso
<drousso at apple.com>'s request for review:
Bug 173569: Web Inspector: Support getting the content of WebGL/WebGL2 contexts
https://bugs.webkit.org/show_bug.cgi?id=173569

Attachment 314513: Patch

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




--- Comment #10 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 314513
  --> https://bugs.webkit.org/attachment.cgi?id=314513
Patch

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

r- just because of the bunch of comments I'd like to see an updated patch. The
approach seems good to me.

> LayoutTests/inspector/canvas/requestContent-webgl2.html:27
> +	       CanvasAgent.requestContent(canvas.identifier, (error, content)
=> {

You should be able to write this like:

    CanvasAgent.requestContent(canvas.identifier)
	.then(({content}) => { InspectorTest.log(content); })
	.then(resolve, reject);

Which looks a little cleaner.

> Source/WebCore/html/canvas/WebGLRenderingContextBase.h:213
> +    void preventBufferClearForInspector(bool value) {
m_preventBufferClearForInspector = value; }

This should be a setter `setPreventBufferClearForInspector(bool)`. And you
might as well include a getter even if it is not used.

> Source/WebCore/html/canvas/WebGLRenderingContextBase.h:841
> +    bool m_preventBufferClearForInspector { false };

The rest of the member variables are in the protected area. For example:

    572    bool m_synthesizedErrorsToConsole { true };
    573    int m_numGLErrorsToConsoleAllowed;

I'd expect this to go near those.

> Source/WebCore/inspector/InspectorCanvasAgent.cpp:151
> +	       return;

This would return without clearing the PreventBufferClearForInspector state you
just added. I'd expect code more like:

    WebGLRenderingContextBase* glContext =
downcast<WebGLRenderingContextBase>(context);
    glContext->setPreventBufferClearForInspector(true);
    ExceptionOr<String> result =
canvasEntry->element->toDataURL(ASCIILiteral("image/png"));
    glContext->setPreventBufferClearForInspector(false);
    if (result.hasException()) {
	errorString = result.releaseException().releaseMessage();
	return;
    }


More information about the webkit-reviews mailing list