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

Unified Diff: ui/events/blink/event_with_callback.h

Issue 2429953002: Implement compositor thread VSync aligned event queue (Closed)
Patch Set: dtapuska&enne's review: Call |Now()| once per loop; Chromium style; Remove parameterized test Created 4 years, 1 month 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
« no previous file with comments | « ui/events/blink/compositor_thread_event_queue.cc ('k') | ui/events/blink/event_with_callback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/event_with_callback.h
diff --git a/ui/events/blink/event_with_callback.h b/ui/events/blink/event_with_callback.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6fd612caf9d6085d252e47ed43a09e32d985498
--- /dev/null
+++ b/ui/events/blink/event_with_callback.h
@@ -0,0 +1,66 @@
+// Copyright 2016 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 UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_
+#define UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_
+
+#include <list>
+
+#include "ui/events/blink/input_handler_proxy.h"
+#include "ui/events/latency_info.h"
+
+namespace ui {
+
+namespace test {
+class InputHandlerProxyEventQueueTest;
+}
+
+class EventWithCallback {
+ public:
+ EventWithCallback(
+ ScopedWebInputEvent event,
+ const LatencyInfo& latency,
+ base::TimeTicks timestamp_now,
+ const InputHandlerProxy::EventDispositionCallback& callback);
+ ~EventWithCallback();
+
+ bool CanCoalesceWith(const EventWithCallback& other) const WARN_UNUSED_RESULT;
+ void CoalesceWith(EventWithCallback* other, base::TimeTicks timestamp_now);
+
+ void RunCallbacks(InputHandlerProxy::EventDisposition,
+ const LatencyInfo& latency,
+ std::unique_ptr<DidOverscrollParams>);
+
+ const blink::WebInputEvent& event() const { return *event_; }
+ const LatencyInfo latency_info() const { return latency_; }
+ base::TimeTicks creation_timestamp() const { return creation_timestamp_; }
+ base::TimeTicks last_coalesced_timestamp() const {
+ return last_coalesced_timestamp_;
+ }
+ size_t coalesced_count() const { return original_events_.size(); }
+
+ private:
+ friend class test::InputHandlerProxyEventQueueTest;
+ struct OriginalEventWithCallback {
+ OriginalEventWithCallback(
+ ScopedWebInputEvent event,
+ const InputHandlerProxy::EventDispositionCallback& callback);
+ ~OriginalEventWithCallback();
+ ScopedWebInputEvent event_;
+ InputHandlerProxy::EventDispositionCallback callback_;
+ };
+
+ void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock);
+
+ ScopedWebInputEvent event_;
+ LatencyInfo latency_;
+ std::list<OriginalEventWithCallback> original_events_;
+
+ base::TimeTicks creation_timestamp_;
+ base::TimeTicks last_coalesced_timestamp_;
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_
« no previous file with comments | « ui/events/blink/compositor_thread_event_queue.cc ('k') | ui/events/blink/event_with_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698