[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:13:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 10455d77264d57226f0f22166fcb4f4015fdaaeb
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 19 22:21:40 2003 +0000

    WebKit:
    	More LiveConnect stuff.  Horrible polling hack that
    	blocks main thread waiting for applet to fully initialize.
    
            Reviewed by Ken.
    
            * Plugins.subproj/WebPluginController.m:
            (-[WebPluginController addPlugin:]):
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge pollForAppletInView:]):
    
    WebCore:
    	More LiveConnect stuff.  With that patch we make the applet
    	visible to JavaScript in an Bindings::Instance.  Next step
    	it to flush out implementation of RuntimeObjectImp and
    	RuntimeFunctionImp.
    
            Reviewed by Ken.
    
            * khtml/html/html_objectimpl.cpp:
            (HTMLAppletElementImpl::HTMLAppletElementImpl):
            (HTMLAppletElementImpl::~HTMLAppletElementImpl):
            (HTMLAppletElementImpl::getAppletInstance):
            * khtml/html/html_objectimpl.h:
            * kwq/KWQKHTMLPart.h:
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::getAppletInstanceForView):
            * kwq/WebCoreBridge.h:
    
    JavaScript:
    	More LiveConnect stuff.
    
            Reviewed by Ken.
    
            * JavaScriptCore.pbproj/project.pbxproj:
            * bindings/jni/jni_class.cpp: Added.
            (JavaClass::_commonInit):
            (JavaClass::JavaClass):
            (_createClassesByNameIfNecessary):
            (JavaClass::classForName):
            (JavaClass::classForInstance):
            (JavaClass::methodNamed):
            (JavaClass::fieldNamed):
            * bindings/jni/jni_class.h: Added.
            (Bindings::JavaClass::_commonDelete):
            (Bindings::JavaClass::~JavaClass):
            (Bindings::JavaClass::_commonCopy):
            (Bindings::JavaClass::JavaClass):
            (Bindings::JavaClass::operator=):
            (Bindings::JavaClass::name):
            (Bindings::JavaClass::constructorAt):
            (Bindings::JavaClass::numConstructors):
            * bindings/jni/jni_instance.cpp: Added.
            (JavaInstance::JavaInstance):
            (JavaInstance::~JavaInstance):
            * bindings/jni/jni_instance.h: Added.
            (Bindings::JObjectWrapper::JObjectWrapper):
            (Bindings::JObjectWrapper::~JObjectWrapper):
            (Bindings::JObjectWrapper::ref):
            (Bindings::JObjectWrapper::deref):
            (Bindings::JavaInstance::getClass):
            (Bindings::JavaInstance::operator=):
            * bindings/jni/jni_runtime.cpp:
            (JavaMethod::JavaMethod):
            * bindings/jni/jni_runtime.h:
            (Bindings::JavaString::JavaString):
            (Bindings::JavaString::~JavaString):
            (Bindings::JavaString::operator=):
            * bindings/jni/jni_utility.cpp:
            (getJavaVM):
            (getJNIEnv):
            (getCharactersFromJString):
            (releaseCharactersForJString):
            (getCharactersFromJStringInEnv):
            (releaseCharactersForJStringInEnv):
            * bindings/jni/jni_utility.h:
            * bindings/runtime.cpp:
            (Instance::createBindingForLanguageInstance):
            * bindings/runtime.h:
            (Bindings::Instance::):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5590 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index a79e561..249908c 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2003-11-19  Richard Williamson   <rjw at apple.com>
+
+	More LiveConnect stuff.  Horrible polling hack that
+	blocks main thread waiting for applet to fully initialize.
+
+        Reviewed by Ken.
+
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController addPlugin:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge pollForAppletInView:]):
+
 2003-11-19  David Hyatt  <hyatt at apple.com>
 
 	Make updateScrollers guard non-static, so that it applies only to the view whose scrollers are being
diff --git a/WebKit/Plugins.subproj/WebPluginController.m b/WebKit/Plugins.subproj/WebPluginController.m
index c4ee1e1..83058d6 100644
--- a/WebKit/Plugins.subproj/WebPluginController.m
+++ b/WebKit/Plugins.subproj/WebPluginController.m
@@ -21,8 +21,8 @@
 #import <Foundation/NSURL_NSURLExtras.h>
 #import <Foundation/NSURLRequest.h>
 
- at interface NSView (WebInternal)
-- (void *)getApplet;
+ at interface NSView (PluginSecrets)
+- (void)setContainingWindow:(NSWindow *)w;
 @end
 
 @implementation WebPluginController
@@ -72,27 +72,20 @@
     
     if (![_views containsObject:view]) {
         [_views addObject:view];
-
+        
         LOG(Plugins, "initializing plug-in %@", view);
         [view pluginInitialize];
 
         if (_started) {
             LOG(Plugins, "starting plug-in %@", view);
             [view pluginStart];
-
-            [self performSelector:@selector(_delayedGetApplet:) withObject:view afterDelay: 4.0];
+            
+            if ([view respondsToSelector:@selector(setContainingWindow:)])
+                [view setContainingWindow:[_HTMLView window]];
         }
     }
 }
 
-// Temporary hack until we add notification from plugin that applet has been
-// activated.
-- (void)_delayedGetApplet: (NSView *)view
-{
-    if ([view respondsToSelector: @selector(getApplet)])
-        NSLog (@"%@ getApplet = %p\n", view, [view getApplet]);
-}
-
 - (void)destroyAllPlugins
 {    
     [self stopAllPlugins];
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index dc6e98f..1e77ff7 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -50,6 +50,8 @@
 #import <Foundation/NSURLFileTypeMappings.h>
 #import <WebKit/WebLocalizableStrings.h>
 
+#import <JavaVM/jni.h>
+
 #define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange"
 #define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode")
 #define UniversalAccessDomain CFSTR("com.apple.universalaccess")
@@ -62,6 +64,13 @@
 - (NSView *)_findLastViewInKeyViewLoop;
 @end
 
+ at interface NSView (JavaPluginSecrets)
+- (void *)getApplet;
+- (BOOL)mayActivate;
+- (void)activateApplet:(id)unused;
+ at end
+
+
 @implementation WebBridge
 
 - (id)initWithWebFrame:(WebFrame *)webFrame
@@ -1046,4 +1055,31 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     }
 }
 
+#define MAX_GET_APPLET_POLL_TIME 10
+#define GET_APPLET_POLL_INTERVAL    1
+
+// pollGetApplet: will poll until getApplet on the plugin view returns non-nil,
+// or MAX_GET_APPLET_POLL_TIME is exceeded.
+- (jobject)pollForAppletInView: (NSView *)view
+{
+    jobject applet = 0;
+    
+    if ([view respondsToSelector: @selector(getApplet)]) {
+        NSTimeInterval timeUsed = 0;
+
+        while (!applet && timeUsed  < MAX_GET_APPLET_POLL_TIME) {
+            applet = [view getApplet];
+            [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:GET_APPLET_POLL_INTERVAL]];
+            timeUsed += GET_APPLET_POLL_INTERVAL;
+            NSLog (@"%s:  applet = %p", __PRETTY_FUNCTION__, applet);
+            
+            if ([view mayActivate]){
+                [view activateApplet:nil];
+            }
+        }
+    }
+    return applet;
+}
+
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list