зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1620152 - Part 4: Replace MOZ_DIAGNOSTIC_ALWAYS_TRUE() with MOZ_ALWAYS_TRUE(). r=janv
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(), so MOZ_DIAGNOSTIC_ALWAYS_TRUE() will be redundant. Differential Revision: https://phabricator.services.mozilla.com/D66922 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ceb9bb69c5
Коммит
a6d592bbe2
|
@ -212,7 +212,7 @@ mozilla::ipc::IPCResult LSRequestChild::RecvReady() {
|
|||
|
||||
// We only expect this to return false if the channel has been closed, but
|
||||
// PBackground's channel never gets shutdown.
|
||||
MOZ_DIAGNOSTIC_ALWAYS_TRUE(SendFinish());
|
||||
MOZ_ALWAYS_TRUE(SendFinish());
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -339,7 +339,7 @@ struct ServiceWorkerManager::RegistrationDataPerPrincipal final {
|
|||
}
|
||||
|
||||
void RemoveScope(const nsACString& aScope) {
|
||||
MOZ_DIAGNOSTIC_ALWAYS_TRUE(RemoveElement(aScope));
|
||||
MOZ_ALWAYS_TRUE(RemoveElement(aScope));
|
||||
}
|
||||
|
||||
// Implements most of "Match Service Worker Registration":
|
||||
|
|
|
@ -682,31 +682,6 @@ struct AssertionConditionType {
|
|||
#define MOZ_ALWAYS_OK(expr) MOZ_ALWAYS_TRUE((expr).isOk())
|
||||
#define MOZ_ALWAYS_ERR(expr) MOZ_ALWAYS_TRUE((expr).isErr())
|
||||
|
||||
/*
|
||||
* MOZ_DIAGNOSTIC_ALWAYS_TRUE is like MOZ_ALWAYS_TRUE, but using
|
||||
* MOZ_DIAGNOSTIC_ASSERT as the underlying assert.
|
||||
*
|
||||
* See the block comment for MOZ_DIAGNOSTIC_ASSERT above for more details on how
|
||||
* diagnostic assertions work and how to use them.
|
||||
*/
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
# define MOZ_DIAGNOSTIC_ALWAYS_TRUE(expr) \
|
||||
do { \
|
||||
if ((expr)) { \
|
||||
/* Do nothing. */ \
|
||||
} else { \
|
||||
MOZ_DIAGNOSTIC_ASSERT(false, #expr); \
|
||||
} \
|
||||
} while (false)
|
||||
#else
|
||||
# define MOZ_DIAGNOSTIC_ALWAYS_TRUE(expr) \
|
||||
do { \
|
||||
if ((expr)) { \
|
||||
/* Silence MOZ_MUST_USE. */ \
|
||||
} \
|
||||
} while (false)
|
||||
#endif
|
||||
|
||||
#undef MOZ_DUMP_ASSERTION_STACK
|
||||
#undef MOZ_CRASH_CRASHREPORT
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче