Bug 711647 - Add MOZ_DELETE to a bunch of deliberately-not-implemented methods across the tree. r=dbaron
authorJeff Walden <jwalden@mit.edu>
Fri, 16 Dec 2011 14:42:07 -0500
changeset 85677 9c7cc49f65561a5f85f437220e0c5d2ebfa6abc8
parent 85676 ca4fa28622964fc3f8c200daab8109d4b8d0fc2f
child 85678 7c0b89927f59d0b43317e76e0f43756a63ebd9e3
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs711647
milestone12.0a1
Bug 711647 - Add MOZ_DELETE to a bunch of deliberately-not-implemented methods across the tree. r=dbaron
content/base/src/nsAttrAndChildArray.h
gfx/thebes/gfxQuartzNativeDrawing.h
js/public/Vector.h
js/src/ds/LifoAlloc.h
js/src/jscompartment.h
js/src/vm/Debugger.h
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/src/xpcprivate.h
layout/base/nsCSSFrameConstructor.h
layout/base/nsStyleChangeList.h
layout/generic/nsFrame.cpp
layout/printing/nsPrintData.h
layout/printing/nsPrintEngine.h
layout/printing/nsPrintObject.h
layout/style/Declaration.h
layout/style/StyleRule.h
layout/style/nsCSSParser.h
layout/style/nsCSSValue.h
layout/style/nsHTMLCSSStyleSheet.h
layout/style/nsHTMLStyleSheet.h
layout/style/nsStyleSet.h
layout/style/nsStyleStruct.h
modules/libjar/nsZipArchive.h
security/manager/ssl/src/nsRecentBadCerts.h
xpcom/base/nsAutoRef.h
xpcom/glue/DeadlockDetector.h
xpcom/glue/nsCOMArray.h
xpcom/glue/nsStringAPI.h
xpcom/string/public/nsString.h
xpcom/string/public/nsTString.h
--- a/content/base/src/nsAttrAndChildArray.h
+++ b/content/base/src/nsAttrAndChildArray.h
@@ -39,16 +39,18 @@
 /*
  * Storage of the children and attributes of a DOM node; storage for
  * the two is unified to minimize footprint.
  */
 
 #ifndef nsAttrAndChildArray_h___
 #define nsAttrAndChildArray_h___
 
+#include "mozilla/Attributes.h"
+
 #include "nscore.h"
 #include "nsAttrName.h"
 #include "nsAttrValue.h"
 
 class nsINode;
 class nsIContent;
 class nsMappedAttributes;
 class nsHTMLStyleSheet;
@@ -131,18 +133,18 @@ public:
   {
     return AttrSlotCount() < ATTRCHILD_ARRAY_MAX_ATTR_COUNT ||
            !AttrSlotIsTaken(ATTRCHILD_ARRAY_MAX_ATTR_COUNT - 1);
   }
 
   PRInt64 SizeOf() const;
 
 private:
