Bug 1357194: Use MOZ_UPDATE_CHANNEL to distinguish between local/nightly and beta/release builds for AccessibleHandler CLSIDs; r?mhowell r?mshal draft
authorAaron Klotz <aklotz@mozilla.com>
Mon, 17 Apr 2017 14:47:41 -0600
changeset 564517 d00ad45d7d15b58a6d734bd08aec7933b8c9b320
parent 563770 93a6595b99a3487aa636ed7555c7afac3c1a4199
child 624765 fdce5f8e3cb4f1a5306ed5bff76eb237e417a6fe
push id54627
push useraklotz@mozilla.com
push dateTue, 18 Apr 2017 18:02:00 +0000
reviewersmhowell, mshal
bugs1357194
milestone55.0a1
Bug 1357194: Use MOZ_UPDATE_CHANNEL to distinguish between local/nightly and beta/release builds for AccessibleHandler CLSIDs; r?mhowell r?mshal MozReview-Commit-ID: Kp8x5o66nrY I want AccessibleHandler.dll to use different UUIDs based on release channel. The way I was doing it before wasn't working correctly because I also wanted local builds to have their own set of UUIDs vs our regular Nightly/Beta/Release builds. I also want the beta channel to have its own set of UUIDs that are distinct from release. I'm using MOZ_UPDATE_CHANNEL to distinguish between the channels when NIGHTLY_BUILD and BETA_OR_RELEASE are insufficient.
accessible/ipc/win/handler/HandlerData.idl
accessible/ipc/win/handler/Makefile.in
accessible/ipc/win/handler/moz.build
browser/installer/windows/nsis/defines.nsi.in
--- a/accessible/ipc/win/handler/HandlerData.idl
+++ b/accessible/ipc/win/handler/HandlerData.idl
@@ -18,17 +18,17 @@ typedef struct _IA2Data
 
 interface IGeckoBackChannel;
 
 // We define different CLSIDs and IIDs depending on channel and officiality.
 // This prevents handlers from installing overtop one another when multiple
 // channels are present. Note that we do not do this for all UUIDs in this IDL,
 // just the ones that are written to the registry (coclass and interfaces that
 // have the [object] annotation)
-#if !defined(MOZ_OFFICIAL_BRANDING)
+#if defined(USE_LOCAL_UUID)
 
 # if defined(DEBUG)
 
 // Local debug builds
 #  define HANDLER_CLSID 398ffd8d-5382-48f7-9e3b-19012762d39a
 #  define IHANDLERCONTROL_IID a218497e-8b10-460b-b668-a92b7ee39ff2
 #  define ASYNCIHANDLERCONTROL_IID ca18b9ab-04b6-41be-87f7-d99913d6a2e8
 #  define IGECKOBACKCHANNEL_IID 231c4946-4479-4c8e-aadc-8a0e48fc4c51
@@ -40,33 +40,41 @@ interface IGeckoBackChannel;
 #  define IHANDLERCONTROL_IID 2b715cce-1790-4fe1-aef5-48bb5acdf3a1
 #  define ASYNCIHANDLERCONTROL_IID 8e089670-4f57-41a7-89c0-37f17482fa6f
 #  define IGECKOBACKCHANNEL_IID 18e2488d-310f-400f-8339-0e50b513e801
 
 # endif
 
 #elif defined(NIGHTLY_BUILD)
 
-// Official Nightly
+// Nightly Builds
 # define IHANDLERCONTROL_IID c57343fc-e011-40c2-b748-da82eabf0f1f
 # define ASYNCIHANDLERCONTROL_IID 648c92a1-ea35-46da-a806-6b55c6247373
 # define HANDLER_CLSID 4629216b-8753-41bf-9527-5bff51401671
 # define IGECKOBACKCHANNEL_IID e61e038d-40dd-464a-9aba-66b206b6911b
 
+#elif defined(USE_BETA_UUID)
+
+// Beta Builds
+# define IHANDLERCONTROL_IID 119149fa-d212-4f22-9517-082eecc1a084
+# define ASYNCIHANDLERCONTROL_IID 4e253d9b-59cf-4b32-a973-38bc85495d61
+# define HANDLER_CLSID 21e9f98d-a6c9-4cb5-b288-ae2fd2a96c58
+# define IGECKOBACKCHANNEL_IID 77b75c7d-d1c2-4469-864d-31aaebb67cc6
+
 #elif defined(RELEASE_OR_BETA)
 
-// Official Beta and Official Release
+// Release Builds
 # define IHANDLERCONTROL_IID ce30f77e-8847-44f0-a648-a9656bd89c0d
 # define ASYNCIHANDLERCONTROL_IID dca8d857-1a63-4045-8f36-8809eb093d04
 # define HANDLER_CLSID 1baa303d-b4b9-45e5-9ccb-e3fca3e274b6
 # define IGECKOBACKCHANNEL_IID b32983ff-ef84-4945-8f86-fb7491b4f57b
 
 #else
 
-// Official Aurora
+// Catch-all
 # define IHANDLERCONTROL_IID 3316ce35-f892-4832-97c5-06c52c03cdba
 # define ASYNCIHANDLERCONTROL_IID 15b48b76-ad38-4ad3-bd1a-d3c48a5a9947
 # define HANDLER_CLSID 4a195748-dca2-45fb-9295-0a139e76a9e7
 # define IGECKOBACKCHANNEL_IID dd2e4a89-999e-4d65-8b65-440c923ddb61
 
 #endif
 
 [uuid(2b0e83b3-fd1a-443f-9ed6-c00d39055b58)]
--- a/accessible/ipc/win/handler/Makefile.in
+++ b/accessible/ipc/win/handler/Makefile.in
@@ -15,17 +15,17 @@ MIDL_GENERATED_FILES = \
   HandlerData.tlb \
   $(NULL)
 
 export:: $(MIDL_GENERATED_FILES)
 
 $(MIDL_GENERATED_FILES): midl_done
 
 midl_done: HandlerData.acf HandlerData.idl
-	$(MIDL) $(MIDL_FLAGS) -I $(IA2DIR) -I $(MSAADIR) -Oicf -acf $(srcdir)/HandlerData.acf $(srcdir)/HandlerData.idl
+	$(MIDL) $(MIDL_FLAGS) $(DEFINES) -I $(IA2DIR) -I $(MSAADIR) -Oicf -acf $(srcdir)/HandlerData.acf $(srcdir)/HandlerData.idl
 	touch $@
 
 INSTALL_TARGETS += midl
 midl_FILES := HandlerData.h \
               HandlerData_i.c \
               $(NULL)
 midl_DEST := $(DIST)/include
 midl_TARGET := midl
--- a/accessible/ipc/win/handler/moz.build
+++ b/accessible/ipc/win/handler/moz.build
@@ -45,16 +45,25 @@ OS_LIBS += [
 RCINCLUDE = 'AccessibleHandler.rc'
 
 # Since we are defining our own COM entry points (DllRegisterServer et al),
 # but we still want to be able to delegate some work to the generated code,
 # we add the prefix "Proxy" to all of the generated counterparts.
 DEFINES['ENTRY_PREFIX'] = 'Proxy'
 DEFINES['REGISTER_PROXY_DLL'] = True
 
+# We want to generate distinct UUIDs on a per-channel basis, so we need
+# finer granularity than the standard preprocessor definitions offer.
+# These defines allow us to separate local builds from automated builds,
+# as well as separate beta from release.
+if CONFIG['MOZ_UPDATE_CHANNEL'] == 'default':
+  DEFINES['USE_LOCAL_UUID'] = True
+elif CONFIG['MOZ_UPDATE_CHANNEL'] == 'beta':
+  DEFINES['USE_BETA_UUID'] = True
+
 # This DLL may be loaded into other processes, so we need static libs for
 # Windows 7 and Windows 8.
 USE_STATIC_LIBS = True
 
 LIBRARY_DEFINES['UNICODE'] = True
 LIBRARY_DEFINES['_UNICODE'] = True
 LIBRARY_DEFINES['MOZ_NO_MOZALLOC'] = True
 DISABLE_STL_WRAPPING = True
--- a/browser/installer/windows/nsis/defines.nsi.in
+++ b/browser/installer/windows/nsis/defines.nsi.in
@@ -54,29 +54,31 @@
 !else
 !define UpdateChannel "@MOZ_UPDATE_CHANNEL@"
 !endif
 
 # AccessibleHandler.dll uses a different CLSID depending on release channel.
 # These defines must match HANDLER_CLSID defined in
 # accessible/ipc/win/handler/HandlerData.idl
 
-#ifndef MOZ_OFFICIAL_BRANDING
+!if "@MOZ_UPDATE_CHANNEL@" == "default"
 #ifdef DEBUG
 !define AccessibleHandlerCLSID "{398FFD8D-5382-48F7-9E3B-19012762D39A}"
 #else
 !define AccessibleHandlerCLSID "{CE573FAF-7815-4FC2-A031-B092268ACE9E}"
 #endif
-#elifdef NIGHTLY_BUILD
+!else if "@MOZ_UPDATE_CHANNEL@" == "nightly"
 !define AccessibleHandlerCLSID "{4629216B-8753-41BF-9527-5BFF51401671}"
-#elifdef RELEASE_OR_BETA
+!else if "@MOZ_UPDATE_CHANNEL@" == "beta"
+!define AccessibleHandlerCLSID "{21E9F98D-A6C9-4CB5-B288-AE2FD2A96C58}"
+!else if "@MOZ_UPDATE_CHANNEL@" == "release"
 !define AccessibleHandlerCLSID "{1BAA303D-B4B9-45E5-9CCB-E3FCA3E274B6}"
-#else
+!else
 !define AccessibleHandlerCLSID "{4A195748-DCA2-45FB-9295-0A139E76A9E7}"
-#endif
+!endif
 
 # Due to official and beta using the same branding this is needed to
 # differentiante between the url used by the stub for downloading.
 !if "@MOZ_UPDATE_CHANNEL@" == "beta"
 !define BETA_UPDATE_CHANNEL
 !endif
 
 !define BaseURLStubPing "http://download-stats.mozilla.org/stub"