зеркало из https://github.com/mozilla/gecko-dev.git
Bug 554262 - [OOPP] Silverlight context menu hangs the browser. r=bent, jmathies.
This commit is contained in:
Родитель
5ac0744b15
Коммит
cc1789ceb6
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче