Chromium Code Reviews| 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..efef386f19916356f2ab0be6da415aa0a62e70c3 |
| --- /dev/null |
| +++ b/content/renderer/input/main_thread_event_queue_task.h |
| @@ -0,0 +1,41 @@ |
| +// 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() {} |
| + |
| + virtual bool CanCoalesceWith(const MainThreadEventQueueTask&) const = 0; |
| + virtual void CoalesceWith(const MainThreadEventQueueTask&) = 0; |
| + virtual bool ShouldSkipOverForCoalescing( |
| + const MainThreadEventQueueTask&) const = 0; |
|
tdresser
2017/03/30 17:46:16
Add a comment on this method. It took me a while t
dtapuska
2017/03/30 19:45:51
Rejigged callback to return an enum and removed tw
|
| + 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_ |