-  nsAttrAndChildArray(const nsAttrAndChildArray& aOther); // Not to be implemented
-  nsAttrAndChildArray& operator=(const nsAttrAndChildArray& aOther); // Not to be implemented
+  nsAttrAndChildArray(const nsAttrAndChildArray& aOther) MOZ_DELETE;
+  nsAttrAndChildArray& operator=(const nsAttrAndChildArray& aOther) MOZ_DELETE;
 
   void Clear();
 
   PRUint32 NonMappedAttrCount() const;
   PRUint32 MappedAttrCount() const;
 
   nsresult GetModifiableMapped(nsMappedAttributeElement* aContent,
                                nsHTMLStyleSheet* aSheet,
--- a/gfx/thebes/gfxQuartzNativeDrawing.h
+++ b/gfx/thebes/gfxQuartzNativeDrawing.h
@@ -33,16 +33,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef _GFXQUARTZNATIVEDRAWING_H_
 #define _GFXQUARTZNATIVEDRAWING_H_
 
+#include "mozilla/Attributes.h"
+
 #include "gfxContext.h"
 #include "gfxQuartzSurface.h"
 
 class THEBES_API gfxQuartzNativeDrawing {
 public:
 
     /* Create native Quartz drawing for a rectangle bounded by
      * nativeRect.
@@ -66,18 +68,18 @@ public:
      * for drawing after that time, the result is undefined. */
     CGContextRef BeginNativeDrawing();
 
     /* Marks the end of native drawing */
     void EndNativeDrawing();
 
 private:
     // don't allow copying via construction or assignment
-    gfxQuartzNativeDrawing(const gfxQuartzNativeDrawing&);
-    const gfxQuartzNativeDrawing& operator=(const gfxQuartzNativeDrawing&);
+    gfxQuartzNativeDrawing(const gfxQuartzNativeDrawing&) MOZ_DELETE;
+    const gfxQuartzNativeDrawing& operator=(const gfxQuartzNativeDrawing&) MOZ_DELETE;
 
     // Final destination context
     nsRefPtr<gfxContext> mContext;
     // context that draws to mQuartzSurface; can be different from mContext
     // if mContext is not drawing to Quartz
     nsRefPtr<gfxContext> mSurfaceContext;
     gfxRect mNativeRect;
 
--- a/js/public/Vector.h
+++ b/js/public/Vector.h
@@ -36,16 +36,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jsvector_h_
 #define jsvector_h_
 
+#include "mozilla/Attributes.h"
+
 #include "TemplateLib.h"
 #include "Utility.h"
 
 /* Silence dire "bugs in previous versions of MSVC have been fixed" warnings */
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable:4345)
 #endif
@@ -269,18 +271,18 @@ class Vector : private AllocPolicy
 
     AlignedStorage<sInlineBytes> storage;
 
 #ifdef DEBUG
     friend class ReentrancyGuard;
     bool entered;
 #endif
 
-    Vector(const Vector &);
-    Vector &operator=(const Vector &);
+    Vector(const Vector &) MOZ_DELETE;
+    Vector &operator=(const Vector &) MOZ_DELETE;
 
     /* private accessors */
 
     bool usingInlineStorage() const {
         return mBegin == (T *)storage.addr();
     }
 
     T *beginNoCheck() const {
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -36,16 +36,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef LifoAlloc_h__
 #define LifoAlloc_h__
 
+#include "mozilla/Attributes.h"
+
 /*
  * This data structure supports stacky LIFO allocation (mark/release and
  * LifoAllocScope). It does not maintain one contiguous segment; instead, it
  * maintains a bunch of linked memory segments. In order to prevent malloc/free
  * thrashing, unused segments are deallocated when garbage collection occurs.
  */
 
 #include "jsutil.h"
@@ -176,18 +178,18 @@ class LifoAlloc
 {
     typedef detail::BumpChunk BumpChunk;
 
     BumpChunk   *first;
     BumpChunk   *latest;
     size_t      markCount;
     size_t      defaultChunkSize_;
 
-    void operator=(const LifoAlloc &);
-    LifoAlloc(const LifoAlloc &);
+    void operator=(const LifoAlloc &) MOZ_DELETE;
+    LifoAlloc(const LifoAlloc &) MOZ_DELETE;
 
     /* 
      * Return a BumpChunk that can perform an allocation of at least size |n|
      * and add it to the chain appropriately.
      *
      * Side effect: if retval is non-null, |first| and |latest| are initialized
      * appropriately.
      */
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -35,16 +35,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jscompartment_h___
 #define jscompartment_h___
 
+#include "mozilla/Attributes.h"
+
 #include "jsclist.h"
 #include "jscntxt.h"
 #include "jsfun.h"
 #include "jsgc.h"
 #include "jsgcstats.h"
 #include "jsobj.h"
 #include "jsscope.h"
 #include "vm/GlobalObject.h"
@@ -464,19 +466,18 @@ class AutoCompartment
   public:
     AutoCompartment(JSContext *cx, JSObject *target);
     ~AutoCompartment();
 
     bool enter();
     void leave();
 
   private:
-    // Prohibit copying.
-    AutoCompartment(const AutoCompartment &);
-    AutoCompartment & operator=(const AutoCompartment &);
+    AutoCompartment(const AutoCompartment &) MOZ_DELETE;
+    AutoCompartment & operator=(const AutoCompartment &) MOZ_DELETE;
 };
 
 /*
  * Use this to change the behavior of an AutoCompartment slightly on error. If
  * the exception happens to be an Error object, copy it to the origin compartment
  * instead of wrapping it.
  */
 class ErrorCopier
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.h
@@ -37,16 +37,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef Debugger_h__
 #define Debugger_h__
 
+#include "mozilla/Attributes.h"
+
 #include "jsapi.h"
 #include "jsclist.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsgc.h"
 #include "jsweakmap.h"
 #include "jswrapper.h"
 
@@ -343,19 +345,18 @@ class Debugger {
     /*
      * Return the Debugger.Script object for |script|, or create a new one if
      * needed. The context |cx| must be in the debugger compartment; |script|
      * must be a script in a debuggee compartment.
      */
     JSObject *wrapScript(JSContext *cx, JSScript *script);
 
   private:
-    /* Prohibit copying. */
-    Debugger(const Debugger &);
-    Debugger & operator=(const Debugger &);
+    Debugger(const Debugger &) MOZ_DELETE;
+    Debugger & operator=(const Debugger &) MOZ_DELETE;
 };
 
 class BreakpointSite {
     friend class Breakpoint;
     friend struct ::JSCompartment;
     friend struct ::JSScript;
     friend class Debugger;
 
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -36,16 +36,18 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+#include "mozilla/Attributes.h"
+
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG
 #endif
 
 #include <stdarg.h>
 
 #include "prlog.h"
 #ifdef ANDROID
@@ -314,34 +316,34 @@ public:
 
 private:
     JSContext* mContext;
     intN       mContextThread;
     nsIThreadJSContextStack* mContextStack;
     char*      mBuf;
 
     // prevent copying and assignment
-    JSCLContextHelper(const JSCLContextHelper &); // not implemented
-    const JSCLContextHelper& operator=(const JSCLContextHelper &); // not implemented
+    JSCLContextHelper(const JSCLContextHelper &) MOZ_DELETE;
+    const JSCLContextHelper& operator=(const JSCLContextHelper &) MOZ_DELETE;
 };
 
 
 class JSCLAutoErrorReporterSetter
 {
 public:
     JSCLAutoErrorReporterSetter(JSContext* cx, JSErrorReporter reporter)
         {mContext = cx; mOldReporter = JS_SetErrorReporter(cx, reporter);}
     ~JSCLAutoErrorReporterSetter()
         {JS_SetErrorReporter(mContext, mOldReporter);}
 private:
     JSContext* mContext;
     JSErrorReporter mOldReporter;
-    // prevent copying and assignment
-    JSCLAutoErrorReporterSetter(const JSCLAutoErrorReporterSetter &); // not implemented
-    const JSCLAutoErrorReporterSetter& operator=(const JSCLAutoErrorReporterSetter &); // not implemented
+
+    JSCLAutoErrorReporterSetter(const JSCLAutoErrorReporterSetter &) MOZ_DELETE;
+    const JSCLAutoErrorReporterSetter& operator=(const JSCLAutoErrorReporterSetter &) MOZ_DELETE;
 };
 
 static nsresult
 ReportOnCaller(JSContext *callerContext,
                const char *format, ...) {
     if (!callerContext) {
         return NS_ERROR_FAILURE;
     }
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -41,16 +41,18 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* All the XPConnect private declarations - only include locally. */
 
 #ifndef xpcprivate_h___
 #define xpcprivate_h___
 
+#include "mozilla/Attributes.h"
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <math.h>
 #include "xpcpublic.h"
 #include "jsapi.h"
 #include "jsdhash.h"
 #include "jsprf.h"
@@ -4019,18 +4021,18 @@ private:
     JSExceptionState* mState;
     bool mErrorReporterSet;
     bool mEvaluated;
     jsword mContextHasThread;
     JSAutoEnterCompartment mEnterCompartment;
     MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER
 
     // No copying or assignment allowed
-    AutoScriptEvaluate(const AutoScriptEvaluate &);
-    AutoScriptEvaluate & operator =(const AutoScriptEvaluate &);
+    AutoScriptEvaluate(const AutoScriptEvaluate &) MOZ_DELETE;
+    AutoScriptEvaluate & operator =(const AutoScriptEvaluate &) MOZ_DELETE;
 };
 
 /***************************************************************************/
 class NS_STACK_CLASS AutoResolveName
 {
 public:
     AutoResolveName(XPCCallContext& ccx, jsid name
                     MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM)
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -38,16 +38,18 @@
 /*
  * construction of a frame tree that is nearly isomorphic to the content
  * tree and updating of that tree in response to dynamic changes
  */
 
 #ifndef nsCSSFrameConstructor_h___
 #define nsCSSFrameConstructor_h___
 
+#include "mozilla/Attributes.h"
+
 #include "nsCOMPtr.h"
 #include "nsILayoutHistoryState.h"
 #include "nsIXBLService.h"
 #include "nsQuoteList.h"
 #include "nsCounterManager.h"
 #include "nsHashKeys.h"
 #include "nsThreadUtils.h"
 #include "nsPageContentFrame.h"
@@ -97,20 +99,19 @@ public:
   static nsIXBLService * GetXBLService();
   static void ReleaseGlobals() { NS_IF_RELEASE(gXBLService); }
 
   // get the alternate text for a content node
   static void GetAlternateTextFor(nsIContent*    aContent,
                                   nsIAtom*       aTag,  // content object's tag
                                   nsXPIDLString& aAltText);
 
-private: 
-  // These are not supported and are not implemented! 
-  nsCSSFrameConstructor(const nsCSSFrameConstructor& aCopy); 
-  nsCSSFrameConstructor& operator=(const nsCSSFrameConstructor& aCopy); 
+private:
+  nsCSSFrameConstructor(const nsCSSFrameConstructor& aCopy) MOZ_DELETE;
+  nsCSSFrameConstructor& operator=(const nsCSSFrameConstructor& aCopy) MOZ_DELETE;
 
 public:
   // XXXbz this method needs to actually return errors!
   nsresult ConstructRootFrame(nsIFrame** aNewFrame);
 
   nsresult ReconstructDocElementHierarchy();
 
   // Create frames for content nodes that are marked as needing frames. This
--- a/layout/base/nsStyleChangeList.h
+++ b/layout/base/nsStyleChangeList.h
@@ -38,16 +38,18 @@
 /*
  * a list of the recomputation that needs to be done in response to a
  * style change
  */
 
 #ifndef nsStyleChangeList_h___
 #define nsStyleChangeList_h___
 
+#include "mozilla/Attributes.h"
+
 #include "nsError.h"
 #include "nsChangeHint.h"
 
 class nsIFrame;
 class nsIContent;
 
 // XXX would all platforms support putting this inside the list?
 struct nsStyleChangeData {
@@ -90,13 +92,13 @@ protected:
   bool                operator==(const nsStyleChangeList& aOther) const;
 
   nsStyleChangeData*  mArray;
   PRInt32             mArraySize;
   PRInt32             mCount;
   nsStyleChangeData   mBuffer[kStyleChangeBufferSize];
 
 private:
-  nsStyleChangeList(const nsStyleChangeList&); // not implemented
+  nsStyleChangeList(const nsStyleChangeList&) MOZ_DELETE;
 };
 
 
 #endif /* nsStyleChangeList_h___ */
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -37,16 +37,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* base class of all rendering objects */
 
+#include "mozilla/Attributes.h"
 #include "mozilla/Util.h"
 
 #include "nsCOMPtr.h"
 #include "nsFrame.h"
 #include "nsFrameList.h"
 #include "nsPlaceholderFrame.h"
 #include "nsLineLayout.h"
 #include "nsIContent.h"
@@ -8069,17 +8070,17 @@ struct DR_FrameTypeInfo
       }
    }
 
   nsIAtom*    mType;
   char        mNameAbbrev[16];
   char        mName[32];
   nsTArray<DR_Rule*> mRules;
 private:
-  DR_FrameTypeInfo& operator=(const DR_FrameTypeInfo&); // NOT USED
+  DR_FrameTypeInfo& operator=(const DR_FrameTypeInfo&) MOZ_DELETE;
 };
 
 DR_FrameTypeInfo::DR_FrameTypeInfo(nsIAtom* aFrameType, 
                                    const char* aFrameNameAbbrev, 
                                    const char* aFrameName)
 {
   mType = aFrameType;
   PL_strncpyz(mNameAbbrev, aFrameNameAbbrev, sizeof(mNameAbbrev));
--- a/layout/printing/nsPrintData.h
+++ b/layout/printing/nsPrintData.h
@@ -29,19 +29,22 @@
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
+
 #ifndef nsPrintData_h___
 #define nsPrintData_h___
 
+#include "mozilla/Attributes.h"
+
 // Interfaces
 #include "nsIDOMWindow.h"
 #include "nsDeviceContext.h"
 #include "nsIPrintProgressParams.h"
 #include "nsIPrintOptions.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsAutoPtr.h"
@@ -118,15 +121,15 @@ public:
   float                       mOrigDCScale;
 
   nsCOMPtr<nsIPrintSettings>  mPrintSettings;
   nsPrintPreviewListener*     mPPEventListeners;
 
   PRUnichar*            mBrandName; //  needed as a substitute name for a document
 
 private:
-  nsPrintData(); //not implemented
-  nsPrintData& operator=(const nsPrintData& aOther); // not implemented
+  nsPrintData() MOZ_DELETE;
+  nsPrintData& operator=(const nsPrintData& aOther) MOZ_DELETE;
 
 };
 
 #endif /* nsPrintData_h___ */
 
