Bug 1157237: Move invocation of async NPP_New to an async task; r=jimm
This commit is contained in:
@@ -2200,6 +2200,17 @@ private:
|
||||
NPError mResult;
|
||||
};
|
||||
|
||||
static void
|
||||
RunAsyncNPP_New(void* aChildInstance)
|
||||
{
|
||||
MOZ_ASSERT(aChildInstance);
|
||||
PluginInstanceChild* childInstance =
|
||||
static_cast<PluginInstanceChild*>(aChildInstance);
|
||||
NPError rv = childInstance->DoNPP_New();
|
||||
AsyncNewResultSender* task = new AsyncNewResultSender(childInstance, rv);
|
||||
childInstance->PostChildAsyncCall(task);
|
||||
}
|
||||
|
||||
bool
|
||||
PluginModuleChild::RecvAsyncNPP_New(PPluginInstanceChild* aActor)
|
||||
{
|
||||
@@ -2207,9 +2218,8 @@ PluginModuleChild::RecvAsyncNPP_New(PPluginInstanceChild* aActor)
|
||||
PluginInstanceChild* childInstance =
|
||||
reinterpret_cast<PluginInstanceChild*>(aActor);
|
||||
AssertPluginThread();
|
||||
NPError rv = childInstance->DoNPP_New();
|
||||
AsyncNewResultSender* task = new AsyncNewResultSender(childInstance, rv);
|
||||
childInstance->PostChildAsyncCall(task);
|
||||
// We don't want to run NPP_New async from within nested calls
|
||||
childInstance->AsyncCall(&RunAsyncNPP_New, childInstance);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user