+2009-02-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ <rdar://problem/6631436>
+ CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit • WebKit::NetscapePluginInstanceProxy::addValueToArray + 55
+
+ Port the NPN_Evaluate code over from WebCore instead of using the frame loader.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::evaluate):
+
2009-02-27 Anders Carlsson <andersca@apple.com>
Reviewed by Geoffrey Garen.
Frame* frame = core([m_pluginView webFrame]);
if (!frame)
return false;
+
+ JSLock lock(false);
- ExecState* exec = frame->script()->globalObject()->globalExec();
- JSValuePtr value = frame->loader()->executeScript(script).jsValue();
+ ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject();
+ ExecState* exec = globalObject->globalExec();
+
+ globalObject->globalData()->timeoutChecker.start();
+ Completion completion = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(script));
+ globalObject->globalData()->timeoutChecker.stop();
+ ComplType type = completion.complType();
- marshalValue(exec, value, resultData, resultLength);
+ JSValuePtr result;
+ if (type == Normal)
+ result = completion.value();
+
+ if (!result)
+ result = jsUndefined();
+
+ marshalValue(exec, result, resultData, resultLength);
exec->clearException();
return true;
}