Commit bde934c5 authored by andersca's avatar andersca

JavaScriptCore:

        Reviewed by Mitz.

        <rdar://problem/5244948>
        Safari keeps on complaining about slow script playing NBC TV video (14133)

        http://bugs.webkit.org/show_bug.cgi?id=14133
        Runaway JavaScript timer fires when spinning around in Google Maps street view

        Make sure to start and stop the timeout checker around calls to JS.
        
        * bindings/NP_jsobject.cpp:
        (_NPN_InvokeDefault):
        (_NPN_Invoke):
        (_NPN_Evaluate):
        * bindings/jni/jni_jsobject.cpp:
        (JavaJSObject::call):
        (JavaJSObject::eval):

WebCore:

        Reviewed by Mitz.

        <rdar://problem/5244948>
        Safari keeps on complaining about slow script playing NBC TV video (14133)

        http://bugs.webkit.org/show_bug.cgi?id=14133
        Runaway JavaScript timer fires when spinning around in Google Maps street view

        Make sure to start and stop the timeout checker around calls to JS.

        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        (-[WebScriptObject evaluateWebScript:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f4535dde
2007-06-14 Anders Carlsson <andersca@apple.com>
Reviewed by Mitz.
<rdar://problem/5244948>
Safari keeps on complaining about slow script playing NBC TV video (14133)
http://bugs.webkit.org/show_bug.cgi?id=14133
Runaway JavaScript timer fires when spinning around in Google Maps street view
Make sure to start and stop the timeout checker around calls to JS.
* bindings/NP_jsobject.cpp:
(_NPN_InvokeDefault):
(_NPN_Invoke):
(_NPN_Evaluate):
* bindings/jni/jni_jsobject.cpp:
(JavaJSObject::call):
(JavaJSObject::eval):
2007-06-13 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
......
......@@ -124,8 +124,10 @@ bool _NPN_InvokeDefault(NPP, NPObject* o, const NPVariant* args, uint32_t argCou
return false;
List argList = listFromVariantArgs(exec, args, argCount, rootObject);
rootObject->interpreter()->startTimeoutCheck();
JSValue *resultV = funcImp->call (exec, funcImp, argList);
rootObject->interpreter()->stopTimeoutCheck();
// Convert and return the result of the function call.
convertValueToNPVariant(exec, resultV, result);
return true;
......@@ -177,7 +179,9 @@ bool _NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant*
JSObject *funcImp = static_cast<JSObject*>(func);
JSObject *thisObj = const_cast<JSObject*>(obj->imp);
List argList = listFromVariantArgs(exec, args, argCount, rootObject);
rootObject->interpreter()->startTimeoutCheck();
JSValue *resultV = funcImp->call (exec, thisObj, argList);
rootObject->interpreter()->stopTimeoutCheck();
// Convert and return the result of the function call.
convertValueToNPVariant(exec, resultV, result);
......@@ -209,7 +213,9 @@ bool _NPN_Evaluate(NPP, NPObject* o, NPString* s, NPVariant* variant)
NPUTF16* scriptString;
unsigned int UTF16Length;
convertNPStringToUTF16(s, &scriptString, &UTF16Length); // requires free() of returned memory
rootObject->interpreter()->startTimeoutCheck();
Completion completion = rootObject->interpreter()->evaluate(UString(), 0, UString((const UChar*)scriptString,UTF16Length));
rootObject->interpreter()->stopTimeoutCheck();
ComplType type = completion.complType();
JSValue* result;
......
......@@ -177,7 +177,9 @@ jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
JSObject *funcImp = static_cast<JSObject*>(func);
JSObject *thisObj = const_cast<JSObject*>(_imp);
List argList = listFromJArray(args);
rootObject->interpreter()->startTimeoutCheck();
JSValue *result = funcImp->call(exec, thisObj, argList);
rootObject->interpreter()->stopTimeoutCheck();
return convertValueToJObject(result);
}
......@@ -195,7 +197,9 @@ jobject JavaJSObject::eval(jstring script) const
if (!rootObject)
return 0;
rootObject->interpreter()->startTimeoutCheck();
Completion completion = rootObject->interpreter()->evaluate(UString(), 0, JavaString(script).ustring(),thisObj);
rootObject->interpreter()->stopTimeoutCheck();
ComplType type = completion.complType();
if (type == Normal) {
......
2007-06-14 Anders Carlsson <andersca@apple.com>
Reviewed by Mitz.
<rdar://problem/5244948>
Safari keeps on complaining about slow script playing NBC TV video (14133)
http://bugs.webkit.org/show_bug.cgi?id=14133
Runaway JavaScript timer fires when spinning around in Google Maps street view
Make sure to start and stop the timeout checker around calls to JS.
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
(-[WebScriptObject evaluateWebScript:]):
2007-06-14 George Staikos <staikos@kde.org>
Reviewed by Maciej.
......@@ -286,7 +286,9 @@ static List listFromNSArray(ExecState *exec, NSArray *array, RootObject* rootObj
JSObject *thisObj = const_cast<JSObject*>([self _imp]);
List argList = listFromNSArray(exec, args, [self _rootObject]);
[self _rootObject]->interpreter()->startTimeoutCheck();
JSValue *result = funcImp->call(exec, thisObj, argList);
[self _rootObject]->interpreter()->stopTimeoutCheck();
if (exec->hadException()) {
LOG_EXCEPTION(exec);
......@@ -317,7 +319,9 @@ static List listFromNSArray(ExecState *exec, NSArray *array, RootObject* rootObj
JSLock lock;
JSValue *v = convertObjcValueToValue(exec, &script, ObjcObjectType, [self _rootObject]);
[self _rootObject]->interpreter()->startTimeoutCheck();
Completion completion = [self _rootObject]->interpreter()->evaluate(UString(), 0, v->toString(exec));
[self _rootObject]->interpreter()->stopTimeoutCheck();
ComplType type = completion.complType();
if (type == Normal) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment