Bug 1436845: Part 1 - Add BasicDllServices; r=jimm
authorAaron Klotz <aklotz@mozilla.com>
Tue, 13 Feb 2018 16:03:11 -0700
changeset 761265 ff7e21c630eb634a2d59910d8f9b95388fc35c0d
parent 761264 724aad27fd444a8b1a01eb96284079aae7cfbd25
child 761266 a9c97aa6d78903db203f80a1d6d78b1547f15297
push id100926
push userrwood@mozilla.com
push dateWed, 28 Feb 2018 21:51:29 +0000
reviewersjimm
bugs1436845
milestone60.0a1
Bug 1436845: Part 1 - Add BasicDllServices; r=jimm BasicDllServices is a simplified implementation that allows programs other than Firefox to link against mozglue and access DLL services without requiring any XPCOM baggage.
mozglue/build/WindowsDllServices.h
--- a/mozglue/build/WindowsDllServices.h
+++ b/mozglue/build/WindowsDllServices.h
@@ -102,14 +102,32 @@ public:
 
 protected:
   DllServices() = default;
   ~DllServices() = default;
 
   virtual void NotifyDllLoad(const bool aIsMainThread, const nsString& aDllName) = 0;
 };
 
+#else
+
+class BasicDllServices : public detail::DllServicesBase
+{
+public:
+  BasicDllServices()
+  {
+    Enable();
+  }
+
+  ~BasicDllServices()
+  {
+    Disable();
+  }
+
+  virtual void DispatchDllLoadNotification(PCUNICODE_STRING aDllName) override {}
+};
+
 #endif // defined(MOZILLA_INTERNAL_API)
 
 } // namespace glue
 } // namespace mozilla
 
 #endif // mozilla_glue_WindowsDllServices_h