+2009-02-12 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ <rdar://problem/6579412>
+ REGRESSION (3.2.1-ToT): Crash in Silverlight viewing streaming lecture
+
+ * Plugins/WebNetscapePluginView.h:
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView userAgent]):
+ Apply workaround for Silverlight workaround.
+
+ (-[WebNetscapePluginView _createPlugin]):
+ Check if the plug-in that we're creating is the silverlight plug-in.
+
2009-02-12 Brady Eidson <beidson@apple.com>
Reviewed by Darin Adler
- (const char *)userAgent
{
- return [[[self webView] userAgentForURL:_baseURL.get()] UTF8String];
+ NSString *userAgent = [[self webView] userAgentForURL:_baseURL.get()];
+
+ if (_isSilverlight) {
+ // Silverlight has a workaround for a leak in Safari 2. This workaround is
+ // applied when the user agent does not contain "Version/3" so we append it
+ // at the end of the user agent.
+ userAgent = [userAgent stringByAppendingString:@" Version/3.2.1"];
+ }
+
+ return [userAgent UTF8String];
}
-(void)status:(const char *)message
PluginMainThreadScheduler::scheduler().registerPlugin(plugin);
+ _isSilverlight = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.SilverlightPlugin"];
+
[[self class] setCurrentPluginView:self];
NPError npErr = [_pluginPackage.get() pluginFuncs]->newp((char *)[_MIMEType.get() cString], plugin, _mode, argsCount, cAttributes, cValues, NULL);
[[self class] setCurrentPluginView:nil];