[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 08:47:56 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f766bf0289164f5be563b3354489ac988f492620
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jun 21 21:28:58 2004 +0000

    WebKit:
    
    	Fixed: <rdar://problem/3701269> change in error handling behavior from 10.3.3 to 10.3.4 breaks unreleased Adobe PDF plug-in
    
            Reviewed by john.
    
            * Misc.subproj/WebKitErrors.m:
            (registerErrors): register string for WebKitErrorPlugInCancelledConnection
            * Misc.subproj/WebKitErrorsPrivate.h:
            * Plugins.subproj/WebBaseNetscapePluginStream.h:
            * Plugins.subproj/WebBaseNetscapePluginStream.m:
            (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): use renamed WEB_REASON_PLUGIN_CANCELLED constant
            (-[WebBaseNetscapePluginStream destroyStream]): ditto
            * Plugins.subproj/WebNetscapePluginRepresentation.m:
            (-[WebNetscapePluginRepresentation cancelWithReason:]): if the reason is WEB_REASON_PLUGIN_CANCELLED, cancel the load with WebKitErrorPlugInCancelledConnection
            * Plugins.subproj/WebNetscapePluginStream.m:
            (-[WebNetscapePluginStream cancelWithReason:]): ditto
    
    WebBrowser:
    
    	Fixed: <rdar://problem/3701269> change in error handling behavior from 10.3.3 to 10.3.4 breaks unreleased Adobe PDF plug-in
    
            Reviewed by john.
    
            * LoadProgressMonitor.m:
            * LocationChangeHandler.m: if the error is WebKitErrorPlugInCancelledConnection ignore it
            (-[LocationChangeHandler webView:locationChangeDone:forDataSource:]): ditto
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6903 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1bfe873..139c371 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2004-06-21  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: <rdar://problem/3701269> change in error handling behavior from 10.3.3 to 10.3.4 breaks unreleased Adobe PDF plug-in
+
+        Reviewed by john.
+
+        * Misc.subproj/WebKitErrors.m:
+        (registerErrors): register string for WebKitErrorPlugInCancelledConnection
+        * Misc.subproj/WebKitErrorsPrivate.h:
+        * Plugins.subproj/WebBaseNetscapePluginStream.h:
+        * Plugins.subproj/WebBaseNetscapePluginStream.m:
+        (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): use renamed WEB_REASON_PLUGIN_CANCELLED constant
+        (-[WebBaseNetscapePluginStream destroyStream]): ditto
+        * Plugins.subproj/WebNetscapePluginRepresentation.m:
+        (-[WebNetscapePluginRepresentation cancelWithReason:]): if the reason is WEB_REASON_PLUGIN_CANCELLED, cancel the load with WebKitErrorPlugInCancelledConnection
+        * Plugins.subproj/WebNetscapePluginStream.m:
+        (-[WebNetscapePluginStream cancelWithReason:]): ditto
+
 === Safari-146 ===
 
 2004-06-17  Richard Williamson   <rjw at apple.com>
diff --git a/WebKit/Misc.subproj/WebKitErrors.m b/WebKit/Misc.subproj/WebKitErrors.m
index 8ba9df5..e0995f6 100644
--- a/WebKit/Misc.subproj/WebKitErrors.m
+++ b/WebKit/Misc.subproj/WebKitErrors.m
@@ -33,6 +33,8 @@ NSString * const WebKitErrorPlugInPageURLStringKey = 	@"WebKitErrorPlugInPageURL
 #define WebKitErrorDescriptionCannotLoadPlugin UI_STRING("Cannot load plug-in", "WebKitErrorCannotLoadPlugin description")
 #define WebKitErrorDescriptionJavaUnavailable UI_STRING("Java is unavailable", "WebKitErrorJavaUnavailable description")
 
+// FIXME: We use "Cannot load plug-in" to avoid localization changes. Update the string when localization is not an issue.
+#define WebKitErrorDescriptionPlugInCancelledConnection UI_STRING("Cannot load plug-in", "WebKitErrorDescriptionPlugInCancelledConnection description")
 
 static pthread_once_t registerErrorsControl = PTHREAD_ONCE_INIT;
 static void registerErrors(void);
@@ -65,8 +67,7 @@ static void registerErrors(void);
                                contentURL:[NSURL _web_URLWithUserTypedString:contentURLString]
                             pluginPageURL:[NSURL _web_URLWithUserTypedString:pluginPageURLString]
                                pluginName:pluginName
-                                 MIMEType:MIMEType
-           ];
+                                 MIMEType:MIMEType];
 }
 
 - (id)_initWithPluginErrorCode:(int)code
@@ -118,6 +119,7 @@ static void registerErrors()
         WebKitErrorDescriptionCannotFindPlugin,		[NSNumber numberWithInt: WebKitErrorCannotFindPlugIn],
         WebKitErrorDescriptionCannotLoadPlugin,		[NSNumber numberWithInt: WebKitErrorCannotLoadPlugIn],
         WebKitErrorDescriptionJavaUnavailable,		[NSNumber numberWithInt: WebKitErrorJavaUnavailable],
