input: Change how synthesized events are dispatched in telemetry tests.
Synthesized events are still generated and dispatched on begin-frame. But
the dispatch is somewhat simplified in this change. Some detail:
. Before this change, SyntheticGestureController would request for the
next input flush through the SyntheticGestureTarget, which would then
request for flush to RenderWidgetHostImpl. This CL changes that, so that
SyntheticGestureController can directly request for flush to
RenderWidgetHostImpl, through a callback installed during construction
of SyntheticGestureController.
BUG=722921
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2856423002
Cr-Commit-Position: refs/heads/master@{#472595}
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
index d5500ab4..2b1a3292 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -674,6 +674,10 @@
return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
}
+void RenderWidgetHostViewChildFrame::OnSetNeedsFlushInput() {
+ NOTIMPLEMENTED();
+}
+
BrowserAccessibilityManager*
RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate, bool for_root_frame) {
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/frame_host/render_widget_host_view_child_frame.h
index df99f2de..551c56c 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.h
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.h
@@ -157,6 +157,7 @@
InputEventAckState FilterInputEvent(
const blink::WebInputEvent& input_event) override;
+ void OnSetNeedsFlushInput() override;
BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate, bool for_root_frame) override;
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index ed78781..b7e4883 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -534,6 +534,10 @@
}
}
+void RenderWidgetHostViewGuest::OnSetNeedsFlushInput() {
+ NOTIMPLEMENTED();
+}
+
void RenderWidgetHostViewGuest::WheelEventAck(
const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result) {
diff --git a/content/browser/frame_host/render_widget_host_view_guest.h b/content/browser/frame_host/render_widget_host_view_guest.h
index e2db9b1..e85a8d6 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.h
+++ b/content/browser/frame_host/render_widget_host_view_guest.h
@@ -119,6 +119,7 @@
void StopSpeaking() override;
#endif // defined(OS_MACOSX)
+ void OnSetNeedsFlushInput() override;
void WheelEventAck(const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result) override;
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller.cc b/content/browser/renderer_host/input/synthetic_gesture_controller.cc
index 9e5bc844..51c28aa 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_controller.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_controller.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target.h"
#include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
@@ -15,8 +16,11 @@
namespace content {
SyntheticGestureController::SyntheticGestureController(
- std::unique_ptr<SyntheticGestureTarget> gesture_target)
- : gesture_target_(std::move(gesture_target)) {}
+ std::unique_ptr<SyntheticGestureTarget> gesture_target,
+ BeginFrameRequestCallback begin_frame_callback)
+ : gesture_target_(std::move(gesture_target)),
+ begin_frame_callback_(std::move(begin_frame_callback)),
+ weak_ptr_factory_(this) {}
SyntheticGestureController::~SyntheticGestureController() {}
@@ -34,51 +38,44 @@
StartGesture(*pending_gesture_queue_.FrontGesture());
}
-void SyntheticGestureController::Flush(base::TimeTicks timestamp) {
- TRACE_EVENT0("input", "SyntheticGestureController::Flush");
- if (pending_gesture_queue_.IsEmpty())
- return;
-
- if (pending_gesture_result_)
- return;
-
- SyntheticGesture* gesture = pending_gesture_queue_.FrontGesture();
- SyntheticGesture::Result result =
- gesture->ForwardInputEvents(timestamp, gesture_target_.get());
-
- if (result == SyntheticGesture::GESTURE_RUNNING) {
- gesture_target_->SetNeedsFlush();
- return;
- }
-
- // It's possible that all events generated by the gesture have been fully
- // dispatched at this point, in which case |OnDidFlushInput()| was called
- // before |pending_gesture_result_| was initialized. Requesting another flush
- // will trigger the necessary gesture-ending call to |OnDidFlushInput()|.
- pending_gesture_result_.reset(new SyntheticGesture::Result(result));
- gesture_target_->SetNeedsFlush();
+void SyntheticGestureController::OnBeginFrame() {
+ // TODO(sad): Instead of dispatching the events immediately, dispatch after an
+ // offset.
+ DispatchNextEvent();
}
-void SyntheticGestureController::OnDidFlushInput() {
- if (!pending_gesture_result_)
- return;
+bool SyntheticGestureController::DispatchNextEvent(base::TimeTicks timestamp) {
+ TRACE_EVENT0("input", "SyntheticGestureController::Flush");
+ if (pending_gesture_queue_.IsEmpty())
+ return false;
- DCHECK(!pending_gesture_queue_.IsEmpty());
- auto pending_gesture_result = std::move(pending_gesture_result_);
+ SyntheticGesture::Result result =
+ pending_gesture_queue_.FrontGesture()->ForwardInputEvents(
+ timestamp, gesture_target_.get());
+
+ if (result == SyntheticGesture::GESTURE_RUNNING) {
+ begin_frame_callback_.Run(
+ base::BindOnce(&SyntheticGestureController::OnBeginFrame,
+ weak_ptr_factory_.GetWeakPtr()));
+ return true;
+ }
+
StopGesture(*pending_gesture_queue_.FrontGesture(),
- pending_gesture_queue_.FrontCallback(),
- *pending_gesture_result);
+ pending_gesture_queue_.FrontCallback(), result);
pending_gesture_queue_.Pop();
-
- if (!pending_gesture_queue_.IsEmpty())
- StartGesture(*pending_gesture_queue_.FrontGesture());
+ if (pending_gesture_queue_.IsEmpty())
+ return false;
+ StartGesture(*pending_gesture_queue_.FrontGesture());
+ return true;
}
void SyntheticGestureController::StartGesture(const SyntheticGesture& gesture) {
TRACE_EVENT_ASYNC_BEGIN0("input,benchmark",
"SyntheticGestureController::running",
&gesture);
- gesture_target_->SetNeedsFlush();
+ begin_frame_callback_.Run(
+ base::BindOnce(&SyntheticGestureController::OnBeginFrame,
+ weak_ptr_factory_.GetWeakPtr()));
}
void SyntheticGestureController::StopGesture(
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller.h b/content/browser/renderer_host/input/synthetic_gesture_controller.h
index 770770a3..7ee0f88f 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_controller.h
+++ b/content/browser/renderer_host/input/synthetic_gesture_controller.h
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "content/browser/renderer_host/input/synthetic_gesture.h"
#include "content/common/content_export.h"
@@ -26,8 +27,12 @@
// input events to the platform until the gesture has finished.
class CONTENT_EXPORT SyntheticGestureController {
public:
- explicit SyntheticGestureController(
- std::unique_ptr<SyntheticGestureTarget> gesture_target);
+ using BeginFrameCallback = base::OnceClosure;
+ using BeginFrameRequestCallback =
+ base::RepeatingCallback<void(BeginFrameCallback)>;
+ SyntheticGestureController(
+ std::unique_ptr<SyntheticGestureTarget> gesture_target,
+ BeginFrameRequestCallback begin_frame_callback);
virtual ~SyntheticGestureController();
typedef base::Callback<void(SyntheticGesture::Result)>
@@ -36,21 +41,17 @@
std::unique_ptr<SyntheticGesture> synthetic_gesture,
const OnGestureCompleteCallback& completion_callback);
- // Forward input events of the currently processed gesture.
- void Flush(base::TimeTicks timestamp);
-
- // To be called when all events generated from the current gesture have been
- // fully flushed from the input pipeline (i.e., sent, processed and ack'ed).
- void OnDidFlushInput();
+ bool DispatchNextEvent(base::TimeTicks = base::TimeTicks::Now());
private:
+ void OnBeginFrame();
+
void StartGesture(const SyntheticGesture& gesture);
void StopGesture(const SyntheticGesture& gesture,
const OnGestureCompleteCallback& completion_callback,
SyntheticGesture::Result result);
std::unique_ptr<SyntheticGestureTarget> gesture_target_;
- std::unique_ptr<SyntheticGesture::Result> pending_gesture_result_;
// A queue of gesture/callback pairs. Implemented as two queues to
// simplify the ownership of SyntheticGesture pointers.
@@ -82,6 +83,10 @@
DISALLOW_COPY_AND_ASSIGN(GestureAndCallbackQueue);
} pending_gesture_queue_;
+ BeginFrameRequestCallback begin_frame_callback_;
+
+ base::WeakPtrFactory<SyntheticGestureController> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(SyntheticGestureController);
};
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
index 4aa4ada7..95d4ee1 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
@@ -135,8 +135,6 @@
// SyntheticGestureTarget:
void DispatchInputEventToPlatform(const WebInputEvent& event) override {}
- void SetNeedsFlush() override { flush_requested_ = true; }
-
SyntheticGestureParams::GestureSourceType
GetDefaultSyntheticGestureSourceType() const override {
return SyntheticGestureParams::TOUCH_INPUT;
@@ -671,8 +669,9 @@
template<typename MockGestureTarget>
void CreateControllerAndTarget() {
target_ = new MockGestureTarget();
- controller_.reset(new SyntheticGestureController(
- std::unique_ptr<SyntheticGestureTarget>(target_)));
+ controller_ = base::MakeUnique<SyntheticGestureController>(
+ std::unique_ptr<SyntheticGestureTarget>(target_),
+ base::Bind([](base::OnceClosure callback) {}));
}
void QueueSyntheticGesture(std::unique_ptr<SyntheticGesture> gesture) {
@@ -684,14 +683,9 @@
}
void FlushInputUntilComplete() {
- while (target_->flush_requested()) {
- while (target_->flush_requested()) {
- target_->ClearFlushRequest();
- time_ += base::TimeDelta::FromMilliseconds(kFlushInputRateInMs);
- controller_->Flush(time_);
- }
- controller_->OnDidFlushInput();
- }
+ do
+ time_ += base::TimeDelta::FromMilliseconds(kFlushInputRateInMs);
+ while (controller_->DispatchNextEvent(time_));
}
void OnSyntheticGestureCompleted(SyntheticGesture::Result result) {
@@ -836,22 +830,9 @@
QueueSyntheticGesture(std::move(gesture_1));
QueueSyntheticGesture(std::move(gesture_2));
- while (target_->flush_requested()) {
- target_->ClearFlushRequest();
+ do {
time_ += base::TimeDelta::FromMilliseconds(kFlushInputRateInMs);
- controller_->Flush(time_);
- }
- EXPECT_EQ(0, num_success_);
- controller_->OnDidFlushInput();
- EXPECT_EQ(1, num_success_);
-
- while (target_->flush_requested()) {
- target_->ClearFlushRequest();
- time_ += base::TimeDelta::FromMilliseconds(kFlushInputRateInMs);
- controller_->Flush(time_);
- }
- EXPECT_EQ(1, num_success_);
- controller_->OnDidFlushInput();
+ } while (controller_->DispatchNextEvent(time_));
EXPECT_EQ(2, num_success_);
}
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target.h b/content/browser/renderer_host/input/synthetic_gesture_target.h
index da44ba2..c364fad9 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target.h
+++ b/content/browser/renderer_host/input/synthetic_gesture_target.h
@@ -27,10 +27,6 @@
virtual void DispatchInputEventToPlatform(
const blink::WebInputEvent& event) = 0;
- // Called by SyntheticGestureController to request a flush at a time
- // appropriate for the platform, e.g. aligned with vsync.
- virtual void SetNeedsFlush() = 0;
-
// Returns the default gesture source type for the target.
virtual SyntheticGestureParams::GestureSourceType
GetDefaultSyntheticGestureSourceType() const = 0;
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
index 2974e36..60019ad 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
@@ -103,10 +103,6 @@
host_->ForwardMouseEventWithLatencyInfo(web_mouse, latency_info);
}
-void SyntheticGestureTargetBase::SetNeedsFlush() {
- host_->SetNeedsFlush();
-}
-
SyntheticGestureParams::GestureSourceType
SyntheticGestureTargetBase::GetDefaultSyntheticGestureSourceType() const {
return SyntheticGestureParams::MOUSE_INPUT;
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_base.h b/content/browser/renderer_host/input/synthetic_gesture_target_base.h
index 3d01549c..1e4096c8 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target_base.h
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_base.h
@@ -43,8 +43,6 @@
// SyntheticGestureTarget:
void DispatchInputEventToPlatform(const blink::WebInputEvent& event) override;
- void SetNeedsFlush() override;
-
SyntheticGestureParams::GestureSourceType
GetDefaultSyntheticGestureSourceType() const override;
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc b/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc
index f36bf7e5..07773e5 100644
--- a/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc
+++ b/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc
@@ -65,9 +65,6 @@
MockSyntheticPointerActionTarget() {}
~MockSyntheticPointerActionTarget() override {}
- // SyntheticGestureTarget:
- void SetNeedsFlush() override { NOTIMPLEMENTED(); }
-
base::TimeDelta PointerAssumedStoppedTime() const override {
NOTIMPLEMENTED();
return base::TimeDelta();
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index d5e2dc7d..cf67ed51 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -489,15 +489,9 @@
waiting_for_screen_rects_ack_ = true;
}
-void RenderWidgetHostImpl::FlushInput() {
- input_router_->RequestNotificationWhenFlushed();
- if (synthetic_gesture_controller_)
- synthetic_gesture_controller_->Flush(base::TimeTicks::Now());
-}
-
-void RenderWidgetHostImpl::SetNeedsFlush() {
- if (view_)
- view_->OnSetNeedsFlushInput();
+void RenderWidgetHostImpl::OnBeginFrame() {
+ if (begin_frame_callback_)
+ std::move(begin_frame_callback_).Run();
}
void RenderWidgetHostImpl::Init() {
@@ -1320,8 +1314,12 @@
std::unique_ptr<SyntheticGesture> synthetic_gesture,
const base::Callback<void(SyntheticGesture::Result)>& on_complete) {
if (!synthetic_gesture_controller_ && view_) {
- synthetic_gesture_controller_.reset(
- new SyntheticGestureController(view_->CreateSyntheticGestureTarget()));
+ synthetic_gesture_controller_ =
+ base::MakeUnique<SyntheticGestureController>(
+ view_->CreateSyntheticGestureTarget(),
+ base::Bind(
+ &RenderWidgetHostImpl::RequestBeginFrameForSynthesizedInput,
+ base::Unretained(this)));
}
if (synthetic_gesture_controller_) {
synthetic_gesture_controller_->QueueSyntheticGesture(
@@ -1866,6 +1864,13 @@
latency_tracker_.OnGpuSwapBuffersCompleted(latency_info);
}
+void RenderWidgetHostImpl::RequestBeginFrameForSynthesizedInput(
+ base::OnceClosure begin_frame_callback) {
+ DCHECK(view_);
+ begin_frame_callback_ = std::move(begin_frame_callback);
+ view_->OnSetNeedsFlushInput();
+}
+
void RenderWidgetHostImpl::OnRenderProcessGone(int status, int exit_code) {
// RenderFrameHost owns a RenderWidgetHost when it needs one, in which case
// it handles destruction.
@@ -2218,8 +2223,6 @@
}
void RenderWidgetHostImpl::DidFlush() {
- if (synthetic_gesture_controller_)
- synthetic_gesture_controller_->OnDidFlushInput();
}
void RenderWidgetHostImpl::DidOverscroll(
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 6938993..67d6dc0 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -478,11 +478,7 @@
// Update the renderer's cache of the screen rect of the view and window.
void SendScreenRects();
- // Called by the view in response to a flush request.
- void FlushInput();
-
- // Request a flush signal from the view.
- void SetNeedsFlush();
+ void OnBeginFrame();
// Indicates whether the renderer drives the RenderWidgetHosts's size or the
// other way around.
@@ -642,6 +638,9 @@
void OnGpuSwapBuffersCompletedInternal(const ui::LatencyInfo& latency_info);
+ void RequestBeginFrameForSynthesizedInput(
+ base::OnceClosure begin_frame_callback);
+
// IPC message handlers
void OnRenderProcessGone(int status, int error_code);
void OnClose();
@@ -983,6 +982,8 @@
// Sorted by frame token.
std::queue<std::pair<uint32_t, std::vector<IPC::Message>>> queued_messages_;
+ base::OnceClosure begin_frame_callback_;
+
base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 5df91ac..2498988 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -2081,15 +2081,16 @@
// Update |last_begin_frame_args_| before handling
// |outstanding_begin_frame_requests_| to prevent the BeginFrameSource from
// sending the same MISSED args in infinite recursion. This may otherwise
- // happen if |host_->FlushInput()| causes a synchronous OnSetNeedsFlushInput()
- // which can lead to |begin_frame_source_->AddObserver()| and OnBeginFrame().
- // By setting |last_begin_frame_args_|, we indicate to the source not to send
- // the same args during |AddObserver()| again.
+ // happen if |host_->OnBeginFrame()| causes a synchronous
+ // OnSetNeedsFlushInput() which can lead to
+ // |begin_frame_source_->AddObserver()| and OnBeginFrame(). By setting
+ // |last_begin_frame_args_|, we indicate to the source not to send the same
+ // args during |AddObserver()| again.
last_begin_frame_args_ = args;
if (outstanding_begin_frame_requests_ & FLUSH_INPUT) {
ClearBeginFrameRequest(FLUSH_INPUT);
- host_->FlushInput();
+ host_->OnBeginFrame();
}
if ((outstanding_begin_frame_requests_ & BEGIN_FRAME) ||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 4756904..d44b13e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -658,7 +658,7 @@
void RenderWidgetHostViewAura::OnBeginFrame(
const cc::BeginFrameArgs& args) {
needs_flush_input_ = false;
- host_->FlushInput();
+ host_->OnBeginFrame();
UpdateNeedsBeginFramesInternal();
host_->Send(new ViewMsg_BeginFrame(host_->GetRoutingID(), args));
}
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 66e549f..86a78504 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -27,9 +27,6 @@
namespace {
-// How many microseconds apart input events should be flushed.
-const int kFlushInputRateInUs = 16666;
-
}
RenderWidgetHostViewBase::RenderWidgetHostViewBase()
@@ -187,17 +184,6 @@
return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
}
-void RenderWidgetHostViewBase::OnSetNeedsFlushInput() {
- if (flush_input_timer_.IsRunning())
- return;
-
- flush_input_timer_.Start(
- FROM_HERE,
- base::TimeDelta::FromMicroseconds(kFlushInputRateInUs),
- this,
- &RenderWidgetHostViewBase::FlushInput);
-}
-
void RenderWidgetHostViewBase::WheelEventAck(
const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result) {
@@ -317,15 +303,6 @@
++renderer_frame_number_;
}
-void RenderWidgetHostViewBase::FlushInput() {
- RenderWidgetHostImpl* impl = NULL;
- if (GetRenderWidgetHost())
- impl = RenderWidgetHostImpl::From(GetRenderWidgetHost());
- if (!impl)
- return;
- impl->FlushInput();
-}
-
void RenderWidgetHostViewBase::ShowDisambiguationPopup(
const gfx::Rect& rect_pixels,
const SkBitmap& zoomed_bitmap) {
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index 2c2364fc..7122708 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -17,7 +17,6 @@
#include "base/observer_list.h"
#include "base/process/kill.h"
#include "base/strings/string16.h"
-#include "base/timer/timer.h"
#include "build/build_config.h"
#include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
#include "cc/output/compositor_frame.h"
@@ -190,7 +189,7 @@
// Called by the host when it requires an input flush; the flush call should
// by synchronized with BeginFrame.
- virtual void OnSetNeedsFlushInput();
+ virtual void OnSetNeedsFlushInput() = 0;
virtual void WheelEventAck(const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result);
@@ -457,14 +456,10 @@
TextInputManager* text_input_manager_;
private:
- void FlushInput();
-
gfx::Rect current_display_area_;
uint32_t renderer_frame_number_;
- base::OneShotTimer flush_input_timer_;
-
base::ObserverList<RenderWidgetHostViewBaseObserver> observers_;
base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index fee24f53..b27aebf2 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -403,7 +403,7 @@
void RenderWidgetHostViewMac::BrowserCompositorMacSendBeginFrame(
const cc::BeginFrameArgs& args) {
needs_flush_input_ = false;
- render_widget_host_->FlushInput();
+ render_widget_host_->OnBeginFrame();
UpdateNeedsBeginFramesInternal();
render_widget_host_->Send(
new ViewMsg_BeginFrame(render_widget_host_->GetRoutingID(), args));
diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h
index 9bbee74..9f01ac1 100644
--- a/content/test/test_render_view_host.h
+++ b/content/test/test_render_view_host.h
@@ -103,6 +103,7 @@
void Focus() override {}
void SetIsLoading(bool is_loading) override {}
void UpdateCursor(const WebCursor& cursor) override {}
+ void OnSetNeedsFlushInput() override {}
void RenderProcessGone(base::TerminationStatus status,
int error_code) override;
void Destroy() override;