--- a/layout/printing/nsPrintEngine.h
+++ b/layout/printing/nsPrintEngine.h
@@ -32,16 +32,18 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #ifndef nsPrintEngine_h___
 #define nsPrintEngine_h___
 
+#include "mozilla/Attributes.h"
+
 #include "nsCOMPtr.h"
 
 #include "nsPrintObject.h"
 #include "nsPrintData.h"
 #include "nsFrameList.h"
 
 // Interfaces
 #include "nsIDocument.h"
@@ -293,13 +295,12 @@ protected:
   nsPrintData*            mPrtPreview;
   nsPrintData*            mOldPrtPreview;
 
   nsCOMPtr<nsIDocument>   mDocument;
 
   FILE* mDebugFile;
 
 private:
-  nsPrintEngine& operator=(const nsPrintEngine& aOther); // not implemented
-
+  nsPrintEngine& operator=(const nsPrintEngine& aOther) MOZ_DELETE;
 };
 
 #endif /* nsPrintEngine_h___ */
--- a/layout/printing/nsPrintObject.h
+++ b/layout/printing/nsPrintObject.h
@@ -32,16 +32,18 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #ifndef nsPrintObject_h___
 #define nsPrintObject_h___
 
+#include "mozilla/Attributes.h"
+
 // Interfaces
 #include "nsCOMPtr.h"
 #include "nsIContent.h"
 #include "nsIPresShell.h"
 #include "nsStyleSet.h"
 #include "nsIViewManager.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
@@ -89,16 +91,15 @@ public:
   bool             mSharedPresShell;
   bool             mInvisible;        // Indicates PO is set to not visible by CSS
   bool             mPrintPreview;
   bool             mDidCreateDocShell;
   float            mShrinkRatio;
   float            mZoomRatio;
 
 private:
-  nsPrintObject& operator=(const nsPrintObject& aOther); // not implemented
-
+  nsPrintObject& operator=(const nsPrintObject& aOther) MOZ_DELETE;
 };
 
 
 
 #endif /* nsPrintObject_h___ */
 
--- a/layout/style/Declaration.h
+++ b/layout/style/Declaration.h
@@ -39,16 +39,18 @@
 /*
  * representation of a declaration block (or style attribute) in a CSS
  * stylesheet
  */
 
 #ifndef mozilla_css_Declaration_h
 #define mozilla_css_Declaration_h
 
+#include "mozilla/Attributes.h"
+
 // This header is in EXPORTS because it's used in several places in content/,
 // but it's not really a public interface.
 #ifndef _IMPL_NS_LAYOUT
 #error "This file should only be included within the layout library"
 #endif
 
 #include "nsCSSDataBlock.h"
 #include "nsCSSProperty.h"
