Bug 1489844 - Port DOMPrefs to StaticPrefs - part 25 - Renaming macros, r=ehsan

This commit is contained in:
Andrea Marchesini 2018-09-10 20:36:18 +02:00
Родитель 7b40fcb2a2
Коммит 9fb73897b2
3 изменённых файлов: 18 добавлений и 30 удалений

Просмотреть файл

@ -24,14 +24,12 @@ DOMPrefs::Initialize()
#define DOM_PREF(name, pref) DOMPrefs::name(); #define DOM_PREF(name, pref) DOMPrefs::name();
#define DOM_WEBIDL_PREF(name) #define DOM_WEBIDL_PREF(name)
#define DOM_WEBIDL_PREF2(name)
#define DOM_UINT32_PREF(name, pref, defaultValue) DOMPrefs::name(); #define DOM_UINT32_PREF(name, pref, defaultValue) DOMPrefs::name();
#include "DOMPrefsInternal.h" #include "DOMPrefsInternal.h"
#undef DOM_PREF #undef DOM_PREF
#undef DOM_WEBIDL_PREF #undef DOM_WEBIDL_PREF
#undef DOM_WEBIDL_PREF2
#undef DOM_UINT32_PREF #undef DOM_UINT32_PREF
} }
@ -49,14 +47,6 @@ DOMPrefs::Initialize()
} }
#define DOM_WEBIDL_PREF(name) \ #define DOM_WEBIDL_PREF(name) \
/* static */ bool \
DOMPrefs::name(JSContext* aCx, JSObject* aObj) \
{ \
return DOMPrefs::name(); \
}
// TODO: this is going to be renamed DOM_WEBIDL_PREF in the last patch.
#define DOM_WEBIDL_PREF2(name) \
/* static */ bool \ /* static */ bool \
DOMPrefs::name(JSContext* aCx, JSObject* aObj) \ DOMPrefs::name(JSContext* aCx, JSObject* aObj) \
{ \ { \
@ -91,7 +81,6 @@ DOMPrefs::DumpEnabled()
#undef DOM_PREF #undef DOM_PREF
#undef DOM_WEBIDL_PREF #undef DOM_WEBIDL_PREF
#undef DOM_WEBIDL_PREF2
#undef DOM_UINT32_PREF #undef DOM_UINT32_PREF
} // dom namespace } // dom namespace

Просмотреть файл

@ -21,14 +21,12 @@ public:
#define DOM_PREF(name, pref) static bool name(); #define DOM_PREF(name, pref) static bool name();
#define DOM_WEBIDL_PREF(name) static bool name(JSContext* aCx, JSObject* aObj); #define DOM_WEBIDL_PREF(name) static bool name(JSContext* aCx, JSObject* aObj);
#define DOM_WEBIDL_PREF2(name) static bool name(JSContext* aCx, JSObject* aObj);
#define DOM_UINT32_PREF(name, pref, defaultValue) static uint32_t name(); #define DOM_UINT32_PREF(name, pref, defaultValue) static uint32_t name();
#include "DOMPrefsInternal.h" #include "DOMPrefsInternal.h"
#undef DOM_PREF #undef DOM_PREF
#undef DOM_WEBIDL_PREF #undef DOM_WEBIDL_PREF
#undef DOM_WEBIDL_PREF2
#undef DOM_UINT32_PREF #undef DOM_UINT32_PREF
}; };

Просмотреть файл

@ -14,26 +14,27 @@
// DOMPrefs::FooBar() // DOMPrefs::FooBar()
// * The second argument is the name of the pref. // * The second argument is the name of the pref.
// //
// DOM_WEBIDL_PREF(FooBar) // DOM_WEBIDL_PREF(foo_bar)
// //
// * This defines DOMPrefs::FooBar(JSContext* aCx, JSObject* aObj); // * This defines DOMPrefs::foo_bar(JSContext* aCx, JSObject* aObj) which
// returns the value of StaticPrefs::foo_bar().
// This is allows the use of DOMPrefs in WebIDL files. // This is allows the use of DOMPrefs in WebIDL files.
DOM_WEBIDL_PREF2(canvas_imagebitmap_extensions_enabled) DOM_WEBIDL_PREF(canvas_imagebitmap_extensions_enabled)
DOM_WEBIDL_PREF2(dom_caches_enabled) DOM_WEBIDL_PREF(dom_caches_enabled)
DOM_WEBIDL_PREF2(dom_webnotifications_serviceworker_enabled) DOM_WEBIDL_PREF(dom_webnotifications_serviceworker_enabled)
DOM_WEBIDL_PREF2(dom_webnotifications_requireinteraction_enabled) DOM_WEBIDL_PREF(dom_webnotifications_requireinteraction_enabled)
DOM_WEBIDL_PREF2(dom_serviceWorkers_enabled) DOM_WEBIDL_PREF(dom_serviceWorkers_enabled)
DOM_WEBIDL_PREF2(dom_storageManager_enabled) DOM_WEBIDL_PREF(dom_storageManager_enabled)
DOM_WEBIDL_PREF2(dom_promise_rejection_events_enabled) DOM_WEBIDL_PREF(dom_promise_rejection_events_enabled)
DOM_WEBIDL_PREF2(dom_push_enabled) DOM_WEBIDL_PREF(dom_push_enabled)
DOM_WEBIDL_PREF2(dom_streams_enabled) DOM_WEBIDL_PREF(dom_streams_enabled)
DOM_WEBIDL_PREF2(gfx_offscreencanvas_enabled) DOM_WEBIDL_PREF(gfx_offscreencanvas_enabled)
DOM_WEBIDL_PREF2(dom_webkitBlink_dirPicker_enabled) DOM_WEBIDL_PREF(dom_webkitBlink_dirPicker_enabled)
DOM_WEBIDL_PREF2(dom_netinfo_enabled) DOM_WEBIDL_PREF(dom_netinfo_enabled)
DOM_WEBIDL_PREF2(dom_fetchObserver_enabled) DOM_WEBIDL_PREF(dom_fetchObserver_enabled)
DOM_WEBIDL_PREF2(dom_enable_performance_observer) DOM_WEBIDL_PREF(dom_enable_performance_observer)
DOM_WEBIDL_PREF2(dom_performance_enable_scheduler_timing) DOM_WEBIDL_PREF(dom_performance_enable_scheduler_timing)
DOM_UINT32_PREF(WorkerCancelingTimeoutMillis, DOM_UINT32_PREF(WorkerCancelingTimeoutMillis,
"dom.worker.canceling.timeoutMilliseconds", "dom.worker.canceling.timeoutMilliseconds",