[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 06:27:38 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 42b17042c9f93f3b3c336d7a73dedcd2fb056e49
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 26 19:59:29 2002 +0000

    	Fixed crash in unknown_text
    	Fixed full-window plug-ins. I think darin broken this :)
    	Cleaned up WebPluginStream a bit
    
            * Plugins.subproj/WebPluginDatabase.m:
            (-[WebPluginDatabase init]):
            * Plugins.subproj/WebPluginStream.m:
            (-[WebPluginStream getFunctionPointersFromPluginView:]):
            (-[WebPluginStream initWithURL:pluginPointer:notifyData:attributes:]):
            (-[WebPluginStream startLoad]):
            (-[WebPluginStream stop]):
            (-[WebPluginStream setUpGlobalsWithHandle:]):
            (-[WebPluginStream receivedError:]):
            (-[WebPluginStream receivedData:withDataSource:]):
            (-[WebPluginStream receivedError:withDataSource:]):
            (-[WebPluginStream WebResourceHandle:dataDidBecomeAvailable:]):
            (-[WebPluginStream WebResourceHandleDidCancelLoading:]):
            (-[WebPluginStream WebResourceHandle:didFailLoadingWithResult:]):
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _mainHandle]): added, WebPluginStream needs this
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1680 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 7aceddb..f214480 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,27 @@
+2002-07-26  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed crash in unknown_text
+	Fixed full-window plug-ins. I think darin broken this :)
+	Cleaned up WebPluginStream a bit
+
+        * Plugins.subproj/WebPluginDatabase.m:
+        (-[WebPluginDatabase init]):
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream getFunctionPointersFromPluginView:]):
+        (-[WebPluginStream initWithURL:pluginPointer:notifyData:attributes:]):
+        (-[WebPluginStream startLoad]):
+        (-[WebPluginStream stop]):
+        (-[WebPluginStream setUpGlobalsWithHandle:]):
+        (-[WebPluginStream receivedError:]):
+        (-[WebPluginStream receivedData:withDataSource:]):
+        (-[WebPluginStream receivedError:withDataSource:]):
+        (-[WebPluginStream WebResourceHandle:dataDidBecomeAvailable:]):
+        (-[WebPluginStream WebResourceHandleDidCancelLoading:]):
+        (-[WebPluginStream WebResourceHandle:didFailLoadingWithResult:]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _mainHandle]): added, WebPluginStream needs this
+
 2002-07-25  Richard Williamson (Local)  <rjw at apple.com>
 
         More incremental changes for back/forward migration.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 7aceddb..f214480 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,27 @@
+2002-07-26  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed crash in unknown_text
+	Fixed full-window plug-ins. I think darin broken this :)
+	Cleaned up WebPluginStream a bit
+
+        * Plugins.subproj/WebPluginDatabase.m:
+        (-[WebPluginDatabase init]):
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream getFunctionPointersFromPluginView:]):
+        (-[WebPluginStream initWithURL:pluginPointer:notifyData:attributes:]):
+        (-[WebPluginStream startLoad]):
+        (-[WebPluginStream stop]):
+        (-[WebPluginStream setUpGlobalsWithHandle:]):
+        (-[WebPluginStream receivedError:]):
+        (-[WebPluginStream receivedData:withDataSource:]):
+        (-[WebPluginStream receivedError:withDataSource:]):
+        (-[WebPluginStream WebResourceHandle:dataDidBecomeAvailable:]):
+        (-[WebPluginStream WebResourceHandleDidCancelLoading:]):
+        (-[WebPluginStream WebResourceHandle:didFailLoadingWithResult:]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _mainHandle]): added, WebPluginStream needs this
+
 2002-07-25  Richard Williamson (Local)  <rjw at apple.com>
 
         More incremental changes for back/forward migration.
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.m b/WebKit/Plugins.subproj/WebPluginDatabase.m
index ddbe656..46c8c56 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.m
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.m
@@ -183,15 +183,15 @@ static NSArray *pluginLocations(void)
             [plugin release];
         }
     }
-        
+
+    plugins = [pluginArray copy];
+    
     // register plug-in WebDocumentViews and WebDocumentRepresentations
