• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff --git content/browser/renderer_host/input/fling_scheduler.cc content/browser/renderer_host/input/fling_scheduler.cc
2index c7a4f1f0c3d00..7e6e3b4e56d42 100644
3--- content/browser/renderer_host/input/fling_scheduler.cc
4+++ content/browser/renderer_host/input/fling_scheduler.cc
5@@ -68,6 +68,9 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded(
6 }
7
8 ui::Compositor* FlingScheduler::GetCompositor() {
9+  if (compositor_) {
10+    return compositor_;
11+  }
12 #if defined(USE_AURA)
13   if (host_->GetView() && host_->GetView()->GetNativeView() &&
14       host_->GetView()->GetNativeView()->GetHost() &&
15diff --git content/browser/renderer_host/input/fling_scheduler_base.h content/browser/renderer_host/input/fling_scheduler_base.h
16index cc4b13a7b9c67..84f3b9ed7cf49 100644
17--- content/browser/renderer_host/input/fling_scheduler_base.h
18+++ content/browser/renderer_host/input/fling_scheduler_base.h
19@@ -7,12 +7,23 @@
20
21 #include "content/browser/renderer_host/input/fling_controller.h"
22
23+namespace ui {
24+class Compositor;
25+}
26+
27 namespace content {
28
29 class FlingSchedulerBase : public FlingControllerSchedulerClient {
30  public:
31   virtual void ProgressFlingOnBeginFrameIfneeded(
32       base::TimeTicks current_time) = 0;
33+
34+  void SetCompositor(ui::Compositor* compositor) {
35+    compositor_ = compositor;
36+  }
37+
38+protected:
39+ ui::Compositor* compositor_ = nullptr;
40 };
41
42 }  // namespace content
43diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc
44index 7436238cd110e..bbc937f1c14df 100644
45--- content/browser/renderer_host/render_widget_host_impl.cc
46+++ content/browser/renderer_host/render_widget_host_impl.cc
47@@ -3107,6 +3107,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() {
48       GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE);
49 }
50
51+void RenderWidgetHostImpl::SetCompositorForFlingScheduler(ui::Compositor* compositor)
52+{
53+  fling_scheduler_->SetCompositor(compositor);
54+}
55+
56 void RenderWidgetHostImpl::AddPendingUserActivation(
57     const WebInputEvent& event) {
58   if ((base::FeatureList::IsEnabled(
59diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h
60index 785cf70788ddb..fc72ea7bb0d7b 100644
61--- content/browser/renderer_host/render_widget_host_impl.h
62+++ content/browser/renderer_host/render_widget_host_impl.h
63@@ -776,6 +776,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
64
65   void ProgressFlingIfNeeded(base::TimeTicks current_time);
66   void StopFling();
67+  void SetCompositorForFlingScheduler(ui::Compositor* compositor);
68
69   // The RenderWidgetHostImpl will keep showing the old page (for a while) after
70   // navigation until the first frame of the new page arrives. This reduces
71