[webkit-changes] cvs commit: WebKit/WebView.subproj WebHTMLView.m
Tim
tomernic at opensource.apple.com
Sun Oct 23 19:13:19 PDT 2005
tomernic 05/10/23 19:13:19
Modified: . ChangeLog
Plugins.subproj WebPluginController.h WebPluginController.m
WebView.subproj WebHTMLView.m
Log:
Bug #: <http://bugzilla.opendarwin.org/show_bug.cgi?id=5365>
Submitted by: mitzpettel
Reviewed by: Dave Hyatt
Send -webPlugInStop (or -pluginStop) and -webPluginDestroy (or -pluginDestroy)
to complying plugins right when they're removed from the WebHTMLView, and also
release them from the plugin controller's arrays.
I think this patch makes WebKit behave more like plugins expect it to, which is
the way it already behaves with Netscape plugins.
I expect complying plugins to stop making noise when receiving the stop
message, but QuickTime doesn't. If it's lucky, then it will be deallocated
because of the release and will stop then. However, JS, for one, can retain the
plugin (e.g. if you execute <javascript:document.getElementById('obj').width;>
before clicking Remove OBJECT), in which case it will just keep playing.
Revision Changes Path
1.3360 +27 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3359
retrieving revision 1.3360
diff -u -r1.3359 -r1.3360
--- ChangeLog 24 Oct 2005 01:42:57 -0000 1.3359
+++ ChangeLog 24 Oct 2005 02:13:11 -0000 1.3360
@@ -1,3 +1,30 @@
+2005-10-23 Tim Omernick <tomernick at apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ <http://bugzilla.opendarwin.org/show_bug.cgi?id=5365>
+
+ Send -webPlugInStop (or -pluginStop) and -webPluginDestroy (or -pluginDestroy)
+ to complying plugins right when they're removed from the WebHTMLView, and also
+ release them from the plugin controller's arrays.
+
+ I think this patch makes WebKit behave more like plugins expect it to, which is
+ the way it already behaves with Netscape plugins.
+
+ I expect complying plugins to stop making noise when receiving the stop
+ message, but QuickTime doesn't. If it's lucky, then it will be deallocated
+ because of the release and will stop then. However, JS, for one, can retain the
+ plugin (e.g. if you execute <javascript:document.getElementById('obj').width;>
+ before clicking Remove OBJECT), in which case it will just keep playing.
+
+ * Plugins.subproj/WebPluginController.h:
+ * Plugins.subproj/WebPluginController.m:
+ (-[WebPluginController destroyPlugin:]):
+ Stop and destroy the plugin.
+ * WebView.subproj/WebHTMLView.m:
+ (-[NSArray willRemoveSubview:]):
+ Destroy plugins when they are removed from the HTML view.
+
2005-10-23 Geoffrey Garen <ggaren at apple.com>
Reviewed by Maciej.
1.15 +1 -0 WebKit/Plugins.subproj/WebPluginController.h
Index: WebPluginController.h
===================================================================
RCS file: /cvs/root/WebKit/Plugins.subproj/WebPluginController.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- WebPluginController.h 5 Jun 2005 17:54:35 -0000 1.14
+++ WebPluginController.h 24 Oct 2005 02:13:17 -0000 1.15
@@ -47,6 +47,7 @@
- (id)initWithDocumentView:(NSView *)view;
- (void)addPlugin:(NSView *)view;
+- (void)destroyPlugin:(NSView *)view;
- (void)startAllPlugins;
- (void)stopAllPlugins;
1.45 +20 -0 WebKit/Plugins.subproj/WebPluginController.m
Index: WebPluginController.m
===================================================================
RCS file: /cvs/root/WebKit/Plugins.subproj/WebPluginController.m,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- WebPluginController.m 5 Jun 2005 17:54:35 -0000 1.44
+++ WebPluginController.m 24 Oct 2005 02:13:18 -0000 1.45
@@ -178,6 +178,26 @@
}
}
+- (void)destroyPlugin:(NSView *)view
+{
+ if ([_views containsObject:view]) {
+ if (_started) {
+ if ([view respondsToSelector:@selector(webPlugInStop)])
+ [view webPlugInStop];
+ else if ([view respondsToSelector:@selector(pluginStop)])
+ [view pluginStop];
+ }
+
+ if ([view respondsToSelector:@selector(webPlugInDestroy)])
+ [view webPlugInDestroy];
+ else if ([view respondsToSelector:@selector(pluginDestroy)])
+ [view pluginDestroy];
+
+ [pluginViews removeObject:view];
+ [_views removeObject:view];
+ }
+}
+
- (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)checkIdentifier
{
[checkIdentifier cancel];
1.477 +7 -0 WebKit/WebView.subproj/WebHTMLView.m
Index: WebHTMLView.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebHTMLView.m,v
retrieving revision 1.476
retrieving revision 1.477
diff -u -r1.476 -r1.477
--- WebHTMLView.m 13 Oct 2005 19:37:31 -0000 1.476
+++ WebHTMLView.m 24 Oct 2005 02:13:18 -0000 1.477
@@ -2169,6 +2169,13 @@
}
}
+- (void)willRemoveSubview:(NSView *)subview
+{
+ if ([WebPluginController isPlugInView:subview])
+ [[self _pluginController] destroyPlugin:subview];
+ [super willRemoveSubview:subview];
+}
+
- (void)reapplyStyles
{
if (!_private->needsToApplyStyles) {
More information about the webkit-changes
mailing list