@@ -234,19 +236,18 @@ public:
     mOrder.Clear();
   }
 
 #ifdef DEBUG
   void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
 #endif
 
 private:
-  // Not implemented, and not supported.
-  Declaration& operator=(const Declaration& aCopy);
-  bool operator==(const Declaration& aCopy) const;
+  Declaration& operator=(const Declaration& aCopy) MOZ_DELETE;
+  bool operator==(const Declaration& aCopy) const MOZ_DELETE;
 
   static void AppendImportanceToString(bool aIsImportant, nsAString& aString);
   // return whether there was a value in |aValue| (i.e., it had a non-null unit)
   bool AppendValueToString(nsCSSProperty aProperty, nsAString& aResult) const;
   // Helper for ToString with strange semantics regarding aValue.
   void AppendPropertyAndValueToString(nsCSSProperty aProperty,
                                       nsAutoString& aValue,
                                       nsAString& aResult) const;
--- a/layout/style/StyleRule.h
+++ b/layout/style/StyleRule.h
@@ -40,16 +40,18 @@
 /*
  * representation of CSS style rules (selectors+declaration) and CSS
  * selectors
  */
 
 #ifndef mozilla_css_StyleRule_h__
 #define mozilla_css_StyleRule_h__
 
+#include "mozilla/Attributes.h"
+
 //#include <stdio.h>
 #include "mozilla/css/Rule.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSPseudoClasses.h"
 #include "nsAutoPtr.h"
 
@@ -67,19 +69,18 @@ public:
   /** Do a deep clone.  Should be used only on the first in the linked list. */
   nsAtomList* Clone() const { return Clone(true); }
 
   nsCOMPtr<nsIAtom> mAtom;
   nsAtomList*       mNext;
 private: 
   nsAtomList* Clone(bool aDeep) const;
 
-  // These are not supported and are not implemented! 
-  nsAtomList(const nsAtomList& aCopy);
-  nsAtomList& operator=(const nsAtomList& aCopy); 
+  nsAtomList(const nsAtomList& aCopy) MOZ_DELETE;
+  nsAtomList& operator=(const nsAtomList& aCopy) MOZ_DELETE;
 };
 
 struct nsPseudoClassList {
 public:
   nsPseudoClassList(nsCSSPseudoClasses::Type aType);
   nsPseudoClassList(nsCSSPseudoClasses::Type aType, const PRUnichar *aString);
   nsPseudoClassList(nsCSSPseudoClasses::Type aType, const PRInt32 *aIntPair);
   nsPseudoClassList(nsCSSPseudoClasses::Type aType,
@@ -104,19 +105,18 @@ public:
     PRInt32*        mNumbers;
     nsCSSSelectorList* mSelectors;
   } u;
   nsCSSPseudoClasses::Type mType;
   nsPseudoClassList* mNext;
 private: 
   nsPseudoClassList* Clone(bool aDeep) const;
 
-  // These are not supported and are not implemented! 
-  nsPseudoClassList(const nsPseudoClassList& aCopy);
-  nsPseudoClassList& operator=(const nsPseudoClassList& aCopy); 
+  nsPseudoClassList(const nsPseudoClassList& aCopy) MOZ_DELETE;
+  nsPseudoClassList& operator=(const nsPseudoClassList& aCopy) MOZ_DELETE;
 };
 
 #define NS_ATTR_FUNC_SET        0     // [attr]
 #define NS_ATTR_FUNC_EQUALS     1     // [attr=value]
 #define NS_ATTR_FUNC_INCLUDES   2     // [attr~=value] (space separated)
 #define NS_ATTR_FUNC_DASHMATCH  3     // [attr|=value] ('-' truncated)
 #define NS_ATTR_FUNC_BEGINSMATCH  4   // [attr^=value] (begins with)
 #define NS_ATTR_FUNC_ENDSMATCH  5     // [attr$=value] (ends with)
@@ -141,19 +141,18 @@ public:
   nsCOMPtr<nsIAtom> mCasedAttr;
   PRInt32         mNameSpace;
   PRUint8         mFunction;
   bool            mCaseSensitive; // If we are in an HTML document,
                                   // is the value case sensitive?
 private: 
   nsAttrSelector* Clone(bool aDeep) const;
 
-  // These are not supported and are not implemented! 
-  nsAttrSelector(const nsAttrSelector& aCopy);
-  nsAttrSelector& operator=(const nsAttrSelector& aCopy); 
+  nsAttrSelector(const nsAttrSelector& aCopy) MOZ_DELETE;
+  nsAttrSelector& operator=(const nsAttrSelector& aCopy) MOZ_DELETE;
 };
 
 struct nsCSSSelector {
 public:
   nsCSSSelector(void);
   ~nsCSSSelector(void);
 
   /** Do a deep clone.  Should be used only on the first in the linked list. */
@@ -230,19 +229,19 @@ public:
   nsAttrSelector* mAttrList;
   nsCSSSelector*  mNegations;
   nsCSSSelector*  mNext;
   PRInt32         mNameSpace;
   PRUnichar       mOperator;
 private:
   // PRInt16 to make sure it packs well with mOperator
   PRInt16        mPseudoType;
-  // These are not supported and are not implemented! 
-  nsCSSSelector(const nsCSSSelector& aCopy);
-  nsCSSSelector& operator=(const nsCSSSelector& aCopy); 
+
+  nsCSSSelector(const nsCSSSelector& aCopy) MOZ_DELETE;
+  nsCSSSelector& operator=(const nsCSSSelector& aCopy) MOZ_DELETE;
 };
 
 /**
  * A selector list is the unit of selectors that each style rule has.
  * For example, "P B, H1 B { ... }" would be a selector list with two
  * items (where each |nsCSSSelectorList| object's |mSelectors| has
  * an |mNext| for the P or H1).  We represent them as linked lists.
  */
