Backed out changeset 42d5d3080bc4 (bug 847656) for mochitest crashes on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2013-03-20 14:17:22 -04:00
parent 2bb7603d17
commit f78b48529c
4 changed files with 6 additions and 8 deletions

View File

@ -370,7 +370,7 @@ ContentParent::JoinAllSubprocesses()
sCanLaunchSubprocesses = false;
}
/*static*/ already_AddRefed<ContentParent>
/*static*/ ContentParent*
ContentParent::GetNewOrUsed(bool aForBrowserElement)
{
if (!gNonAppContentParents)
@ -394,7 +394,7 @@ ContentParent::GetNewOrUsed(bool aForBrowserElement)
PROCESS_PRIORITY_FOREGROUND);
p->Init();
gNonAppContentParents->AppendElement(p);
return p.forget();
return p;
}
namespace {
@ -465,7 +465,7 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
}
if (aContext.IsBrowserElement() || !aContext.HasOwnApp()) {
if (nsRefPtr<ContentParent> cp = GetNewOrUsed(aContext.IsBrowserElement())) {
if (ContentParent* cp = GetNewOrUsed(aContext.IsBrowserElement())) {
nsRefPtr<TabParent> tp(new TabParent(aContext));
tp->SetOwnerElement(aFrameElement);
PBrowserParent* browser = cp->SendPBrowserConstructor(

View File

@ -81,8 +81,7 @@ public:
*/
static void JoinAllSubprocesses();
static already_AddRefed<ContentParent>
GetNewOrUsed(bool aForBrowserElement = false);
static ContentParent* GetNewOrUsed(bool aForBrowserElement = false);
/**
* Get or create a content process for the given TabContext. aFrameElement

View File

@ -780,7 +780,7 @@ nsXULAppInfo::EnsureContentProcess()
if (XRE_GetProcessType() != GeckoProcessType_Default)
return NS_ERROR_NOT_AVAILABLE;
nsRefPtr<ContentParent> unused = ContentParent::GetNewOrUsed();
unused << ContentParent::GetNewOrUsed();
return NS_OK;
}

View File

@ -695,8 +695,7 @@ ContentParent* gContentParent; //long-lived, manually refcounted
TestShellParent* GetOrCreateTestShellParent()
{
if (!gContentParent) {
nsRefPtr<ContentParent> parent = ContentParent::GetNewOrUsed().get();
parent.forget(&gContentParent);
NS_ADDREF(gContentParent = ContentParent::GetNewOrUsed());
} else if (!gContentParent->IsAlive()) {
return nullptr;
}