Bug 829557. Part 1: When calling into plugin code, identify situations where it is safe (or unsafe) to reenter Gecko from plugin code. r=bsmedberg

When Gecko is reentered from unsafe call sites, we allow the reentry, but we
suppress execution of the refresh driver to minimize the danger.
In this patch, we treat all sites as unsafe.
This commit is contained in:
Robert O'Callahan
2013-02-28 00:50:27 +13:00
parent 773d0d4280
commit 9b4faa088f
9 changed files with 80 additions and 38 deletions

View File

@@ -186,9 +186,9 @@ enum eNPPStreamTypeInternal {
static NS_DEFINE_IID(kMemoryCID, NS_MEMORY_CID);
PRIntervalTime NS_NotifyBeginPluginCall()
PRIntervalTime NS_NotifyBeginPluginCall(NSPluginCallReentry aReentryState)
{
nsNPAPIPluginInstance::BeginPluginCall();
nsNPAPIPluginInstance::BeginPluginCall(aReentryState);
return PR_IntervalNow();
}
@@ -196,9 +196,9 @@ PRIntervalTime NS_NotifyBeginPluginCall()
// registered to listen to the "experimental-notify-plugin-call" subject.
// Each "experimental-notify-plugin-call" notification carries with it the run
// time value in milliseconds that the call took to execute.
void NS_NotifyPluginCall(PRIntervalTime startTime)
void NS_NotifyPluginCall(PRIntervalTime startTime, NSPluginCallReentry aReentryState)
{
nsNPAPIPluginInstance::EndPluginCall();
nsNPAPIPluginInstance::EndPluginCall(aReentryState);
PRIntervalTime endTime = PR_IntervalNow() - startTime;
nsCOMPtr<nsIObserverService> notifyUIService =
@@ -789,7 +789,8 @@ nsPluginThreadRunnable::Run()
if (mFunc) {
PluginDestructionGuard guard(mInstance);
NS_TRY_SAFE_CALL_VOID(mFunc(mUserData), nullptr);
NS_TRY_SAFE_CALL_VOID(mFunc(mUserData), nullptr,
NS_PLUGIN_CALL_UNSAFE_TO_REENTER_GECKO);
}
return NS_OK;