зеркало из https://github.com/mozilla/pjs.git
Bug 566057: Remove obsolete managee tracking code in ContentProcessChild that's leading to use-after-free errors. r=jduell
This commit is contained in:
Родитель
ca8676612f
Коммит
37a15f9f78
|
@ -61,7 +61,6 @@ namespace dom {
|
|||
ContentProcessChild* ContentProcessChild::sSingleton;
|
||||
|
||||
ContentProcessChild::ContentProcessChild()
|
||||
: mQuit(PR_FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -86,37 +85,27 @@ PIFrameEmbeddingChild*
|
|||
ContentProcessChild::AllocPIFrameEmbedding()
|
||||
{
|
||||
nsRefPtr<TabChild> iframe = new TabChild();
|
||||
NS_ENSURE_TRUE(iframe && NS_SUCCEEDED(iframe->Init()) &&
|
||||
mIFrames.AppendElement(iframe),
|
||||
nsnull);
|
||||
return iframe.forget().get();
|
||||
return NS_SUCCEEDED(iframe->Init()) ? iframe.forget().get() : NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentProcessChild::DeallocPIFrameEmbedding(PIFrameEmbeddingChild* iframe)
|
||||
{
|
||||
if (mIFrames.RemoveElement(iframe)) {
|
||||
TabChild* child = static_cast<TabChild*>(iframe);
|
||||
NS_RELEASE(child);
|
||||
}
|
||||
TabChild* child = static_cast<TabChild*>(iframe);
|
||||
NS_RELEASE(child);
|
||||
return true;
|
||||
}
|
||||
|
||||
PTestShellChild*
|
||||
ContentProcessChild::AllocPTestShell()
|
||||
{
|
||||
PTestShellChild* testshell = new TestShellChild();
|
||||
if (testshell && mTestShells.AppendElement(testshell)) {
|
||||
return testshell;
|
||||
}
|
||||
delete testshell;
|
||||
return nsnull;
|
||||
return new TestShellChild();
|
||||
}
|
||||
|
||||
bool
|
||||
ContentProcessChild::DeallocPTestShell(PTestShellChild* shell)
|
||||
{
|
||||
mTestShells.RemoveElement(shell);
|
||||
delete shell;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -163,23 +152,12 @@ ContentProcessChild::RecvSetOffline(const PRBool& offline)
|
|||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
ContentProcessChild::Quit()
|
||||
{
|
||||
NS_ASSERTION(mQuit, "Exiting uncleanly!");
|
||||
mIFrames.Clear();
|
||||
mTestShells.Clear();
|
||||
}
|
||||
|
||||
void
|
||||
ContentProcessChild::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
if (AbnormalShutdown == why)
|
||||
NS_WARNING("shutting down because of crash!");
|
||||
|
||||
mQuit = PR_TRUE;
|
||||
Quit();
|
||||
|
||||
XRE_ShutdownChildProcess();
|
||||
}
|
||||
|
||||
|
|
|
@ -89,15 +89,8 @@ private:
|
|||
NS_OVERRIDE
|
||||
virtual void ActorDestroy(ActorDestroyReason why);
|
||||
|
||||
void Quit();
|
||||
|
||||
static ContentProcessChild* sSingleton;
|
||||
|
||||
nsTArray<PIFrameEmbeddingChild* > mIFrames;
|
||||
nsTArray<nsAutoPtr<PTestShellChild> > mTestShells;
|
||||
|
||||
PRBool mQuit;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(ContentProcessChild);
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче