1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  *
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef gfx_src_gfxTelemetry_h__
7 #define gfx_src_gfxTelemetry_h__
8 
9 namespace mozilla {
10 namespace gfx {
11 
12 // Describes the status of a graphics feature, in terms of whether or not we've
13 // attempted to initialize the feature, and if so, whether or not it succeeded
14 // (and if not, why).
15 enum class FeatureStatus
16 {
17   // This feature has not been requested.
18   Unused,
19 
20   // This feature is unavailable due to Safe Mode, not being included with
21   // the operating system, or a dependent feature being disabled.
22   Unavailable,
23 
24   // This feature crashed immediately when we tried to initialize it, but we
25   // were able to recover via SEH (or something similar).
26   CrashedInHandler,
27 
28   // This feature was blocked for reasons outside the blacklist, such as a
29   // runtime test failing.
30   Blocked,
31 
32   // This feature has been blocked by the graphics blacklist.
33   Blacklisted,
34 
35   // This feature was attempted but failed to activate.
36   Failed,
37 
38   // This feature was explicitly disabled by the user.
39   Disabled,
40 
41   // This feature is available for use.
42   Available,
43 
44   // This feature was explicitly force-enabled by the user.
45   ForceEnabled,
46 
47   // This feature was disabled due to the startup crash guard.
48   CrashedOnStartup,
49 
50   // This feature was attempted but later determined to be broken.
51   Broken,
52 
53   // Add new entries above here.
54   LAST
55 };
56 
57 const char* FeatureStatusToString(FeatureStatus aStatus);
58 bool IsFeatureStatusFailure(FeatureStatus aStatus);
59 bool IsFeatureStatusSuccess(FeatureStatus aStatus);
60 
61 enum class TelemetryDeviceCode : uint32_t {
62   Content = 0,
63   Image = 1,
64   D2D1 = 2
65 };
66 
67 } // namespace gfx
68 } // namespace mozilla
69 
70 #endif // gfx_src_gfxTelemetry_h__
71