mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 828034 - Fix crash when PluginModuleParent::CleanupFromTimeout runs before channel error notification. r=bsmedberg
This commit is contained in:
parent
3d06005920
commit
494dd6c49d
@ -262,7 +262,7 @@ PluginModuleParent::TimeoutChanged(const char* aPref, void* aModule)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginModuleParent::CleanupFromTimeout()
|
PluginModuleParent::CleanupFromTimeout(const bool aFromHangUI)
|
||||||
{
|
{
|
||||||
if (mShutdown) {
|
if (mShutdown) {
|
||||||
return;
|
return;
|
||||||
@ -273,11 +273,22 @@ PluginModuleParent::CleanupFromTimeout()
|
|||||||
MessageLoop::current()->PostDelayedTask(
|
MessageLoop::current()->PostDelayedTask(
|
||||||
FROM_HERE,
|
FROM_HERE,
|
||||||
mTaskFactory.NewRunnableMethod(
|
mTaskFactory.NewRunnableMethod(
|
||||||
&PluginModuleParent::CleanupFromTimeout), 10);
|
&PluginModuleParent::CleanupFromTimeout, aFromHangUI), 10);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Close();
|
/* If the plugin container was terminated by the Plugin Hang UI,
|
||||||
|
then either the I/O thread detects a channel error, or the
|
||||||
|
main thread must set the error (whomever gets there first).
|
||||||
|
OTOH, if we terminate and return false from
|
||||||
|
ShouldContinueFromReplyTimeout, then the channel state has
|
||||||
|
already been set to ChannelTimeout and we should call the
|
||||||
|
regular Close function. */
|
||||||
|
if (aFromHangUI) {
|
||||||
|
GetIPCChannel()->CloseWithError();
|
||||||
|
} else {
|
||||||
|
Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
@ -465,17 +476,19 @@ PluginModuleParent::TerminateChildProcess(MessageLoop* aMsgLoop)
|
|||||||
|
|
||||||
// this must run before the error notification from the channel,
|
// this must run before the error notification from the channel,
|
||||||
// or not at all
|
// or not at all
|
||||||
if (aMsgLoop == MessageLoop::current()) {
|
bool isFromHangUI = aMsgLoop != MessageLoop::current();
|
||||||
aMsgLoop->PostTask(
|
if (isFromHangUI) {
|
||||||
FROM_HERE,
|
|
||||||
mTaskFactory.NewRunnableMethod(
|
|
||||||
&PluginModuleParent::CleanupFromTimeout));
|
|
||||||
} else {
|
|
||||||
// If we're posting from a different thread we can't create
|
// If we're posting from a different thread we can't create
|
||||||
// the task via mTaskFactory
|
// the task via mTaskFactory
|
||||||
aMsgLoop->PostTask(FROM_HERE,
|
aMsgLoop->PostTask(FROM_HERE,
|
||||||
NewRunnableMethod(this,
|
NewRunnableMethod(this,
|
||||||
&PluginModuleParent::CleanupFromTimeout));
|
&PluginModuleParent::CleanupFromTimeout,
|
||||||
|
isFromHangUI));
|
||||||
|
} else {
|
||||||
|
aMsgLoop->PostTask(
|
||||||
|
FROM_HERE,
|
||||||
|
mTaskFactory.NewRunnableMethod(
|
||||||
|
&PluginModuleParent::CleanupFromTimeout, isFromHangUI));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!KillProcess(OtherProcess(), 1, false))
|
if (!KillProcess(OtherProcess(), 1, false))
|
||||||
|
@ -296,7 +296,7 @@ private:
|
|||||||
void ProcessFirstMinidump();
|
void ProcessFirstMinidump();
|
||||||
void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes);
|
void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes);
|
||||||
#endif
|
#endif
|
||||||
void CleanupFromTimeout();
|
void CleanupFromTimeout(const bool aByHangUI);
|
||||||
void SetChildTimeout(const int32_t aChildTimeout);
|
void SetChildTimeout(const int32_t aChildTimeout);
|
||||||
static int TimeoutChanged(const char* aPref, void* aModule);
|
static int TimeoutChanged(const char* aPref, void* aModule);
|
||||||
void NotifyPluginCrashed();
|
void NotifyPluginCrashed();
|
||||||
|
Loading…
Reference in New Issue
Block a user