mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 847656: Change ContentParent::GetNewOrUsed to return an already_AddRefed value. r=khuey
This commit is contained in:
parent
3be59a99fb
commit
614dfd0dfd
@ -370,7 +370,7 @@ ContentParent::JoinAllSubprocesses()
|
||||
sCanLaunchSubprocesses = false;
|
||||
}
|
||||
|
||||
/*static*/ ContentParent*
|
||||
/*static*/ already_AddRefed<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;
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
namespace {
|
||||
@ -465,7 +465,7 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
|
||||
}
|
||||
|
||||
if (aContext.IsBrowserElement() || !aContext.HasOwnApp()) {
|
||||
if (ContentParent* cp = GetNewOrUsed(aContext.IsBrowserElement())) {
|
||||
if (nsRefPtr<ContentParent> cp = GetNewOrUsed(aContext.IsBrowserElement())) {
|
||||
nsRefPtr<TabParent> tp(new TabParent(aContext));
|
||||
tp->SetOwnerElement(aFrameElement);
|
||||
PBrowserParent* browser = cp->SendPBrowserConstructor(
|
||||
|
@ -81,7 +81,8 @@ public:
|
||||
*/
|
||||
static void JoinAllSubprocesses();
|
||||
|
||||
static ContentParent* GetNewOrUsed(bool aForBrowserElement = false);
|
||||
static already_AddRefed<ContentParent>
|
||||
GetNewOrUsed(bool aForBrowserElement = false);
|
||||
|
||||
/**
|
||||
* Get or create a content process for the given TabContext. aFrameElement
|
||||
|
@ -780,7 +780,7 @@ nsXULAppInfo::EnsureContentProcess()
|
||||
if (XRE_GetProcessType() != GeckoProcessType_Default)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
unused << ContentParent::GetNewOrUsed();
|
||||
nsRefPtr<ContentParent> unused = ContentParent::GetNewOrUsed();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -695,7 +695,8 @@ ContentParent* gContentParent; //long-lived, manually refcounted
|
||||
TestShellParent* GetOrCreateTestShellParent()
|
||||
{
|
||||
if (!gContentParent) {
|
||||
NS_ADDREF(gContentParent = ContentParent::GetNewOrUsed());
|
||||
nsRefPtr<ContentParent> parent = ContentParent::GetNewOrUsed().get();
|
||||
parent.forget(&gContentParent);
|
||||
} else if (!gContentParent->IsAlive()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user