mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 538918 - Fix for bug 545338, don't drop into WaitForNotify() when spin loop unwinds. r=bent.
--HG-- extra : transplant_source : %CA%8B%E6%0B%3E%FC%AEK%B2PH%D5l%BEh%D4oj%E2Y
This commit is contained in:
parent
d9ef9492f1
commit
6d16384b41
@ -727,18 +727,8 @@ RPCChannel::WaitForNotify()
|
||||
// received. Note, spin loop can cause reentrant race conditions, which
|
||||
// is expected.
|
||||
if (RPCChannel::IsSpinLoopActive()) {
|
||||
if (SpinInternalEventLoop()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Coming out of spin loop after a modal loop ends, we can't drop into
|
||||
// deferred processing on the assumption that MsgWaitForMultipleObjects
|
||||
// will get signaled with gEventLoopMessage - messages may have already
|
||||
// been received and stored in mPending & mOutOfTurnReplies. So we check
|
||||
// various stacks to figure out if we should fall through or just return.
|
||||
if (IsMessagePending()) {
|
||||
return true;
|
||||
}
|
||||
SpinInternalEventLoop();
|
||||
return true; // bug 545338
|
||||
}
|
||||
|
||||
if (++gEventLoopDepth == 1) {
|
||||
@ -806,23 +796,8 @@ RPCChannel::WaitForNotify()
|
||||
// of true indicates gEventLoopMessage was received, exit out of
|
||||
// WaitForNotify so we can deal with it in RPCChannel.
|
||||
RPCChannel::EnterModalLoop();
|
||||
if (SpinInternalEventLoop())
|
||||
return true;
|
||||
|
||||
// See comments above - never assume MsgWaitForMultipleObjects will
|
||||
// get signaled.
|
||||
if (IsMessagePending())
|
||||
return true;
|
||||
|
||||
// We drop out of our inner event loop after the plugin has relinquished
|
||||
// control back to the shim, but the ipdl call has yet to return, so reset
|
||||
// our hook in case and continue waiting on gEventLoopMessage.
|
||||
windowHook = SetWindowsHookEx(WH_CALLWNDPROC, CallWindowProcedureHook,
|
||||
NULL, gUIThreadId);
|
||||
NS_ASSERTION(windowHook, "Failed to set proc hook on the rebound!");
|
||||
|
||||
SyncChannel::SetIsPumpingMessages(true);
|
||||
continue;
|
||||
SpinInternalEventLoop();
|
||||
return true; // bug 545338
|
||||
}
|
||||
|
||||
if (PeekMessageW(&msg, (HWND)-1, gEventLoopMessage, gEventLoopMessage,
|
||||
|
Loading…
x
Reference in New Issue
Block a user