mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 571225 - Crash in [@ SendSyncMessageToParent] , r=mfinkle
This commit is contained in:
parent
05b74830ae
commit
69a7d2d3fa
@ -57,13 +57,16 @@ bool SendSyncMessageToParent(void* aCallbackData,
|
||||
{
|
||||
nsInProcessTabChildGlobal* tabChild =
|
||||
static_cast<nsInProcessTabChildGlobal*>(aCallbackData);
|
||||
PRInt32 count = tabChild->mASyncMessages.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsCOMPtr<nsIRunnable> async = tabChild->mASyncMessages.SafeObjectAt(i);
|
||||
nsCOMPtr<nsIContent> owner = tabChild->mOwner;
|
||||
nsTArray<nsCOMPtr<nsIRunnable> > asyncMessages;
|
||||
asyncMessages.SwapElements(tabChild->mASyncMessages);
|
||||
PRUint32 len = asyncMessages.Length();
|
||||
for (PRInt32 i = 0; i < len; ++i) {
|
||||
nsCOMPtr<nsIRunnable> async = asyncMessages[i];
|
||||
async->Run();
|
||||
}
|
||||
if (tabChild->mChromeMessageManager) {
|
||||
tabChild->mChromeMessageManager->ReceiveMessage(tabChild->mOwner, aMessage, PR_TRUE,
|
||||
tabChild->mChromeMessageManager->ReceiveMessage(owner, aMessage, PR_TRUE,
|
||||
aJSON, nsnull, aJSONRetVal);
|
||||
}
|
||||
return true;
|
||||
@ -78,7 +81,7 @@ public:
|
||||
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
mTabChild->mASyncMessages.RemoveObject(this);
|
||||
mTabChild->mASyncMessages.RemoveElement(this);
|
||||
if (mTabChild->mChromeMessageManager) {
|
||||
mTabChild->mChromeMessageManager->ReceiveMessage(mTabChild->mOwner, mMessage,
|
||||
PR_FALSE,
|
||||
@ -97,8 +100,9 @@ bool SendAsyncMessageToParent(void* aCallbackData,
|
||||
{
|
||||
nsInProcessTabChildGlobal* tabChild =
|
||||
static_cast<nsInProcessTabChildGlobal*>(aCallbackData);
|
||||
nsRefPtr<nsIRunnable> ev = new nsAsyncMessageToParent(tabChild, aMessage, aJSON);
|
||||
tabChild->mASyncMessages.AppendObject(ev);
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
new nsAsyncMessageToParent(tabChild, aMessage, aJSON);
|
||||
tabChild->mASyncMessages.AppendElement(ev);
|
||||
NS_DispatchToCurrentThread(ev);
|
||||
return true;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ protected:
|
||||
public:
|
||||
nsIContent* mOwner;
|
||||
nsFrameMessageManager* mChromeMessageManager;
|
||||
nsCOMArray<nsIRunnable> mASyncMessages;
|
||||
nsTArray<nsCOMPtr<nsIRunnable> > mASyncMessages;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user