mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 581341 - Part 4: Always run the IPC testshell callback, regardless of execution success or failure. r=bent
This commit is contained in:
parent
552b6b6a78
commit
3e3121d80b
@ -327,6 +327,14 @@ ContentParent::DestroyTestShell(TestShellParent* aTestShell)
|
||||
return PTestShellParent::Send__delete__(aTestShell);
|
||||
}
|
||||
|
||||
TestShellParent*
|
||||
ContentParent::GetTestShellSingleton()
|
||||
{
|
||||
if (!ManagedPTestShellParent().Length())
|
||||
return nsnull;
|
||||
return static_cast<TestShellParent*>(ManagedPTestShellParent()[0]);
|
||||
}
|
||||
|
||||
ContentParent::ContentParent()
|
||||
: mGeolocationWatchID(-1)
|
||||
, mRunToCompletionDepth(0)
|
||||
|
@ -94,6 +94,7 @@ public:
|
||||
|
||||
TestShellParent* CreateTestShell();
|
||||
bool DestroyTestShell(TestShellParent* aTestShell);
|
||||
TestShellParent* GetTestShellSingleton();
|
||||
|
||||
void ReportChildAlreadyBlocked();
|
||||
bool RequestRunToCompletion();
|
||||
|
@ -146,3 +146,18 @@ TestShellCommandParent::ReleaseCallback()
|
||||
{
|
||||
mCallback.Release();
|
||||
}
|
||||
|
||||
bool
|
||||
TestShellCommandParent::ExecuteCallback(const nsString& aResponse)
|
||||
{
|
||||
return static_cast<TestShellParent*>(Manager())->CommandDone(
|
||||
this, aResponse);
|
||||
}
|
||||
|
||||
void
|
||||
TestShellCommandParent::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
if (why == AbnormalShutdown) {
|
||||
ExecuteCallback(EmptyString());
|
||||
}
|
||||
}
|
||||
|
@ -92,9 +92,12 @@ public:
|
||||
void ReleaseCallback();
|
||||
|
||||
protected:
|
||||
bool ExecuteCallback(const nsString& aResponse);
|
||||
|
||||
void ActorDestroy(ActorDestroyReason why);
|
||||
|
||||
bool Recv__delete__(const nsString& aResponse) {
|
||||
return static_cast<TestShellParent*>(Manager())->CommandDone(
|
||||
this, aResponse);
|
||||
return ExecuteCallback(aResponse);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -706,16 +706,18 @@ XRE_ShutdownChildProcess()
|
||||
}
|
||||
|
||||
namespace {
|
||||
TestShellParent* gTestShellParent = nsnull;
|
||||
TestShellParent* GetOrCreateTestShellParent()
|
||||
{
|
||||
if (!gTestShellParent) {
|
||||
ContentParent* parent = ContentParent::GetSingleton();
|
||||
NS_ENSURE_TRUE(parent, nsnull);
|
||||
gTestShellParent = parent->CreateTestShell();
|
||||
NS_ENSURE_TRUE(gTestShellParent, nsnull);
|
||||
ContentParent* parent = ContentParent::GetSingleton();
|
||||
if (!parent) {
|
||||
return nsnull;
|
||||
}
|
||||
return gTestShellParent;
|
||||
TestShellParent* testShell = parent->GetTestShellSingleton();
|
||||
if (testShell) {
|
||||
return testShell;
|
||||
}
|
||||
testShell = parent->CreateTestShell();
|
||||
return testShell;
|
||||
}
|
||||
}
|
||||
|
||||
@ -754,9 +756,11 @@ XRE_GetChildGlobalObject(JSContext* aCx, JSObject** aGlobalP)
|
||||
bool
|
||||
XRE_ShutdownTestShell()
|
||||
{
|
||||
if (!gTestShellParent)
|
||||
ContentParent* cp = ContentParent::GetSingleton(PR_FALSE);
|
||||
TestShellParent* tsp = cp ? cp->GetTestShellSingleton() : nsnull;
|
||||
if (!tsp)
|
||||
return true;
|
||||
return ContentParent::GetSingleton()->DestroyTestShell(gTestShellParent);
|
||||
return cp->DestroyTestShell(tsp);
|
||||
}
|
||||
|
||||
#ifdef MOZ_X11
|
||||
|
Loading…
Reference in New Issue
Block a user