Bug 1103036 - Ensure __delete__ message from TabChild doesn't get sent after ActorDestroy (r=bent)

This commit is contained in:
Bill McCloskey 2015-01-06 21:42:00 -08:00
Родитель 832550d4bf
Коммит 29d9df892b
2 изменённых файлов: 10 добавлений и 1 удалений

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

@ -777,7 +777,10 @@ private:
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mTabChild); MOZ_ASSERT(mTabChild);
unused << PBrowserChild::Send__delete__(mTabChild); // Check in case ActorDestroy was called after RecvDestroy message.
if (mTabChild->IPCOpen()) {
unused << PBrowserChild::Send__delete__(mTabChild);
}
mTabChild = nullptr; mTabChild = nullptr;
return NS_OK; return NS_OK;
@ -905,6 +908,7 @@ TabChild::TabChild(nsIContentChild* aManager,
, mUniqueId(aTabId) , mUniqueId(aTabId)
, mDPI(0) , mDPI(0)
, mDefaultScale(0) , mDefaultScale(0)
, mIPCOpen(true)
{ {
if (!sActiveDurationMsSet) { if (!sActiveDurationMsSet) {
Preferences::AddIntVarCache(&sActiveDurationMs, Preferences::AddIntVarCache(&sActiveDurationMs,
@ -1654,6 +1658,8 @@ TabChild::DestroyWindow()
void void
TabChild::ActorDestroy(ActorDestroyReason why) TabChild::ActorDestroy(ActorDestroyReason why)
{ {
mIPCOpen = false;
DestroyWindow(); DestroyWindow();
if (mTabChildGlobal) { if (mTabChildGlobal) {

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

@ -499,6 +499,8 @@ public:
nsIntPoint GetChromeDisplacement() { return mChromeDisp; }; nsIntPoint GetChromeDisplacement() { return mChromeDisp; };
bool IPCOpen() { return mIPCOpen; }
protected: protected:
virtual ~TabChild(); virtual ~TabChild();
@ -662,6 +664,7 @@ private:
TabId mUniqueId; TabId mUniqueId;
float mDPI; float mDPI;
double mDefaultScale; double mDefaultScale;
bool mIPCOpen;
DISALLOW_EVIL_CONSTRUCTORS(TabChild); DISALLOW_EVIL_CONSTRUCTORS(TabChild);
}; };