+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)
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);
+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.
#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