Fix nullptr scrollbar crash

Not sure how this can happen. ScrollbarsFor somehow returns a nullptr in
the ScrollbarSet. This must mean ToScrollbarLayer returns nullptr. This
method returns nullptr in the base and this in the
ScrollbarLayerImplBase override. Therefore the LayerToId muse be
returning a non-scrollbar layer.

The only time we add anything to element_id_to_scrollbar_layer_ids_
though is from LTI::RegisterScrollbar which is necessarily a scrollbar
layer. I think this means the Layer with the scrollbar layer's ID at
some point changes to a different layer. The ID-to-Layer mapping is
cleared when a layer is destroyed and the scrollbar layer clears the
element_id_to_scrollbar_layer_ids_ mapping in its destructor so I'm
speculating that we might be registering a new non-scrollbar layer with
the same id. I've converted the DCHECK to a CHECK at that location to
see if it comes back with any crashes from the wild.

Bug: 924068
Change-Id: I9bb15812aeda0a2c92d2547a52af9fbdbacc65b0
Reviewed-on: https://chromium-review.googlesource.com/c/1435686
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630059}
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index b3fa34c..b3e3819 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -1469,7 +1469,9 @@
 }
 
 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) {
-  DCHECK(!LayerById(layer->id()));
+  // TODO(bokan): Temporarily and speculatively CHECK in release builds to see
+  // if this is the cause of crbug.com/924068.
+  CHECK(!LayerById(layer->id()));
   layer_id_map_[layer->id()] = layer;
 }