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

Unified Diff: services/ui/ws/window_manager_state.h

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: rebase and use EventTargeter Created 3 years, 7 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: services/ui/ws/window_manager_state.h
diff --git a/services/ui/ws/window_manager_state.h b/services/ui/ws/window_manager_state.h
index 68e808b16f0b14d4d372e151af6207ed81c936fa..21e3df828358833a0183f1bb22f86973901fb401 100644
--- a/services/ui/ws/window_manager_state.h
+++ b/services/ui/ws/window_manager_state.h
@@ -154,13 +154,13 @@ class WindowManagerState : public EventDispatcherDelegate,
};
// Tracks state associated with an event being dispatched to a client.
- struct InFlightEventDetails {
- InFlightEventDetails(WindowManagerState* window_manager_state,
- WindowTree* tree,
- int64_t display_id,
- const Event& event,
- EventDispatchPhase phase);
- ~InFlightEventDetails();
+ struct InFlightEventDispatchDetails {
+ InFlightEventDispatchDetails(WindowManagerState* window_manager_state,
+ WindowTree* tree,
+ int64_t display_id,
+ const Event& event,
+ EventDispatchPhase phase);
+ ~InFlightEventDispatchDetails();
base::OneShotTimer timer;
WindowTree* tree;
@@ -214,11 +214,6 @@ class WindowManagerState : public EventDispatcherDelegate,
std::unique_ptr<ProcessedEventTarget> processed_event_target,
int64_t display_id);
- // Processes the next valid event in |event_queue_|. If the event has already
- // been processed it is dispatched, otherwise the event is passed to the
- // EventDispatcher for processing.
- void ProcessNextEventFromQueue();
-
// Dispatches the event to the appropriate client and starts the ack timer.
void DispatchInputEventToWindowImpl(ServerWindow* target,
ClientSpecificId client_id,
@@ -270,6 +265,10 @@ class WindowManagerState : public EventDispatcherDelegate,
const int64_t display_id,
const Event& event,
Accelerator* accelerator) override;
+ // Processes the next valid event in |event_queue_|. If the event has already
+ // been processed it is dispatched, otherwise the event is passed to the
+ // EventDispatcher for processing.
+ void ProcessNextEventFromQueue() override;
ClientSpecificId GetEventTargetClientId(const ServerWindow* window,
bool in_nonclient_area) override;
ServerWindow* GetRootWindowContaining(gfx::Point* location_in_display,
@@ -288,13 +287,16 @@ class WindowManagerState : public EventDispatcherDelegate,
bool got_frame_decoration_values_ = false;
mojom::FrameDecorationValuesPtr frame_decoration_values_;
+ // Events can go into this queue if there's a hit-test in flight in
+ // EventDispatcher or if we are actively dispatching an event.
std::queue<std::unique_ptr<QueuedEvent>> event_queue_;
std::vector<DebugAccelerator> debug_accelerators_;
// If non-null we're actively waiting for a response from a client for an
// event.
- std::unique_ptr<InFlightEventDetails> in_flight_event_details_;
+ std::unique_ptr<InFlightEventDispatchDetails>
+ in_flight_event_dispatch_details_;
EventDispatcher event_dispatcher_;

Powered by Google App Engine
This is Rietveld 408576698