Skip to content

Commit

Permalink
input: Remove dead code.
Browse files Browse the repository at this point in the history
Synthesized input events for telemetry tests are no longer triggered on a
begin frame (after crrev.com/475692). So remove the now-unused code for
requesting a begin frame for dispatching synthesized input events.

BUG=722921
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2935563002
Cr-Commit-Position: refs/heads/master@{#479326}
  • Loading branch information
sadrulhc authored and Commit Bot committed Jun 14, 2017
1 parent 29e207d commit 110abc7
Show file tree
Hide file tree
Showing 16 changed files with 5 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,6 @@ InputEventAckState RenderWidgetHostViewChildFrame::FilterChildGestureEvent(
return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
}

void RenderWidgetHostViewChildFrame::OnSetNeedsFlushInput() {
NOTIMPLEMENTED();
}

BrowserAccessibilityManager*
RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate, bool for_root_frame) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
const blink::WebInputEvent& input_event) override;
InputEventAckState FilterChildGestureEvent(
const blink::WebGestureEvent& gesture_event) override;
void OnSetNeedsFlushInput() override;
BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate, bool for_root_frame) override;

Expand Down
4 changes: 0 additions & 4 deletions content/browser/frame_host/render_widget_host_view_guest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,6 @@ void RenderWidgetHostViewGuest::MaybeSendSyntheticTapGesture(
}
}

void RenderWidgetHostViewGuest::OnSetNeedsFlushInput() {
NOTIMPLEMENTED();
}

