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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:14:18 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f4d79689ac78f265f1af5cb747682280e6720e12
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 20 22:00:33 2003 +0000

    WebKit:
    	Added spin of event loop during applet lookup poll.  This
    	is necessary to allow timers and performOnMainThread: methods
    	a chance to fire.  The plugin depends on these mechanisms during
    	initialization.
    
            Reviewed by Chris.
    
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge pollForAppletInView:]):
    
    WebCore:
    	Cleaned up synchronous applet lookup and initialization.
    	We need to further cleanup applet instantiation.  It doesn't
    	need to be lazy with my modified Java Plugin.
    
            Reviewed by Chris.
    
            * khtml/ecma/kjs_html.cpp:
            (KJS::HTMLElement::tryGet):
            * khtml/html/html_objectimpl.cpp:
            (HTMLAppletElementImpl::setupApplet):
            (HTMLAppletElementImpl::getAppletInstance):
            * khtml/html/html_objectimpl.h:
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::getAppletInstanceForView):
            * kwq/KWQKJavaAppletWidget.h:
            * kwq/KWQKJavaAppletWidget.mm:
            (KJavaAppletWidget::showApplet):
    
    JavaScriptCore:
    	More LiveConnect stuff.
    
            Reviewed by Chris.
    
            * bindings/jni/jni_class.cpp:
            (JavaClass::classForName):
            (JavaClass::classForInstance):
            * bindings/jni/jni_instance.cpp:
            (JavaInstance::getValueOfField):
            * bindings/jni/jni_instance.h:
            (Bindings::JObjectWrapper::JObjectWrapper):
            * bindings/jni/jni_runtime.h:
            (Bindings::JavaConstructor::~JavaConstructor):
            (Bindings::JavaConstructor::operator=):
            (Bindings::JavaMethod::JavaMethod):
            (Bindings::JavaMethod::_commonDelete):
            (Bindings::JavaMethod::signature):
            * bindings/jni/jni_utility.cpp:
            (getJNIEnv):
            (attachToJavaVM):
            * bindings/jni/jni_utility.h:
            * bindings/runtime.h:
            * bindings/runtime_object.cpp:
            (RuntimeObjectImp::~RuntimeObjectImp):
            (RuntimeObjectImp::get):
            * bindings/runtime_object.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5601 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 52fff27..627348b 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,32 @@
+2003-11-20  Richard Williamson   <rjw at apple.com>
+
+	More LiveConnect stuff.
+
+        Reviewed by Chris.
+
+        * bindings/jni/jni_class.cpp:
+        (JavaClass::classForName):
+        (JavaClass::classForInstance):
+        * bindings/jni/jni_instance.cpp:
+        (JavaInstance::getValueOfField):
+        * bindings/jni/jni_instance.h:
+        (Bindings::JObjectWrapper::JObjectWrapper):
+        * bindings/jni/jni_runtime.h:
+        (Bindings::JavaConstructor::~JavaConstructor):
+        (Bindings::JavaConstructor::operator=):
+        (Bindings::JavaMethod::JavaMethod):
+        (Bindings::JavaMethod::_commonDelete):
+        (Bindings::JavaMethod::signature):
+        * bindings/jni/jni_utility.cpp:
+        (getJNIEnv):
+        (attachToJavaVM):
+        * bindings/jni/jni_utility.h:
+        * bindings/runtime.h:
+        * bindings/runtime_object.cpp:
+        (RuntimeObjectImp::~RuntimeObjectImp):
+        (RuntimeObjectImp::get):
+        * bindings/runtime_object.h:
+
 2003-11-19  Richard Williamson   <rjw at apple.com>
 
 	More LiveConnect stuff.
diff --git a/JavaScriptCore/bindings/jni/jni_class.cpp b/JavaScriptCore/bindings/jni/jni_class.cpp
index d4fa308..e932eb7 100644
--- a/JavaScriptCore/bindings/jni/jni_class.cpp
+++ b/JavaScriptCore/bindings/jni/jni_class.cpp
@@ -103,7 +103,7 @@ JavaClass *JavaClass::classForName (const char *name)
     _createClassesByNameIfNecessary();
     
     CFStringRef stringName = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