-    NSArray *mimes = [database MIMETypes];
+    NSArray *mimes = [self MIMETypes];
     for (i = 0; i < [mimes count]; i++) {
         [WebView registerViewClass:[WebPluginView class] forMIMEType:[mimes objectAtIndex:i]];
         [WebDataSource registerRepresentationClass:[WebPluginStream class] forMIMEType:[mimes objectAtIndex:i]];
     }
-    
-    plugins = [pluginArray copy];
 
     return self;
 }
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index 1639ab3..c86652a 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -7,6 +7,7 @@
 #import <WebKit/WebPluginStream.h>
 #import <WebKit/WebView.h>
 #import <WebKit/WebDataSource.h>
+#import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebControllerPrivate.h>
 #import <WebKitDebug.h>
 
@@ -19,6 +20,16 @@ static NSString *getCarbonPath(NSString *posixPath);
 
 @implementation WebPluginStream
 
+- (void) getFunctionPointersFromPluginView:(WebPluginView *)pluginView
+{
+    NPP_NewStream = 	[pluginView NPP_NewStream];
+    NPP_WriteReady = 	[pluginView NPP_WriteReady];
+    NPP_Write = 	[pluginView NPP_Write];
+    NPP_StreamAsFile = 	[pluginView NPP_StreamAsFile];
+    NPP_DestroyStream = [pluginView NPP_DestroyStream];
+    NPP_URLNotify = 	[pluginView NPP_URLNotify];
+}
+
 - init
 {
     [super init];
@@ -54,13 +65,8 @@ static NSString *getCarbonPath(NSString *posixPath);
     attributes = [theAttributes retain];
     instance = thePluginPointer;
     notifyData = theNotifyData;
-    
-    NPP_NewStream = 	[view NPP_NewStream];
-    NPP_WriteReady = 	[view NPP_WriteReady];
-    NPP_Write = 	[view NPP_Write];
-    NPP_StreamAsFile = 	[view NPP_StreamAsFile];
-    NPP_DestroyStream = [view NPP_DestroyStream];
-    NPP_URLNotify = 	[view NPP_URLNotify];
+
+    [self getFunctionPointersFromPluginView:view];
     
     isFirstChunk = YES;
     stopped = YES;
@@ -85,10 +91,13 @@ static NSString *getCarbonPath(NSString *posixPath);
 
 - (void)startLoad
 {
-    resource = [[WebResourceHandle alloc] initWithURL:URL attributes:attributes flags:0];
-    if(resource){
-        [resource addClient:self];
-        [resource loadInBackground];
+    if(stopped){
+        stopped = NO;
+        resource = [[WebResourceHandle alloc] initWithURL:URL attributes:attributes flags:0];
+        if(resource){
+            [resource addClient:self];
+            [resource loadInBackground];
+        }
     }
 }
 
@@ -96,8 +105,9 @@ static NSString *getCarbonPath(NSString *posixPath);
 {
     if(!stopped){
         stopped = YES;
-        if([resource statusCode] == WebResourceHandleStatusLoading)
+        if([resource statusCode] == WebResourceHandleStatusLoading){
             [resource cancelLoadInBackground];
+        }
         [resource removeClient:self];
         [resource release];
     }
@@ -105,6 +115,22 @@ static NSString *getCarbonPath(NSString *posixPath);
     view = nil;
 }
 
+- (void)setUpGlobalsWithHandle:(WebResourceHandle *)handle
+{
+    NSString *URLString = [[handle url] absoluteString];
+    char *cURL = (char *)malloc([URLString cStringLength]+1);
+    [URLString getCString:cURL];
+
+    npStream.ndata = self;
+    npStream.url = cURL;
+    npStream.end = 0;
+    npStream.lastmodified = 0;
+    npStream.notifyData = notifyData;
+    offset = 0;
+    
+    mimeType = [[handle contentType] retain];
+}
+
 - (void)receivedData:(NSData *)data
 {
     int32 numBytes;
@@ -147,11 +173,11 @@ static NSString *getCarbonPath(NSString *posixPath);
     }
 }
 
-- (void)receivedError
+- (void)receivedError:(NPError)error
 {
     NPError npErr;
     
-    npErr = NPP_DestroyStream(instance, &npStream, NPRES_NETWORK_ERR);
+    npErr = NPP_DestroyStream(instance, &npStream, error);
     WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "NPP_DestroyStream: %d\n", npErr);
 }
 
@@ -184,40 +210,30 @@ static NSString *getCarbonPath(NSString *posixPath);
     [self stop];
 }
 
