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

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: Caching feature. 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..9395af6c92741421b7f3fa3219e8c027173ca402 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 kRecordGestureAction;
+} // namespace features
+
class SCHEDULER_EXPORT UserModel {
public:
- UserModel();
+ explicit UserModel(
+ const 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_;
@@ -76,6 +89,8 @@ class SCHEDULER_EXPORT UserModel {
bool is_gesture_active_; // This typically means the user's finger is down.
bool is_gesture_expected_;
+ bool record_gesture_action_;
+
DISALLOW_COPY_AND_ASSIGN(UserModel);
};

Powered by Google App Engine
This is Rietveld 408576698