Bug 1351200 - Part 1: stylo: Allow fetching prefs on servo traversal threads; r?froydnj
MozReview-Commit-ID: 7MMWyX1t5CR
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -21,16 +21,17 @@
#include "plstr.h"
#include "PLDHashTable.h"
#include "plbase64.h"
#include "mozilla/ArenaAllocator.h"
#include "mozilla/ArenaAllocatorExtensions.h"
#include "mozilla/Logging.h"
#include "mozilla/MemoryReporting.h"
+#include "mozilla/ServoStyleSet.h"
#include "mozilla/dom/PContent.h"
#include "mozilla/dom/ContentPrefs.h"
#include "nsQuickSort.h"
#include "nsString.h"
#include "nsPrintfCString.h"
#include "prlink.h"
using namespace mozilla;
@@ -757,17 +758,17 @@ inInitArray(const char* key)
return BinarySearchIf(list, 0, prefsLen,
StringComparator(key), &found);
}
#endif
PrefHashEntry* pref_HashTableLookup(const char *key)
{
#ifndef MOZ_B2G
- MOZ_ASSERT(NS_IsMainThread());
+ MOZ_ASSERT(NS_IsMainThread() || mozilla::ServoStyleSet::IsInServoTraversal());
#endif
MOZ_ASSERT((!XRE_IsContentProcess() || gPhase != START),
"pref access before commandline prefs set");
/* If you're hitting this assertion, you've added a pref access to start up.
* Consider moving it later or add it to the whitelist in ContentPrefs.cpp
* and get review from a DOM peer
*/
#ifdef DEBUG