Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1975)

Unified Diff: content/renderer/input/non_blocking_event_queue.cc

Issue 1780953003: Change the non-blocking event queue to the main thread event queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_regression_5
Patch Set: Fix android Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/input/non_blocking_event_queue.cc
diff --git a/content/renderer/input/non_blocking_event_queue.cc b/content/renderer/input/non_blocking_event_queue.cc
deleted file mode 100644
index 4fc5d11b6119dbb649877443a52c14f442711bb0..0000000000000000000000000000000000000000
--- a/content/renderer/input/non_blocking_event_queue.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/renderer/input/non_blocking_event_queue.h"
-
-namespace content {
-
-NonBlockingEventQueue::NonBlockingEventQueue(
- int routing_id,
- NonBlockingEventQueueClient* client)
- : routing_id_(routing_id), client_(client) {}
-
-NonBlockingEventQueue::~NonBlockingEventQueue() {}
-
-void NonBlockingEventQueue::HandleEvent(const blink::WebInputEvent* event,
- const ui::LatencyInfo& latency) {
- if (event->type == blink::WebInputEvent::MouseWheel) {
- if (wheel_events_.state() == WebInputEventQueueState::ITEM_PENDING) {
- wheel_events_.Queue(MouseWheelEventWithLatencyInfo(
- *static_cast<const blink::WebMouseWheelEvent*>(event), latency));
- } else {
- wheel_events_.set_state(WebInputEventQueueState::ITEM_PENDING);
- client_->SendNonBlockingEvent(routing_id_, event, latency);
- }
- } else if (blink::WebInputEvent::isTouchEventType(event->type)) {
- if (touch_events_.state() == WebInputEventQueueState::ITEM_PENDING) {
- touch_events_.Queue(TouchEventWithLatencyInfo(
- *static_cast<const blink::WebTouchEvent*>(event), latency));
- } else {
- touch_events_.set_state(WebInputEventQueueState::ITEM_PENDING);
- client_->SendNonBlockingEvent(routing_id_, event, latency);
- }
- } else {
- NOTREACHED() << "Invalid passive event type";
- }
-}
-
-void NonBlockingEventQueue::EventHandled(blink::WebInputEvent::Type type) {
- if (type == blink::WebInputEvent::MouseWheel) {
- if (!wheel_events_.empty()) {
- scoped_ptr<MouseWheelEventWithLatencyInfo> event = wheel_events_.Pop();
-
- client_->SendNonBlockingEvent(routing_id_, &event->event, event->latency);
- } else {
- wheel_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING);
- }
- } else if (blink::WebInputEvent::isTouchEventType(type)) {
- if (!touch_events_.empty()) {
- scoped_ptr<TouchEventWithLatencyInfo> event = touch_events_.Pop();
- client_->SendNonBlockingEvent(routing_id_, &event->event, event->latency);
- } else {
- touch_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING);
- }
- } else {
- NOTREACHED() << "Invalid passive event type";
- }
-}
-
-} // namespace content
« no previous file with comments | « content/renderer/input/non_blocking_event_queue.h ('k') | content/renderer/input/non_blocking_event_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698