WebKit:
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Dec 2004 02:00:34 +0000 (02:00 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Dec 2004 02:00:34 +0000 (02:00 +0000)
Helper method to get URL of plugin view.

        Reviewed by Chris.

        * Misc.subproj/WebNSViewExtras.m:
        (-[NSView _webViewURL]):

JavaScriptCore:
Pass URL of plugin view when call into JNI.

        Reviewed by Chris.

        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/bindings/jni/jni_objc.mm
WebKit/ChangeLog
WebKit/Misc.subproj/WebNSViewExtras.m

index 95eec4d22bcf50b8ee58709c00b5331700af82da..d8a5a52808ff706cc852208a15dd9ea838786c04 100644 (file)
@@ -1,3 +1,12 @@
+2004-12-14  Richard Williamson   <rjw@apple.com>
+
+       Pass URL of plugin view when call into JNI.
+
+        Reviewed by Chris.
+
+        * bindings/jni/jni_objc.mm:
+        (KJS::Bindings::dispatchJNICall):
+
 2004-12-13  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
index 5d931b06a424b5b98ec739f2409e7630e6fd2e72..b9ad924662bb7cb6c7440a023e881cc6e4f31d0e 100644 (file)
@@ -39,13 +39,21 @@ using namespace KJS::Bindings;
        exceptionDescription:(NSString **)exceptionString;
 @end
 
+@interface NSObject (WebPrivate)
+- (NSURL *)_webViewURL;
+@end
+
 bool KJS::Bindings::dispatchJNICall (const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, Value &exceptionDescription)
 {
     id view = (id)targetAppletView;
     
     if ([view respondsToSelector:@selector(webPlugInCallJava:isStatic:returnType:method:arguments:callingURL:exceptionDescription:)]) {
         NSString *_exceptionDescription = 0;
-        NSURL *_callingURL = callingURL ? [NSURL URLWithString:[NSString stringWithUTF8String:callingURL]] : nil;
+
+       // Always just pass the URL of the page that contains the applet.  The
+       // execution restrictions implemented in WebCore will guarantee
+       // that only appropriate JavaScript can reference the applet.
+       NSURL *_callingURL = [view _webViewURL];
         result = [view webPlugInCallJava:obj isStatic:isStatic returnType:returnType method:methodID arguments:args callingURL:_callingURL exceptionDescription:&_exceptionDescription];
         if (_exceptionDescription != 0) {
             exceptionDescription = convertNSStringToString(_exceptionDescription);
index 310adfbb593a3f7167a48b813cfc95a8a2233e41..4df941d992a773848a5ba9b907ac3c98f31b2104 100644 (file)
@@ -1,3 +1,12 @@
+2004-12-14  Richard Williamson   <rjw@apple.com>
+
+       Helper method to get URL of plugin view.
+
+        Reviewed by Chris.
+
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView _webViewURL]):
+
 2004-12-14  Vicki Murley <vicki@apple.com>
 
         Reviewed by rjw.
index 2ffa31d28dc2ea9e580012fc5a6e7170d414bdb6..da5068b0fac7c982e7be1af9049840e7fde77d63 100644 (file)
@@ -5,6 +5,7 @@
 
 #import <WebKit/WebNSViewExtras.h>
 
+#import <WebKit/WebDataSource.h>
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebFrameViewInternal.h>
 #import <WebKit/WebImageRenderer.h>
     return [[self _frame] dataSource];
 }
 
+- (NSURL *)_webViewURL
+{
+    return [[[[[self superview] _frame] dataSource] request] URL];
+}
 @end