Bug 967694 - Make clear that we only sync spawn plugins in response to content, not chrome, JS access. r=bsmedberg

This commit is contained in:
John Schoenick 2014-02-04 13:53:32 -08:00
parent cab43a3bfd
commit 5cfba85d3a

View File

@ -2622,7 +2622,7 @@ nsObjectLoadingContent::ScriptRequestPluginInstance(JSContext* aCx,
NS_NOTREACHED("failed to dispatch PluginScripted event");
}
mScriptRequested = true;
} else if (mType == eType_Plugin && !mInstanceOwner &&
} else if (callerIsContentJS && mType == eType_Plugin && !mInstanceOwner &&
nsContentUtils::IsSafeToRunScript() &&
InActiveDocument(thisContent)) {
// If we're configured as a plugin in an active document and it's safe to
@ -3434,7 +3434,8 @@ nsObjectLoadingContent::DoNewResolve(JSContext* aCx, JS::Handle<JSObject*> aObje
JS::Handle<jsid> aId,
JS::MutableHandle<JSPropertyDescriptor> aDesc)
{
// We don't resolve anything; we just try to make sure we're instantiated
// We don't resolve anything; we just try to make sure we're instantiated.
// This purposefully does not fire for chrome/xray resolves, see bug 967694
nsRefPtr<nsNPAPIPluginInstance> pi;
nsresult rv = ScriptRequestPluginInstance(aCx, getter_AddRefs(pi));
@ -3450,8 +3451,8 @@ nsObjectLoadingContent::GetOwnPropertyNames(JSContext* aCx,
ErrorResult& aRv)
{
// Just like DoNewResolve, just make sure we're instantiated. That will do
// the work our Enumerate hook needs to do, and we don't want to return these
// property names from Xrays anyway.
// the work our Enumerate hook needs to do. This purposefully does not fire
// for xray resolves, see bug 967694
nsRefPtr<nsNPAPIPluginInstance> pi;
aRv = ScriptRequestPluginInstance(aCx, getter_AddRefs(pi));
}