[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:21:21 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 048397acee61d54cbd15fe17a9cbb943acf3085a
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 23 06:55:08 2003 +0000
Fixed problem where we weren't stopping the Java plug-in. This problem was introduced on Jan. 1 when the ownership of the WebPluginController was moved from WebFrame to WebDataSource. This change moves the WebPluginController to the WebHTMLView. Why this change?
- The state of the plug-ins (currently only the Java plug-in) completely relies on the state of the WebHTMLView, not on the state of the WebDataSource.
- WebHTMLView and WebDataSource are usually coupled via WebView and WebFrame, but not always. In a transitional state, the WebHTMLView may not be up to date with the WebDataSource.
- WebPluginController controls an array of views. It makes more sense for this object to be owned by a view (WebHTMLView) not a model.
Reviewed by darin.
* Plugins.subproj/WebPluginController.h:
* Plugins.subproj/WebPluginController.m:
(-[WebPluginController initWithHTMLView:]): renamed, take the HTML view
(-[WebPluginController addPlugin:]): use the HTML view
(-[WebPluginController HTMLViewWillBeDeallocated]): renamed
(-[WebPluginController showURL:inFrame:]): use the HTML view
(-[WebPluginController showStatus:]): use the HTML view
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge pluginViewWithPackage:attributes:baseURL:]): get the plug-in controller from the HTML view
* WebView.subproj/WebDataSourcePrivate.h:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSourcePrivate dealloc]): removed calls to plug-in controller
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView initWithFrame:]): create plug-in controller
(-[WebHTMLView viewWillMoveToWindow:]): get plug-in controller from self, data source won't be accessible here since we don't have a superview
(-[WebHTMLView viewDidMoveToWindow]): get plug-in controller from self
(-[WebHTMLView addSubview:]): get plug-in controller from self
* WebView.subproj/WebHTMLViewPrivate.h:
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLViewPrivate dealloc]): release plug-in controller
(-[WebHTMLView _pluginController]): added
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 21a3eba..6f344f1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,37 @@
+2003-01-22 Chris Blumenberg <cblu at apple.com>
+
+ Fixed problem where we weren't stopping the Java plug-in. This problem was introduced on Jan. 1 when the ownership of the WebPluginController was moved from WebFrame to WebDataSource. This change moves the WebPluginController to the WebHTMLView. Why this change?
+
+ - The state of the plug-ins (currently only the Java plug-in) completely relies on the state of the WebHTMLView, not on the state of the WebDataSource.
+
+ - WebHTMLView and WebDataSource are usually coupled via WebView and WebFrame, but not always. In a transitional state, the WebHTMLView may not be up to date with the WebDataSource.
+
+ - WebPluginController controls an array of views. It makes more sense for this object to be owned by a view (WebHTMLView) not a model.
+
+ Reviewed by darin.
+
+ * Plugins.subproj/WebPluginController.h:
+ * Plugins.subproj/WebPluginController.m:
+ (-[WebPluginController initWithHTMLView:]): renamed, take the HTML view
+ (-[WebPluginController addPlugin:]): use the HTML view
+ (-[WebPluginController HTMLViewWillBeDeallocated]): renamed
+ (-[WebPluginController showURL:inFrame:]): use the HTML view
+ (-[WebPluginController showStatus:]): use the HTML view
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): get the plug-in controller from the HTML view
+ * WebView.subproj/WebDataSourcePrivate.h:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSourcePrivate dealloc]): removed calls to plug-in controller
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView initWithFrame:]): create plug-in controller
+ (-[WebHTMLView viewWillMoveToWindow:]): get plug-in controller from self, data source won't be accessible here since we don't have a superview
+ (-[WebHTMLView viewDidMoveToWindow]): get plug-in controller from self
+ (-[WebHTMLView addSubview:]): get plug-in controller from self
+ * WebView.subproj/WebHTMLViewPrivate.h:
+ * WebView.subproj/WebHTMLViewPrivate.m:
+ (-[WebHTMLViewPrivate dealloc]): release plug-in controller
+ (-[WebHTMLView _pluginController]): added
+
2003-01-22 John Sullivan <sullivan at apple.com>
- fixed 3152427 -- Need unique IDs for bookmarks, for
diff --git a/WebKit/Plugins.subproj/WebPluginController.h b/WebKit/Plugins.subproj/WebPluginController.h
index 3cdf821..7299d47 100644
--- a/WebKit/Plugins.subproj/WebPluginController.h
+++ b/WebKit/Plugins.subproj/WebPluginController.h
@@ -8,20 +8,20 @@
#import <Foundation/Foundation.h>
- at class WebDataSource;
+ at class WebHTMLView;
@protocol WebPlugin;
@protocol WebPluginContainer;
@interface WebPluginController : NSObject <WebPluginContainer>
{
- WebDataSource *_dataSource;
+ WebHTMLView *_HTMLView;
NSMutableArray *_views;
BOOL _started;
}
-- (id)initWithDataSource:(WebDataSource *)dataSource;
-- (void)dataSourceWillBeDeallocated;
+- (id)initWithHTMLView:(WebHTMLView *)HTMLView;
+- (void)HTMLViewWillBeDeallocated;
- (void)addPlugin:(NSView <WebPlugin> *)view;
diff --git a/WebKit/Plugins.subproj/WebPluginController.m b/WebKit/Plugins.subproj/WebPluginController.m
index 2e50464..69d329e 100644
--- a/WebKit/Plugins.subproj/WebPluginController.m
+++ b/WebKit/Plugins.subproj/WebPluginController.m
@@ -9,8 +9,9 @@
#import <WebKit/WebPluginController.h>
#import <WebKit/WebController.h>
-#import <WebKit/WebDataSource.h>
#import <WebKit/WebFrame.h>
+#import <WebKit/WebHTMLView.h>
+#import <WebKit/WebHTMLViewPrivate.h>
#import <WebKit/WebKitLogging.h>
#import <WebKit/WebPlugin.h>
#import <WebKit/WebPluginContainer.h>
@@ -21,10 +22,10 @@
@implementation WebPluginController
-- initWithDataSource:(WebDataSource *)dataSource
+- initWithHTMLView:(WebHTMLView *)HTMLView
{
[super init];
- _dataSource = dataSource;
+ _HTMLView = HTMLView;
_views = [[NSMutableArray alloc] init];
return self;
}
@@ -55,7 +56,7 @@
- (void)addPlugin:(NSView <WebPlugin> *)view
{
- if (!_dataSource) {
+ if (!_HTMLView) {
ERROR("can't add a plug-in to a defunct WebPluginController");
return;
}
@@ -73,7 +74,7 @@
}
}
-- (void)dataSourceWillBeDeallocated
+- (void)HTMLViewWillBeDeallocated
{
LOG(Plugins, "destroying all plug-ins");
@@ -83,7 +84,7 @@
[_views release];
_views = nil;
- _dataSource = nil;
+ _HTMLView = nil;
}
- (void)showURL:(NSURL *)URL inFrame:(NSString *)target
@@ -92,11 +93,11 @@
ERROR("nil URL passed");
return;
}
- if (!_dataSource) {
+ if (!_HTMLView) {
ERROR("could not load URL %@ because plug-in has already been destroyed", URL);
return;
}
- WebFrame *frame = [_dataSource webFrame];
+ WebFrame *frame = [_HTMLView _frame];
if (!frame) {
ERROR("could not load URL %@ because plug-in has already been stopped", URL);
return;
@@ -114,11 +115,11 @@
if (!message) {
message = @"";
}
- if (!_dataSource) {
+ if (!_HTMLView) {
ERROR("could not show status message (%@) because plug-in has already been destroyed", message);
return;
}
- [[[_dataSource controller] windowOperationsDelegate] setStatusText:message];
+ [[[_HTMLView _controller] windowOperationsDelegate] setStatusText:message];
}
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 2669691..c2941dd 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -394,7 +394,11 @@
attributes:(NSDictionary *)attributes
baseURL:(NSURL *)baseURL
{
- WebPluginController *pluginController = [[self dataSource] _pluginController];
+ WebHTMLView *docView = (WebHTMLView *)[[frame webView] documentView];
+
+ ASSERT ([docView isKindOfClass:[WebHTMLView class]]);
+
+ WebPluginController *pluginController = [docView _pluginController];
NSDictionary *arguments = [NSDictionary dictionaryWithObjectsAndKeys:
baseURL, WebPluginBaseURLKey,
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index c36df2a..855d74b 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -12,7 +12,6 @@
@class WebHistoryItem;
@class WebIconLoader;
@class WebMainResourceClient;
- at class WebPluginController;
@class WebResourceRequest;
@class WebResourceResponse;
@class WebSubresourceClient;
@@ -87,8 +86,6 @@
BOOL storedInPageCache;
BOOL loadingFromPageCache;
-
- WebPluginController *pluginController;
}
@end
@@ -149,6 +146,5 @@
- (void)_setStoredInPageCache:(BOOL)f;
- (BOOL)_storedInPageCache;
- (BOOL)_loadingFromPageCache;
-- (WebPluginController *)_pluginController;
@end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index cf6f1d6..0c0e504 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -23,8 +23,6 @@
#import <WebKit/WebKitLogging.h>
#import <WebKit/WebLocationChangeDelegate.h>
#import <WebKit/WebMainResourceClient.h>
-#import <WebKit/WebNetscapePluginStream.h>
-#import <WebKit/WebPluginController.h>
#import <WebKit/WebSubresourceClient.h>
#import <WebKit/WebTextRepresentation.h>
#import <WebKit/WebViewPrivate.h>
@@ -47,8 +45,6 @@
// retained while loading, so no need to release here
ASSERT(!loading);
- [pluginController dataSourceWillBeDeallocated];
-
// FIXME: We don't know why this is needed, but without it we leak icon loaders.
[iconLoader stopLoading];
@@ -68,7 +64,6 @@
[triggeringAction release];
[lastCheckedRequest release];
[downloadPath release];
- [pluginController release];
[super dealloc];
}
@@ -676,12 +671,4 @@
return _private->loadingFromPageCache;
}
-- (WebPluginController *)_pluginController
-{
- if (!_private->pluginController) {
- _private->pluginController = [[WebPluginController alloc] initWithDataSource:self];
- }
- return _private->pluginController;
-}
-
@end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 8999a2b..3ee2b80 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -43,6 +43,8 @@
_private = [[WebHTMLViewPrivate alloc] init];
+ _private->pluginController = [[WebPluginController alloc] initWithHTMLView:self];
+
_private->needsLayout = YES;
_private->canDragTo = YES;
@@ -218,12 +220,13 @@
- (void)viewWillMoveToWindow:(NSWindow *)window
{
+ // FIXME: Some of these calls may not work because this view may be already removed from it's superview.
[self removeMouseMovedObserver];
[self removeWindowObservers];
[self removeSuperviewObservers];
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_updateMouseoverWithFakeEvent) object:nil];
- [[[[self _frame] dataSource] _pluginController] stopAllPlugins];
+ [[self _pluginController] stopAllPlugins];
}
- (void)viewDidMoveToWindow
@@ -233,7 +236,7 @@
[self addSuperviewObservers];
[self addMouseMovedObserver];
- [[[[self _frame] dataSource] _pluginController] startAllPlugins];
+ [[self _pluginController] startAllPlugins];
_private->inWindow = YES;
} else {
@@ -251,7 +254,7 @@
- (void)addSubview:(NSView *)view
{
if ([view conformsToProtocol:@protocol(WebPlugin)]) {
- [[[[self _frame] dataSource] _pluginController] addPlugin:view];
+ [[self _pluginController] addPlugin:view];
}
[super addSubview:view];
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index bd15f94..ca43acd 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -11,6 +11,7 @@
@class WebBridge;
@class WebController;
@class WebFrame;
+ at class WebPluginController;
@interface WebHTMLViewPrivate : NSObject
{
@@ -32,6 +33,8 @@
NSURL *draggingImageURL;
NSSize lastLayoutSize;
+
+ WebPluginController *pluginController;
}
@end
@@ -66,4 +69,6 @@
- (void)_handleAutoscrollForMouseDragged:(NSEvent *)event;
- (BOOL)_mayStartDragWithMouseDragged:(NSEvent *)event;
+- (WebPluginController *)_pluginController;
+
@end
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index bf654d1..7d9d052 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -25,6 +25,7 @@
#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebNSViewExtras.h>
#import <WebKit/WebNetscapePluginEmbeddedView.h>
+#import <WebKit/WebPluginController.h>
#import <WebKit/WebPreferences.h>
#import <WebKit/WebStringTruncator.h>
#import <WebKit/WebViewPrivate.h>
@@ -87,9 +88,13 @@ static BOOL forceRealHitTest = NO;
- (void)dealloc
{
+ [pluginController HTMLViewWillBeDeallocated];
+
[mouseDownEvent release];
[dragElement release];
[draggingImageURL release];
+ [pluginController release];
+
[super dealloc];
}
@@ -560,6 +565,11 @@ static BOOL forceRealHitTest = NO;
return NO;
}
+- (WebPluginController *)_pluginController
+{
+ return _private->pluginController;
+}
+
@end
@implementation NSView (WebHTMLViewPrivate)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list