[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 2017It'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.