[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:39:08 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 15d67e449931a8f2dcfbca85d1284619ca1a18fe
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Sep 14 00:02:30 2002 +0000

    WebCore:
    
    	Here's the *real* mistake that killed plugins. I accidentally
    	stopped creating objects at all! Duh. Fixed now.
    
            * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::createPart):
    	Make a part for a plugin if we need one. Not a KHTMLPart, but
    	a KWQPluginPart.
    
    WebKit:
    
    	Added assertions, and dealt with some breakage I created while
    	trying to fix, here, what I broke in WebCore.
    
            * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView start]):
    	Do get the dataSource from our parent when we are being used as an
    	object in a view rather than a document view.
    
            * Plugins.subproj/WebPluginStream.m:
            * WebView.subproj/WebDataSource.m:
            * WebView.subproj/WebFrame.m:
    	Leave in the assertions I used to debug.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2064 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index c8a1f82..f701a5e 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-09-13  Darin Adler  <darin at apple.com>
+
+	Here's the *real* mistake that killed plugins. I accidentally
+	stopped creating objects at all! Duh. Fixed now.
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::createPart):
+	Make a part for a plugin if we need one. Not a KHTMLPart, but
+	a KWQPluginPart.
+
+2002-09-13  Darin Adler  <darin at apple.com>
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::createPart):
+	Fix plugin-related crashes by making sure each part has a unique
+	frame name. There may be something fundamentally wrong with how this
+	is working now.
+
 2002-09-13  Richard Williamson (Home)  <rjw at apple.com>
 
         Made justified text work correctly in khtml for rendering
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c8a1f82..f701a5e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,19 @@
+2002-09-13  Darin Adler  <darin at apple.com>
+
+	Here's the *real* mistake that killed plugins. I accidentally
+	stopped creating objects at all! Duh. Fixed now.
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::createPart):
+	Make a part for a plugin if we need one. Not a KHTMLPart, but
+	a KWQPluginPart.
+
+2002-09-13  Darin Adler  <darin at apple.com>
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::createPart):
+	Fix plugin-related crashes by making sure each part has a unique
+	frame name. There may be something fundamentally wrong with how this
+	is working now.
+
 2002-09-13  Richard Williamson (Home)  <rjw at apple.com>
 
         Made justified text work correctly in khtml for rendering
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c8a1f82..f701a5e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2002-09-13  Darin Adler  <darin at apple.com>
+
+	Here's the *real* mistake that killed plugins. I accidentally
+	stopped creating objects at all! Duh. Fixed now.
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::createPart):
+	Make a part for a plugin if we need one. Not a KHTMLPart, but
+	a KWQPluginPart.
+
+2002-09-13  Darin Adler  <darin at apple.com>
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::createPart):
+	Fix plugin-related crashes by making sure each part has a unique
+	frame name. There may be something fundamentally wrong with how this
+	is working now.
+
 2002-09-13  Richard Williamson (Home)  <rjw at apple.com>
 
         Made justified text work correctly in khtml for rendering
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 58c5f1d..9664d9b 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -194,53 +194,44 @@ void KWQKHTMLPartImpl::urlSelected(const KURL &url, int button, int state, const
     [targetBridge loadURL:cocoaURL referrer:referrer(args)];
 }
 
