зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1620152) because it blocks the backout of bug 1626967. a=backout
Backed out changeset c6fe172dd237 (bug 1620152) Backed out changeset a13507db74f7 (bug 1620152) Backed out changeset 005a31ffa4bf (bug 1620152) Backed out changeset 9c80be97934f (bug 1620152)
This commit is contained in:
Родитель
c18e39510e
Коммит
88bbcf97df
|
@ -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_ALWAYS_TRUE(SendFinish());
|
||||
MOZ_DIAGNOSTIC_ALWAYS_TRUE(SendFinish());
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -339,7 +339,7 @@ struct ServiceWorkerManager::RegistrationDataPerPrincipal final {
|
|||
}
|
||||
|
||||
void RemoveScope(const nsACString& aScope) {
|
||||
MOZ_ALWAYS_TRUE(RemoveElement(aScope));
|
||||
MOZ_DIAGNOSTIC_ALWAYS_TRUE(RemoveElement(aScope));
|
||||
}
|
||||
|
||||
// Implements most of "Match Service Worker Registration":
|
||||
|
|
|
@ -10443,7 +10443,7 @@ bool CodeGenerator::generateWasm(wasm::FuncTypeIdDesc funcTypeId,
|
|||
}
|
||||
// In debug builds, we'll always have a stack map, even if there are no
|
||||
// refs to track.
|
||||
MOZ_ASSERT(functionEntryStackMap);
|
||||
MOZ_ALWAYS_TRUE(functionEntryStackMap);
|
||||
if (functionEntryStackMap &&
|
||||
!stackMaps->add((uint8_t*)(uintptr_t)trapInsnOffset.offset(),
|
||||
functionEntryStackMap)) {
|
||||
|
@ -10498,7 +10498,7 @@ bool CodeGenerator::generateWasm(wasm::FuncTypeIdDesc funcTypeId,
|
|||
return false;
|
||||
}
|
||||
// In debug builds, we'll always have a stack map.
|
||||
MOZ_ASSERT(stackMap);
|
||||
MOZ_ALWAYS_TRUE(stackMap);
|
||||
if (!stackMap) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ static bool GenerateCraneliftCode(WasmMacroAssembler& masm,
|
|||
|
||||
// In debug builds, we'll always have a stack map, even if there are no
|
||||
// refs to track.
|
||||
MOZ_ASSERT(functionEntryStackMap);
|
||||
MOZ_ALWAYS_TRUE(functionEntryStackMap);
|
||||
|
||||
if (functionEntryStackMap &&
|
||||
!stackMaps->add((uint8_t*)(uintptr_t)trapInsnOffset.offset(),
|
||||
|
|
|
@ -665,23 +665,47 @@ struct AssertionConditionType {
|
|||
|
||||
/*
|
||||
* MOZ_ALWAYS_TRUE(expr) and friends always evaluate the provided expression,
|
||||
* in debug builds and in release builds both. Then, in debug builds and
|
||||
* Nightly and DevEdition release builds, the value of the expression is
|
||||
* asserted either true or false using MOZ_DIAGNOSTIC_ASSERT.
|
||||
* in debug builds and in release builds both. Then, in debug builds only, the
|
||||
* value of the expression is asserted either true or false using MOZ_ASSERT.
|
||||
*/
|
||||
#define MOZ_ALWAYS_TRUE(expr) \
|
||||
do { \
|
||||
if (MOZ_LIKELY(expr)) { \
|
||||
/* Silence MOZ_MUST_USE. */ \
|
||||
} else { \
|
||||
MOZ_DIAGNOSTIC_ASSERT(false, #expr); \
|
||||
} \
|
||||
#define MOZ_ALWAYS_TRUE(expr) \
|
||||
do { \
|
||||
if (MOZ_LIKELY(expr)) { \
|
||||
/* Silence MOZ_MUST_USE. */ \
|
||||
} else { \
|
||||
MOZ_ASSERT(false, #expr); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#define MOZ_ALWAYS_FALSE(expr) MOZ_ALWAYS_TRUE(!(expr))
|
||||
#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
|
||||
|
||||
|
|
|
@ -5493,35 +5493,35 @@ static void InitStaticPrefsFromShared() {
|
|||
// process (the common case) then the overwriting here won't change the
|
||||
// mirror variable's value.
|
||||
//
|
||||
// Note that the MOZ_ASSERT calls below can fail in one obscure case: when a
|
||||
// Firefox update occurs and we get a main process from the old binary (with
|
||||
// static prefs {A,B,C,D}) plus a new content process from the new binary
|
||||
// (with static prefs {A,B,C,D,E}). The content process' call to
|
||||
// Note that the MOZ_ALWAYS_TRUE calls below can fail in one obscure case:
|
||||
// when a Firefox update occurs and we get a main process from the old binary
|
||||
// (with static prefs {A,B,C,D}) plus a new content process from the new
|
||||
// binary (with static prefs {A,B,C,D,E}). The content process' call to
|
||||
// GetSharedPrefValue() for pref E will fail because the shared pref map was
|
||||
// created by the main process, which doesn't have pref E.
|
||||
// created by the main process, which doesn't have pref E. (This failure will
|
||||
// be silent because MOZ_ALWAYS_TRUE is a no-op in non-debug builds.)
|
||||
//
|
||||
// This silent failure is safe. The mirror variable for pref E is already
|
||||
// initialized to the default value in the content process, and the main
|
||||
// process cannot have changed pref E because it doesn't know about it!
|
||||
//
|
||||
// Nonetheless, it's useful to have the MOZ_ASSERT here for testing of debug
|
||||
// builds, where this scenario involving inconsistent binaries should not
|
||||
// occur.
|
||||
// Nonetheless, it's useful to have the MOZ_ALWAYS_TRUE here for testing of
|
||||
// debug builds, where this scenario involving inconsistent binaries should
|
||||
// not occur.
|
||||
#define NEVER_PREF(name, cpp_type, value)
|
||||
#define ALWAYS_PREF(name, base_id, full_id, cpp_type, value) \
|
||||
{ \
|
||||
StripAtomic<cpp_type> val; \
|
||||
DebugOnly<nsresult> rv = Internals::GetSharedPrefValue(name, &val); \
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv)); \
|
||||
StaticPrefs::sMirror_##full_id = val; \
|
||||
#define ALWAYS_PREF(name, base_id, full_id, cpp_type, value) \
|
||||
{ \
|
||||
StripAtomic<cpp_type> val; \
|
||||
nsresult rv = Internals::GetSharedPrefValue(name, &val); \
|
||||
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(rv)); \
|
||||
StaticPrefs::sMirror_##full_id = val; \
|
||||
}
|
||||
#define ONCE_PREF(name, base_id, full_id, cpp_type, value) \
|
||||
{ \
|
||||
cpp_type val; \
|
||||
DebugOnly<nsresult> rv = \
|
||||
Internals::GetSharedPrefValue(ONCE_PREF_NAME(name), &val); \
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv)); \
|
||||
StaticPrefs::sMirror_##full_id = val; \
|
||||
#define ONCE_PREF(name, base_id, full_id, cpp_type, value) \
|
||||
{ \
|
||||
cpp_type val; \
|
||||
nsresult rv = Internals::GetSharedPrefValue(ONCE_PREF_NAME(name), &val); \
|
||||
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(rv)); \
|
||||
StaticPrefs::sMirror_##full_id = val; \
|
||||
}
|
||||
#include "mozilla/StaticPrefListAll.h"
|
||||
#undef NEVER_PREF
|
||||
|
|
Загрузка…
Ссылка в новой задаче