diff --git a/content/base/src/nsAttrAndChildArray.h b/content/base/src/nsAttrAndChildArray.h index 983d87e28025..a3e66c1e4012 100644 --- a/content/base/src/nsAttrAndChildArray.h +++ b/content/base/src/nsAttrAndChildArray.h @@ -44,6 +44,8 @@ #ifndef nsAttrAndChildArray_h___ #define nsAttrAndChildArray_h___ +#include "mozilla/Attributes.h" + #include "nscore.h" #include "nsAttrName.h" #include "nsAttrValue.h" @@ -136,8 +138,8 @@ public: 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(); diff --git a/gfx/thebes/gfxQuartzNativeDrawing.h b/gfx/thebes/gfxQuartzNativeDrawing.h index 5203800c5b91..321d73de227e 100644 --- a/gfx/thebes/gfxQuartzNativeDrawing.h +++ b/gfx/thebes/gfxQuartzNativeDrawing.h @@ -38,6 +38,8 @@ #ifndef _GFXQUARTZNATIVEDRAWING_H_ #define _GFXQUARTZNATIVEDRAWING_H_ +#include "mozilla/Attributes.h" + #include "gfxContext.h" #include "gfxQuartzSurface.h" @@ -71,8 +73,8 @@ public: 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 mContext; diff --git a/js/public/Vector.h b/js/public/Vector.h index d5022d5471ad..96e455e93101 100644 --- a/js/public/Vector.h +++ b/js/public/Vector.h @@ -41,6 +41,8 @@ #ifndef jsvector_h_ #define jsvector_h_ +#include "mozilla/Attributes.h" + #include "TemplateLib.h" #include "Utility.h" @@ -274,8 +276,8 @@ class Vector : private AllocPolicy bool entered; #endif - Vector(const Vector &); - Vector &operator=(const Vector &); + Vector(const Vector &) MOZ_DELETE; + Vector &operator=(const Vector &) MOZ_DELETE; /* private accessors */ diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index e5a96326a430..3c5681361ccc 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -41,6 +41,8 @@ #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 @@ -181,8 +183,8 @@ class LifoAlloc 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| diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h index d188c69e1358..59550280ccdf 100644 --- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -40,6 +40,8 @@ #ifndef jscompartment_h___ #define jscompartment_h___ +#include "mozilla/Attributes.h" + #include "jsclist.h" #include "jscntxt.h" #include "jsfun.h" @@ -469,9 +471,8 @@ class AutoCompartment void leave(); private: - // Prohibit copying. - AutoCompartment(const AutoCompartment &); - AutoCompartment & operator=(const AutoCompartment &); + AutoCompartment(const AutoCompartment &) MOZ_DELETE; + AutoCompartment & operator=(const AutoCompartment &) MOZ_DELETE; }; /* diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index fcbece278eb4..cde6abdd21fe 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -42,6 +42,8 @@ #ifndef Debugger_h__ #define Debugger_h__ +#include "mozilla/Attributes.h" + #include "jsapi.h" #include "jsclist.h" #include "jscntxt.h" @@ -348,9 +350,8 @@ class Debugger { 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 { diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 21da8900d188..eb1ab67ab946 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -41,6 +41,8 @@ * * ***** END LICENSE BLOCK ***** */ +#include "mozilla/Attributes.h" + #ifdef MOZ_LOGGING #define FORCE_PR_LOG #endif @@ -319,8 +321,8 @@ private: 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; }; @@ -334,9 +336,9 @@ public: 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 diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 5ea2ff9ea9f0..38a43819e5d3 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -46,6 +46,8 @@ #ifndef xpcprivate_h___ #define xpcprivate_h___ +#include "mozilla/Attributes.h" + #include #include #include @@ -4024,8 +4026,8 @@ private: 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; }; /***************************************************************************/ diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 5768405dd81c..db13977c23ff 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -43,6 +43,8 @@ #ifndef nsCSSFrameConstructor_h___ #define nsCSSFrameConstructor_h___ +#include "mozilla/Attributes.h" + #include "nsCOMPtr.h" #include "nsILayoutHistoryState.h" #include "nsIXBLService.h" @@ -102,10 +104,9 @@ public: 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! diff --git a/layout/base/nsStyleChangeList.h b/layout/base/nsStyleChangeList.h index 0d1b1492f4e0..1a777cb6e35a 100644 --- a/layout/base/nsStyleChangeList.h +++ b/layout/base/nsStyleChangeList.h @@ -43,6 +43,8 @@ #ifndef nsStyleChangeList_h___ #define nsStyleChangeList_h___ +#include "mozilla/Attributes.h" + #include "nsError.h" #include "nsChangeHint.h" @@ -95,7 +97,7 @@ protected: nsStyleChangeData mBuffer[kStyleChangeBufferSize]; private: - nsStyleChangeList(const nsStyleChangeList&); // not implemented + nsStyleChangeList(const nsStyleChangeList&) MOZ_DELETE; }; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index d852c9aba541..9ed608ae006c 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -42,6 +42,7 @@ /* base class of all rendering objects */ +#include "mozilla/Attributes.h" #include "mozilla/Util.h" #include "nsCOMPtr.h" @@ -8074,7 +8075,7 @@ struct DR_FrameTypeInfo char mName[32]; nsTArray mRules; private: - DR_FrameTypeInfo& operator=(const DR_FrameTypeInfo&); // NOT USED + DR_FrameTypeInfo& operator=(const DR_FrameTypeInfo&) MOZ_DELETE; }; DR_FrameTypeInfo::DR_FrameTypeInfo(nsIAtom* aFrameType, diff --git a/layout/printing/nsPrintData.h b/layout/printing/nsPrintData.h index 1c795a9bfa74..4b4272b8dca0 100644 --- a/layout/printing/nsPrintData.h +++ b/layout/printing/nsPrintData.h @@ -34,9 +34,12 @@ * 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" @@ -123,8 +126,8 @@ public: 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; }; diff --git a/layout/printing/nsPrintEngine.h b/layout/printing/nsPrintEngine.h index 6c600f77ff0f..92b5c5f2e0c9 100644 --- a/layout/printing/nsPrintEngine.h +++ b/layout/printing/nsPrintEngine.h @@ -37,6 +37,8 @@ #ifndef nsPrintEngine_h___ #define nsPrintEngine_h___ +#include "mozilla/Attributes.h" + #include "nsCOMPtr.h" #include "nsPrintObject.h" @@ -298,8 +300,7 @@ protected: FILE* mDebugFile; private: - nsPrintEngine& operator=(const nsPrintEngine& aOther); // not implemented - + nsPrintEngine& operator=(const nsPrintEngine& aOther) MOZ_DELETE; }; #endif /* nsPrintEngine_h___ */ diff --git a/layout/printing/nsPrintObject.h b/layout/printing/nsPrintObject.h index 16d3d2d0ca14..3e8e2013448f 100644 --- a/layout/printing/nsPrintObject.h +++ b/layout/printing/nsPrintObject.h @@ -37,6 +37,8 @@ #ifndef nsPrintObject_h___ #define nsPrintObject_h___ +#include "mozilla/Attributes.h" + // Interfaces #include "nsCOMPtr.h" #include "nsIContent.h" @@ -94,8 +96,7 @@ public: float mZoomRatio; private: - nsPrintObject& operator=(const nsPrintObject& aOther); // not implemented - + nsPrintObject& operator=(const nsPrintObject& aOther) MOZ_DELETE; }; diff --git a/layout/style/Declaration.h b/layout/style/Declaration.h index b5160f4a0f28..deee16d816f9 100644 --- a/layout/style/Declaration.h +++ b/layout/style/Declaration.h @@ -44,6 +44,8 @@ #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 @@ -239,9 +241,8 @@ public: #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) diff --git a/layout/style/StyleRule.h b/layout/style/StyleRule.h index da1b1c64af43..20c3c0677aec 100644 --- a/layout/style/StyleRule.h +++ b/layout/style/StyleRule.h @@ -45,6 +45,8 @@ #ifndef mozilla_css_StyleRule_h__ #define mozilla_css_StyleRule_h__ +#include "mozilla/Attributes.h" + //#include #include "mozilla/css/Rule.h" #include "nsString.h" @@ -72,9 +74,8 @@ public: 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 { @@ -109,9 +110,8 @@ public: 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] @@ -146,9 +146,8 @@ public: 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 { @@ -235,9 +234,9 @@ public: 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; }; /** @@ -277,9 +276,8 @@ struct nsCSSSelectorList { 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 @@ -381,10 +379,6 @@ public: 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(); @@ -396,6 +390,9 @@ private: // 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 diff --git a/layout/style/nsCSSParser.h b/layout/style/nsCSSParser.h index af399f00cf7f..d7888cc83594 100644 --- a/layout/style/nsCSSParser.h +++ b/layout/style/nsCSSParser.h @@ -40,6 +40,8 @@ #ifndef nsCSSParser_h___ #define nsCSSParser_h___ +#include "mozilla/Attributes.h" + #include "nsAString.h" #include "nsCSSProperty.h" #include "nsColor.h" @@ -74,9 +76,8 @@ public: 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 diff --git a/layout/style/nsCSSValue.h b/layout/style/nsCSSValue.h index f91493f6e625..3fe4cc755245 100644 --- a/layout/style/nsCSSValue.h +++ b/layout/style/nsCSSValue.h @@ -40,6 +40,8 @@ #ifndef nsCSSValue_h___ #define nsCSSValue_h___ +#include "mozilla/Attributes.h" + #include "nsCOMPtr.h" #include "nsCRTGlue.h" #include "nsCSSKeywords.h" @@ -495,9 +497,8 @@ public: 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 { @@ -644,9 +645,8 @@ private: #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. @@ -1073,9 +1073,8 @@ struct nsCSSValueGradient { 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 { diff --git a/layout/style/nsHTMLCSSStyleSheet.h b/layout/style/nsHTMLCSSStyleSheet.h index 229bfe473acb..380decff0b3f 100644 --- a/layout/style/nsHTMLCSSStyleSheet.h +++ b/layout/style/nsHTMLCSSStyleSheet.h @@ -42,6 +42,8 @@ #ifndef nsHTMLCSSStyleSheet_h_ #define nsHTMLCSSStyleSheet_h_ +#include "mozilla/Attributes.h" + #include "nsIStyleSheet.h" #include "nsIStyleRuleProcessor.h" @@ -90,9 +92,8 @@ public: 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 mURL; diff --git a/layout/style/nsHTMLStyleSheet.h b/layout/style/nsHTMLStyleSheet.h index 1213aa1a0986..91b7bbde7c66 100644 --- a/layout/style/nsHTMLStyleSheet.h +++ b/layout/style/nsHTMLStyleSheet.h @@ -45,6 +45,8 @@ #ifndef nsHTMLStyleSheet_h_ #define nsHTMLStyleSheet_h_ +#include "mozilla/Attributes.h" + #include "nsIStyleSheet.h" #include "nsIStyleRuleProcessor.h" #include "nsIStyleRule.h" @@ -107,9 +109,8 @@ public: 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(); diff --git a/layout/style/nsStyleSet.h b/layout/style/nsStyleSet.h index 783928430dca..a08ba721fcd3 100644 --- a/layout/style/nsStyleSet.h +++ b/layout/style/nsStyleSet.h @@ -47,6 +47,8 @@ #ifndef nsStyleSet_h_ #define nsStyleSet_h_ +#include "mozilla/Attributes.h" + #include "nsIStyleRuleProcessor.h" #include "nsCSSStyleSheet.h" #include "nsBindingManager.h" @@ -321,9 +323,8 @@ class nsStyleSet 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); diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index d8114caec12c..4384ea26e1f3 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -48,6 +48,8 @@ #ifndef nsStyleStruct_h___ #define nsStyleStruct_h___ +#include "mozilla/Attributes.h" + #include "nsColor.h" #include "nsCoord.h" #include "nsMargin.h" @@ -179,9 +181,8 @@ public: 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 { @@ -938,7 +939,7 @@ private: nscoord mTwipsPerPixel; - nsStyleBorder& operator=(const nsStyleBorder& aOther); // Not to be implemented + nsStyleBorder& operator=(const nsStyleBorder& aOther) MOZ_DELETE; }; @@ -1064,7 +1065,7 @@ struct nsStyleList { PRUint8 mListStylePosition; // [inherited] private: nsCOMPtr 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 }; diff --git a/modules/libjar/nsZipArchive.h b/modules/libjar/nsZipArchive.h index e21ec9c0c71a..51a98a58c591 100644 --- a/modules/libjar/nsZipArchive.h +++ b/modules/libjar/nsZipArchive.h @@ -43,6 +43,8 @@ #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 */ @@ -250,14 +252,15 @@ private: // logging handle mozilla::AutoFDClose mLog; - //--- private methods --- - - nsZipArchive& operator=(const nsZipArchive& rhs); // prevent assignments - nsZipArchive(const nsZipArchive& rhs); // prevent copies +private: + //--- private methods --- nsZipItem* CreateZipItem(); nsresult BuildFileList(); nsresult BuildSynthetics(); + + nsZipArchive& operator=(const nsZipArchive& rhs) MOZ_DELETE; + nsZipArchive(const nsZipArchive& rhs) MOZ_DELETE; }; /** @@ -280,9 +283,8 @@ private: 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; }; /** diff --git a/security/manager/ssl/src/nsRecentBadCerts.h b/security/manager/ssl/src/nsRecentBadCerts.h index 1d38c41483a1..fde7154134ee 100644 --- a/security/manager/ssl/src/nsRecentBadCerts.h +++ b/security/manager/ssl/src/nsRecentBadCerts.h @@ -40,7 +40,9 @@ #ifndef __RECENTBADCERTS_H__ #define __RECENTBADCERTS_H__ +#include "mozilla/Attributes.h" #include "mozilla/ReentrantMonitor.h" + #include "nsIRecentBadCertsService.h" #include "nsTHashtable.h" #include "nsString.h" @@ -80,17 +82,8 @@ public: 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 diff --git a/xpcom/base/nsAutoRef.h b/xpcom/base/nsAutoRef.h index 3c344f4ffb6e..f211372f72d5 100644 --- a/xpcom/base/nsAutoRef.h +++ b/xpcom/base/nsAutoRef.h @@ -40,6 +40,8 @@ #ifndef nsAutoRef_h_ #define nsAutoRef_h_ +#include "mozilla/Attributes.h" + #include "nscore.h" // for nsnull, bool template class nsSimpleRef; @@ -642,7 +644,7 @@ protected: }; private: - ThisClass& operator=(const ThisClass& aSmartRef); + ThisClass& operator=(const ThisClass& aSmartRef) MOZ_DELETE; public: RawRef operator->() const diff --git a/xpcom/glue/DeadlockDetector.h b/xpcom/glue/DeadlockDetector.h index 0f9e3abaa6ee..cfcfd4044930 100644 --- a/xpcom/glue/DeadlockDetector.h +++ b/xpcom/glue/DeadlockDetector.h @@ -39,6 +39,8 @@ #ifndef mozilla_DeadlockDetector_h #define mozilla_DeadlockDetector_h +#include "mozilla/Attributes.h" + #include #include "plhash.h" @@ -566,8 +568,9 @@ public: */ 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; }; diff --git a/xpcom/glue/nsCOMArray.h b/xpcom/glue/nsCOMArray.h index 76810d3c1032..35941c3a3097 100644 --- a/xpcom/glue/nsCOMArray.h +++ b/xpcom/glue/nsCOMArray.h @@ -39,6 +39,8 @@ #ifndef nsCOMArray_h__ #define nsCOMArray_h__ +#include "mozilla/Attributes.h" + #include "nsVoidArray.h" #include "nsISupports.h" @@ -125,7 +127,7 @@ private: 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 @@ -277,7 +279,7 @@ class nsCOMArray : public nsCOMArray_base private: // don't implement these! - nsCOMArray& operator=(const nsCOMArray& other); + nsCOMArray& operator=(const nsCOMArray& other) MOZ_DELETE; }; diff --git a/xpcom/glue/nsStringAPI.h b/xpcom/glue/nsStringAPI.h index 95987337ed78..8f88125cfb99 100644 --- a/xpcom/glue/nsStringAPI.h +++ b/xpcom/glue/nsStringAPI.h @@ -50,6 +50,8 @@ #ifndef nsStringAPI_h__ #define nsStringAPI_h__ +#include "mozilla/Attributes.h" + #include "nsXPCOMStrings.h" #include "nsISupportsImpl.h" #include "prlog.h" @@ -941,7 +943,7 @@ public: } private: - self_type& operator=(const self_type& aString); // NOT IMPLEMENTED + self_type& operator=(const self_type& aString) MOZ_DELETE; }; class nsDependentCString : public nsCString @@ -964,7 +966,7 @@ public: } private: - self_type& operator=(const self_type& aString); // NOT IMPLEMENTED + self_type& operator=(const self_type& aString) MOZ_DELETE; }; @@ -1018,7 +1020,7 @@ public: } private: - self_type& operator=(const self_type& aString); // NOT IMPLEMENTED + self_type& operator=(const self_type& aString) MOZ_DELETE; }; class NS_ConvertUTF8toUTF16 : public nsString @@ -1040,7 +1042,7 @@ public: } private: - self_type& operator=(const self_type& aString); // NOT IMPLEMENTED + self_type& operator=(const self_type& aString) MOZ_DELETE; }; class NS_ConvertUTF16toUTF8 : public nsCString @@ -1062,7 +1064,7 @@ public: } private: - self_type& operator=(const self_type& aString); // NOT IMPLEMENTED + self_type& operator=(const self_type& aString) MOZ_DELETE; }; class NS_LossyConvertUTF16toASCII : public nsCString @@ -1084,7 +1086,7 @@ public: } private: - self_type& operator=(const self_type& aString); // NOT IMPLEMENTED + self_type& operator=(const self_type& aString) MOZ_DELETE; }; @@ -1256,7 +1258,7 @@ public: } 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 @@ -1296,7 +1298,7 @@ public: } private: - self_type& operator=(const self_type& aString); // NOT IMPLEMENTED + self_type& operator=(const self_type& aString) MOZ_DELETE; }; diff --git a/xpcom/string/public/nsString.h b/xpcom/string/public/nsString.h index 34bacf3fc587..38c7d7ff42da 100644 --- a/xpcom/string/public/nsString.h +++ b/xpcom/string/public/nsString.h @@ -39,6 +39,7 @@ #ifndef nsString_h___ #define nsString_h___ +#include "mozilla/Attributes.h" #ifndef nsSubstring_h___ #include "nsSubstring.h" diff --git a/xpcom/string/public/nsTString.h b/xpcom/string/public/nsTString.h index ee73c6a7dce4..35b6bf88ac60 100644 --- a/xpcom/string/public/nsTString.h +++ b/xpcom/string/public/nsTString.h @@ -697,8 +697,7 @@ class nsTAdoptingString_CharT : public nsTXPIDLString_CharT 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; };