Bug 554466: Only EnqueuePending when there's been an rpc out-call. r=bent

This commit is contained in:
Chris Jones 2010-03-24 00:52:47 -05:00
parent ba0dff954e
commit f6e896ba0c
2 changed files with 13 additions and 3 deletions

View File

@ -96,7 +96,8 @@ RPCChannel::RPCChannel(RPCListener* aListener)
mOutOfTurnReplies(), mOutOfTurnReplies(),
mDeferred(), mDeferred(),
mRemoteStackDepthGuess(0), mRemoteStackDepthGuess(0),
mBlockedOnParent(false) mBlockedOnParent(false),
mSawRPCOutMsg(false)
{ {
MOZ_COUNT_CTOR(RPCChannel); MOZ_COUNT_CTOR(RPCChannel);
@ -597,10 +598,11 @@ void
RPCChannel::ExitedCxxStack() RPCChannel::ExitedCxxStack()
{ {
Listener()->OnExitedCxxStack(); Listener()->OnExitedCxxStack();
{ if (mSawRPCOutMsg) {
MutexAutoLock lock(mMutex); MutexAutoLock lock(mMutex);
// see long comment in OnMaybeDequeueOne() // see long comment in OnMaybeDequeueOne()
EnqueuePendingMessages(); EnqueuePendingMessages();
mSawRPCOutMsg = false;
} }
} }

View File

@ -242,7 +242,10 @@ protected:
if (mThat.mCxxStackFrames.empty()) if (mThat.mCxxStackFrames.empty())
mThat.EnteredCxxStack(); mThat.EnteredCxxStack();
mThat.mCxxStackFrames.push_back(RPCFrame(direction, msg)); mThat.mCxxStackFrames.push_back(RPCFrame(direction, msg));
mThat.mSawRPCOutMsg |= (direction == OUT_MESSAGE) &&
(msg->is_rpc());
} }
~CxxStackFrame() { ~CxxStackFrame() {
@ -385,7 +388,12 @@ protected:
// not protected by mMutex. It is managed exclusively by the // not protected by mMutex. It is managed exclusively by the
// helper |class CxxStackFrame|. // helper |class CxxStackFrame|.
std::vector<RPCFrame> mCxxStackFrames; std::vector<RPCFrame> mCxxStackFrames;
// Did we process an RPC out-call during this stack? Only
// meaningful in ExitedCxxStack(), from which this variable is
// reset.
bool mSawRPCOutMsg;
private: private:
// //