New issue
Advanced search Search tips

Issue 741167 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Variable 'bottom_layer' is assigned a value that is never used in CompositedLayerMapping

Project Member Reported by e...@chromium.org, Jul 11 2017

Issue description

[third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:1629]: (style) Variable 'bottom_layer' is assigned a value that is never used.

The following code in CompositedLayerMapping.cpp starting at line 1623 appears to be unused. It determines the bottom_layer but none of the code later in the function references it.

  // Now constructing the subtree for the overflow controls.
  bottom_layer = graphics_layer_.get();
  // TODO(pdr): Ensure painting uses the correct GraphicsLayer when root layer
  // scrolls is enabled.   crbug.com/638719 
  if (is_main_frame_layout_view_layer_ &&
      !RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
    bottom_layer = GetLayoutObject()
                       .GetFrame()
                       ->GetPage()
                       ->GetVisualViewport()
                       .ContainerLayer();
  }
 

Comment 1 by skobes@chromium.org, Jul 11 2017

It's used inside the update_bottom_layer lambda closure:

  auto update_bottom_layer = [&bottom_layer](GraphicsLayer* layer) {
    if (layer) {
      bottom_layer->AddChild(layer);
      bottom_layer = layer;
    }
  };

Every call to update_bottom_layer depends on the current value of bottom_layer.

Are you seeing that warning from a compiler or an automated style checker?  If so we should fix whatever is generating it.

Comment 2 by e...@chromium.org, Jul 11 2017

Status: WontFix (was: Available)
Ah, that makes sense. Didn't realize it was a lambda when reading though the code. Thanks for the clarification.

Local warning, might need to update my toolchain.

Sign in to add a comment