Bug 1060696 - Remove nsISupportsObsolete.h. r=froydnj
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Fri, 16 Jan 2015 07:34:51 +0200
changeset 224144 244f30e89f71adb00742de576c0eba831262392e
parent 224143 93828c511189f52e6bf8e4240d6d1d5968d390f3
child 224145 add393f947f302cf0214b3cd963f7cc009b53aac
push id28117
push usercbook@mozilla.com
push dateFri, 16 Jan 2015 13:47:16 +0000
treeherdermozilla-central@47b586de5661 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1060696
milestone38.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 1060696 - Remove nsISupportsObsolete.h. r=froydnj
xpcom/base/moz.build
xpcom/base/nsISupportsObsolete.h
xpcom/sample/xpconnect-sample.html
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -49,17 +49,16 @@ EXPORTS += [
     'nsCycleCollector.h',
     'nsDebugImpl.h',
     'nsError.h',
     'nsGZFileWriter.h',
     'nsIID.h',
     'nsInterfaceRequestorAgg.h',
     'nsISizeOf.h',
     'nsISupportsBase.h',
-    'nsISupportsObsolete.h',
     'nsObjCExceptions.h',
     'nsRefPtr.h',
     'nsStackWalk.h',
     'nsTraceRefcnt.h',
     'nsWeakPtr.h',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
deleted file mode 100644
--- a/xpcom/base/nsISupportsObsolete.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-#ifndef nsISupportsObsolete_h__
-#define nsISupportsObsolete_h__
-
-#include "prcmon.h"
-
-///////////////////////////////////////////////////////////////////////////////
-
-
-#define NS_INIT_REFCNT() NS_INIT_ISUPPORTS()
-
-/**
- * Macro to free an array of pointers to nsISupports (or classes
- * derived from it).  A convenience wrapper around
- * NS_FREE_XPCOM_POINTER_ARRAY.
- *
- * Note that if you know that none of your nsISupports pointers are
- * going to be 0, you can gain a bit of speed by calling
- * NS_FREE_XPCOM_POINTER_ARRAY directly and using NS_RELEASE as your
- * free function.
- *
- * @param size      Number of elements in the array.  If not a constant, this
- *                  should be a int32_t.  Note that this means this macro
- *                  will not work if size >= 2^31.
- * @param array     The array to be freed.
- */
-#define NS_FREE_XPCOM_ISUPPORTS_POINTER_ARRAY(size, array)                    \
-  NS_FREE_XPCOM_POINTER_ARRAY((size), (array), NS_IF_RELEASE)
-
-
-///////////////////////////////////////////////////////////////////////////////
-
-/* use these functions to associate get/set methods with a
-   C++ member variable
-*/
-
-#define NS_METHOD_GETTER(_method, _type, _member) \
-_method(_type* aResult) \
-{\
-  if (!aResult) return NS_ERROR_NULL_POINTER; \
-  *aResult = _member; \
-  return NS_OK; \
-}
-
-#define NS_METHOD_SETTER(_method, _type, _member) \
-_method(_type aResult) \
-{ \
-  _member = aResult; \
-  return NS_OK; \
-}
-
-/*
- * special for strings to get/set char* strings
- * using PL_strdup and PR_FREEIF
- */
-#define NS_METHOD_GETTER_STR(_method,_member)   \
-_method(char* *aString)                         \
-{                                               \
-  if (!aString) return NS_ERROR_NULL_POINTER;   \
-  if (!(*aString = PL_strdup(_member)))         \
-    return NS_ERROR_OUT_OF_MEMORY;              \
-  return NS_OK;                                 \
-}
-
-#define NS_METHOD_SETTER_STR(_method, _member) \
-_method(const char *aString)                   \
-{                                              \
-  if (_member) PR_Free(_member);               \
-  if (!aString)                                \
-    _member = nullptr;                         \
-  else if (!(_member = PL_strdup(aString)))    \
-    return NS_ERROR_OUT_OF_MEMORY;             \
-  return NS_OK;                                \
-}
-
-/* Getter/Setter macros.
-   Usage:
-   NS_IMPL_[CLASS_]GETTER[_<type>](method, [type,] member);
-   NS_IMPL_[CLASS_]SETTER[_<type>](method, [type,] member);
-   NS_IMPL_[CLASS_]GETSET[_<type>]([class, ]postfix, [type,] member);
-
-   where:
-   CLASS_  - implementation is inside a class definition
-             (otherwise the class name is needed)
-             Do NOT use in publicly exported header files, because
-             the implementation may be included many times over.
-             Instead, use the non-CLASS_ version.
-   _<type> - For more complex (STR, IFACE) data types
-             (otherwise the simple data type is needed)
-   method  - name of the method, such as GetWidth or SetColor
-   type    - simple data type if required
-   member  - class member variable such as m_width or mColor
-   class   - the class name, such as Window or MyObject
-   postfix - Method part after Get/Set such as "Width" for "GetWidth"
-
-   Example:
-   class Window {
-   public:
-     NS_IMPL_CLASS_GETSET(Width, int, m_width);
-     NS_IMPL_CLASS_GETTER_STR(GetColor, m_color);
-     NS_IMETHOD SetColor(char *color);
-
-   private:
-     int m_width;     // read/write
-     char *m_color;   // readonly
-   };
-
-   // defined outside of class
-   NS_IMPL_SETTER_STR(Window::GetColor, m_color);
-
-   Questions/Comments to alecf@netscape.com
-*/
-
-
-/*
- * Getter/Setter implementation within a class definition
- */
-
-/* simple data types */
-#define NS_IMPL_CLASS_GETTER(_method, _type, _member) \
-NS_IMETHOD NS_METHOD_GETTER(_method, _type, _member)
-
-#define NS_IMPL_CLASS_SETTER(_method, _type, _member) \
-NS_IMETHOD NS_METHOD_SETTER(_method, _type, _member)
-
-#define NS_IMPL_CLASS_GETSET(_postfix, _type, _member) \
-NS_IMPL_CLASS_GETTER(Get##_postfix, _type, _member) \
-NS_IMPL_CLASS_SETTER(Set##_postfix, _type, _member)
-
-/* strings */
-#define NS_IMPL_CLASS_GETTER_STR(_method, _member) \
-NS_IMETHOD NS_METHOD_GETTER_STR(_method, _member)
-
-#define NS_IMPL_CLASS_SETTER_STR(_method, _member) \
-NS_IMETHOD NS_METHOD_SETTER_STR(_method, _member)
-
-#define NS_IMPL_CLASS_GETSET_STR(_postfix, _member) \
-NS_IMPL_CLASS_GETTER_STR(Get##_postfix, _member) \
-NS_IMPL_CLASS_SETTER_STR(Set##_postfix, _member)
-
-/* Getter/Setter implementation outside of a class definition */
-
-/* simple data types */
-#define NS_IMPL_GETTER(_method, _type, _member) \
-NS_IMETHODIMP NS_METHOD_GETTER(_method, _type, _member)
-
-#define NS_IMPL_SETTER(_method, _type, _member) \
-NS_IMETHODIMP NS_METHOD_SETTER(_method, _type, _member)
-
-#define NS_IMPL_GETSET(_class, _postfix, _type, _member) \
-NS_IMPL_GETTER(_class::Get##_postfix, _type, _member) \
-NS_IMPL_SETTER(_class::Set##_postfix, _type, _member)
-
-/* strings */
-#define NS_IMPL_GETTER_STR(_method, _member) \
-NS_IMETHODIMP NS_METHOD_GETTER_STR(_method, _member)
-
-#define NS_IMPL_SETTER_STR(_method, _member) \
-NS_IMETHODIMP NS_METHOD_SETTER_STR(_method, _member)
-
-#define NS_IMPL_GETSET_STR(_class, _postfix, _member) \
-NS_IMPL_GETTER_STR(_class::Get##_postfix, _member) \
-NS_IMPL_SETTER_STR(_class::Set##_postfix, _member)
-
-/**
- * IID for the nsIsThreadsafe interface
- * {88210890-47a6-11d2-bec3-00805f8a66dc}
- *
- * This interface is *only* used for debugging purposes to determine if
- * a given component is threadsafe.
- */
-#define NS_ISTHREADSAFE_IID                                                   \
-  { 0x88210890, 0x47a6, 0x11d2,                                               \
-    {0xbe, 0xc3, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0xdc} }
-
-#define NS_LOCK_INSTANCE()                                                    \
-  PR_CEnterMonitor((void*)this)
-#define NS_UNLOCK_INSTANCE()                                                  \
-  PR_CExitMonitor((void*)this)
-
-/**
- * This implements query interface with two assumptions: First, the
- * class in question implements nsISupports and its own interface and
- * nothing else. Second, the implementation of the class's primary
- * inheritance chain leads to its own interface.
- *
- * @param _class The name of the class implementing the method
- * @param _classiiddef The name of the #define symbol that defines the IID
- * for the class (e.g. NS_ISUPPORTS_IID)
- */
-#if defined(DEBUG)
-#define NS_VERIFY_THREADSAFE_INTERFACE(_iface)                                \
- if (nullptr != (_iface)) {                                                   \
-   nsISupports* tmp;                                                          \
-   static NS_DEFINE_IID(kIsThreadsafeIID, NS_ISTHREADSAFE_IID);               \
-   NS_PRECONDITION((NS_OK == _iface->QueryInterface(kIsThreadsafeIID,         \
-                                                    (void**)&tmp)),           \
-                   "Interface is not threadsafe");                            \
- }
-#else
-#define NS_VERIFY_THREADSAFE_INTERFACE(_iface)
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-
-#endif
--- a/xpcom/sample/xpconnect-sample.html
+++ b/xpcom/sample/xpconnect-sample.html
@@ -57,19 +57,17 @@ of the interface used at runtime.
 <br><tt>void poke(in string aValue);</tt><b></b>
 <p><b><a href="http://lxr.mozilla.org/mozilla/source/xpcom/sample/nsSample.cpp">nsSample.cpp</a></b>
 <p>This contains the implementation of nsISample.idl. SampleImpl
 inherits from nsISample.h, the header dynamically created by the xpidl
 compiler. The attribute Value has been expanded into a get and set
 and the return values have been modified to NS_IMETHOD, a success status
 for the method. The macro NS_DECL_ISUPPORTS, defined in <a href="http://lxr.mozilla.org/mozilla/source/xpcom/base/nsISupportsUtils.h">mozilla/xpcom/public/nsISupportsUtils.h</a>
 defines the inherited methods from nsISupports.h.
-<br><tt>NS_IMPL_ISUPPORTS(SampleImpl, nsISample)</tt>
-<br>In the constructor, the macro NS_INIT_REFCNT is called which sets the
-reference count to 0.<p>
+<br><tt>NS_IMPL_ISUPPORTS(SampleImpl, nsISample)</tt><p>
 Note that the methods in the C++ bindings use InterCaps style, while the IDL
 and JavaScript versions should use interCaps naming.  The JavaScript binding
 matches the case of the IDL, <b>except</b> <a
 href="http://bugzilla.mozilla.org/show_bug.cgi?id=14460">QueryInterface</a>.
 <p><b><a href="http://lxr.mozilla.org/mozilla/source/xpcom/sample/nsSampleFactory.cpp">nsSampleFactory.cpp</a></b>
 <p>This is the class which builds the instance of the nsSample class.
 The COM framework uses factories to create instance of implementations
 rather than having the implementations instantiate themselves in order to