@@ -272,19 +271,18 @@ struct nsCSSSelectorList {
   nsCSSSelectorList* Clone() const { return Clone(true); }
 
   nsCSSSelector*     mSelectors;
   PRInt32            mWeight;
   nsCSSSelectorList* mNext;
 private: 
   nsCSSSelectorList* Clone(bool aDeep) const;
 
-  // These are not supported and are not implemented! 
-  nsCSSSelectorList(const nsCSSSelectorList& aCopy);
-  nsCSSSelectorList& operator=(const nsCSSSelectorList& aCopy); 
+  nsCSSSelectorList(const nsCSSSelectorList& aCopy) MOZ_DELETE;
+  nsCSSSelectorList& operator=(const nsCSSSelectorList& aCopy) MOZ_DELETE;
 };
 
 // 464bab7a-2fce-4f30-ab44-b7a5f3aae57d
 #define NS_CSS_STYLE_RULE_IMPL_CID \
 { 0x464bab7a, 0x2fce, 0x4f30, \
   { 0xab, 0x44, 0xb7, 0xa5, 0xf3, 0xaa, 0xe5, 0x7d } }
 
 namespace mozilla {
@@ -377,30 +375,29 @@ public:
   // The new mapping function.
   virtual void MapRuleInfoInto(nsRuleData* aRuleData);
 
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
 #endif
 
 private:
-  // This is not supported and not implemented!
-  StyleRule& operator=(const StyleRule& aCopy);
-
-private:
   ~StyleRule();
 
 private:
   nsCSSSelectorList*      mSelector; // null for style attribute
   Declaration*            mDeclaration;
   ImportantRule*          mImportantRule; // initialized by RuleMatched
   DOMCSSStyleRule*        mDOMRule;
   // Keep the same type so that MSVC packs them.
   PRUint32                mLineNumber : 31;
   PRUint32                mWasMatched : 1;
+
+private:
+  StyleRule& operator=(const StyleRule& aCopy) MOZ_DELETE;
 };
 
 } // namespace css
 } // namespace mozilla
 
 NS_DEFINE_STATIC_IID_ACCESSOR(mozilla::css::StyleRule, NS_CSS_STYLE_RULE_IMPL_CID)
 
 #endif /* mozilla_css_StyleRule_h__ */
--- a/layout/style/nsCSSParser.h
+++ b/layout/style/nsCSSParser.h
@@ -35,16 +35,18 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* parsing of CSS stylesheets, based on a token stream from the CSS scanner */
 
 #ifndef nsCSSParser_h___
 #define nsCSSParser_h___
 
+#include "mozilla/Attributes.h"
+
 #include "nsAString.h"
 #include "nsCSSProperty.h"
 #include "nsColor.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 
 class nsCSSStyleSheet;
@@ -69,19 +71,18 @@ class NS_STACK_CLASS nsCSSParser {
 public:
   nsCSSParser(mozilla::css::Loader* aLoader = nsnull,
               nsCSSStyleSheet* aSheet = nsnull);
   ~nsCSSParser();
 
   static void Shutdown();
 
 private:
-  // not to be implemented
-  nsCSSParser(nsCSSParser const&);
-  nsCSSParser& operator=(nsCSSParser const&);
+  nsCSSParser(nsCSSParser const&) MOZ_DELETE;
+  nsCSSParser& operator=(nsCSSParser const&) MOZ_DELETE;
 
 public:
   // Set a style sheet for the parser to fill in. The style sheet must
   // implement the nsCSSStyleSheet interface.  Null can be passed in to clear
   // out an existing stylesheet reference.
   nsresult SetStyleSheet(nsCSSStyleSheet* aSheet);
 
   // Set whether or not to emulate Nav quirks
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -35,16 +35,18 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* representation of simple property values within CSS declarations */
 
 #ifndef nsCSSValue_h___
 #define nsCSSValue_h___
 
+#include "mozilla/Attributes.h"
+
 #include "nsCOMPtr.h"
 #include "nsCRTGlue.h"
 #include "nsCSSKeywords.h"
 #include "nsCSSProperty.h"
 #include "nsColor.h"
 #include "nsCoord.h"
 #include "nsString.h"
 #include "nsStringBuffer.h"
@@ -490,19 +492,18 @@ public:
     nsCOMPtr<nsIURI> mReferrer;
     nsCOMPtr<nsIPrincipal> mOriginPrincipal;
 
     NS_INLINE_DECL_REFCOUNTING(nsCSSValue::URL)
 
   private:
     mutable bool mURIResolved;
 
-    // not to be implemented
-    URL(const URL& aOther);
-    URL& operator=(const URL& aOther);
+    URL(const URL& aOther) MOZ_DELETE;
+    URL& operator=(const URL& aOther) MOZ_DELETE;
   };
 
   struct Image : public URL {
     // Not making the constructor and destructor inline because that would
     // force us to include imgIRequest.h, which leads to REQUIRES hell, since
     // this header is included all over.
     // aString must not be null.
     Image(nsIURI* aURI, nsStringBuffer* aString, nsIURI* aReferrer,
@@ -639,19 +640,18 @@ private:
     CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
       val->~nsCSSValue();
     }
   }
 
 #undef CSSVALUE_LIST_FOR_EXTRA_VALUES
 
 private:
-  // not to be implemented
-  Array(const Array& aOther);
-  Array& operator=(const Array& aOther);
+  Array(const Array& aOther) MOZ_DELETE;
+  Array& operator=(const Array& aOther) MOZ_DELETE;
 };
 
 // Prefer nsCSSValue::Array for lists of fixed size.
 struct nsCSSValueList {
   nsCSSValueList() : mNext(nsnull) { MOZ_COUNT_CTOR(nsCSSValueList); }
   ~nsCSSValueList();
 
   nsCSSValueList* Clone() const;  // makes a deep copy
@@ -1068,19 +1068,18 @@ struct nsCSSValueGradient {
   bool operator!=(const nsCSSValueGradient& aOther) const
   {
     return !(*this == aOther);
   }
 
   NS_INLINE_DECL_REFCOUNTING(nsCSSValueGradient)
 
 private:
-  // not to be implemented
-  nsCSSValueGradient(const nsCSSValueGradient& aOther);
-  nsCSSValueGradient& operator=(const nsCSSValueGradient& aOther);
+  nsCSSValueGradient(const nsCSSValueGradient& aOther) MOZ_DELETE;
+  nsCSSValueGradient& operator=(const nsCSSValueGradient& aOther) MOZ_DELETE;
 };
 
 struct nsCSSCornerSizes {
   nsCSSCornerSizes(void);
   nsCSSCornerSizes(const nsCSSCornerSizes& aCopy);
   ~nsCSSCornerSizes();
 
   // argument is a "full corner" constant from nsStyleConsts.h
--- a/layout/style/nsHTMLCSSStyleSheet.h
+++ b/layout/style/nsHTMLCSSStyleSheet.h
@@ -37,16 +37,18 @@
 
 /*
  * style sheet and style rule processor representing style attributes
  */
 
 #ifndef nsHTMLCSSStyleSheet_h_
 #define nsHTMLCSSStyleSheet_h_
 
+#include "mozilla/Attributes.h"
+
 #include "nsIStyleSheet.h"
 #include "nsIStyleRuleProcessor.h"
 
 class nsHTMLCSSStyleSheet : public nsIStyleSheet,
                             public nsIStyleRuleProcessor {
 public:
   nsHTMLCSSStyleSheet();
 
@@ -85,18 +87,17 @@ public:
     HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
   virtual bool MediumFeaturesChanged(nsPresContext* aPresContext);
   virtual NS_MUST_OVERRIDE size_t
     SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
   virtual NS_MUST_OVERRIDE size_t
     SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
 
 private: 
-  // These are not supported and are not implemented! 
-  nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy); 
-  nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy); 
+  nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
+  nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
 
 protected:
   nsCOMPtr<nsIURI> mURL;
   nsIDocument*     mDocument;
 };
 
 #endif /* !defined(nsHTMLCSSStyleSheet_h_) */