-    JavaClass *aClass = (JavaClass *)CFDictionaryGetValue(classesByName, name);
+    JavaClass *aClass = (JavaClass *)CFDictionaryGetValue(classesByName, stringName);
     if (aClass == NULL) {
         aClass = new JavaClass (name);
         CFDictionaryAddValue (classesByName, stringName, aClass);
@@ -119,9 +119,17 @@ JavaClass *JavaClass::classForInstance (jobject instance)
     
     jobject classOfInstance = callJNIObjectMethod(instance, "getClass", "()Ljava/lang/Class;");
     jstring className = (jstring)callJNIObjectMethod(classOfInstance, "getName", "()Ljava/lang/String;");
-    
+
     const char *classNameC = getCharactersFromJString (className);
-    JavaClass *aClass = classForName(classNameC);
+    
+    CFStringRef stringName = CFStringCreateWithCString(NULL, classNameC, kCFStringEncodingASCII);
+    JavaClass *aClass = (JavaClass *)CFDictionaryGetValue(classesByName, stringName);
+    if (aClass == NULL) {
+        aClass = new JavaClass (classOfInstance);
+        CFDictionaryAddValue (classesByName, stringName, aClass);
+    }
+    CFRelease (stringName);
+    
     releaseCharactersForJString(className, classNameC);
 
     return aClass;
diff --git a/JavaScriptCore/bindings/jni/jni_instance.cpp b/JavaScriptCore/bindings/jni/jni_instance.cpp
index f09758d..b673716 100644
--- a/JavaScriptCore/bindings/jni/jni_instance.cpp
+++ b/JavaScriptCore/bindings/jni/jni_instance.cpp
@@ -41,3 +41,9 @@ JavaInstance::JavaInstance (const JavaInstance &other) : Instance() {
     _instance = other._instance;
     _instance->ref();
 };
+
+KJS::Value JavaInstance::getValueOfField (const Field *aField) const
+{
+    return KJS::Value(0);
+}
+
diff --git a/JavaScriptCore/bindings/jni/jni_instance.h b/JavaScriptCore/bindings/jni/jni_instance.h
index 38c0438..654d5ae 100644
--- a/JavaScriptCore/bindings/jni/jni_instance.h
+++ b/JavaScriptCore/bindings/jni/jni_instance.h
@@ -50,7 +50,7 @@ protected:
         _env->DeleteLocalRef (instance);
         
         if  (_instance == NULL) {
-            fprintf (stderr, "%s:  out of memory!\n", __PRETTY_FUNCTION__);
+            fprintf (stderr, "%s:  could not get GlobalRef for %p\n", __PRETTY_FUNCTION__, instance);
         }
     }
     
@@ -96,6 +96,8 @@ public:
         
         return *this;
     };
+
+    virtual KJS::Value getValueOfField (const Field *aField) const;
     
 private:
     JObjectWrapper *_instance;
