Line data Source code
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 : #include "gfxTelemetry.h"
7 :
8 : namespace mozilla {
9 : namespace gfx {
10 :
11 : const char*
12 2 : FeatureStatusToString(FeatureStatus aStatus)
13 : {
14 2 : switch (aStatus) {
15 : case FeatureStatus::Unused:
16 2 : return "unused";
17 : case FeatureStatus::Unavailable:
18 0 : return "unavailable";
19 : case FeatureStatus::CrashedInHandler:
20 0 : return "crashed";
21 : case FeatureStatus::Blocked:
22 0 : return "blocked";
23 : case FeatureStatus::Blacklisted:
24 0 : return "blacklisted";
25 : case FeatureStatus::OptIn:
26 0 : return "opt-in";
27 : case FeatureStatus::Failed:
28 0 : return "failed";
29 : case FeatureStatus::Disabled:
30 0 : return "disabled";
31 : case FeatureStatus::Available:
32 0 : return "available";
33 : case FeatureStatus::ForceEnabled:
34 0 : return "force_enabled";
35 : case FeatureStatus::CrashedOnStartup:
36 0 : return "crashed_on_startup";
37 : case FeatureStatus::Broken:
38 0 : return "broken";
39 : default:
40 0 : MOZ_ASSERT_UNREACHABLE("missing status case");
41 : return "unknown";
42 : }
43 : }
44 :
45 : bool
46 7 : IsFeatureStatusFailure(FeatureStatus aStatus)
47 : {
48 7 : return !(aStatus == FeatureStatus::Unused ||
49 : aStatus == FeatureStatus::Available ||
50 7 : aStatus == FeatureStatus::ForceEnabled);
51 : }
52 :
53 : bool
54 6 : IsFeatureStatusSuccess(FeatureStatus aStatus)
55 : {
56 6 : return aStatus == FeatureStatus::Available ||
57 6 : aStatus == FeatureStatus::ForceEnabled;
58 : }
59 :
60 : } // namespace gfx
61 : } // namespace mozilla
|