Bug 1329718 - remove nsISupportsVoid and associated machinery; r=erahm
authorNathan Froyd <froydnj@mozilla.com>
Tue, 10 Jan 2017 16:31:48 -0500
changeset 373856 bd533dd0ca2a44161eba477f33c6b99873e52ce6
parent 373855 8fa726d6a29582d19e5839e61ae993c467f6f1cd
child 373857 44518b9776d40c85da56f486f16a3a6d26337c3f
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1329718
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329718 - remove nsISupportsVoid and associated machinery; r=erahm Nothing uses it, it's virtually impossible to use from script, and there are better ways to pass a |void*| around in C++.
dom/base/nsJSEnvironment.cpp
xpcom/build/XPCOMInit.cpp
xpcom/build/XPCOMModule.inc
xpcom/build/nsXPCOMCID.h
xpcom/ds/nsISupportsPrimitives.idl
xpcom/ds/nsSupportsPrimitives.cpp
xpcom/ds/nsSupportsPrimitives.h
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -985,18 +985,17 @@ nsJSContext::AddSupportsPrimitiveTojsval
 
       *aArgv = v;
 
       break;
     }
     case nsISupportsPrimitive::TYPE_ID :
     case nsISupportsPrimitive::TYPE_PRUINT64 :
     case nsISupportsPrimitive::TYPE_PRINT64 :
-    case nsISupportsPrimitive::TYPE_PRTIME :
-    case nsISupportsPrimitive::TYPE_VOID : {
+    case nsISupportsPrimitive::TYPE_PRTIME : {
       NS_WARNING("Unsupported primitive type used");
       aArgv->setNull();
       break;
     }
     default : {
       NS_WARNING("Unknown primitive type used");
       aArgv->setNull();
       break;
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -214,17 +214,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupport
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsPRUint64)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsPRTime)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsChar)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsPRInt16)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsPRInt32)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsPRInt64)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsFloat)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsDouble)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsVoid)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsInterfacePointer)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsConsoleService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAtomService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimer)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinaryOutputStream)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinaryInputStream)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsStorageStream)
--- a/xpcom/build/XPCOMModule.inc
+++ b/xpcom/build/XPCOMModule.inc
@@ -37,17 +37,16 @@
     COMPONENT_SUPPORTS(PRUINT64, PRUint64)
     COMPONENT_SUPPORTS(PRTIME, PRTime)
     COMPONENT_SUPPORTS(CHAR, Char)
     COMPONENT_SUPPORTS(PRINT16, PRInt16)
     COMPONENT_SUPPORTS(PRINT32, PRInt32)
     COMPONENT_SUPPORTS(PRINT64, PRInt64)
     COMPONENT_SUPPORTS(FLOAT, Float)
     COMPONENT_SUPPORTS(DOUBLE, Double)
-    COMPONENT_SUPPORTS(VOID, Void)
     COMPONENT_SUPPORTS(INTERFACE_POINTER, InterfacePointer)
 
 #undef COMPONENT_SUPPORTS
     COMPONENT(LOCAL_FILE, nsLocalFile::nsLocalFileConstructor)
     COMPONENT(DIRECTORY_SERVICE, nsDirectoryService::Create)
     COMPONENT(PROCESS, nsProcessConstructor)
     COMPONENT(ENVIRONMENT, nsEnvironment::Create)
 
