summaryrefslogtreecommitdiffstats
path: root/dom/base/UseCounter.h
blob: de978ed938add467ca8b406a658870c8b2d7f9b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef UseCounter_h_
#define UseCounter_h_

#include <stdint.h>
#include "mozilla/BitSet.h"

namespace mozilla {

enum UseCounter : int16_t {
  eUseCounter_UNKNOWN = -1,
#define USE_COUNTER_DOM_METHOD(interface_, name_) \
  eUseCounter_##interface_##_##name_,
#define USE_COUNTER_DOM_ATTRIBUTE(interface_, name_) \
  eUseCounter_##interface_##_##name_##_getter,       \
      eUseCounter_##interface_##_##name_##_setter,
#define USE_COUNTER_CUSTOM(name_, desc_) eUseCounter_custom_##name_,
#include "mozilla/dom/UseCounterList.h"
#undef USE_COUNTER_DOM_METHOD
#undef USE_COUNTER_DOM_ATTRIBUTE
#undef USE_COUNTER_CUSTOM

#define DEPRECATED_OPERATION(op_) eUseCounter_##op_,
#include "nsDeprecatedOperationList.h"
#undef DEPRECATED_OPERATION

  eUseCounter_FirstCSSProperty,
  __reset_hack = eUseCounter_FirstCSSProperty - 1,

// Need an extra level of macro nesting to force expansion of method_
// params before they get pasted.
#define CSS_PROP_USE_COUNTER(method_) eUseCounter_property_##method_,
#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_
#define CSS_PROP_LONGHAND(name_, id_, method_, ...) \
  CSS_PROP_USE_COUNTER(method_)
#define CSS_PROP_SHORTHAND(name_, id_, method_, ...) \
  CSS_PROP_USE_COUNTER(method_)
#define CSS_PROP_ALIAS(name_, aliasid_, id_, method_, ...) \
  CSS_PROP_USE_COUNTER(method_)
#include "mozilla/ServoCSSPropList.h"
#undef CSS_PROP_ALIAS
#undef CSS_PROP_SHORTHAND
#undef CSS_PROP_LONGHAND
#undef CSS_PROP_PUBLIC_OR_PRIVATE
#undef CSS_PROP_USE_COUNTER

  eUseCounter_EndCSSProperties,
  eUseCounter_FirstCountedUnknownProperty = eUseCounter_EndCSSProperties,
  __reset_hack_2 = eUseCounter_FirstCountedUnknownProperty - 1,

#define COUNTED_UNKNOWN_PROPERTY(name_, method_) \
  eUseCounter_unknown_property_##method_,
#include "mozilla/CountedUnknownProperties.h"
#undef COUNTED_UNKNOWN_PROPERTY

  eUseCounter_Count
};

using UseCounters = BitSet<eUseCounter_Count, uint64_t>;

enum class UseCounterWorker : int16_t {
  Unknown = -1,
#define USE_COUNTER_DOM_METHOD(interface_, name_) interface_##_##name_,
#define USE_COUNTER_DOM_ATTRIBUTE(interface_, name_) \
  interface_##_##name_##_getter, interface_##_##name_##_setter,
#define USE_COUNTER_CUSTOM(name_, desc_) Custom_##name_,
#include "mozilla/dom/UseCounterWorkerList.h"
#undef USE_COUNTER_DOM_METHOD
#undef USE_COUNTER_DOM_ATTRIBUTE
#undef USE_COUNTER_CUSTOM
  Count
};

}  // namespace mozilla

#endif