diff --git a/JavaScriptCore/bindings/jni/jni_runtime.h b/JavaScriptCore/bindings/jni/jni_runtime.h
index 2a19e10..6e03f18 100644
--- a/JavaScriptCore/bindings/jni/jni_runtime.h
+++ b/JavaScriptCore/bindings/jni/jni_runtime.h
@@ -123,7 +123,7 @@ public:
     JavaConstructor (JNIEnv *e, jobject aConstructor);
     
     ~JavaConstructor() {
-        delete _parameters;
+        delete [] _parameters;
     };
 
     void _commonCopy(const JavaConstructor &other) {
@@ -144,7 +144,7 @@ public:
         if (this == &other)
             return *this;
             
-        delete _parameters;
+        delete [] _parameters;
         
         _commonCopy (other);
 
@@ -200,14 +200,14 @@ private:
 class JavaMethod : public Method
 {
 public:
-    JavaMethod() : Method(), _name(0), _returnType(0) {};
+    JavaMethod() : Method(), _name(0), _signature(0), _returnType(0) {};
     
     JavaMethod (JNIEnv *env, jobject aMethod);
     
     void _commonDelete() {
         delete _name;
         delete _returnType;
-        delete _parameters;
+        delete [] _parameters;
     };
     
     ~JavaMethod () {
@@ -243,6 +243,7 @@ public:
 
     virtual KJS::Value value() const { return KJS::Value(0); }
     virtual const char *name() const { return _name->characters(); };
+    virtual const char *signature() const { return _signature->characters(); };
     virtual RuntimeType returnType() const { return _returnType->characters(); };
     virtual Parameter *parameterAt(long i) const { return &_parameters[i]; };
     virtual long numParameters() const { return _numParameters; };
@@ -251,6 +252,7 @@ private:
     JavaParameter *_parameters;
     long _numParameters;
     JavaString *_name;
+    JavaString *_signature;
     JavaString *_returnType;
 };
 
diff --git a/JavaScriptCore/bindings/jni/jni_utility.cpp b/JavaScriptCore/bindings/jni/jni_utility.cpp
index 142c66d..d3a973f 100644
--- a/JavaScriptCore/bindings/jni/jni_utility.cpp
+++ b/JavaScriptCore/bindings/jni/jni_utility.cpp
@@ -53,7 +53,7 @@ JNIEnv *getJNIEnv()
     JNIEnv *env;
     jint jniError = 0;
 
-    jniError = (jvm)->AttachCurrentThread((void**)&env, (void *)NULL);
+    jniError = (getJavaVM())->AttachCurrentThread((void**)&env, (void *)NULL);
     if ( jniError == JNI_OK )
         return env;
     else
@@ -93,20 +93,6 @@ static bool attachToJavaVM(JavaVM **jvm, JNIEnv **env)
     return attached;
 }
 
-typedef enum {
-    void_function,
-    object_function,
-    boolean_function,
-    byte_function,
-    char_function,
-    short_function,
-    int_function,
-    long_function,
-    float_function,
-    double_function
-} JNIFunctionType;
-
-
 static jvalue callJNIMethod( JNIFunctionType type, jobject obj, const char *name, const char *sig, va_list args)
 {
     JavaVM *jvm = NULL;
diff --git a/JavaScriptCore/bindings/jni/jni_utility.h b/JavaScriptCore/bindings/jni/jni_utility.h
index 492415e..3599857 100644
--- a/JavaScriptCore/bindings/jni/jni_utility.h
+++ b/JavaScriptCore/bindings/jni/jni_utility.h
@@ -27,6 +27,19 @@
 
 #include <JavaVM/jni.h>
 
+typedef enum {
+    void_function,
+    object_function,
+    boolean_function,
+    byte_function,
+    char_function,
+    short_function,
+    int_function,
+    long_function,
+    float_function,
+    double_function
+} JNIFunctionType;
+
 const char *getCharactersFromJString (jstring aJString);
 void releaseCharactersForJString (jstring aJString, const char *s);
 
diff --git a/JavaScriptCore/bindings/runtime.h b/JavaScriptCore/bindings/runtime.h
index a537654..9edcdbd 100644
--- a/JavaScriptCore/bindings/runtime.h
+++ b/JavaScriptCore/bindings/runtime.h
@@ -25,6 +25,7 @@
 #ifndef _RUNTIME_H_
 #define _RUNTIME_H_
 
+#include "list.h"
 #include "value.h"
 
 namespace Bindings
@@ -101,9 +102,14 @@ public:
     static Instance *createBindingForLanguageInstance (BindingLanguage language, void *instance);
 
     virtual Class *getClass() const = 0;
+    
+    virtual KJS::Value getValueOfField (const Field *aField) const = 0;
+    
     virtual ~Instance() {};
 };
 
+const char *signatureForParameters(const KJS::List &aList);
+
 };
 
 #endif
diff --git a/JavaScriptCore/bindings/runtime_object.cpp b/JavaScriptCore/bindings/runtime_object.cpp
index 497c5d1..169589e 100644
--- a/JavaScriptCore/bindings/runtime_object.cpp
+++ b/JavaScriptCore/bindings/runtime_object.cpp
@@ -36,6 +36,7 @@
 #include <assert.h>
 
 using namespace KJS;
+using namespace Bindings;
 
 const ClassInfo *RuntimeObjectImp::classInfo() const
 {
@@ -51,6 +52,11 @@ RuntimeObjectImp::RuntimeObjectImp(ObjectImp *proto)
     _classInfo.propHashTable = 0;
 }
 