--- a/xpcom/build/nsXPCOMCID.h
+++ b/xpcom/build/nsXPCOMCID.h
@@ -167,19 +167,14 @@
 { 0xba, 0xea, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
 #define NS_SUPPORTS_FLOAT_CONTRACTID "@mozilla.org/supports-float;1"
 
 #define NS_SUPPORTS_DOUBLE_CID \
 { 0xcbf86871, 0x4ac0, 0x11d3, \
 { 0xba, 0xea, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
 #define NS_SUPPORTS_DOUBLE_CONTRACTID "@mozilla.org/supports-double;1"
 
-#define NS_SUPPORTS_VOID_CID \
-{ 0xaf10f3e0, 0x568d, 0x11d3, \
-{ 0xba, 0xf8, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
-#define NS_SUPPORTS_VOID_CONTRACTID "@mozilla.org/supports-void;1"
-
 #define NS_SUPPORTS_INTERFACE_POINTER_CID \
 { 0xA99FEBBA, 0x1DD1, 0x11B2, \
 { 0xA9, 0x43, 0xB0, 0x23, 0x34, 0xA6, 0xD0, 0x83 } }
 #define NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID "@mozilla.org/supports-interface-pointer;1"
 
 #endif
--- a/xpcom/ds/nsISupportsPrimitives.idl
+++ b/xpcom/ds/nsISupportsPrimitives.idl
@@ -27,17 +27,17 @@ interface nsISupportsPrimitive : nsISupp
     const unsigned short TYPE_PRUINT64          = 8;
     const unsigned short TYPE_PRTIME            = 9;
     const unsigned short TYPE_CHAR              = 10;
     const unsigned short TYPE_PRINT16           = 11;
     const unsigned short TYPE_PRINT32           = 12;
     const unsigned short TYPE_PRINT64           = 13;
     const unsigned short TYPE_FLOAT             = 14;
     const unsigned short TYPE_DOUBLE            = 15;
-    const unsigned short TYPE_VOID              = 16;
+    // 16 was for TYPE_VOID
     const unsigned short TYPE_INTERFACE_POINTER = 17;
 
     readonly attribute unsigned short type;
 };
 
 /**
  * Scriptable storage for nsID structures
  */
@@ -204,27 +204,16 @@ interface nsISupportsFloat : nsISupports
 [scriptable, uuid(b32523a0-4ac0-11d3-baea-00805f8a5dd7)]
 interface nsISupportsDouble : nsISupportsPrimitive
 {
     attribute double data;
     string toString();
 };
 
 /**
- * Scriptable storage for generic pointers
- */
-
-[scriptable, uuid(464484f0-568d-11d3-baf8-00805f8a5dd7)]
-interface nsISupportsVoid : nsISupportsPrimitive
-{
-    [noscript] attribute voidPtr data;
-    string toString();
-};
-
-/**
  * Scriptable storage for other XPCOM objects
  */
 
 [scriptable, uuid(995ea724-1dd1-11b2-9211-c21bdd3e7ed0)]
 interface nsISupportsInterfacePointer : nsISupportsPrimitive
 {
     attribute nsISupports data;
     attribute nsIDPtr dataIID;
--- a/xpcom/ds/nsSupportsPrimitives.cpp
+++ b/xpcom/ds/nsSupportsPrimitives.cpp
@@ -670,59 +670,16 @@ nsSupportsDouble::ToString(char** aResul
   NS_ASSERTION(aResult, "Bad pointer");
   *aResult = DataToString("%f", mData);
   return  NS_OK;
 }
 
 /***************************************************************************/
 
 
-NS_IMPL_ISUPPORTS(nsSupportsVoid, nsISupportsVoid,
-                  nsISupportsPrimitive)
-
-nsSupportsVoid::nsSupportsVoid()
-  : mData(nullptr)
-{
-}
-
-NS_IMETHODIMP
-nsSupportsVoid::GetType(uint16_t* aType)
-{
-  NS_ASSERTION(aType, "Bad pointer");
-  *aType = TYPE_VOID;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSupportsVoid::GetData(void** aData)
-{
-  NS_ASSERTION(aData, "Bad pointer");
-  *aData = mData;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSupportsVoid::SetData(void* aData)
-{
-  mData = aData;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSupportsVoid::ToString(char** aResult)
-{
-  NS_ASSERTION(aResult, "Bad pointer");
-  static const char str[] = "[raw data]";
-  *aResult = static_cast<char*>(nsMemory::Clone(str, sizeof(str)));
-  return NS_OK;
-}
-
-/***************************************************************************/
-
-
 NS_IMPL_ISUPPORTS(nsSupportsInterfacePointer,
                   nsISupportsInterfacePointer,
                   nsISupportsPrimitive)
 
 nsSupportsInterfacePointer::nsSupportsInterfacePointer()
   : mIID(nullptr)
 {
 }
--- a/xpcom/ds/nsSupportsPrimitives.h
+++ b/xpcom/ds/nsSupportsPrimitives.h
@@ -263,33 +263,16 @@ public:
 private:
   ~nsSupportsDouble() {}
 
   double mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsVoid final : public nsISupportsVoid
-{
-public:
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSISUPPORTSPRIMITIVE
-  NS_DECL_NSISUPPORTSVOID
-
-  nsSupportsVoid();
-
-private:
-  ~nsSupportsVoid() {}
-
-  void* mData;
-};
-
-/***************************************************************************/
-
 class nsSupportsInterfacePointer final : public nsISupportsInterfacePointer
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISUPPORTSPRIMITIVE
   NS_DECL_NSISUPPORTSINTERFACEPOINTER
 
   nsSupportsInterfacePointer();