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

Unified Diff: chrome/browser/ui/webui/media_router/media_router_ui.h

Issue 1510603003: [Media Router] Add UMA metrics for Media Router Dialog WebUI performance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years 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: chrome/browser/ui/webui/media_router/media_router_ui.h
diff --git a/chrome/browser/ui/webui/media_router/media_router_ui.h b/chrome/browser/ui/webui/media_router/media_router_ui.h
index 88f17cb44d61480e44613b2a2ad26e7e673e8f6e..09040ca0f6245c83f5eb749ecc7ec7140473b4b8 100644
--- a/chrome/browser/ui/webui/media_router/media_router_ui.h
+++ b/chrome/browser/ui/webui/media_router/media_router_ui.h
@@ -126,6 +126,11 @@ class MediaRouterUI : public ConstrainedWebDialogUI,
// Marked virtual for tests.
virtual const std::string& GetRouteProviderExtensionId() const;
+ // Called to track UI metrics.
+ void SetUIInitializationTimer(const base::Time& start_time);
+ void OnUIInitiallyLoaded();
+ void OnUIInitialDataReceived();
+
private:
FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, SortedSinks);
FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
@@ -253,6 +258,10 @@ class MediaRouterUI : public ConstrainedWebDialogUI,
// Timer used to implement a timeout on a create route request.
base::OneShotTimer route_creation_timer_;
+ // The start time for UI initialization metrics timer. When a dialog has been
+ // been painted and initialized with initial data, this should be cleared.
+ base::Time start_time_;
+
// NOTE: Weak pointers must be invalidated before all other member variables.
// Therefore |weak_factory_| must be placed at the end.
base::WeakPtrFactory<MediaRouterUI> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698