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

Unified Diff: ui/latency/latency_tracker.h

Issue 2814483002: Splitting up RenderWidgetHostLatencyTracker and some renames. (Closed)
Patch Set: Rebase Created 3 years, 8 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: ui/latency/latency_tracker.h
diff --git a/ui/latency/latency_tracker.h b/ui/latency/latency_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..df75a7c17512d84733b8dc4f05a758673ec39f73
--- /dev/null
+++ b/ui/latency/latency_tracker.h
@@ -0,0 +1,45 @@
+// Copyright 2017 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_LATENCY_LATENCY_TRACKER_H_
+#define UI_LATENCY_LATENCY_TRACKER_H_
+
+#include <stdint.h>
tdresser 2017/04/10 16:15:54 Is this used?
mfomitchev 2017/04/10 19:00:07 Removed
+
+#include <vector>
tdresser 2017/04/10 16:15:54 Is this used?
mfomitchev 2017/04/10 19:00:07 Removed
+
+#include "base/macros.h"
+#include "ui/latency/latency_info.h"
+
+namespace ui {
+
+// Utility class for tracking the latency of events.
+class LatencyTracker {
tdresser 2017/04/10 16:15:54 Should we split up the RenderWidgetHostLatencyTrac
mfomitchev 2017/04/10 19:00:07 All the unit tests I see that test OnGpuSwapBuffer
+ public:
+ LatencyTracker() = default;
+ ~LatencyTracker() = default;
+
+ // Terminates latency tracking for events that triggered rendering, also
+ // performing relevant UMA latency reporting.
+ // Called when GPU buffers swap completes.
+ void OnGpuSwapBuffersCompleted(const LatencyInfo& latency);
+
+ protected:
+ virtual void ReportRapporScrollLatency(
+ const std::string& name,
+ const LatencyInfo::LatencyComponent& start_component,
+ const LatencyInfo::LatencyComponent& end_component);
+
+ private:
+ void ComputeTouchAndWheelScrollLatencyHistograms(
+ const LatencyInfo::LatencyComponent& gpu_swap_begin_component,
+ const LatencyInfo::LatencyComponent& gpu_swap_end_component,
+ const LatencyInfo& latency);
+
+ DISALLOW_COPY_AND_ASSIGN(LatencyTracker);
+};
+
+} // namespace latency
+
+#endif // UI_LATENCY_LATENCY_TRACKER_H_

Powered by Google App Engine
This is Rietveld 408576698