+RuntimeObjectImp::~RuntimeObjectImp()
+{
+    delete instance;
+}
+
 RuntimeObjectImp::RuntimeObjectImp(Bindings::Instance *i) : ObjectImp ((ObjectImp *)0)
 {
     instance = i;
@@ -59,8 +65,15 @@ RuntimeObjectImp::RuntimeObjectImp(Bindings::Instance *i) : ObjectImp ((ObjectIm
 
 Value RuntimeObjectImp::get(ExecState *exec, const Identifier &propertyName) const
 {
-    printf ("%s: NOT YET IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
+    printf ("%s: NOT FULLY IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
     // Get the value of the RuntimeObject's property.
+    
+    Field *aField = instance->getClass()->fieldNamed(propertyName.ascii());
+    if (aField){
+        instance->getValueOfField (aField); 
+        printf ("%s: found field = %p, type = %s\n", __PRETTY_FUNCTION__, aField, aField->type());
+    }
+    
     return Undefined();
 }
 
diff --git a/JavaScriptCore/bindings/runtime_object.h b/JavaScriptCore/bindings/runtime_object.h
index 2c5dc04..d400e89 100644
--- a/JavaScriptCore/bindings/runtime_object.h
+++ b/JavaScriptCore/bindings/runtime_object.h
@@ -36,6 +36,8 @@ class RuntimeObjectImp : public ObjectImp {
 public:
     RuntimeObjectImp(ObjectImp *proto);
     
+    ~RuntimeObjectImp();
+    
     RuntimeObjectImp(Bindings::Instance *i);
 
     const ClassInfo *classInfo() const;
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 742ef8e..a2546c6 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2003-11-20  Richard Williamson   <rjw at apple.com>
+
+	Cleaned up synchronous applet lookup and initialization.
+	We need to further cleanup applet instantiation.  It doesn't
+	need to be lazy with my modified Java Plugin.
+
+        Reviewed by Chris.
+
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLElement::tryGet):
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLAppletElementImpl::setupApplet):
+        (HTMLAppletElementImpl::getAppletInstance):
+        * khtml/html/html_objectimpl.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::getAppletInstanceForView):
+        * kwq/KWQKJavaAppletWidget.h:
+        * kwq/KWQKJavaAppletWidget.mm:
+        (KJavaAppletWidget::showApplet):
+
 2003-11-20  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by David
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index 7d60a5e..cd3b6b7 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -1114,9 +1114,12 @@ Value KJS::HTMLElement::tryGet(ExecState *exec, const Identifier &propertyName)
       break;
     case ID_APPLET: {
         DOM::HTMLAppletElementImpl *appletElement = static_cast<DOM::HTMLAppletElementImpl *>(element.handle());
-        RuntimeObjectImp valueForApplet(appletElement->getAppletInstance());
-        printf ("%s:  ID_APPLET %p, propertyName %s\n", __PRETTY_FUNCTION__, appletElement->getAppletInstance(), propertyName.ascii());
-        return valueForApplet.get(exec,propertyName);
+        
+        if (appletElement->getAppletInstance()) {
+            RuntimeObjectImp valueForApplet(appletElement->getAppletInstance());
+            printf ("%s:  ID_APPLET %p, propertyName %s\n", __PRETTY_FUNCTION__, appletElement->getAppletInstance(), propertyName.ascii());
+            return valueForApplet.get(exec,propertyName);
+        }
     }
       break;
     default:
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index 9e8b068..aa6e702 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -166,21 +166,47 @@ bool HTMLAppletElementImpl::callMember(const QString & name, const QStringList &
 }
 
 #if APPLE_CHANGES
+void HTMLAppletElementImpl::setupApplet() const
+{
+    RenderApplet *r = static_cast<RenderApplet*>(m_render);
+    if (r && r->widget()){
+        KJavaAppletWidget *javaWidget = static_cast<KJavaAppletWidget*>(static_cast<RenderApplet*>(m_render)->widget());
+        
+        // Make sure all the parameters are set.
+        NodeImpl *child = firstChild();
+        while(child) {
+    
+            if(child->id() == ID_PARAM) {
+                HTMLParamElementImpl *p = static_cast<HTMLParamElementImpl *>(child);
+                if(javaWidget->applet())
+                    javaWidget->applet()->setParameter( p->name(), p->value());
+            }
+            child = child->nextSibling();
+        }
+        
+        // Create the plugin view for the applet.
+        // FIXME?  What about percent and variable widths/heights?
+        // FIXME?  What about padding and margins?
+        javaWidget->showApplet(r->style()->width().value, r->style()->height().value);
+    }
+}
+
 Bindings::Instance *HTMLAppletElementImpl::getAppletInstance() const
 {
     if (appletInstance)
         return appletInstance;
     
-    // Actually get instance point for corresponding jobject and create
-    // a Instance with it.
-    if (renderer()){
-        RenderApplet *r = static_cast<RenderApplet*>(m_render);
+    RenderApplet *r = static_cast<RenderApplet*>(m_render);
+    if (r && r->widget()){
+        // Make sure we've setup the applet.  This ensure that the applet
+        // will be returned from getAppletInstanceForView() below.
+        setupApplet();
         
-        if (r->widget()){
-            void *_view = r->widget()->getView();
-            KHTMLView* w = getDocument()->view();
-            appletInstance = KWQ(w->part())->getAppletInstanceForView((NSView *)_view);
-        }
+        // Call into the part (and over the bridge) to pull the Bindings::Instance
+        // from the guts of the Java VM.
+        void *_view = r->widget()->getView();
+        KHTMLView* v = getDocument()->view();
+        appletInstance = KWQ(v->part())->getAppletInstanceForView((NSView *)_view);
     }
     return appletInstance;
 }
diff --git a/WebCore/khtml/html/html_objectimpl.h b/WebCore/khtml/html/html_objectimpl.h
index eb0bc00..fd514ca 100644
--- a/WebCore/khtml/html/html_objectimpl.h
+++ b/WebCore/khtml/html/html_objectimpl.h
@@ -59,6 +59,7 @@ public:
     bool callMember(const QString &, const QStringList &, JType &, QString &);
     
 #if APPLE_CHANGES
+    void setupApplet() const;
     Bindings::Instance *getAppletInstance() const;
 #endif
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 4042685..0429d89 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -2753,15 +2753,14 @@ void KWQKHTMLPart::print()
 
 Bindings::Instance *KWQKHTMLPart::getAppletInstanceForView (NSView *aView)
 {
-    // Unfortunately we have to do a layout here to guarantee that 'real'
-    // applet view is correctly set on the RenderApplet's widget.
-    forceLayout();
-    
     // Get a pointer to the actual Java applet instance.
     jobject applet = [_bridge pollForAppletInView:aView];
     
-    // Wrap the Java instance in a language neutral binding and hand
-    // off ownership to the APPLET element.
-    return Bindings::Instance::createBindingForLanguageInstance (Bindings::Instance::JavaLanguage, applet);
+    if (applet)
+        // Wrap the Java instance in a language neutral binding and hand
+        // off ownership to the APPLET element.
+        return Bindings::Instance::createBindingForLanguageInstance (Bindings::Instance::JavaLanguage, applet);
+    
+    return 0;
 }
 
diff --git a/WebCore/kwq/KWQKJavaAppletWidget.h b/WebCore/kwq/KWQKJavaAppletWidget.h
index 89fb263..dbd6a1d 100644
--- a/WebCore/kwq/KWQKJavaAppletWidget.h
+++ b/WebCore/kwq/KWQKJavaAppletWidget.h
@@ -64,6 +64,7 @@ public:
     void setParameter(const QString &, const QString &);
 
     void showApplet();
+    void showApplet(int width, int height);
 
 private:
     KJavaApplet _applet;
diff --git a/WebCore/kwq/KWQKJavaAppletWidget.mm b/WebCore/kwq/KWQKJavaAppletWidget.mm
index 9fed103..fb61f93 100644
--- a/WebCore/kwq/KWQKJavaAppletWidget.mm
+++ b/WebCore/kwq/KWQKJavaAppletWidget.mm
@@ -58,12 +58,17 @@ void KJavaAppletWidget::setParameter(const QString &name, const QString &value)
 
 void KJavaAppletWidget::showApplet()
 {
+    showApplet (width(), height());
+}
+
+void KJavaAppletWidget::showApplet(int w, int h)
+{
     // If the view is a KWQView, we haven't replaced it with the Java view yet.
     // Only set the Java view once.
     KWQ_BLOCK_EXCEPTIONS;
     if ([getView() isKindOfClass:[KWQView class]]) {
         setView([KWQ(_context->part())->bridge()
-            viewForJavaAppletWithFrame:NSMakeRect(x(), y(), width(), height())
+            viewForJavaAppletWithFrame:NSMakeRect(x(), y(), w, h)
                             attributes:_parameters
                                baseURL:KURL(_baseURL).getNSURL()]);
         // Add the view to the main view now so the applet starts immediately rather than until the first paint.
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f50a01b..1fa59f4 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2003-11-20  Richard Williamson   <rjw at apple.com>
+
+	Added spin of event loop during applet lookup poll.  This
+	is necessary to allow timers and performOnMainThread: methods
+	a chance to fire.  The plugin depends on these mechanisms during
+	initialization.
+
+        Reviewed by Chris.
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge pollForAppletInView:]):
+
 2003-11-20  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by me
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 1e77ff7..19ad229 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -48,6 +48,7 @@
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLFileTypeMappings.h>
+
 #import <WebKit/WebLocalizableStrings.h>
 
 #import <JavaVM/jni.h>
@@ -1055,7 +1056,7 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     }
 }
 
-#define MAX_GET_APPLET_POLL_TIME 10
+#define MAX_GET_APPLET_POLL_TIME 20
 #define GET_APPLET_POLL_INTERVAL    1
 
 // pollGetApplet: will poll until getApplet on the plugin view returns non-nil,
@@ -1076,6 +1077,10 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
             if ([view mayActivate]){
                 [view activateApplet:nil];
             }
+            
+            // Give the run loop a spin.  This will cause any delayed or performOnMainThread:
+            // methods to fire.  The plugin does this during initialization.
+            [[NSApplication sharedApplication] nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:NO];
         }
     }
     return applet;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list