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

Unified Diff: content/renderer/input/main_thread_event_queue_task.h

Issue 2765583002: Teach main thread event queue about closures. (Closed)
Patch Set: Fix typo Created 3 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/main_thread_event_queue_task.h
diff --git a/content/renderer/input/main_thread_event_queue_task.h b/content/renderer/input/main_thread_event_queue_task.h
new file mode 100644
index 0000000000000000000000000000000000000000..64fc0ade70d212d9b9fd714f76c97a431d6252af
--- /dev/null
+++ b/content/renderer/input/main_thread_event_queue_task.h
@@ -0,0 +1,46 @@
+// Copyright 2017 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.
+
+#ifndef CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_TASK_H_
+#define CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_TASK_H_
+
+#include "content/common/input/input_event_ack_state.h"
+#include "third_party/WebKit/public/platform/WebInputEvent.h"
+#include "third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h"
+
+namespace content {
+
+class MainThreadEventQueueClient;
+
+// A work item to execute from the main thread event queue.
+// The MainThreadEventQueue supports 2 types of tasks (subclasses):
+// 1) Closures
+// 2) WebInputEvent
+class MainThreadEventQueueTask {
+ public:
+ virtual ~MainThreadEventQueueTask() {}
+
+ enum class CoalesceResult {
+ Coalesced,
+ CannotCoalesce,
+ // Keep iterating on the queue looking for a matching event with the
+ // same modality.
+ KeepSearching,
+ };
+
+ virtual CoalesceResult CoalesceWith(const MainThreadEventQueueTask&) = 0;
+ virtual bool IsWebInputEvent() const = 0;
+ virtual void Dispatch(int routing_id, MainThreadEventQueueClient*) = 0;
+ virtual void EventHandled(
+ int routing_id,
+ blink::scheduler::RendererScheduler* renderer_scheduler,
+ MainThreadEventQueueClient* client,
+ blink::WebInputEvent::Type type,
+ blink::WebInputEventResult result,
+ InputEventAckState ack_result) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_TASK_H_
« no previous file with comments | « content/renderer/input/main_thread_event_queue.cc ('k') | content/renderer/input/main_thread_event_queue_task_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698