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

Unified Diff: components/scheduler/renderer/user_model.h

Issue 1683583002: Report user actions when gesture starts and stops in user_model. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not register action callback in single process. Created 4 years, 9 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: components/scheduler/renderer/user_model.h
diff --git a/components/scheduler/renderer/user_model.h b/components/scheduler/renderer/user_model.h
index f93b10beadcfa0f2cfbffed5454f3d3e62b2ba35..8028ba4a73597f538e45e96f06eae7323ee5a6d1 100644
--- a/components/scheduler/renderer/user_model.h
+++ b/components/scheduler/renderer/user_model.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_SCHEDULER_RENDERER_USER_MODEL_H_
#define COMPONENTS_SCHEDULER_RENDERER_USER_MODEL_H_
+#include "base/feature_list.h"
#include "base/macros.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
@@ -12,11 +13,20 @@
#include "components/scheduler/scheduler_export.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
namespace scheduler {
+namespace features {
+SCHEDULER_EXPORT extern const base::Feature kRecordSchedulerGestureActions;
+} // namespace features
+
class SCHEDULER_EXPORT UserModel {
public:
- UserModel();
+ explicit UserModel(
+ scoped_refptr<base::SingleThreadTaskRunner> default_task_runner);
~UserModel();
// Tells us that the system started processing an input event. Must be paired
@@ -67,6 +77,9 @@ class SCHEDULER_EXPORT UserModel {
const base::TimeTicks now,
base::TimeDelta* prediction_valid_duration) const;
+ // Task runner used to execute tasks on the main thread.
+ scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
+
int pending_input_event_count_;
base::TimeTicks last_input_signal_time_;
base::TimeTicks last_gesture_start_time_;
« no previous file with comments | « components/scheduler/renderer/renderer_scheduler_impl.cc ('k') | components/scheduler/renderer/user_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698