--- a/layout/style/nsHTMLStyleSheet.h
+++ b/layout/style/nsHTMLStyleSheet.h
@@ -40,16 +40,18 @@
 /*
  * style sheet and style rule processor representing data from presentational
  * HTML attributes
  */
 
 #ifndef nsHTMLStyleSheet_h_
 #define nsHTMLStyleSheet_h_
 
+#include "mozilla/Attributes.h"
+
 #include "nsIStyleSheet.h"
 #include "nsIStyleRuleProcessor.h"
 #include "nsIStyleRule.h"
 #include "pldhash.h"
 #include "nsCOMPtr.h"
 #include "nsColor.h"
 class nsMappedAttributes;
 
@@ -102,19 +104,18 @@ public:
 
   // Mapped Attribute management methods
   already_AddRefed<nsMappedAttributes>
     UniqueMappedAttributes(nsMappedAttributes* aMapped);
   void DropMappedAttributes(nsMappedAttributes* aMapped);
 
   PRInt64 DOMSizeOf() const;
 private: 
-  // These are not supported and are not implemented! 
-  nsHTMLStyleSheet(const nsHTMLStyleSheet& aCopy); 
-  nsHTMLStyleSheet& operator=(const nsHTMLStyleSheet& aCopy); 
+  nsHTMLStyleSheet(const nsHTMLStyleSheet& aCopy) MOZ_DELETE;
+  nsHTMLStyleSheet& operator=(const nsHTMLStyleSheet& aCopy) MOZ_DELETE;
 
   ~nsHTMLStyleSheet();
 
   class HTMLColorRule;
   friend class HTMLColorRule;
   class HTMLColorRule : public nsIStyleRule {
   public:
     HTMLColorRule() {}
--- a/layout/style/nsStyleSet.h
+++ b/layout/style/nsStyleSet.h
@@ -42,16 +42,18 @@
  * the container for the style sheets that apply to a presentation, and
  * the internal API that the style system exposes for creating (and
  * potentially re-creating) style contexts
  */
 
 #ifndef nsStyleSet_h_
 #define nsStyleSet_h_
 
+#include "mozilla/Attributes.h"
+
 #include "nsIStyleRuleProcessor.h"
 #include "nsCSSStyleSheet.h"
 #include "nsBindingManager.h"
 #include "nsRuleNode.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsAutoPtr.h"
 #include "nsIStyleRule.h"
@@ -316,19 +318,18 @@ class nsStyleSet
     --mUnusedRuleNodeCount;
   }
 
   nsCSSStyleSheet::EnsureUniqueInnerResult EnsureUniqueInnerOnCSSSheets();
 
   nsIStyleRule* InitialStyleRule();
 
  private:
-  // Not to be implemented
-  nsStyleSet(const nsStyleSet& aCopy);
-  nsStyleSet& operator=(const nsStyleSet& aCopy);
+  nsStyleSet(const nsStyleSet& aCopy) MOZ_DELETE;
+  nsStyleSet& operator=(const nsStyleSet& aCopy) MOZ_DELETE;
 
   // Returns false on out-of-memory.
   bool BuildDefaultStyleData(nsPresContext* aPresContext);
 
   // Run mark-and-sweep GC on mRuleTree and mOldRuleTrees, based on mRoots.
   void GCRuleTrees();
 
   // Update the rule processor list after a change to the style sheet list.
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -43,16 +43,18 @@
 /*
  * structs that contain the data provided by nsStyleContext, the
  * internal API for computed style data for an element
  */
 
 #ifndef nsStyleStruct_h___
 #define nsStyleStruct_h___
 
+#include "mozilla/Attributes.h"
+
 #include "nsColor.h"
 #include "nsCoord.h"
 #include "nsMargin.h"
 #include "nsRect.h"
 #include "nsFont.h"
 #include "nsStyleCoord.h"
 #include "nsStyleConsts.h"
 #include "nsChangeHint.h"
@@ -174,19 +176,18 @@ public:
 
   bool IsOpaque();
 
   NS_INLINE_DECL_REFCOUNTING(nsStyleGradient)
 
 private:
   ~nsStyleGradient() {}
 
-  // Not to be implemented
-  nsStyleGradient(const nsStyleGradient& aOther);
-  nsStyleGradient& operator=(const nsStyleGradient& aOther);
+  nsStyleGradient(const nsStyleGradient& aOther) MOZ_DELETE;
+  nsStyleGradient& operator=(const nsStyleGradient& aOther) MOZ_DELETE;
 };
 
 enum nsStyleImageType {
   eStyleImageType_Null,
   eStyleImageType_Image,
   eStyleImageType_Gradient,
   eStyleImageType_Element
 };
@@ -933,17 +934,17 @@ protected:
 private:
   nsCOMPtr<imgIRequest> mBorderImage; // [reset]
 
   // Cache used by callers for border-image painting
   nsCOMArray<imgIContainer> mSubImages;
 
   nscoord       mTwipsPerPixel;
 
