зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1365928 - patch 2 - Annotate style-struct getters with MOZ_NONNULL_RETURN for better optimization. r=mats
This commit is contained in:
Родитель
67ca6e1f88
Коммит
fcf175b16a
|
@ -787,12 +787,13 @@ public:
|
|||
* accepts an *optional* pointer the style struct.
|
||||
*/
|
||||
#define STYLE_STRUCT(name_, checkdata_cb_) \
|
||||
const nsStyle##name_ * Style##name_ () const { \
|
||||
const nsStyle##name_ * Style##name_ () const MOZ_NONNULL_RETURN { \
|
||||
NS_ASSERTION(mStyleContext, "No style context found!"); \
|
||||
return mStyleContext->Style##name_ (); \
|
||||
} \
|
||||
const nsStyle##name_ * Style##name_##WithOptionalParam( \
|
||||
const nsStyle##name_ * aStyleStruct) const { \
|
||||
const nsStyle##name_ * aStyleStruct) const \
|
||||
MOZ_NONNULL_RETURN { \
|
||||
if (aStyleStruct) { \
|
||||
MOZ_ASSERT(aStyleStruct == Style##name_()); \
|
||||
return aStyleStruct; \
|
||||
|
|
|
@ -345,7 +345,7 @@ public:
|
|||
* function, both because they're easier to read and because they're
|
||||
* faster.
|
||||
*/
|
||||
const void* NS_FASTCALL StyleData(nsStyleStructID aSID);
|
||||
const void* NS_FASTCALL StyleData(nsStyleStructID aSID) MOZ_NONNULL_RETURN;
|
||||
|
||||
/**
|
||||
* Define typesafe getter functions for each style struct by
|
||||
|
@ -354,9 +354,9 @@ public:
|
|||
* const nsStyleBorder* StyleBorder();
|
||||
* const nsStyleColor* StyleColor();
|
||||
*/
|
||||
#define STYLE_STRUCT(name_, checkdata_cb_) \
|
||||
const nsStyle##name_ * Style##name_() { \
|
||||
return DoGetStyle##name_<true>(); \
|
||||
#define STYLE_STRUCT(name_, checkdata_cb_) \
|
||||
const nsStyle##name_ * Style##name_() MOZ_NONNULL_RETURN { \
|
||||
return DoGetStyle##name_<true>(); \
|
||||
}
|
||||
#include "nsStyleStructList.h"
|
||||
#undef STYLE_STRUCT
|
||||
|
|
Загрузка…
Ссылка в новой задаче