OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_METRICS_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_METRICS_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_METRICS_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_METRICS_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/media/router/route_request_result.h" |
10 | 11 |
11 namespace base { | 12 namespace base { |
12 class Version; | 13 class Version; |
13 } // namespace base | 14 } // namespace base |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 class Extension; | 17 class Extension; |
17 } // namespace extensions | 18 } // namespace extensions |
18 | 19 |
19 namespace media_router { | 20 namespace media_router { |
20 | 21 |
21 // NOTE: Do not renumber enums as that would confuse interpretation of | 22 // NOTE: Do not renumber enums as that would confuse interpretation of |
22 // previously logged data. When making changes, also update the enum list | 23 // previously logged data. When making changes, also update the enum lists |
23 // in tools/metrics/histograms/histograms.xml to keep it in sync. | 24 // in tools/metrics/histograms/histograms.xml to keep it in sync. |
24 | 25 |
25 // Why the Media Route Provider process was woken up. | 26 // Why the Media Route Provider process was woken up. |
26 enum class MediaRouteProviderWakeReason { | 27 enum class MediaRouteProviderWakeReason { |
27 CREATE_ROUTE = 0, | 28 CREATE_ROUTE = 0, |
28 JOIN_ROUTE = 1, | 29 JOIN_ROUTE = 1, |
29 TERMINATE_ROUTE = 2, | 30 TERMINATE_ROUTE = 2, |
30 SEND_SESSION_MESSAGE = 3, | 31 SEND_SESSION_MESSAGE = 3, |
31 SEND_SESSION_BINARY_MESSAGE = 4, | 32 SEND_SESSION_BINARY_MESSAGE = 4, |
32 DETACH_ROUTE = 5, | 33 DETACH_ROUTE = 5, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const extensions::Extension& extension); | 80 const extensions::Extension& extension); |
80 | 81 |
81 // Records why the media route provider extension was woken up. | 82 // Records why the media route provider extension was woken up. |
82 static void RecordMediaRouteProviderWakeReason( | 83 static void RecordMediaRouteProviderWakeReason( |
83 MediaRouteProviderWakeReason reason); | 84 MediaRouteProviderWakeReason reason); |
84 | 85 |
85 // Records the outcome of an attempt to wake the Media Router component event | 86 // Records the outcome of an attempt to wake the Media Router component event |
86 // page. | 87 // page. |
87 static void RecordMediaRouteProviderWakeup(MediaRouteProviderWakeup wakeup); | 88 static void RecordMediaRouteProviderWakeup(MediaRouteProviderWakeup wakeup); |
88 | 89 |
| 90 // Records the outcome of a call to terminateRoute() on the Media Route |
| 91 // Provider Manager. |
| 92 static void RecordMediaRouteProviderTerminateRoute( |
| 93 RouteRequestResult::ResultCode result_code); |
| 94 |
89 private: | 95 private: |
90 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoMetricsTest, | 96 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoMetricsTest, |
91 TestGetMediaRouteProviderVersion); | 97 TestGetMediaRouteProviderVersion); |
92 | 98 |
93 // Returns the version status of the Media Router component extension. | 99 // Returns the version status of the Media Router component extension. |
94 static MediaRouteProviderVersion GetMediaRouteProviderVersion( | 100 static MediaRouteProviderVersion GetMediaRouteProviderVersion( |
95 const base::Version& extension_version, | 101 const base::Version& extension_version, |
96 const base::Version& browser_version); | 102 const base::Version& browser_version); |
97 }; | 103 }; |
98 | 104 |
99 } // namespace media_router | 105 } // namespace media_router |
100 | 106 |
101 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_METRICS_H_ | 107 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_METRICS_H_ |
OLD | NEW |