[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:17:09 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit afa1d3999681d6adec44dc660ef570d376d79d4a
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 9 22:26:12 2003 +0000

            Reviewed by Darin.
    
    	<rdar://problem/3501030>: JavaScript sites crash when a PAC file is in place (WebCore,Safari 1.2)
    
            * khtml/ecma/kjs_events.cpp:
            (JSEventListener::handleEvent): Lock interpreter when needed.
            (JSLazyEventListener::parseCode): Likewise.
            (KJS::getDOMEvent): Likewise.
            * khtml/ecma/kjs_proxy.cpp:
            (KJSProxyImpl::evaluate): Likewise.
            (KJSProxyImpl::initScript): Likewise.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5729 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a34c936..11f3a99 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2003-12-09  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Darin.
+
+	<rdar://problem/3501030>: JavaScript sites crash when a PAC file is in place (WebCore,Safari 1.2)
+	
+        * khtml/ecma/kjs_events.cpp:
+        (JSEventListener::handleEvent): Lock interpreter when needed.
+        (JSLazyEventListener::parseCode): Likewise.
+        (KJS::getDOMEvent): Likewise.
+        * khtml/ecma/kjs_proxy.cpp:
+        (KJSProxyImpl::evaluate): Likewise.
+        (KJSProxyImpl::initScript): Likewise.
+
 2003-12-09  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3491235, really make <script src="..."/> work in HTML.  My original attempt to fix this only made
diff --git a/WebCore/khtml/ecma/kjs_events.cpp b/WebCore/khtml/ecma/kjs_events.cpp
index d508bb9..8f5944c 100644
--- a/WebCore/khtml/ecma/kjs_events.cpp
+++ b/WebCore/khtml/ecma/kjs_events.cpp
@@ -83,7 +83,9 @@ void JSEventListener::handleEvent(DOM::Event &evt, bool isWindowEvent)
     if (isWindowEvent) {
         thisObj = win;
     } else {
+        KJS::Interpreter::lock();
         thisObj = Object::dynamicCast(getDOMNode(exec,evt.currentTarget()));
+        KJS::Interpreter::unlock();
         if ( !thisObj.isNull() ) {
             ScopeChain scope = oldScope;
             static_cast<DOMNode*>(thisObj.imp())->pushEventHandlerScope(exec, scope);
@@ -97,7 +99,9 @@ void JSEventListener::handleEvent(DOM::Event &evt, bool isWindowEvent)
     // ... and in the interpreter
     interpreter->setCurrentEvent( &evt );
 
+    KJS::Interpreter::lock();
     Value retval = listener.call(exec, thisObj, args);
+    KJS::Interpreter::unlock();
 
     listener.setScope( oldScope );
 
@@ -175,6 +179,9 @@ void JSLazyEventListener::parseCode() const
       KJS::ScriptInterpreter *interpreter = static_cast<KJS::ScriptInterpreter *>(proxy->interpreter());
       ExecState *exec = interpreter->globalExec();
 
+
+      KJS::Interpreter::lock();
+
       //KJS::Constructor constr(KJS::Global::current().get("Function").imp());
       KJS::Object constr = interpreter->builtinFunction();
       KJS::List args;
@@ -184,6 +191,8 @@ void JSLazyEventListener::parseCode() const
       args.append(eventString);
       args.append(KJS::String(code));
       listener = constr.construct(exec, args); // ### is globalExec ok ?
+
+      KJS::Interpreter::unlock();
       
       if ( exec->hadException() ) {
 	exec->clearException();
@@ -379,6 +388,9 @@ Value KJS::getDOMEvent(ExecState *exec, DOM::Event e)
   if (!ei)
     return Null();
   ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->interpreter());
+
+  KJS::Interpreter::lock();
+
   DOMObject *ret = interp->getDOMObject(ei);
   if (!ret) {
     if (ei->isKeyboardEvent())
@@ -394,6 +406,9 @@ Value KJS::getDOMEvent(ExecState *exec, DOM::Event e)
 
     interp->putDOMObject(ei, ret);
   }
+
+  KJS::Interpreter::unlock();
+
   return Value(ret);
 }
 
diff --git a/WebCore/khtml/ecma/kjs_proxy.cpp b/WebCore/khtml/ecma/kjs_proxy.cpp
index e6bb265..de89052 100644
--- a/WebCore/khtml/ecma/kjs_proxy.cpp
+++ b/WebCore/khtml/ecma/kjs_proxy.cpp
@@ -129,7 +129,9 @@ QVariant KJSProxyImpl::evaluate(QString filename, int baseLine,
   {
     if ( comp.complType() == Throw )
     {
+        KJS::Interpreter::lock();
         UString msg = comp.value().toString(m_script->globalExec());
+        KJS::Interpreter::unlock();
         kdWarning(6070) << "Script threw exception: " << msg.qstring() << endl;
     }
     return QVariant();
@@ -268,8 +270,10 @@ void KJSProxyImpl::initScript()
   m_script->setDebuggingEnabled(m_debugEnabled);
 #endif
   //m_script->enableDebug();
+  KJS::Interpreter::lock();
   globalObject.put(m_script->globalExec(),
 		   "debug", Value(new TestFunctionImp()), Internal);
+  KJS::Interpreter::unlock();
 
 #if APPLE_CHANGES
   QString userAgent = KWQ(m_part)->userAgent();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list