-  nsStyleBorder& operator=(const nsStyleBorder& aOther); // Not to be implemented
+  nsStyleBorder& operator=(const nsStyleBorder& aOther) MOZ_DELETE;
 };
 
 
 struct nsStyleOutline {
   nsStyleOutline(nsPresContext* aPresContext);
   nsStyleOutline(const nsStyleOutline& aOutline);
   ~nsStyleOutline(void) {
     MOZ_COUNT_DTOR(nsStyleOutline);
@@ -1059,17 +1060,17 @@ struct nsStyleList {
     if (mListStyleImage)
       mListStyleImage->LockImage();
   }
 
   PRUint8   mListStyleType;             // [inherited] See nsStyleConsts.h
   PRUint8   mListStylePosition;         // [inherited]
 private:
   nsCOMPtr<imgIRequest> mListStyleImage; // [inherited]
-  nsStyleList& operator=(const nsStyleList& aOther); // Not to be implemented
+  nsStyleList& operator=(const nsStyleList& aOther) MOZ_DELETE;
 public:
   nsRect        mImageRegion;           // [inherited] the rect to use within an image
 };
 
 struct nsStylePosition {
   nsStylePosition(void);
   nsStylePosition(const nsStylePosition& aOther);
   ~nsStylePosition(void);
--- a/modules/libjar/nsZipArchive.h
+++ b/modules/libjar/nsZipArchive.h
@@ -38,16 +38,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsZipArchive_h_
 #define nsZipArchive_h_
 
+#include "mozilla/Attributes.h"
+
 #define ZIP_TABSIZE   256
 #define ZIP_BUFLEN    (4*1024)      /* Used as output buffer when deflating items to a file */
 
 #ifndef PL_ARENA_CONST_ALIGN_MASK
 #define PL_ARENA_CONST_ALIGN_MASK  (sizeof(void*)-1)
 #endif
 #include "plarena.h"
 
@@ -245,24 +247,25 @@ private:
   bool          mBuiltSynthetics;
 
   // file handle
   nsRefPtr<nsZipHandle> mFd;
 
   // logging handle
   mozilla::AutoFDClose mLog;
 
+
+private:
   //--- private methods ---
-  
-  nsZipArchive& operator=(const nsZipArchive& rhs); // prevent assignments
-  nsZipArchive(const nsZipArchive& rhs);            // prevent copies
-
   nsZipItem*        CreateZipItem();
   nsresult          BuildFileList();
   nsresult          BuildSynthetics();
+
+  nsZipArchive& operator=(const nsZipArchive& rhs) MOZ_DELETE;
+  nsZipArchive(const nsZipArchive& rhs) MOZ_DELETE;
 };
 
 /** 
  * nsZipFind 
  *
  * a helper class for nsZipArchive, representing a search
  */
 class nsZipFind
@@ -275,19 +278,18 @@ public:
 
 private:
   nsRefPtr<nsZipArchive> mArchive;
   char*         mPattern;
   nsZipItem*    mItem;
   PRUint16      mSlot;
   bool          mRegExp;
 
-  //-- prevent copies and assignments
-  nsZipFind& operator=(const nsZipFind& rhs);
-  nsZipFind(const nsZipFind& rhs);
+  nsZipFind& operator=(const nsZipFind& rhs) MOZ_DELETE;
+  nsZipFind(const nsZipFind& rhs) MOZ_DELETE;
 };
 
 /** 
  * nsZipCursor -- a low-level class for reading the individual items in a zip.
  */
 class nsZipCursor {
 public:
   /**
--- a/security/manager/ssl/src/nsRecentBadCerts.h
+++ b/security/manager/ssl/src/nsRecentBadCerts.h
@@ -35,17 +35,19 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __RECENTBADCERTS_H__
 #define __RECENTBADCERTS_H__
 
+#include "mozilla/Attributes.h"
 #include "mozilla/ReentrantMonitor.h"
+
 #include "nsIRecentBadCertsService.h"
 #include "nsTHashtable.h"
 #include "nsString.h"
 #include "secitem.h"
 
 class RecentBadCert
 {
 public:
@@ -75,27 +77,18 @@ public:
 
   nsString mHostWithPort;
   SECItem mDERCert;
   bool isDomainMismatch;
   bool isNotValidAtThisTime;
   bool isUntrusted;
 
 private:
-  RecentBadCert(const RecentBadCert &other)
-  {
-    NS_NOTREACHED("RecentBadCert(const RecentBadCert &other) not implemented");
-    this->operator=(other);
-  }
-
-  RecentBadCert &operator=(const RecentBadCert &other)
-  {
-    NS_NOTREACHED("RecentBadCert &operator=(const RecentBadCert &other) not implemented");
-    return *this;
-  }
+  RecentBadCert(const RecentBadCert &other) MOZ_DELETE;
+  RecentBadCert &operator=(const RecentBadCert &other) MOZ_DELETE;
 };
 
 class nsRecentBadCertsService : public nsIRecentBadCertsService
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIRECENTBADCERTSSERVICE
 
--- a/xpcom/base/nsAutoRef.h
+++ b/xpcom/base/nsAutoRef.h
@@ -35,16 +35,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsAutoRef_h_
 #define nsAutoRef_h_
 
+#include "mozilla/Attributes.h"
+
 #include "nscore.h" // for nsnull, bool
 
 template <class T> class nsSimpleRef;
 template <class T> class nsAutoRefBase;
 template <class T> class nsReturnRef;
 template <class T> class nsReturningRef;
 
 /**
@@ -637,17 +639,17 @@ protected:
         }
         explicit LocalSimpleRef(RawRef aRawRef)
             : SimpleRef(aRawRef)
         {
         }
     };
 
 private:
-    ThisClass& operator=(const ThisClass& aSmartRef);
+    ThisClass& operator=(const ThisClass& aSmartRef) MOZ_DELETE;
     
 public:
     RawRef operator->() const
     {
         return this->get();
     }
 
     // Transfer ownership to a raw reference.
--- a/xpcom/glue/DeadlockDetector.h
+++ b/xpcom/glue/DeadlockDetector.h
@@ -34,16 +34,18 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #ifndef mozilla_DeadlockDetector_h
 #define mozilla_DeadlockDetector_h
 
+#include "mozilla/Attributes.h"
+
 #include <stdlib.h>
 
 #include "plhash.h"
 #include "prlock.h"
 
 #include "nsTArray.h"
 
 #ifdef NS_TRACE_MALLOC
@@ -561,18 +563,19 @@ public:
 
     /**
      * Protects contentious methods.
      * Nb: can't use mozilla::Mutex since we are used as its deadlock
      * detector.
      */
     PRLock* mLock;
 
-    DeadlockDetector(const DeadlockDetector& aDD);
-    DeadlockDetector& operator=(const DeadlockDetector& aDD);
+private:
+    DeadlockDetector(const DeadlockDetector& aDD) MOZ_DELETE;
+    DeadlockDetector& operator=(const DeadlockDetector& aDD) MOZ_DELETE;
 };
 
 
 template<typename T>
 const PLHashAllocOps DeadlockDetector<T>::kAllocOps = {
     DeadlockDetector<T>::TableAlloc, DeadlockDetector<T>::TableFree,
     DeadlockDetector<T>::EntryAlloc, DeadlockDetector<T>::EntryFree
 };
--- a/xpcom/glue/nsCOMArray.h
+++ b/xpcom/glue/nsCOMArray.h
@@ -34,16 +34,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsCOMArray_h__
 #define nsCOMArray_h__
 
+#include "mozilla/Attributes.h"
+
 #include "nsVoidArray.h"
 #include "nsISupports.h"
 
 // See below for the definition of nsCOMArray<T>
 
 // a class that's nsISupports-specific, so that we can contain the
 // work of this class in the XPCOM dll
 class NS_COM_GLUE nsCOMArray_base
@@ -120,17 +122,17 @@ public:
     }
 
 private:
     
     // the actual storage
     nsVoidArray mArray;
 
     // don't implement these, defaults will muck with refcounts!