+#pragma mark WebDocumentRepresentation
+
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
 {
     if(isFirstChunk){
-        URL = [[dataSource inputURL] retain];
-        NSString *URLString = [URL absoluteString];
-        char *cURL = (char *)malloc([URLString cStringLength]+1);
-        [URLString getCString:cURL];
-        
-        npStream.ndata = self;
-        npStream.url = cURL;
-        npStream.end = 0;
-        npStream.lastmodified = 0;
-        npStream.notifyData = 0;
-        offset = 0;
-        mimeType = [[dataSource contentType] retain];
-        
         WebFrame *frame = [dataSource webFrame];
         WebView *webView = [frame webView];
         view = [[webView documentView] retain];
         instance = [view pluginInstance];
-        
-        NPP_NewStream = 	[view NPP_NewStream];
-        NPP_WriteReady = 	[view NPP_WriteReady];
-        NPP_Write = 		[view NPP_Write];
-        NPP_StreamAsFile = 	[view NPP_StreamAsFile];
-        NPP_DestroyStream = 	[view NPP_DestroyStream];
-        NPP_URLNotify = 	[view NPP_URLNotify];
+
+        [self getFunctionPointersFromPluginView:view];
+        [self setUpGlobalsWithHandle:[dataSource _mainHandle]];
     }
+    
     [self receivedData:data];
 }
 
 - (void)receivedError:(WebError *)error withDataSource:(WebDataSource *)dataSource
 {
-    [self receivedError];
+    if([error errorCode] == WebResultCancelled){
+        [self receivedError:NPRES_USER_BREAK];
+    } else {
+        [self receivedError:NPRES_NETWORK_ERR];
+    }
 }
 
 - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
@@ -225,6 +241,8 @@ static NSString *getCarbonPath(NSString *posixPath);
     [self finishedLoadingWithData:[dataSource data]];
 }
 
+#pragma mark WebResourceHandle
+
 - (void)WebResourceHandleDidBeginLoading:(WebResourceHandle *)handle
 {
     [[view webController] _didStartLoading:URL];
@@ -233,19 +251,9 @@ static NSString *getCarbonPath(NSString *posixPath);
 - (void)WebResourceHandle:(WebResourceHandle *)handle dataDidBecomeAvailable:(NSData *)data
 {
     WebController *webController = [view webController];
-    
+
     if(isFirstChunk){
-        NSString *URLString = [[handle url] absoluteString];
-        char *cURL = (char *)malloc([URLString cStringLength]+1);
-        [URLString getCString:cURL];
-        
-        npStream.ndata = self;
-        npStream.url = cURL;
-        npStream.end = 0;
-        npStream.lastmodified = 0;
-        npStream.notifyData = notifyData;
-        offset = 0;
-        mimeType = [[handle contentType] retain];
+        [self setUpGlobalsWithHandle:handle];
     }
     [self receivedData:data];
     
@@ -271,8 +279,8 @@ static NSString *getCarbonPath(NSString *posixPath);
     
     [webController _receivedProgress:[WebLoadProgress progress]
         forResourceHandle: handle fromDataSource: [view webDataSource] complete: YES];
-            
-    [self receivedError];
+
+    [self receivedError:NPRES_USER_BREAK];
     
     [webController _didStopLoading:URL];
 }
@@ -286,8 +294,8 @@ static NSString *getCarbonPath(NSString *posixPath);
     [webController _receivedError: result forResourceHandle: handle 
         partialProgress: loadProgress fromDataSource: [view webDataSource]];
     [loadProgress release];
-    
-    [self receivedError];
+
+    [self receivedError:NPRES_NETWORK_ERR];
     
     [webController _didStopLoading:URL];
 }
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 38c4327..e751837 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -118,7 +118,7 @@
 - (void)_setIconURL:(NSURL *)url withType:(NSString *)iconType;
 - (BOOL)_isDummy;
 - (void)_setIsDummy: (BOOL)f;
-
+- (WebResourceHandle*)_mainHandle;
 
 // Convenience interface for getting here from an WebDataSource.
 // This returns nil if the representation is not an WebHTMLRepresentation.
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index f719c93..c63a070 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -510,4 +510,9 @@
     _private->iconURL = [url retain];
 }
 
+- (WebResourceHandle*)_mainHandle
+{
+    return _private->mainHandle;
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list