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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc

Issue 2915983002: [Media Router] Add UMA metrics to record the load time for route controls (Closed)
Patch Set: Fix a test failure Created 3 years, 6 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 unified diff | Download patch
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 "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h" 5 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 const char kReportFilter[] = "reportFilter"; 53 const char kReportFilter[] = "reportFilter";
54 const char kReportInitialAction[] = "reportInitialAction"; 54 const char kReportInitialAction[] = "reportInitialAction";
55 const char kReportInitialState[] = "reportInitialState"; 55 const char kReportInitialState[] = "reportInitialState";
56 const char kReportNavigateToView[] = "reportNavigateToView"; 56 const char kReportNavigateToView[] = "reportNavigateToView";
57 const char kReportRouteCreationOutcome[] = "reportRouteCreationOutcome"; 57 const char kReportRouteCreationOutcome[] = "reportRouteCreationOutcome";
58 const char kReportRouteCreation[] = "reportRouteCreation"; 58 const char kReportRouteCreation[] = "reportRouteCreation";
59 const char kReportSelectedCastMode[] = "reportSelectedCastMode"; 59 const char kReportSelectedCastMode[] = "reportSelectedCastMode";
60 const char kReportSinkCount[] = "reportSinkCount"; 60 const char kReportSinkCount[] = "reportSinkCount";
61 const char kReportTimeToClickSink[] = "reportTimeToClickSink"; 61 const char kReportTimeToClickSink[] = "reportTimeToClickSink";
62 const char kReportTimeToInitialActionClose[] = "reportTimeToInitialActionClose"; 62 const char kReportTimeToInitialActionClose[] = "reportTimeToInitialActionClose";
63 const char kReportWebUIRouteControllerLoaded[] =
64 "reportWebUIRouteControllerLoaded";
63 const char kSearchSinksAndCreateRoute[] = "searchSinksAndCreateRoute"; 65 const char kSearchSinksAndCreateRoute[] = "searchSinksAndCreateRoute";
64 const char kOnInitialDataReceived[] = "onInitialDataReceived"; 66 const char kOnInitialDataReceived[] = "onInitialDataReceived";
65 const char kOnMediaControllerAvailable[] = "onMediaControllerAvailable"; 67 const char kOnMediaControllerAvailable[] = "onMediaControllerAvailable";
66 const char kOnMediaControllerClosed[] = "onMediaControllerClosed"; 68 const char kOnMediaControllerClosed[] = "onMediaControllerClosed";
67 const char kPauseCurrentMedia[] = "pauseCurrentMedia"; 69 const char kPauseCurrentMedia[] = "pauseCurrentMedia";
68 const char kPlayCurrentMedia[] = "playCurrentMedia"; 70 const char kPlayCurrentMedia[] = "playCurrentMedia";
69 const char kSeekCurrentMedia[] = "seekCurrentMedia"; 71 const char kSeekCurrentMedia[] = "seekCurrentMedia";
70 const char kSetCurrentMediaMute[] = "setCurrentMediaMute"; 72 const char kSetCurrentMediaMute[] = "setCurrentMediaMute";
71 const char kSetCurrentMediaVolume[] = "setCurrentMediaVolume"; 73 const char kSetCurrentMediaVolume[] = "setCurrentMediaVolume";
72 74
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 web_ui()->RegisterMessageCallback( 426 web_ui()->RegisterMessageCallback(
425 kReportTimeToClickSink, 427 kReportTimeToClickSink,
426 base::Bind(&MediaRouterWebUIMessageHandler::OnReportTimeToClickSink, 428 base::Bind(&MediaRouterWebUIMessageHandler::OnReportTimeToClickSink,
427 base::Unretained(this))); 429 base::Unretained(this)));
428 web_ui()->RegisterMessageCallback( 430 web_ui()->RegisterMessageCallback(
429 kReportTimeToInitialActionClose, 431 kReportTimeToInitialActionClose,
430 base::Bind( 432 base::Bind(
431 &MediaRouterWebUIMessageHandler::OnReportTimeToInitialActionClose, 433 &MediaRouterWebUIMessageHandler::OnReportTimeToInitialActionClose,
432 base::Unretained(this))); 434 base::Unretained(this)));
433 web_ui()->RegisterMessageCallback( 435 web_ui()->RegisterMessageCallback(
436 kReportWebUIRouteControllerLoaded,
437 base::Bind(
438 &MediaRouterWebUIMessageHandler::OnReportWebUIRouteControllerLoaded,
439 base::Unretained(this)));
440 web_ui()->RegisterMessageCallback(
434 kSearchSinksAndCreateRoute, 441 kSearchSinksAndCreateRoute,
435 base::Bind(&MediaRouterWebUIMessageHandler::OnSearchSinksAndCreateRoute, 442 base::Bind(&MediaRouterWebUIMessageHandler::OnSearchSinksAndCreateRoute,
436 base::Unretained(this))); 443 base::Unretained(this)));
437 web_ui()->RegisterMessageCallback( 444 web_ui()->RegisterMessageCallback(
438 kOnInitialDataReceived, 445 kOnInitialDataReceived,
439 base::Bind(&MediaRouterWebUIMessageHandler::OnInitialDataReceived, 446 base::Bind(&MediaRouterWebUIMessageHandler::OnInitialDataReceived,
440 base::Unretained(this))); 447 base::Unretained(this)));
441 web_ui()->RegisterMessageCallback( 448 web_ui()->RegisterMessageCallback(
442 kOnMediaControllerAvailable, 449 kOnMediaControllerAvailable,
443 base::Bind(&MediaRouterWebUIMessageHandler::OnMediaControllerAvailable, 450 base::Bind(&MediaRouterWebUIMessageHandler::OnMediaControllerAvailable,
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 DVLOG(1) << "OnReportTimeToClickSink"; 808 DVLOG(1) << "OnReportTimeToClickSink";
802 double time_to_click; 809 double time_to_click;
803 if (!args->GetDouble(0, &time_to_click)) { 810 if (!args->GetDouble(0, &time_to_click)) {
804 DVLOG(1) << "Unable to extract args."; 811 DVLOG(1) << "Unable to extract args.";
805 return; 812 return;
806 } 813 }
807 UMA_HISTOGRAM_TIMES("MediaRouter.Ui.Action.StartLocal.Latency", 814 UMA_HISTOGRAM_TIMES("MediaRouter.Ui.Action.StartLocal.Latency",
808 base::TimeDelta::FromMillisecondsD(time_to_click)); 815 base::TimeDelta::FromMillisecondsD(time_to_click));
809 } 816 }
810 817
818 void MediaRouterWebUIMessageHandler::OnReportWebUIRouteControllerLoaded(
819 const base::ListValue* args) {
820 DVLOG(1) << "OnReportWebUIRouteControllerLoaded";
821 double load_time;
822 if (!args->GetDouble(0, &load_time)) {
823 DVLOG(1) << "Unable to extract args.";
824 return;
825 }
826 UMA_HISTOGRAM_TIMES("MediaRouter.Ui.Dialog.LoadedWebUiRouteController",
827 base::TimeDelta::FromMillisecondsD(load_time));
828 }
829
811 void MediaRouterWebUIMessageHandler::OnReportTimeToInitialActionClose( 830 void MediaRouterWebUIMessageHandler::OnReportTimeToInitialActionClose(
812 const base::ListValue* args) { 831 const base::ListValue* args) {
813 DVLOG(1) << "OnReportTimeToInitialActionClose"; 832 DVLOG(1) << "OnReportTimeToInitialActionClose";
814 double time_to_close; 833 double time_to_close;
815 if (!args->GetDouble(0, &time_to_close)) { 834 if (!args->GetDouble(0, &time_to_close)) {
816 VLOG(0) << "Unable to extract args."; 835 VLOG(0) << "Unable to extract args.";
817 return; 836 return;
818 } 837 }
819 UMA_HISTOGRAM_TIMES("MediaRouter.Ui.Action.CloseLatency", 838 UMA_HISTOGRAM_TIMES("MediaRouter.Ui.Action.CloseLatency",
820 base::TimeDelta::FromMillisecondsD(time_to_close)); 839 base::TimeDelta::FromMillisecondsD(time_to_close));
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 } 1067 }
1049 1068
1050 return value; 1069 return value;
1051 } 1070 }
1052 1071
1053 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) { 1072 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) {
1054 set_web_ui(web_ui); 1073 set_web_ui(web_ui);
1055 } 1074 }
1056 1075
1057 } // namespace media_router 1076 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698