Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (jsd parts); r=Waldo
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 12 Jun 2012 23:45:08 -0400
changeset 96633 2da255c1aeb9568f3fb7fe30e5661c03b103542f
parent 96632 8b34c182b276f12ed95b0fb74a2b40cbab2c8e75
child 96634 4530efc8e2ecc805b7688fd998c7cfbab0b8e8d3
push id22925
push useremorley@mozilla.com
push dateThu, 14 Jun 2012 09:21:42 +0000
treeherdermozilla-central@85e31a4bdd41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs758992
milestone16.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 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (jsd parts); r=Waldo
js/jsd/jsd_xpc.cpp
js/jsd/jsd_xpc.h
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -18,16 +18,17 @@
 #include "nsIJSRuntimeService.h"
 #include "nsIThreadInternal.h"
 #include "nsThreadUtils.h"
 #include "nsMemory.h"
 #include "jsdebug.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 /* XXX DOM dependency */
 #include "nsIScriptContext.h"
 #include "nsIJSContextStack.h"
 
 /*
  * defining CAUTIOUS_SCRIPTHOOK makes jsds disable GC while calling out to the
  * script hook.  This was a hack to avoid some js engine problems that should
@@ -3376,17 +3377,17 @@ jsdService::GetService ()
 }
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(jsdService, jsdService::GetService)
 
 /* app-start observer.  turns on the debugger at app-start.  this is inserted
  * and/or removed from the app-start category by the jsdService::initAtStartup
  * property.
  */
-class jsdASObserver : public nsIObserver 
+class jsdASObserver MOZ_FINAL : public nsIObserver
 {
   public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
     jsdASObserver () {}    
 };
 
--- a/js/jsd/jsd_xpc.h
+++ b/js/jsd/jsd_xpc.h
@@ -8,16 +8,17 @@
 #define JSDSERVICE_H___
 
 #include "jsdIDebuggerService.h"
 #include "jsdebug.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nspr.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 // #if defined(DEBUG_rginda_l)
 // #   define DEBUG_verbose
 // #endif
 
 struct LiveEphemeral {
     /* link in a chain of live values list */
     PRCList                  links;
@@ -28,17 +29,17 @@ struct LiveEphemeral {
 struct PCMapEntry {
     PRUint32 pc, line;
 };
     
 /*******************************************************************************
  * reflected jsd data structures
  *******************************************************************************/
 
-class jsdObject : public jsdIObject
+class jsdObject MOZ_FINAL : public jsdIObject
 {
   public:
     NS_DECL_ISUPPORTS
     NS_DECL_JSDIOBJECT
 
     /* you'll normally use use FromPtr() instead of directly constructing one */
     jsdObject (JSDContext *aCx, JSDObject *aObject) :
         mCx(aCx), mObject(aObject)