+class KWQPluginPart : public ReadOnlyPart
+{
+    virtual bool openURL(const KURL &) { return true; }
+    virtual bool closeURL() { return true; }
+};
+
 ReadOnlyPart *KWQKHTMLPartImpl::createPart(const ChildFrame &child, const KURL &url, const QString &mimeType)
 {
-    LOG(Frames, "name %s", child.m_name.ascii());
-    
     NSURL *childURL = url.getNSURL();
     if (childURL == nil) {
         // FIXME: Do we need to report an error to someone?
         return 0;
     }
     
-    HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(child.m_frame->element());
-    WebCoreBridge *childBridge = [_bridge createChildFrameNamed:child.m_name.getNSString()
-        withURL:childURL referrer:referrer(child.m_args)
-        renderPart:child.m_frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
-        marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()];
-    return [childBridge part];
-}
-
-bool KWQKHTMLPartImpl::requestObject(RenderPart *frame, const QString &url, const QString &serviceType, const QStringList &args)
-{
-    if (url.isEmpty()) {
-        return false;
-    }
-    NSURL *cocoaURL = part->completeURL(url).getNSURL();
-    if (cocoaURL == nil) {
-        // FIXME: We need to report an error to someone.
-        return false;
-    }
-
-    if (frame->widget()) {
-        return true;
-    }
-    
-    NSMutableArray *argsArray = [NSMutableArray arrayWithCapacity:args.count()];
-    for (uint i = 0; i < args.count(); i++) {
-        [argsArray addObject:args[i].getNSString()];
+    if (child.m_type == ChildFrame::Object) {
+        NSMutableArray *paramsArray = [NSMutableArray arrayWithCapacity:child.m_params.count()];
+        for (uint i = 0; i < child.m_params.count(); i++) {
+            [paramsArray addObject:child.m_params[i].getNSString()];
+        }
+        
+        KWQPluginPart *newPart = new KWQPluginPart;
+        newPart->setWidget(new QWidget([[WebCoreViewFactory sharedFactory]
+            viewForPluginWithURL:childURL
+                     serviceType:child.m_args.serviceType.getNSString()
+                       arguments:paramsArray
+                         baseURL:KURL(d->m_doc->baseURL()).getNSURL()]));
+        return newPart;
+    } else {
+        LOG(Frames, "name %s", child.m_name.ascii());
+        HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(child.m_frame->element());
+        WebCoreBridge *childBridge = [_bridge createChildFrameNamed:child.m_name.getNSString()
+            withURL:childURL referrer:referrer(child.m_args)
+            renderPart:child.m_frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
+            marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()];
+        return [childBridge part];
     }
-    
-    QWidget *widget = new QWidget([[WebCoreViewFactory sharedFactory]
-        viewForPluginWithURL:cocoaURL
-                 serviceType:serviceType.getNSString()
-                   arguments:argsArray
-                     baseURL:KURL(d->m_doc->baseURL()).getNSURL()]);
-    frame->setWidget(widget);
-    return true;
 }
-
+    
 void KWQKHTMLPartImpl::submitForm(const KURL &u, const URLArgs &args)
 {
     if (!args.doPost()) {
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 58c5f1d..9664d9b 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -194,53 +194,44 @@ void KWQKHTMLPartImpl::urlSelected(const KURL &url, int button, int state, const
     [targetBridge loadURL:cocoaURL referrer:referrer(args)];
 }
 
+class KWQPluginPart : public ReadOnlyPart
+{
+    virtual bool openURL(const KURL &) { return true; }
+    virtual bool closeURL() { return true; }
+};
+
 ReadOnlyPart *KWQKHTMLPartImpl::createPart(const ChildFrame &child, const KURL &url, const QString &mimeType)
 {
-    LOG(Frames, "name %s", child.m_name.ascii());
-    
     NSURL *childURL = url.getNSURL();
     if (childURL == nil) {
         // FIXME: Do we need to report an error to someone?
         return 0;
     }
     
-    HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(child.m_frame->element());
-    WebCoreBridge *childBridge = [_bridge createChildFrameNamed:child.m_name.getNSString()
-        withURL:childURL referrer:referrer(child.m_args)
-        renderPart:child.m_frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
-        marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()];
-    return [childBridge part];
-}
-
-bool KWQKHTMLPartImpl::requestObject(RenderPart *frame, const QString &url, const QString &serviceType, const QStringList &args)
-{
-    if (url.isEmpty()) {
-        return false;
-    }
-    NSURL *cocoaURL = part->completeURL(url).getNSURL();
-    if (cocoaURL == nil) {
-        // FIXME: We need to report an error to someone.
-        return false;
-    }
-
-    if (frame->widget()) {
-        return true;
-    }
-    
-    NSMutableArray *argsArray = [NSMutableArray arrayWithCapacity:args.count()];
-    for (uint i = 0; i < args.count(); i++) {
-        [argsArray addObject:args[i].getNSString()];
+    if (child.m_type == ChildFrame::Object) {
+        NSMutableArray *paramsArray = [NSMutableArray arrayWithCapacity:child.m_params.count()];
+        for (uint i = 0; i < child.m_params.count(); i++) {
+            [paramsArray addObject:child.m_params[i].getNSString()];
+        }
+        
+        KWQPluginPart *newPart = new KWQPluginPart;
+        newPart->setWidget(new QWidget([[WebCoreViewFactory sharedFactory]
+            viewForPluginWithURL:childURL
+                     serviceType:child.m_args.serviceType.getNSString()
+                       arguments:paramsArray
+                         baseURL:KURL(d->m_doc->baseURL()).getNSURL()]));
+        return newPart;
+    } else {
+        LOG(Frames, "name %s", child.m_name.ascii());
+        HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(child.m_frame->element());
+        WebCoreBridge *childBridge = [_bridge createChildFrameNamed:child.m_name.getNSString()
+            withURL:childURL referrer:referrer(child.m_args)
+            renderPart:child.m_frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
+            marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()];
+        return [childBridge part];
     }
-    
-    QWidget *widget = new QWidget([[WebCoreViewFactory sharedFactory]
-        viewForPluginWithURL:cocoaURL
-                 serviceType:serviceType.getNSString()
-                   arguments:argsArray
-                     baseURL:KURL(d->m_doc->baseURL()).getNSURL()]);
-    frame->setWidget(widget);
-    return true;
 }
-
+    
 void KWQKHTMLPartImpl::submitForm(const KURL &u, const URLArgs &args)
 {
     if (!args.doPost()) {
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3a65742..c0c26b3 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,19 @@
 2002-09-13  Darin Adler  <darin at apple.com>
 
+	Added assertions, and dealt with some breakage I created while
+	trying to fix, here, what I broke in WebCore.
+
+        * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView start]):
+	Do get the dataSource from our parent when we are being used as an
+	object in a view rather than a document view.
+
+        * Plugins.subproj/WebPluginStream.m:
+        * WebView.subproj/WebDataSource.m:
+        * WebView.subproj/WebFrame.m:
+	Leave in the assertions I used to debug.
+
+2002-09-13  Darin Adler  <darin at apple.com>
+
 	- fixed 3031685 -- The text encoding setting is not propagated to subframes
 
         * WebView.subproj/WebDocument.h: Remove old WebDocumentTextEncoding methods,
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 3a65742..c0c26b3 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,19 @@
 2002-09-13  Darin Adler  <darin at apple.com>
 
+	Added assertions, and dealt with some breakage I created while
+	trying to fix, here, what I broke in WebCore.
+
+        * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView start]):
+	Do get the dataSource from our parent when we are being used as an
+	object in a view rather than a document view.
+
+        * Plugins.subproj/WebPluginStream.m:
+        * WebView.subproj/WebDataSource.m:
+        * WebView.subproj/WebFrame.m:
+	Leave in the assertions I used to debug.
+
+2002-09-13  Darin Adler  <darin at apple.com>
+
 	- fixed 3031685 -- The text encoding setting is not propagated to subframes
 
         * WebView.subproj/WebDocument.h: Remove old WebDocumentTextEncoding methods,
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index e65d4c4..62c0da5 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -34,6 +34,8 @@
 
 - (void) getFunctionPointersFromPluginView:(WebNetscapePluginView *)pluginView
 {
+    ASSERT(pluginView);
+    
     NPP_NewStream = 	[pluginView NPP_NewStream];
     NPP_WriteReady = 	[pluginView NPP_WriteReady];
     NPP_Write = 	[pluginView NPP_Write];
@@ -67,6 +69,7 @@
        return nil;
     
     view = [(WebNetscapePluginView *)thePluginPointer->ndata retain];
+    ASSERT(view);
     URL = [theURL retain];
     instance = thePluginPointer;
     notifyData = theNotifyData;
@@ -96,7 +99,6 @@
 
 - (void)startLoad
 {
-    ASSERT([view webDataSource]);
     WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
     resource = [[WebResourceHandle alloc] initWithRequest:request client:self];
     [resource loadInBackground];
@@ -235,6 +237,12 @@
 
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
 {
+    ASSERT(dataSource);
+    ASSERT([dataSource webFrame]);
+    ASSERT([[dataSource webFrame] webView]);
+    ASSERT([[[dataSource webFrame] webView] documentView]);
+    ASSERT([(WebNetscapePluginView *)[[[dataSource webFrame] webView] documentView] pluginInstance]);
+    
     if(isFirstChunk){
         WebFrame *frame = [dataSource webFrame];
         WebView *webView = [frame webView];
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index f17e7f5..eac8621 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -577,6 +577,7 @@
     WebView *webView = (WebView *)[self _web_superviewOfClass:[WebView class]];
     webController = [[webView controller] retain];
     webFrame = 	    [[webController frameForView:webView] retain];
+    webDataSource = [[webFrame dataSource] retain];
     
     if(srcURL){
         stream = [[WebNetscapePluginStream alloc] initWithURL:srcURL pluginPointer:instance];
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 48f60a5..7d2677c 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -118,6 +118,10 @@
 {
     if (_private->frames == nil)
         _private->frames = [[NSMutableDictionary alloc] init];
+
+    // Check to make sure a duplicate frame name didn't creep in.
+    ASSERT([_private->frames objectForKey:[frame name]] == nil);
+
     [[frame dataSource] _setParent: self];   
     [_private->frames setObject: frame forKey: [frame name]];    
 }
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 4fdf2e8..9fff225 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -157,6 +157,8 @@
         
         [_private setProvisionalDataSource: newDataSource];
         
+        ASSERT([newDataSource webFrame] == self);
+        
         // We tell the documentView provisionalDataSourceChanged:
         // once it has been created by the controller.
             

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list