+        WebKitErrorDescriptionPlugInCancelledConnection,[NSNumber numberWithInt: WebKitErrorPlugInCancelledConnection],
         nil];
 
     [NSError _web_addErrorsWithCodesAndDescriptions:dict inDomain:WebKitErrorDomain];
diff --git a/WebKit/Misc.subproj/WebKitErrorsPrivate.h b/WebKit/Misc.subproj/WebKitErrorsPrivate.h
index 33825ba..20f10b5 100644
--- a/WebKit/Misc.subproj/WebKitErrorsPrivate.h
+++ b/WebKit/Misc.subproj/WebKitErrorsPrivate.h
@@ -7,6 +7,8 @@
 
 #import <WebKit/WebKitErrors.h>
 
+#define WebKitErrorPlugInCancelledConnection 203
+
 @interface NSError (WebKitExtras)
 + (NSError *)_webKitErrorWithCode:(int)code failingURL:(NSString *)URL;
 + (NSError *)_webKitErrorWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL;
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
index ae68799..15c594e 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
@@ -10,6 +10,8 @@
 @class WebNetscapePluginPackage;
 @class NSURLResponse;
 
+#define WEB_REASON_PLUGIN_CANCELLED -1
+
 @interface WebBaseNetscapePluginStream : NSObject
 {
     NSMutableData *deliveryData;
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
index 06a63c0..9d191f3 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
@@ -16,8 +16,6 @@
 #import <Foundation/NSFileManager_NSURLExtras.h>
 #import <Foundation/NSURL_NSURLExtras.h>
 
-#define WEB_REASON_NONE -1
-
 @implementation WebBaseNetscapePluginStream
 
 - (void)dealloc
@@ -103,7 +101,7 @@
     
     transferMode = NP_NORMAL;
     offset = 0;
-    reason = WEB_REASON_NONE;
+    reason = WEB_REASON_PLUGIN_CANCELLED;
 
     // FIXME: Need a way to check if stream is seekable
 
@@ -112,8 +110,8 @@
 
     if (npErr != NPERR_NO_ERROR) {
         ERROR("NPP_NewStream failed with error: %d URLString: %s", npErr, [URL _web_URLCString]);
-        // Calling cancelWithReason with WEB_REASON_NONE cancels the load, but doesn't call NPP_DestroyStream.
-        [self cancelWithReason:WEB_REASON_NONE];
+        // Calling cancelWithReason with WEB_REASON_PLUGIN_CANCELLED cancels the load, but doesn't call NPP_DestroyStream.
+        [self cancelWithReason:WEB_REASON_PLUGIN_CANCELLED];
         return;
     }
 
@@ -146,7 +144,7 @@
 
 - (void)destroyStream
 {
-    if (![plugin isLoaded] || !stream.ndata || [deliveryData length] > 0 || reason == WEB_REASON_NONE) {
+    if (![plugin isLoaded] || !stream.ndata || [deliveryData length] > 0 || reason == WEB_REASON_PLUGIN_CANCELLED) {
         return;
     }
     
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m b/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m
index 97b9a95..5f75893 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m
@@ -3,10 +3,12 @@
 	Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <WebKit/WebDataSource.h>
+#import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFrameView.h>
+#import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebNetscapePluginDocumentView.h>
+#import <WebKit/WebNetscapePluginPackage.h>
 #import <WebKit/WebNetscapePluginRepresentation.h>
 
 #import <Foundation/NSURLResponse.h>
@@ -68,7 +70,17 @@
 
 - (void)cancelWithReason:(NPReason)theReason
 {
-    [[_dataSource webFrame] stopLoading];
+    if (theReason == WEB_REASON_PLUGIN_CANCELLED) {
+        NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection
+                                                        contentURL:[[_dataSource request] URL]
+                                                     pluginPageURL:nil
+                                                        pluginName:[plugin name]
+                                                          MIMEType:[[_dataSource response] MIMEType]];
+        [_dataSource _stopLoadingWithError:error];
+        [error release];
+    } else {
+        [[_dataSource webFrame] stopLoading];
+    }
     [super cancelWithReason:theReason];
 }
 
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginStream.m b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
index dc99e7e..549f56c 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
@@ -10,6 +10,7 @@
 #import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNetscapePluginEmbeddedView.h>
+#import <WebKit/WebNetscapePluginPackage.h>
 #import <WebKit/WebViewPrivate.h>
 
 #import <Foundation/NSError_NSURLExtras.h>
@@ -74,7 +75,18 @@
 
 - (void)cancelWithReason:(NPReason)theReason
 {
-    [_loader cancel];
+    if (theReason == WEB_REASON_PLUGIN_CANCELLED) {
+        NSURLResponse *response = [_loader response];
+        NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection
+                                                        contentURL:[response URL]
+                                                     pluginPageURL:nil
+                                                        pluginName:[plugin name]
+                                                          MIMEType:[response MIMEType]];
+        [_loader cancelWithError:error];
+        [error release];
+    } else {
+        [_loader cancel];
+    }
     [super cancelWithReason:theReason];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list