Bug 554262 - [OOPP] Silverlight context menu hangs the browser. r=bent, jmathies.

This commit is contained in:
Chris Jones 2010-03-24 16:49:54 -05:00
Родитель 5b1f0953f8
Коммит 484bf7cef6
2 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -204,7 +204,11 @@ RPCChannel::Call(Message* msg, Message* reply)
while (!EventOccurred()) {
bool maybeTimedOut = !RPCChannel::WaitForNotify();
if (EventOccurred())
if (EventOccurred() ||
// we might have received a "subtly deferred" message
// in a nested loop that it's now time to process
(!maybeTimedOut &&
(!mDeferred.empty() || !mOutOfTurnReplies.empty())))
break;
if (maybeTimedOut && !ShouldContinueFromTimeout())
@ -224,10 +228,18 @@ RPCChannel::Call(Message* msg, Message* reply)
recvd = it->second;
mOutOfTurnReplies.erase(it);
}
else {
else if (!mPending.empty()) {
recvd = mPending.front();
mPending.pop();
}
else {
// because of subtleties with nested event loops, it's
// possible that we got here and nothing happened. or, we
// might have a deferred in-call that needs to be
// processed. either way, we won't break the inner while
// loop again until something new happens.
continue;
}
if (!recvd.is_sync() && !recvd.is_rpc()) {
MutexAutoUnlock unlock(mMutex);

Просмотреть файл

@ -658,6 +658,8 @@ RPCChannel::SpinInternalEventLoop()
} else {
TranslateMessage(&msg);
DispatchMessageW(&msg);
ExitSpinLoop();
return false;
}
} else {
// Block and wait for any posted application messages