UseCounter.h (2750B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 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 UseCounter_h_ 7 #define UseCounter_h_ 8 9 #include <stdint.h> 10 11 #include "mozilla/BitSet.h" 12 13 namespace mozilla { 14 15 enum UseCounter : int16_t { 16 eUseCounter_UNKNOWN = -1, 17 #define USE_COUNTER_DOM_METHOD(interface_, name_) \ 18 eUseCounter_##interface_##_##name_, 19 #define USE_COUNTER_DOM_ATTRIBUTE(interface_, name_) \ 20 eUseCounter_##interface_##_##name_##_getter, \ 21 eUseCounter_##interface_##_##name_##_setter, 22 #define USE_COUNTER_CUSTOM(name_, desc_) eUseCounter_custom_##name_, 23 #include "mozilla/dom/UseCounterList.h" 24 #undef USE_COUNTER_DOM_METHOD 25 #undef USE_COUNTER_DOM_ATTRIBUTE 26 #undef USE_COUNTER_CUSTOM 27 28 #define DEPRECATED_OPERATION(op_) eUseCounter_##op_, 29 #include "nsDeprecatedOperationList.h" 30 #undef DEPRECATED_OPERATION 31 32 eUseCounter_FirstCSSProperty, 33 __reset_hack = eUseCounter_FirstCSSProperty - 1, 34 35 // Need an extra level of macro nesting to force expansion of method_ 36 // params before they get pasted. 37 #define CSS_PROP_USE_COUNTER(method_) eUseCounter_property_##method_, 38 #define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_ 39 #define CSS_PROP_LONGHAND(name_, id_, method_, ...) \ 40 CSS_PROP_USE_COUNTER(method_) 41 #define CSS_PROP_SHORTHAND(name_, id_, method_, ...) \ 42 CSS_PROP_USE_COUNTER(method_) 43 #define CSS_PROP_ALIAS(name_, aliasid_, id_, method_, ...) \ 44 CSS_PROP_USE_COUNTER(method_) 45 #include "mozilla/ServoCSSPropList.h" 46 #undef CSS_PROP_ALIAS 47 #undef CSS_PROP_SHORTHAND 48 #undef CSS_PROP_LONGHAND 49 #undef CSS_PROP_PUBLIC_OR_PRIVATE 50 #undef CSS_PROP_USE_COUNTER 51 52 eUseCounter_EndCSSProperties, 53 eUseCounter_FirstCountedUnknownProperty = eUseCounter_EndCSSProperties, 54 __reset_hack_2 = eUseCounter_FirstCountedUnknownProperty - 1, 55 56 #define COUNTED_UNKNOWN_PROPERTY(name_, method_) \ 57 eUseCounter_unknown_property_##method_, 58 #include "mozilla/CountedUnknownProperties.h" 59 #undef COUNTED_UNKNOWN_PROPERTY 60 61 eUseCounter_Count 62 }; 63 64 using UseCounters = BitSet<eUseCounter_Count, uint64_t>; 65 66 enum class UseCounterWorker : int16_t { 67 Unknown = -1, 68 #define USE_COUNTER_DOM_METHOD(interface_, name_) interface_##_##name_, 69 #define USE_COUNTER_DOM_ATTRIBUTE(interface_, name_) \ 70 interface_##_##name_##_getter, interface_##_##name_##_setter, 71 #define USE_COUNTER_CUSTOM(name_, desc_) Custom_##name_, 72 #include "mozilla/dom/UseCounterWorkerList.h" 73 #undef USE_COUNTER_DOM_METHOD 74 #undef USE_COUNTER_DOM_ATTRIBUTE 75 #undef USE_COUNTER_CUSTOM 76 Count 77 }; 78 79 } // namespace mozilla 80 81 #endif