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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/user_model.cc

Issue 2476263002: scheduler: Reset pending input event count on navigation (Closed)
Patch Set: Formatting 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/renderer/user_model_unittest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "platform/scheduler/renderer/user_model.h" 5 #include "platform/scheduler/renderer/user_model.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 8
9 namespace blink { 9 namespace blink {
10 namespace scheduler { 10 namespace scheduler {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 void UserModel::Reset(base::TimeTicks now) { 191 void UserModel::Reset(base::TimeTicks now) {
192 last_input_signal_time_ = base::TimeTicks(); 192 last_input_signal_time_ = base::TimeTicks();
193 last_gesture_start_time_ = base::TimeTicks(); 193 last_gesture_start_time_ = base::TimeTicks();
194 last_continuous_gesture_time_ = base::TimeTicks(); 194 last_continuous_gesture_time_ = base::TimeTicks();
195 last_gesture_expected_start_time_ = base::TimeTicks(); 195 last_gesture_expected_start_time_ = base::TimeTicks();
196 last_reset_time_ = now; 196 last_reset_time_ = now;
197 is_gesture_active_ = false; 197 is_gesture_active_ = false;
198 is_gesture_expected_ = false; 198 is_gesture_expected_ = false;
199 pending_input_event_count_ = 0;
199 } 200 }
200 201
201 void UserModel::AsValueInto(base::trace_event::TracedValue* state) const { 202 void UserModel::AsValueInto(base::trace_event::TracedValue* state) const {
202 state->BeginDictionary("user_model"); 203 state->BeginDictionary("user_model");
203 state->SetInteger("pending_input_event_count", pending_input_event_count_); 204 state->SetInteger("pending_input_event_count", pending_input_event_count_);
204 state->SetDouble( 205 state->SetDouble(
205 "last_input_signal_time", 206 "last_input_signal_time",
206 (last_input_signal_time_ - base::TimeTicks()).InMillisecondsF()); 207 (last_input_signal_time_ - base::TimeTicks()).InMillisecondsF());
207 state->SetDouble( 208 state->SetDouble(
208 "last_gesture_start_time", 209 "last_gesture_start_time",
209 (last_gesture_start_time_ - base::TimeTicks()).InMillisecondsF()); 210 (last_gesture_start_time_ - base::TimeTicks()).InMillisecondsF());
210 state->SetDouble( 211 state->SetDouble(
211 "last_continuous_gesture_time", 212 "last_continuous_gesture_time",
212 (last_continuous_gesture_time_ - base::TimeTicks()).InMillisecondsF()); 213 (last_continuous_gesture_time_ - base::TimeTicks()).InMillisecondsF());
213 state->SetDouble("last_gesture_expected_start_time", 214 state->SetDouble("last_gesture_expected_start_time",
214 (last_gesture_expected_start_time_ - base::TimeTicks()) 215 (last_gesture_expected_start_time_ - base::TimeTicks())
215 .InMillisecondsF()); 216 .InMillisecondsF());
216 state->SetDouble("last_reset_time", 217 state->SetDouble("last_reset_time",
217 (last_reset_time_ - base::TimeTicks()).InMillisecondsF()); 218 (last_reset_time_ - base::TimeTicks()).InMillisecondsF());
218 state->SetBoolean("is_gesture_expected", is_gesture_expected_); 219 state->SetBoolean("is_gesture_expected", is_gesture_expected_);
219 state->SetBoolean("is_gesture_active", is_gesture_active_); 220 state->SetBoolean("is_gesture_active", is_gesture_active_);
220 state->EndDictionary(); 221 state->EndDictionary();
221 } 222 }
222 223
223 } // namespace scheduler 224 } // namespace scheduler
224 } // namespace blink 225 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/renderer/user_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698