Bug 1431072 - Move a duplicate declarations (NS_NPAPIPLUGIN_CALLBACK) into a common file r?jimm draft
authorSylvestre Ledru <sledru@mozilla.com>
Wed, 17 Jan 2018 14:32:56 +0100
changeset 721566 f8fda3d1081bff0a0bf051e798e59cdfd18c7f6f
parent 721397 c5ad79b879e2b716f058220f6fffb7ab87c1e01c
child 746368 d1a60bd5663d4cda43b4b40eb1f503d89582e3d1
push id95873
push usersledru@mozilla.com
push dateWed, 17 Jan 2018 13:33:17 +0000
reviewersjimm
bugs1431072
milestone59.0a1
Bug 1431072 - Move a duplicate declarations (NS_NPAPIPLUGIN_CALLBACK) into a common file r?jimm MozReview-Commit-ID: HZsNoNUOtnO
dom/plugins/base/npfunctions.h
dom/plugins/base/nsNPAPIPlugin.h
dom/plugins/ipc/PluginModuleChild.h
--- a/dom/plugins/base/npfunctions.h
+++ b/dom/plugins/base/npfunctions.h
@@ -264,9 +264,23 @@ typedef NPError        (*NP_ShutdownFunc
 NP_EXPORT(NPError)     NP_Shutdown(void);
 typedef NPError        (*NP_GetValueFunc)(void *, NPPVariable, void *);
 NP_EXPORT(NPError)     NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
 #ifdef __cplusplus
 }
 #endif
 #endif
 
+// clang-format off
+// See bug 1431030
+#if defined(XP_WIN)
+#define NS_NPAPIPLUGIN_CALLBACK(_type, _name) _type (__stdcall * _name)
+#else
+#define NS_NPAPIPLUGIN_CALLBACK(_type, _name) _type (* _name)
+#endif
+// clang-format on
+
+typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_GETENTRYPOINTS) (NPPluginFuncs* pCallbacks);
+typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGININIT) (const NPNetscapeFuncs* pCallbacks);
+typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINUNIXINIT) (const NPNetscapeFuncs* pCallbacks, NPPluginFuncs* fCallbacks);
+typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINSHUTDOWN) (void);
+
 #endif /* npfunctions_h_ */
--- a/dom/plugins/base/nsNPAPIPlugin.h
+++ b/dom/plugins/base/nsNPAPIPlugin.h
@@ -9,30 +9,16 @@
 #include "prlink.h"
 #include "npfunctions.h"
 #include "nsPluginHost.h"
 
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/PluginLibrary.h"
 #include "mozilla/RefCounted.h"
 
-// clang-format off
-// See bug 1431030
-#if defined(XP_WIN)
-#define NS_NPAPIPLUGIN_CALLBACK(_type, _name) _type (__stdcall * _name)
-#else
-#define NS_NPAPIPLUGIN_CALLBACK(_type, _name) _type (* _name)
-#endif
-// clang-format on
-
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_GETENTRYPOINTS) (NPPluginFuncs* pCallbacks);
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGININIT) (const NPNetscapeFuncs* pCallbacks);
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINUNIXINIT) (const NPNetscapeFuncs* pCallbacks, NPPluginFuncs* fCallbacks);
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINSHUTDOWN) ();
-
 // nsNPAPIPlugin is held alive both by active nsPluginTag instances and
 // by active nsNPAPIPluginInstance.
 class nsNPAPIPlugin final
 {
 private:
   typedef mozilla::PluginLibrary PluginLibrary;
 
 public:
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -27,29 +27,16 @@
 #include "PluginInterposeOSX.h"
 #endif
 
 #include "mozilla/plugins/PPluginModuleChild.h"
 #include "mozilla/plugins/PluginInstanceChild.h"
 #include "mozilla/plugins/PluginMessageUtils.h"
 #include "mozilla/plugins/PluginQuirks.h"
 
-// NOTE: stolen from nsNPAPIPlugin.h
-
-#if defined(XP_WIN)
-#define NS_NPAPIPLUGIN_CALLBACK(_type, _name) _type (__stdcall * _name)
-#else
-#define NS_NPAPIPLUGIN_CALLBACK(_type, _name) _type (* _name)
-#endif
-
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_GETENTRYPOINTS) (NPPluginFuncs* pCallbacks);
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGININIT) (const NPNetscapeFuncs* pCallbacks);
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINUNIXINIT) (const NPNetscapeFuncs* pCallbacks, NPPluginFuncs* fCallbacks);
-typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINSHUTDOWN) (void);
-
 namespace mozilla {
 
 class ChildProfilerController;
 
 namespace plugins {
 
 class PluginInstanceChild;