cc: Detemplatize LayerIterator

It's only valid on LayerImpl now, so remove templating.

This also removes validation of property trees on the main thread,
as it was using layer iterator to walk the RSLL.

Depends on https://codereview.chromium.org/1179133004/

R=danakj
Bug=413479
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1192553004

Cr-Commit-Position: refs/heads/master@{#335114}
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 0789b84..16ddc1d7 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -608,8 +608,8 @@
     // LayerIterator is used here instead of CallFunctionForSubtree to only
     // UpdateTilePriorities on layers that will be visible (and thus have valid
     // draw properties) and not because any ordering is required.
-    auto end = LayerIterator<LayerImpl>::End(&render_surface_layer_list_);
-    for (auto it = LayerIterator<LayerImpl>::Begin(&render_surface_layer_list_);
+    LayerIterator end = LayerIterator::End(&render_surface_layer_list_);
+    for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_);
          it != end; ++it) {
       occlusion_tracker.EnterLayer(it);
 
@@ -1006,12 +1006,9 @@
 
 void LayerTreeImpl::GetAllPrioritizedTilesForTracing(
     std::vector<PrioritizedTile>* prioritized_tiles) const {
-  typedef LayerIterator<LayerImpl> LayerIteratorType;
-  LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
-  for (LayerIteratorType it =
-           LayerIteratorType::Begin(&render_surface_layer_list_);
-       it != end;
-       ++it) {
+  LayerIterator end = LayerIterator::End(&render_surface_layer_list_);
+  for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_);
+       it != end; ++it) {
     if (!it.represents_itself())
       continue;
     LayerImpl* layer_impl = *it;
@@ -1028,10 +1025,9 @@
   state->EndDictionary();
 
   state->BeginArray("render_surface_layer_list");
-  typedef LayerIterator<LayerImpl> LayerIteratorType;
-  LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
-  for (LayerIteratorType it = LayerIteratorType::Begin(
-           &render_surface_layer_list_); it != end; ++it) {
+  LayerIterator end = LayerIterator::End(&render_surface_layer_list_);
+  for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_);
+       it != end; ++it) {
     if (!it.represents_itself())
       continue;
     TracedValue::AppendIDRef(*it, state);