New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 651455 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All , Mac
Pri: 3
Type: Bug



Sign in to add a comment

LayerDebugInfo::AppendAsTraceFormat uses JsonWriter::Write directly on |out| which clears it.

Project Member Reported by gab@chromium.org, Sep 29 2016

Issue description

LayerDebugInfo::AppendAsTraceFormat uses JsonWrite::Write directly on |out| which clears it.

All other AppendAsTraceFormat() impls correctly use a temp variable to interact with JsonWriter::Write (I admit that this is a bit silly but that's how it is right now).

https://cs.chromium.org/chromium/src/ui/compositor/layer.cc?dr=CSs&q=LayerDebugInfo::AppendAsTraceFormat&sq=package:chromium&l=825

I made the same mistake in https://codereview.chromium.org/2374193002/ by copying LayerDebugInfo's approach. It borks the JSON and tracing chokes.

I tried to trace with cc.debug + cc.debug.quads + devtools.timeline.layers enabled but I didn't manage to trigger this bug (nor get a "layer_name" arg appended) so this code doesn't seem to run right now..?

I'll let owners (@piman from ui\compositor\OWNERS) figure out whether to fix it or remove it (if it was never noticed that chrome://tracing chokes when generating such a trace then it likely never ran..!).
 

Comment 1 by gab@chromium.org, Sep 29 2016

Summary: LayerDebugInfo::AppendAsTraceFormat uses JsonWriter::Write directly on |out| which clears it. (was: LayerDebugInfo::AppendAsTraceFormat uses JsonWrite::Write directly on |out| which clears it.)

Comment 2 by piman@chromium.org, Oct 10 2016

Owner: vollick@chromium.org
-> vollick who I believe wrote the code
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b44373a0917b40509990fa33bfde2ca24bdd15e3

commit b44373a0917b40509990fa33bfde2ca24bdd15e3
Author: vollick <vollick@chromium.org>
Date: Wed Nov 02 16:19:14 2016

LayerDebugInfo should not clobber trace output

The code previously used the JSON writer incorrectly (needed to use a
temporary).

BUG= 651455 

Review-Url: https://codereview.chromium.org/2467953003
Cr-Commit-Position: refs/heads/master@{#429295}

[modify] https://crrev.com/b44373a0917b40509990fa33bfde2ca24bdd15e3/ui/compositor/layer.cc
[modify] https://crrev.com/b44373a0917b40509990fa33bfde2ca24bdd15e3/ui/compositor/layer_unittest.cc

Status: Fixed (was: Assigned)
Thanks for noticing this! (The code is indeed not dead, but you have to build for cros in debug and turn on the usually-disabled cc.debug category).

Sign in to add a comment