From 9fb73897b2ce9e8a1af1eac5f61c4271e47bafdc Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Mon, 10 Sep 2018 20:36:18 +0200 Subject: [PATCH] Bug 1489844 - Port DOMPrefs to StaticPrefs - part 25 - Renaming macros, r=ehsan --- dom/base/DOMPrefs.cpp | 11 ----------- dom/base/DOMPrefs.h | 2 -- dom/base/DOMPrefsInternal.h | 35 ++++++++++++++++++----------------- 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/dom/base/DOMPrefs.cpp b/dom/base/DOMPrefs.cpp index d9c93e5943e2..5efbc3460cf5 100644 --- a/dom/base/DOMPrefs.cpp +++ b/dom/base/DOMPrefs.cpp @@ -24,14 +24,12 @@ DOMPrefs::Initialize() #define DOM_PREF(name, pref) DOMPrefs::name(); #define DOM_WEBIDL_PREF(name) -#define DOM_WEBIDL_PREF2(name) #define DOM_UINT32_PREF(name, pref, defaultValue) DOMPrefs::name(); #include "DOMPrefsInternal.h" #undef DOM_PREF #undef DOM_WEBIDL_PREF -#undef DOM_WEBIDL_PREF2 #undef DOM_UINT32_PREF } @@ -49,14 +47,6 @@ DOMPrefs::Initialize() } #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 \ DOMPrefs::name(JSContext* aCx, JSObject* aObj) \ { \ @@ -91,7 +81,6 @@ DOMPrefs::DumpEnabled() #undef DOM_PREF #undef DOM_WEBIDL_PREF -#undef DOM_WEBIDL_PREF2 #undef DOM_UINT32_PREF } // dom namespace diff --git a/dom/base/DOMPrefs.h b/dom/base/DOMPrefs.h index 597378d53e89..8f4667d264c2 100644 --- a/dom/base/DOMPrefs.h +++ b/dom/base/DOMPrefs.h @@ -21,14 +21,12 @@ public: #define DOM_PREF(name, pref) static bool name(); #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(); #include "DOMPrefsInternal.h" #undef DOM_PREF #undef DOM_WEBIDL_PREF -#undef DOM_WEBIDL_PREF2 #undef DOM_UINT32_PREF }; diff --git a/dom/base/DOMPrefsInternal.h b/dom/base/DOMPrefsInternal.h index f7f54cf02c1b..5d3e55cb6db8 100644 --- a/dom/base/DOMPrefsInternal.h +++ b/dom/base/DOMPrefsInternal.h @@ -14,26 +14,27 @@ // DOMPrefs::FooBar() // * 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. -DOM_WEBIDL_PREF2(canvas_imagebitmap_extensions_enabled) -DOM_WEBIDL_PREF2(dom_caches_enabled) -DOM_WEBIDL_PREF2(dom_webnotifications_serviceworker_enabled) -DOM_WEBIDL_PREF2(dom_webnotifications_requireinteraction_enabled) -DOM_WEBIDL_PREF2(dom_serviceWorkers_enabled) -DOM_WEBIDL_PREF2(dom_storageManager_enabled) -DOM_WEBIDL_PREF2(dom_promise_rejection_events_enabled) -DOM_WEBIDL_PREF2(dom_push_enabled) -DOM_WEBIDL_PREF2(dom_streams_enabled) -DOM_WEBIDL_PREF2(gfx_offscreencanvas_enabled) -DOM_WEBIDL_PREF2(dom_webkitBlink_dirPicker_enabled) -DOM_WEBIDL_PREF2(dom_netinfo_enabled) -DOM_WEBIDL_PREF2(dom_fetchObserver_enabled) -DOM_WEBIDL_PREF2(dom_enable_performance_observer) -DOM_WEBIDL_PREF2(dom_performance_enable_scheduler_timing) +DOM_WEBIDL_PREF(canvas_imagebitmap_extensions_enabled) +DOM_WEBIDL_PREF(dom_caches_enabled) +DOM_WEBIDL_PREF(dom_webnotifications_serviceworker_enabled) +DOM_WEBIDL_PREF(dom_webnotifications_requireinteraction_enabled) +DOM_WEBIDL_PREF(dom_serviceWorkers_enabled) +DOM_WEBIDL_PREF(dom_storageManager_enabled) +DOM_WEBIDL_PREF(dom_promise_rejection_events_enabled) +DOM_WEBIDL_PREF(dom_push_enabled) +DOM_WEBIDL_PREF(dom_streams_enabled) +DOM_WEBIDL_PREF(gfx_offscreencanvas_enabled) +DOM_WEBIDL_PREF(dom_webkitBlink_dirPicker_enabled) +DOM_WEBIDL_PREF(dom_netinfo_enabled) +DOM_WEBIDL_PREF(dom_fetchObserver_enabled) +DOM_WEBIDL_PREF(dom_enable_performance_observer) +DOM_WEBIDL_PREF(dom_performance_enable_scheduler_timing) DOM_UINT32_PREF(WorkerCancelingTimeoutMillis, "dom.worker.canceling.timeoutMilliseconds",