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

Side by Side Diff: content/renderer/input/input_event_filter.h

Issue 2162143002: Don't use PostTask queueing between compositor and main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix fairness of post tasks it was causing some tests to fail Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/input/input_event_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/input/input_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698