OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_TASK_H_ |
| 6 #define CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_TASK_H_ |
| 7 |
| 8 #include "content/common/input/input_event_ack_state.h" |
| 9 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 10 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class MainThreadEventQueueClient; |
| 15 |
| 16 // A work item to execute from the main thread event queue. |
| 17 // The MainThreadEventQueue supports 2 types of tasks (subclasses): |
| 18 // 1) Closures |
| 19 // 2) WebInputEvent |
| 20 class MainThreadEventQueueTask { |
| 21 public: |
| 22 virtual ~MainThreadEventQueueTask() {} |
| 23 |
| 24 enum class CoalesceResult { |
| 25 Coalesced, |
| 26 CannotCoalesce, |
| 27 // Keep iterating on the queue looking for a matching event with the |
| 28 // same modality. |
| 29 KeepSearching, |
| 30 }; |
| 31 |
| 32 virtual CoalesceResult CoalesceWith(const MainThreadEventQueueTask&) = 0; |
| 33 virtual bool IsWebInputEvent() const = 0; |
| 34 virtual void Dispatch(int routing_id, MainThreadEventQueueClient*) = 0; |
| 35 virtual void EventHandled( |
| 36 int routing_id, |
| 37 blink::scheduler::RendererScheduler* renderer_scheduler, |
| 38 MainThreadEventQueueClient* client, |
| 39 blink::WebInputEvent::Type type, |
| 40 blink::WebInputEventResult result, |
| 41 InputEventAckState ack_result) = 0; |
| 42 }; |
| 43 |
| 44 } // namespace content |
| 45 |
| 46 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_TASK_H_ |
OLD | NEW |