-    nsCOMArray_base& operator=(const nsCOMArray_base& other);
+    nsCOMArray_base& operator=(const nsCOMArray_base& other) MOZ_DELETE;
 };
 
 // a non-XPCOM, refcounting array of XPCOM objects
 // used as a member variable or stack variable - this object is NOT
 // refcounted, but the objects that it holds are
 //
 // most of the read-only accessors like ObjectAt()/etc do NOT refcount
 // on the way out. This means that you can do one of two things:
@@ -272,13 +274,13 @@ class nsCOMArray : public nsCOMArray_bas
     // as necessary
     bool RemoveObjectsAt(PRInt32 aIndex, PRInt32 aCount) {
         return nsCOMArray_base::RemoveObjectsAt(aIndex, aCount);
     }
 
 private:
 
     // don't implement these!
-    nsCOMArray<T>& operator=(const nsCOMArray<T>& other);
+    nsCOMArray<T>& operator=(const nsCOMArray<T>& other) MOZ_DELETE;
 };
 
 
 #endif
--- a/xpcom/glue/nsStringAPI.h
+++ b/xpcom/glue/nsStringAPI.h
@@ -45,16 +45,18 @@
 
 #ifdef MOZILLA_INTERNAL_API
 #error nsStringAPI.h is only usable from non-MOZILLA_INTERNAL_API code!
 #endif
 
 #ifndef nsStringAPI_h__
 #define nsStringAPI_h__
 
+#include "mozilla/Attributes.h"
+
 #include "nsXPCOMStrings.h"
 #include "nsISupportsImpl.h"
 #include "prlog.h"
 #include "nsTArray.h"
 
 /**
  * Comparison function for use with nsACString::Equals
  */
@@ -936,17 +938,17 @@ public:
   void Rebind(const char_type* aData, size_type aLength = PR_UINT32_MAX)
   {
     NS_StringContainerFinish(*this);
     NS_StringContainerInit2(*this, aData, aLength,
                             NS_STRING_CONTAINER_INIT_DEPEND);
   }
   
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 class nsDependentCString : public nsCString
 {
 public:
   typedef nsDependentCString        self_type;
 
   nsDependentCString() {}
@@ -959,17 +961,17 @@ public:
   void Rebind(const char_type* aData, size_type aLength = PR_UINT32_MAX)
   {
     NS_CStringContainerFinish(*this);
     NS_CStringContainerInit2(*this, aData, aLength,
                              NS_CSTRING_CONTAINER_INIT_DEPEND);
   }
   
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 
 /**
  * conversion classes
  */
 
 inline void
@@ -1013,17 +1015,17 @@ public:
   explicit
   NS_ConvertASCIItoUTF16(const char* aData, PRUint32 aLength = PR_UINT32_MAX)
   {
     NS_CStringToUTF16(nsDependentCString(aData, aLength),
                       NS_CSTRING_ENCODING_ASCII, *this);
   }
 
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 class NS_ConvertUTF8toUTF16 : public nsString
 {
 public:
   typedef NS_ConvertUTF8toUTF16    self_type;
 
   explicit
@@ -1035,17 +1037,17 @@ public:
   explicit
   NS_ConvertUTF8toUTF16(const char* aData, PRUint32 aLength = PR_UINT32_MAX)
   {
     NS_CStringToUTF16(nsDependentCString(aData, aLength),
                       NS_CSTRING_ENCODING_UTF8, *this);
   }
 
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 class NS_ConvertUTF16toUTF8 : public nsCString
 {
 public:
   typedef NS_ConvertUTF16toUTF8    self_type;
 
   explicit
@@ -1057,17 +1059,17 @@ public:
   explicit
   NS_ConvertUTF16toUTF8(const PRUnichar* aData, PRUint32 aLength = PR_UINT32_MAX)
   {
     NS_UTF16ToCString(nsDependentString(aData, aLength),
                       NS_CSTRING_ENCODING_UTF8, *this);
   }
 
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 class NS_LossyConvertUTF16toASCII : public nsCString
 {
 public:
   typedef NS_LossyConvertUTF16toASCII    self_type;
 
   explicit
@@ -1079,17 +1081,17 @@ public:
   explicit
   NS_LossyConvertUTF16toASCII(const PRUnichar* aData, PRUint32 aLength = PR_UINT32_MAX)
   {
     NS_UTF16ToCString(nsDependentString(aData, aLength),
                       NS_CSTRING_ENCODING_ASCII, *this);
   }
 
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 
 /**
  * literal strings
  *
  * NOTE: HAVE_CPP_2BYTE_WCHAR_T may be automatically defined for some platforms
  * in nscore.h.  On other platforms, it may be defined in xpcom-config.h.
@@ -1251,17 +1253,17 @@ public:
   {
     NS_StringContainerFinish(*this);
     NS_StringContainerInit2(*this, aStart, aLength,
                             NS_STRING_CONTAINER_INIT_DEPEND |
                             NS_STRING_CONTAINER_INIT_SUBSTRING);
   }
 
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 class NS_COM_GLUE nsDependentCSubstring : public nsCStringContainer
 {
 public:
   typedef nsDependentCSubstring self_type;
   typedef nsACString            abstract_string_type;
 
@@ -1291,17 +1293,17 @@ public:
   {
     NS_CStringContainerFinish(*this);
     NS_CStringContainerInit2(*this, aStart, aLength,
                              NS_CSTRING_CONTAINER_INIT_DEPEND |
                              NS_CSTRING_CONTAINER_INIT_SUBSTRING);
   }
 
 private:
-  self_type& operator=(const self_type& aString); // NOT IMPLEMENTED
+  self_type& operator=(const self_type& aString) MOZ_DELETE;
 };
 
 
 /**
  * Various nsDependentC?Substring constructor functions
  */
 
 // PRUnichar
--- a/xpcom/string/public/nsString.h
+++ b/xpcom/string/public/nsString.h
@@ -34,16 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsString_h___
 #define nsString_h___
 
+#include "mozilla/Attributes.h"
 
 #ifndef nsSubstring_h___
 #include "nsSubstring.h"
 #endif
 
 #ifndef nsDependentSubstring_h___
 #include "nsDependentSubstring.h"
 #endif
--- a/xpcom/string/public/nsTString.h
+++ b/xpcom/string/public/nsTString.h
@@ -692,13 +692,12 @@ class nsTAdoptingString_CharT : public n
       self_type& operator=( const substring_tuple_type& tuple )                                 { Assign(tuple);    return *this; }
 
         // Adopt(), if possible, when assigning to a self_type&. Note
         // that this violates the constness of str, str is always
         // truncated when this operator is called.
       self_type& operator=( const self_type& str );
 
     private:
-        // NOT TO BE IMPLEMENTED.
-      self_type& operator=( const char_type* data );
-      self_type& operator=( char_type* data );
+      self_type& operator=( const char_type* data ) MOZ_DELETE;
+      self_type& operator=( char_type* data ) MOZ_DELETE;
   };