Rewrite content rendering timeout using new fallback semantics

Content rendering timeout will now set the fallback to the first Surface
after navigation instead of invalidating it.

Bug: 861769
TBR: [email protected]
Change-Id: I145a482cc084398d6687aa749acd563c9a07c6e2
Reviewed-on: https://chromium-review.googlesource.com/1174707
Commit-Queue: Andre Kaba <[email protected]>
Reviewed-by: Khushal <[email protected]>
Reviewed-by: Fady Samuel <[email protected]>
Cr-Commit-Position: refs/heads/master@{#584798}
diff --git a/ui/android/delegated_frame_host_android.h b/ui/android/delegated_frame_host_android.h
index be08120d..12c0736 100644
--- a/ui/android/delegated_frame_host_android.h
+++ b/ui/android/delegated_frame_host_android.h
@@ -51,7 +51,6 @@
     virtual void ReclaimResources(
         const std::vector<viz::ReturnedResource>& resources) = 0;
     virtual void OnFrameTokenChanged(uint32_t frame_token) = 0;
-    virtual void DidReceiveFirstFrameAfterNavigation() = 0;
   };
 
   DelegatedFrameHostAndroid(ViewAndroid* view,
@@ -91,6 +90,11 @@
   // FrameEvictorClient implementation.
   void EvictDelegatedFrame() override;
 
+  // Advances the fallback surface to the first surface after navigation. This
+  // ensures that stale surfaces are not presented to the user for an indefinite
+  // period of time.
+  void ResetFallbackToFirstNavigationSurface();
+
   bool HasDelegatedContent() const;
 
   cc::SurfaceLayer* content_layer_for_testing() { return content_layer_.get(); }
@@ -192,7 +196,7 @@
 
   // Whether we've received a frame from the renderer since navigating.
   // Only used when surface synchronization is on.
-  uint32_t first_parent_sequence_number_after_navigation_ = 0;
+  viz::LocalSurfaceId first_local_surface_id_after_navigation_;
   bool received_frame_after_navigation_ = false;
 
   // The local surface id as of the most recent call to