void RenderWidgetHostViewGuest::WheelEventAck(
const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result) {
Expand Down
1 change: 0 additions & 1 deletion content/browser/frame_host/render_widget_host_view_guest.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest
void StopSpeaking() override;
#endif // defined(OS_MACOSX)

void OnSetNeedsFlushInput() override;
void WheelEventAck(const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ class CONTENT_EXPORT SyntheticGestureController {
public:
virtual ~Delegate() {}

// Requests a single begin frame. The passed callback is run on the next
// begin frame message.
virtual void RequestBeginFrameForSynthesizedInput(
base::OnceClosure callback) = 0;

// Returns whether any gesture created by dispatched input events has
// completed or not.
virtual bool HasGestureStopped() = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,6 @@ class DummySyntheticGestureControllerDelegate

private:
// SyntheticGestureController::Delegate:
void RequestBeginFrameForSynthesizedInput(
base::OnceClosure callback) override {}
bool HasGestureStopped() override { return true; }

DISALLOW_COPY_AND_ASSIGN(DummySyntheticGestureControllerDelegate);
Expand Down
12 changes: 0 additions & 12 deletions content/browser/renderer_host/render_widget_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,6 @@ void RenderWidgetHostImpl::SendScreenRects() {
waiting_for_screen_rects_ack_ = true;
}

void RenderWidgetHostImpl::OnBeginFrame() {
if (begin_frame_callback_)
std::move(begin_frame_callback_).Run();
}

void RenderWidgetHostImpl::Init() {
DCHECK(process_->HasConnection());

Expand Down Expand Up @@ -2548,13 +2543,6 @@ void RenderWidgetHostImpl::RequestMojoCompositorFrameSink(
renderer_compositor_frame_sink_ = std::move(client);
}

void RenderWidgetHostImpl::RequestBeginFrameForSynthesizedInput(
base::OnceClosure begin_frame_callback) {
DCHECK(view_);
begin_frame_callback_ = std::move(begin_frame_callback);
view_->OnSetNeedsFlushInput();
}

bool RenderWidgetHostImpl::HasGestureStopped() {
return !input_router_->HasPendingEvents();
}
Expand Down
7 changes: 0 additions & 7 deletions content/browser/renderer_host/render_widget_host_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// Update the renderer's cache of the screen rect of the view and window.
void SendScreenRects();

void OnBeginFrame();

// Indicates whether the renderer drives the RenderWidgetHosts's size or the
// other way around.
bool auto_resize_enabled() { return auto_resize_enabled_; }
Expand Down Expand Up @@ -586,9 +584,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
return last_frame_metadata_;
}

// SyntheticGestureController::Delegate:
void RequestBeginFrameForSynthesizedInput(
base::OnceClosure begin_frame_callback) override;
bool HasGestureStopped() override;

// cc::mojom::MojoCompositorFrameSink implementation.
Expand Down Expand Up @@ -994,8 +989,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// 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);
Expand Down
17 changes: 1 addition & 16 deletions content/browser/renderer_host/render_widget_host_view_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1750,11 +1750,6 @@ InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent(
return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
}

void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() {
TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput");
AddBeginFrameRequest(FLUSH_INPUT);
}

BrowserAccessibilityManager*
RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate, bool for_root_frame) {
Expand Down Expand Up @@ -2137,19 +2132,9 @@ void RenderWidgetHostViewAndroid::OnBeginFrame(const cc::BeginFrameArgs& args) {

// 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_->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.
// sending the same MISSED args in infinite recursion.
last_begin_frame_args_ = args;

if (outstanding_begin_frame_requests_ & FLUSH_INPUT) {
ClearBeginFrameRequest(FLUSH_INPUT);
host_->OnBeginFrame();
}

if ((outstanding_begin_frame_requests_ & BEGIN_FRAME) ||
(outstanding_begin_frame_requests_ & PERSISTENT_BEGIN_FRAME)) {
ClearBeginFrameRequest(BEGIN_FRAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
InputEventAckState ack_result) override;
InputEventAckState FilterInputEvent(
const blink::WebInputEvent& input_event) override;
void OnSetNeedsFlushInput() override;
void GestureEventAck(const blink::WebGestureEvent& event,
InputEventAckState ack_result) override;
BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
Expand Down Expand Up @@ -328,9 +327,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
void OnLostResources();

enum BeginFrameRequestType {
FLUSH_INPUT = 1 << 0,
BEGIN_FRAME = 1 << 1,
PERSISTENT_BEGIN_FRAME = 1 << 2
BEGIN_FRAME = 1 << 0,
PERSISTENT_BEGIN_FRAME = 1 << 1
};
void AddBeginFrameRequest(BeginFrameRequestType request);
void ClearBeginFrameRequest(BeginFrameRequestType request);
Expand Down
11 changes: 1 addition & 10 deletions content/browser/renderer_host/render_widget_host_view_aura.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host,
has_composition_text_(false),
background_color_(SK_ColorWHITE),
needs_begin_frames_(false),
needs_flush_input_(false),
added_frame_observer_(false),
cursor_visibility_state_in_renderer_(UNKNOWN),
#if defined(OS_WIN)
Expand Down Expand Up @@ -650,14 +649,7 @@ void RenderWidgetHostViewAura::SetNeedsBeginFrames(bool needs_begin_frames) {
UpdateNeedsBeginFramesInternal();
}

void RenderWidgetHostViewAura::OnSetNeedsFlushInput() {
needs_flush_input_ = true;
UpdateNeedsBeginFramesInternal();
}

void RenderWidgetHostViewAura::OnBeginFrame() {
needs_flush_input_ = false;
host_->OnBeginFrame();
UpdateNeedsBeginFramesInternal();
}

Expand Down Expand Up @@ -2431,8 +2423,7 @@ void RenderWidgetHostViewAura::SetPopupChild(
void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() {
if (!delegated_frame_host_)
return;
delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ ||
needs_flush_input_);
delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_);
}

} // namespace content
4 changes: 0 additions & 4 deletions content/browser/renderer_host/render_widget_host_view_aura.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
void EndFrameSubscription() override;
bool HasAcceleratedSurface(const gfx::Size& desired_size) override;
gfx::Rect GetBoundsInRootWindow() override;
void OnSetNeedsFlushInput() override;
void WheelEventAck(const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result) override;
void GestureEventAck(const blink::WebGestureEvent& event,
Expand Down Expand Up @@ -535,9 +534,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
// Whether a request for begin frames has been issued.
bool needs_begin_frames_;

// Whether a request to flush input has been issued.
bool needs_flush_input_;

// Whether or not a frame observer has been added.
bool added_frame_observer_;

Expand Down
4 changes: 0 additions & 4 deletions content/browser/renderer_host/render_widget_host_view_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
virtual InputEventAckState FilterChildGestureEvent(
const blink::WebGestureEvent& gesture_event);

// Called by the host when it requires an input flush; the flush call should
// by synchronized with BeginFrame.
virtual void OnSetNeedsFlushInput() = 0;

virtual void WheelEventAck(const blink::WebMouseWheelEvent& event,
InputEventAckState ack_result);

Expand Down
4 changes: 0 additions & 4 deletions content/browser/renderer_host/render_widget_host_view_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac

bool LockMouse() override;
void UnlockMouse() override;
void OnSetNeedsFlushInput() override;
void GestureEventAck(const blink::WebGestureEvent& event,
InputEventAckState ack_result) override;

Expand Down Expand Up @@ -568,9 +567,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// Whether a request for begin frames has been issued.
bool needs_begin_frames_;

// Whether a request to flush input has been issued.
bool needs_flush_input_;

// The background color of the web content. This color will be drawn when the
// web content is not able to draw in time.
SkColor background_color_ = SK_ColorTRANSPARENT;
Expand Down
11 changes: 1 addition & 10 deletions content/browser/renderer_host/render_widget_host_view_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ float FlipYFromRectToScreen(float y, float rect_height) {
}

void RenderWidgetHostViewMac::BrowserCompositorMacOnBeginFrame() {
needs_flush_input_ = false;
render_widget_host_->OnBeginFrame();
UpdateNeedsBeginFramesInternal();
}

Expand Down Expand Up @@ -445,7 +443,6 @@ float FlipYFromRectToScreen(float y, float rect_height) {
allow_pause_for_resize_or_repaint_(true),
is_guest_view_hack_(is_guest_view_hack),
fullscreen_parent_host_view_(nullptr),
needs_flush_input_(false),
weak_factory_(this) {
// |cocoa_view_| owns us and we will be deleted when |cocoa_view_|
// goes away. Since we autorelease it, our caller must put
Expand Down Expand Up @@ -1211,14 +1208,8 @@ new BrowserCompositorMac(this, this, render_widget_host_->is_hidden(),
UpdateNeedsBeginFramesInternal();
}

void RenderWidgetHostViewMac::OnSetNeedsFlushInput() {
needs_flush_input_ = true;
UpdateNeedsBeginFramesInternal();
}

void RenderWidgetHostViewMac::UpdateNeedsBeginFramesInternal() {
browser_compositor_->SetNeedsBeginFrames(needs_begin_frames_ ||
needs_flush_input_);
browser_compositor_->SetNeedsBeginFrames(needs_begin_frames_);
}

void RenderWidgetHostViewMac::KillSelf() {
Expand Down
1 change: 0 additions & 1 deletion content/test/test_render_view_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
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;
Expand Down

0 comments on commit 110abc7

Please sign in to comment.