зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1047509 - Part 2: Replace nsCxPusher in nsJSNPRuntime.cpp nsJSObjWrapper::NP_GetProperty. r=bholley
This commit is contained in:
Родитель
3e1c0c8724
Коммит
6a7e711651
|
@ -737,12 +737,17 @@ nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id,
|
|||
NPVariant *result)
|
||||
{
|
||||
NPP npp = NPPStack::Peek();
|
||||
JSContext *cx = GetJSContext(npp);
|
||||
|
||||
if (!cx) {
|
||||
nsCOMPtr<nsIGlobalObject> globalObject = GetGlobalObject(npp);
|
||||
if (NS_WARN_IF(!globalObject)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We're about to run script via JS_CallFunctionValue, so we need an
|
||||
// AutoEntryScript. NPAPI plugins are Gecko-specific and not in any spec.
|
||||
dom::AutoEntryScript aes(globalObject);
|
||||
JSContext *cx = aes.cx();
|
||||
|
||||
if (!npobj) {
|
||||
ThrowJSException(cx,
|
||||
"Null npobj in nsJSObjWrapper::NP_GetProperty!");
|
||||
|
@ -752,8 +757,6 @@ nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id,
|
|||
|
||||
nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
|
||||
|
||||
nsCxPusher pusher;
|
||||
pusher.Push(cx);
|
||||
AutoJSExceptionReporter reporter(cx);
|
||||
JSAutoCompartment ac(cx, npjsobj->mJSObj);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче