зеркало из https://github.com/mozilla/gecko-dev.git
Enable XPC_CHECK_WRAPPER_THREADSAFETY in release builds and make it force a failure from XPCWrappedNative::FinishInit (612745, r=gal).
This commit is contained in:
Родитель
49be74785b
Коммит
636ce9e9a6
|
@ -179,8 +179,8 @@ static FARPROC GetProcAddressA(HMODULE hMod, wchar_t *procName);
|
|||
|
||||
#ifdef DEBUG
|
||||
#define XPC_DETECT_LEADING_UPPERCASE_ACCESS_ERRORS
|
||||
#define XPC_CHECK_WRAPPER_THREADSAFETY
|
||||
#endif
|
||||
#define XPC_CHECK_WRAPPER_THREADSAFETY
|
||||
|
||||
#if defined(DEBUG_xpc_hacker)
|
||||
#define XPC_DUMP_AT_SHUTDOWN
|
||||
|
|
|
@ -1202,8 +1202,11 @@ XPCWrappedNative::FinishInit(XPCCallContext &ccx)
|
|||
mThread = do_GetCurrentThread();
|
||||
|
||||
if(HasProto() && GetProto()->ClassIsMainThreadOnly() && !NS_IsMainThread())
|
||||
{
|
||||
DEBUG_ReportWrapperThreadSafetyError(ccx,
|
||||
"MainThread only wrapper created on the wrong thread", this);
|
||||
return JS_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
// A hack for bug 517665, increase the probability for GC.
|
||||
|
@ -1511,7 +1514,8 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
|
|||
if (!XPCPerThreadData::IsMainThread(ccx) ||
|
||||
(wrapper &&
|
||||
wrapper->GetProto() &&
|
||||
!wrapper->GetProto()->ClassIsMainThreadOnly())) {
|
||||
!wrapper->GetProto()->ClassIsMainThreadOnly()))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче