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

Unified Diff: ui/latency/latency_info.h

Issue 2771053003: WIP: Plumbing input event latency reporting through Mus GPU.
Patch Set: NON_EXPORTED_BASE 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
« no previous file with comments | « ui/latency/latency_histogram_macros.h ('k') | ui/latency/latency_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/latency/latency_info.h
diff --git a/ui/latency/latency_info.h b/ui/latency/latency_info.h
index f34e09ac8ea47f67560820c47c1ed3e261576b0e..a122b0160fc18b0ea53e8d6434ff8d9537d2d756 100644
--- a/ui/latency/latency_info.h
+++ b/ui/latency/latency_info.h
@@ -75,9 +75,10 @@ enum LatencyComponentType {
TAB_SHOW_COMPONENT,
// Timestamp when the frame is swapped in renderer.
INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT,
- // Timestamp of when the browser process receives a buffer swap notification
- // from the renderer.
- INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT,
+ // Timestamp of when the display compositor receives a compositor frame from
+ // the renderer.
+ // Display compositor can be either in the browser process or in Mus.
+ DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT,
// Timestamp of when the gpu service began swap buffers, unlike
// INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT which measures after.
INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT,
@@ -112,6 +113,8 @@ enum SourceEventType {
SOURCE_EVENT_TYPE_LAST = OTHER,
};
+const char* GetComponentName(ui::LatencyComponentType type);
+
class LatencyInfo {
public:
struct LatencyComponent {
@@ -193,6 +196,12 @@ class LatencyInfo {
int64_t id,
LatencyComponent* output) const;
+ // Returns true if a component with |type| is found in the latency component.
+ // The first such component (when iterating over latency_components_) is
+ // stored to |output| if |output| is not NULL. Returns false if no such
+ // component is found.
+ bool FindLatency(LatencyComponentType type, LatencyComponent* output) const;
+
void RemoveLatency(LatencyComponentType type);
// Returns true if there is still room for keeping the |input_coordinate|,
@@ -256,6 +265,12 @@ class LatencyInfo {
#endif
};
+// This is declared here for use in gtest-based unit tests, but is defined in
+// //ui/latency:test_support target.
+// Without this the default PrintTo template in gtest tries to pass LatencyInfo
+// by value, which leads to an alignment compile error on Windows.
+void PrintTo(const LatencyInfo& latency, ::std::ostream* os);
+
} // namespace ui
#endif // UI_LATENCY_LATENCY_INFO_H_
« no previous file with comments | « ui/latency/latency_histogram_macros.h ('k') | ui/latency/latency_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698