author | Joshua Cranmer <Pidgeot18@gmail.com> |
Sat, 23 Mar 2013 21:14:43 -0500 | |
changeset 137259 | 4d7684259549a9e5dda78b3f45f95e7f46014af9 |
parent 137258 | 9dfc8698edd08ea77c193b4ffe69ec8421983559 |
child 137260 | 275cd395f9fadaa42da633e20780d39193d817db |
push id | 336 |
push user | akeybl@mozilla.com |
push date | Mon, 17 Jun 2013 22:53:19 +0000 |
treeherder | mozilla-release@574a39cdf657 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Waldo |
bugs | 767563 |
milestone | 22.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
|
--- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -2937,20 +2937,20 @@ public: gfxFloat mPartWidth; bool mClipBeforePart; bool mClipAfterPart; }; // return storage used by this run, for memory reporter; // nsTransformedTextRun needs to override this as it holds additional data - virtual NS_MUST_OVERRIDE size_t - SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf); - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf); + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) + MOZ_MUST_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + MOZ_MUST_OVERRIDE; // Get the size, if it hasn't already been gotten, marking as it goes. size_t MaybeSizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) { if (mFlags & gfxTextRunFactory::TEXT_RUN_SIZE_ACCOUNTED) { return 0; } mFlags |= gfxTextRunFactory::TEXT_RUN_SIZE_ACCOUNTED; return SizeOfIncludingThis(aMallocSizeOf);
--- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -82,18 +82,18 @@ // Frame allocation boilerplate macros. Every subclass of nsFrame // must define its own operator new and GetAllocatedSize. If they do // not, the per-frame recycler lists in nsPresArena will not work // correctly, with potentially catastrophic consequences (not enough // memory is allocated for a frame object). #define NS_DECL_FRAMEARENA_HELPERS \ - NS_MUST_OVERRIDE void* operator new(size_t, nsIPresShell*); \ - virtual NS_MUST_OVERRIDE nsQueryFrame::FrameIID GetFrameId(); + void* operator new(size_t, nsIPresShell*) MOZ_MUST_OVERRIDE; \ + virtual nsQueryFrame::FrameIID GetFrameId() MOZ_MUST_OVERRIDE; #define NS_IMPL_FRAMEARENA_HELPERS(class) \ void* class::operator new(size_t sz, nsIPresShell* aShell) \ { return aShell->AllocateFrame(nsQueryFrame::class##_id, sz); } \ nsQueryFrame::FrameIID class::GetFrameId() \ { return nsQueryFrame::class##_id; } //----------------------------------------------------------------------
--- a/layout/generic/nsTextRunTransformations.h +++ b/layout/generic/nsTextRunTransformations.h @@ -97,18 +97,18 @@ public: { if (mNeedsRebuild) { mNeedsRebuild = false; mFactory->RebuildTextRun(this, aRefContext); } } // override the gfxTextRun impls to account for additional members here - virtual NS_MUST_OVERRIDE size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf); - virtual NS_MUST_OVERRIDE size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf); + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) MOZ_MUST_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) MOZ_MUST_OVERRIDE; nsTransformingTextRunFactory *mFactory; nsTArray<nsRefPtr<nsStyleContext> > mStyles; nsTArray<bool> mCapitalize; nsString mString; bool mOwnsFactory; bool mNeedsRebuild;
--- a/layout/style/AnimationCommon.h +++ b/layout/style/AnimationCommon.h @@ -37,20 +37,20 @@ public: NS_DECL_ISUPPORTS // nsIStyleRuleProcessor (parts) virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData); virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; virtual nsRestyleHint HasAttributeDependentStyle(AttributeRuleProcessorData* aData) MOZ_OVERRIDE; virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; /** * Notify the manager that the pres context is going away. */ void Disconnect(); enum FlushFlags { Can_Throttle,
--- a/layout/style/GroupRule.h +++ b/layout/style/GroupRule.h @@ -62,20 +62,19 @@ public: */ nsresult DeleteStyleRuleAt(uint32_t aIndex); nsresult InsertStyleRuleAt(uint32_t aIndex, Rule* aRule); nsresult ReplaceStyleRule(Rule *aOld, Rule *aNew); virtual bool UseForPresentation(nsPresContext* aPresContext, nsMediaQueryResultCacheKey& aKey) = 0; - NS_MUST_OVERRIDE size_t // non-virtual -- it is only called by subclasses - SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const; - virtual size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const = 0; + // non-virtual -- it is only called by subclasses + size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const = 0; protected: // to help implement nsIDOMCSSRule nsresult AppendRulesToCssText(nsAString& aCssText); // to implement common methods on nsIDOMCSSMediaRule and // nsIDOMCSSMozDocumentRule nsresult GetCssRules(nsIDOMCSSRuleList* *aRuleList);
--- a/layout/style/NameSpaceRule.h +++ b/layout/style/NameSpaceRule.h @@ -47,18 +47,18 @@ public: // Rule methods virtual int32_t GetType() const; virtual already_AddRefed<Rule> Clone() const; nsIAtom* GetPrefix() const { return mPrefix; } void GetURLSpec(nsString& aURLSpec) const { aURLSpec = mURLSpec; } - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const + MOZ_MUST_OVERRIDE; // nsIDOMCSSRule interface NS_DECL_NSIDOMCSSRULE private: nsCOMPtr<nsIAtom> mPrefix; nsString mURLSpec; };
--- a/layout/style/Rule.h +++ b/layout/style/Rule.h @@ -105,18 +105,18 @@ public: virtual nsIDOMCSSRule* GetExistingDOMRule() = 0; // to implement methods on nsIDOMCSSRule nsresult GetParentRule(nsIDOMCSSRule** aParentRule); nsresult GetParentStyleSheet(nsIDOMCSSStyleSheet** aSheet); // This is pure virtual because all of Rule's data members are non-owning and // thus measured elsewhere. - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const = 0; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE = 0; // This is used to measure nsCOMArray<Rule>s. static size_t SizeOfCOMArrayElementIncludingThis(css::Rule* aElement, nsMallocSizeOfFun aMallocSizeOf, void* aData); protected: // This is either an nsCSSStyleSheet* or a nsHTMLStyleSheet*. The former
--- a/layout/style/nsAnimationManager.h +++ b/layout/style/nsAnimationManager.h @@ -217,20 +217,20 @@ public: // nsIStyleRuleProcessor (parts) virtual void RulesMatching(ElementRuleProcessorData* aData) MOZ_OVERRIDE; virtual void RulesMatching(PseudoElementRuleProcessorData* aData) MOZ_OVERRIDE; virtual void RulesMatching(AnonBoxRuleProcessorData* aData) MOZ_OVERRIDE; #ifdef MOZ_XUL virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE; #endif - virtual NS_MUST_OVERRIDE size_t - SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; // nsARefreshObserver virtual void WillRefresh(mozilla::TimeStamp aTime) MOZ_OVERRIDE; void FlushAnimations(FlushFlags aFlags); /** * Return the style rule that RulesMatching should add for
--- a/layout/style/nsCSSRuleProcessor.h +++ b/layout/style/nsCSSRuleProcessor.h @@ -107,20 +107,20 @@ public: virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; virtual nsRestyleHint HasAttributeDependentStyle(AttributeRuleProcessorData* aData) MOZ_OVERRIDE; virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfExcludingThis(nsMallocSizeOfFun mallocSizeOf) const MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf) const MOZ_OVERRIDE; + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun mallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; // Append all the currently-active font face rules to aArray. Return // true for success and false for failure. bool AppendFontFaceRules(nsPresContext* aPresContext, nsTArray<nsFontFaceRuleContainer>& aArray); bool AppendKeyframesRules(nsPresContext* aPresContext, nsTArray<nsCSSKeyframesRule*>& aArray);
--- a/layout/style/nsCSSRules.h +++ b/layout/style/nsCSSRules.h @@ -84,18 +84,18 @@ public: // rest of GroupRule virtual bool UseForPresentation(nsPresContext* aPresContext, nsMediaQueryResultCacheKey& aKey); // @media rule methods nsresult SetMedia(nsMediaList* aMedia); - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE; protected: void AppendConditionText(nsAString& aOutput); nsRefPtr<nsMediaList> mMedia; }; class DocumentRule MOZ_FINAL : public GroupRule, @@ -162,18 +162,18 @@ public: , next(aOther.next ? new URL(*aOther.next) : nullptr) { } ~URL(); }; void SetURLs(URL *aURLs) { mURLs = aURLs; } - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE; protected: void AppendConditionText(nsAString& aOutput); nsAutoPtr<URL> mURLs; // linked list of |struct URL| above. }; } // namespace css
--- a/layout/style/nsHTMLCSSStyleSheet.h +++ b/layout/style/nsHTMLCSSStyleSheet.h @@ -54,20 +54,20 @@ public: #ifdef MOZ_XUL virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE; #endif virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; virtual nsRestyleHint HasAttributeDependentStyle(AttributeRuleProcessorData* aData) MOZ_OVERRIDE; virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; void CacheStyleAttr(const nsAString& aSerialized, MiscContainer* aValue); void EvictStyleAttr(const nsAString& aSerialized, MiscContainer* aValue); MiscContainer* LookupStyleAttr(const nsAString& aSerialized); private: nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE; nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
--- a/layout/style/nsHTMLStyleSheet.h +++ b/layout/style/nsHTMLStyleSheet.h @@ -55,20 +55,20 @@ public: #ifdef MOZ_XUL virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE; #endif virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; virtual nsRestyleHint HasAttributeDependentStyle(AttributeRuleProcessorData* aData) MOZ_OVERRIDE; virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) + const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; size_t DOMSizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const; void Reset(nsIURI* aURL); nsresult SetLinkColor(nscolor aColor); nsresult SetActiveLinkColor(nscolor aColor); nsresult SetVisitedLinkColor(nscolor aColor); // Mapped Attribute management methods
--- a/layout/style/nsTransitionManager.h +++ b/layout/style/nsTransitionManager.h @@ -165,20 +165,20 @@ public: // nsIStyleRuleProcessor (parts) virtual void RulesMatching(ElementRuleProcessorData* aData) MOZ_OVERRIDE; virtual void RulesMatching(PseudoElementRuleProcessorData* aData) MOZ_OVERRIDE; virtual void RulesMatching(AnonBoxRuleProcessorData* aData) MOZ_OVERRIDE; #ifdef MOZ_XUL virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE; #endif - virtual NS_MUST_OVERRIDE size_t - SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; - virtual NS_MUST_OVERRIDE size_t - SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE; + virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const + MOZ_MUST_OVERRIDE MOZ_OVERRIDE; + virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const + MOZ_MUST_OVERRIDE MOZ_OVERRIDE; // nsARefreshObserver virtual void WillRefresh(mozilla::TimeStamp aTime) MOZ_OVERRIDE; void FlushTransitions(FlushFlags aFlags); // Performs a 'mini-flush' to make styles from throttled transitions // up-to-date prior to processing an unrelated style change, so that
--- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -314,11 +314,69 @@ * MOZ_WARN_UNUSED_RESULT int foo() { return 42; } */ #if defined(__GNUC__) || defined(__clang__) # define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) #else # define MOZ_WARN_UNUSED_RESULT #endif +/* + * The following macros are attributes that support the static analysis plugin + * included with Mozilla, and will be implemented (when such support is enabled) + * as C++11 attributes. Since such attributes are legal pretty much everywhere + * and have subtly different semantics depending on their placement, the + * following is a guide on where to place the attributes. + * + * Attributes that apply to a struct or class precede the name of the class: + * (Note that this is different from the placement of MOZ_FINAL for classes!) + * + * class MOZ_CLASS_ATTRIBUTE SomeClass {}; + * + * Attributes that apply to functions follow the parentheses and const + * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body: + * + * void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE; + * void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {} + * void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0; + * void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE; + * + * Attributes that apply to variables or parameters follow the variable's name: + * + * int variable MOZ_VARIABLE_ATTRIBUTE; + * + * Attributes that apply to types follow the type name: + * + * typedef int MOZ_TYPE_ATTRIBUTE MagicInt; + * int MOZ_TYPE_ATTRIBUTE someVariable; + * int * MOZ_TYPE_ATTRIBUTE magicPtrInt; + * int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt; + * + * Attributes that apply to statements precede the statement: + * + * MOZ_IF_ATTRIBUTE if (x == 0) + * MOZ_DO_ATTRIBUTE do { } while(0); + * + * Attributes that apply to labels precede the label: + * + * MOZ_LABEL_ATTRIBUTE target: + * goto target; + * MOZ_CASE_ATTRIBUTE case 5: + * MOZ_DEFAULT_ATTRIBUTE default: + * + * The static analyses that are performed by the plugin are as follows: + * + * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate + * subclasses must provide an exact override of this method; if a subclass + * does not override this method, the compiler will emit an error. This + * attribute is not limited to virtual methods, so if it is applied to a + * nonvirtual method and the subclass does not provide an equivalent + * definition, the compiler will emit an error. + */ +#ifdef MOZ_CLANG_PLUGIN +# define MOZ_MUST_OVERRIDE __attribute__((annotate("moz_must_override"))) +#else +# define MOZ_MUST_OVERRIDE /* nothing */ +#endif /* MOZ_CLANG_PLUGIN */ + #endif /* __cplusplus */ #endif /* mozilla_Attributes_h_ */
--- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -372,38 +372,25 @@ typedef uint32_t nsrefcnt; #if defined(HAVE_THREAD_TLS_KEYWORD) #define NS_TLS __thread #endif /** * Static type annotations, enforced when static-checking is enabled: * * NS_STACK_CLASS: a class which must only be instantiated on the stack - * - * NS_MUST_OVERRIDE: - * a method which every immediate subclass of this class must - * override. A subclass override can itself be NS_MUST_OVERRIDE, in - * which case its own subclasses must override the method as well. - * - * This is similar to, but not the same as, marking a method pure - * virtual. It has no effect on the class in which the annotation - * appears, you can still provide a definition for the method, and - * it objects to the mere existence of a subclass that doesn't - * override the method. See examples in analysis/must-override.js. */ #ifdef NS_STATIC_CHECKING #define NS_STACK_CLASS __attribute__((user("NS_stack"))) #define NS_OKONHEAP __attribute__((user("NS_okonheap"))) #define NS_SUPPRESS_STACK_CHECK __attribute__((user("NS_suppress_stackcheck"))) -#define NS_MUST_OVERRIDE __attribute__((user("NS_must_override"))) #else #define NS_STACK_CLASS #define NS_OKONHEAP #define NS_SUPPRESS_STACK_CHECK -#define NS_MUST_OVERRIDE #endif /* * SEH exception macros. */ #ifdef HAVE_SEH_EXCEPTIONS #define MOZ_SEH_TRY __try #define MOZ_SEH_EXCEPT(expr) __except(expr)