OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
6 #define CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 blink::WebInputEvent::Type type, | 71 blink::WebInputEvent::Type type, |
72 InputEventAckState ack_result) override; | 72 InputEventAckState ack_result) override; |
73 | 73 |
74 // IPC::MessageFilter methods: | 74 // IPC::MessageFilter methods: |
75 void OnFilterAdded(IPC::Sender* sender) override; | 75 void OnFilterAdded(IPC::Sender* sender) override; |
76 void OnFilterRemoved() override; | 76 void OnFilterRemoved() override; |
77 void OnChannelClosing() override; | 77 void OnChannelClosing() override; |
78 bool OnMessageReceived(const IPC::Message& message) override; | 78 bool OnMessageReceived(const IPC::Message& message) override; |
79 | 79 |
80 // MainThreadEventQueueClient methods: | 80 // MainThreadEventQueueClient methods: |
81 void SendEventToMainThread(int routing_id, | 81 void HandleEventOnMainThread(int routing_id, |
82 const blink::WebInputEvent* event, | 82 const blink::WebInputEvent* event, |
83 const ui::LatencyInfo& latency, | 83 const ui::LatencyInfo& latency, |
84 InputEventDispatchType dispatch_type) override; | 84 InputEventDispatchType dispatch_type) override; |
85 // Send an InputEventAck IPC message. |touch_event_id| represents | 85 // Send an InputEventAck IPC message. |touch_event_id| represents |
86 // the unique event id for the original WebTouchEvent and should | 86 // the unique event id for the original WebTouchEvent and should |
87 // be 0 if otherwise. See WebInputEventTraits::GetUniqueTouchEventId. | 87 // be 0 if otherwise. See WebInputEventTraits::GetUniqueTouchEventId. |
88 void SendInputEventAck(int routing_id, | 88 void SendInputEventAck(int routing_id, |
89 blink::WebInputEvent::Type type, | 89 blink::WebInputEvent::Type type, |
90 InputEventAckState ack_result, | 90 InputEventAckState ack_result, |
91 uint32_t touch_event_id) override; | 91 uint32_t touch_event_id) override; |
92 | 92 |
93 private: | 93 private: |
94 ~InputEventFilter() override; | 94 ~InputEventFilter() override; |
(...skipping 14 matching lines...) Expand all Loading... |
109 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner_; | 109 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner_; |
110 Handler handler_; | 110 Handler handler_; |
111 | 111 |
112 // Protects access to routes_. | 112 // Protects access to routes_. |
113 base::Lock routes_lock_; | 113 base::Lock routes_lock_; |
114 | 114 |
115 // Indicates the routing_ids for which input events should be filtered. | 115 // Indicates the routing_ids for which input events should be filtered. |
116 std::set<int> routes_; | 116 std::set<int> routes_; |
117 | 117 |
118 using RouteQueueMap = | 118 using RouteQueueMap = |
119 std::unordered_map<int, std::unique_ptr<MainThreadEventQueue>>; | 119 std::unordered_map<int, scoped_refptr<MainThreadEventQueue>>; |
120 RouteQueueMap route_queues_; | 120 RouteQueueMap route_queues_; |
121 | 121 |
122 // Used to intercept overscroll notifications while an event is being | 122 // Used to intercept overscroll notifications while an event is being |
123 // dispatched. If the event causes overscroll, the overscroll metadata can be | 123 // dispatched. If the event causes overscroll, the overscroll metadata can be |
124 // bundled in the event ack, saving an IPC. Note that we must continue | 124 // bundled in the event ack, saving an IPC. Note that we must continue |
125 // supporting overscroll IPC notifications due to fling animation updates. | 125 // supporting overscroll IPC notifications due to fling animation updates. |
126 std::unique_ptr<DidOverscrollParams>* current_overscroll_params_; | 126 std::unique_ptr<DidOverscrollParams>* current_overscroll_params_; |
127 }; | 127 }; |
128 | 128 |
129 } // namespace content | 129 } // namespace content |
130 | 130 |
131 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 131 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
OLD | NEW |