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

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:41:49 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 3455523d149a81c955af57e775617cc4c264e531
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon May 12 23:32:26 2003 +0000

    WebKit:
    
    	- addition to Darin's previous patch; when checking whether a request can
    	be handled, take into account the schemes that were registered without
    	an NSURLProtocol getting involved.
    
            Reviewed by Darin
    
            * WebView.subproj/WebViewPrivate.h:
            * WebView.subproj/WebViewPrivate.m:
            (+[WebView _canHandleRequest:]):
    	like NSURLConnection canHandleRequest, but also takes into account the
    	schemes that were registered without an NSURLProtocol
            * Plugins.subproj/WebNetscapePluginStream.m:
            (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]):
    	use +[WebView _canHandleRequest] instead of +[NSURLConnection canHandleRequest]
            * WebView.subproj/WebDefaultContextMenuDelegate.m:
            (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]):
    	ditto
            * WebView.subproj/WebDefaultPolicyDelegate.m:
            (-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
    	ditto
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _continueAfterNavigationPolicy:]):
    	ditto
    
    WebBrowser:
    
    	- more code cleanup from bookmarks view change; eliminated
    	BookmarksProtocol entirely.
    
            Reviewed by Darin
    
            * BookmarksProtocol.h: Removed. Two #defines were moved to BookmarksView.h
            * BookmarksProtocol.m: Removed.
    
            * BookmarksView.h: Moved to #defines here from BookmarksProtocol.h
    
            * AppController.m:
    	#import BookmarksView.h instead of BookmarksProtocol.h
            (+[AppController initialize]):
    	remove call that registered BookmarkProtocol with NSURLProtocol
    
            * BrowserWebController.m:
    	#import BookmarksView.h instead of BookmarksProtocol.h
            (-[BrowserWebView decidePolicyForAction:request:frame:newFrameName:decisionListener:]):
    	use +[WebView _canHandleRequest] instead of +[NSURLConnection canHandleRequest] so it
    	works for bookmarks (and any future registered schemes)
    
            * BrowserWindowController.m:
    	#import BookmarksView.h instead of BookmarksProtocol.h
            * ContextMenuHandler.m:
            (-[BrowserWebView webView:contextMenuItemsForElement:defaultMenuItems:]):
    	use +[WebView _canHandleRequest] instead of +[NSURLConnection canHandleRequest] so it
    	works for bookmarks (and any future registered schemes)
    
            * English.lproj/StringsNotToBeLocalized.txt:
    	updated for moving the two #defines
    
            * WebBrowser.pbproj/project.pbxproj: updated for removed files
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index bd93943..f2094a2 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2003-05-12  John Sullivan  <sullivan at apple.com>
+
+	- addition to Darin's previous patch; when checking whether a request can
+	be handled, take into account the schemes that were registered without
+	an NSURLProtocol getting involved.
+
+        Reviewed by Darin
+
+        * WebView.subproj/WebViewPrivate.h:
+        * WebView.subproj/WebViewPrivate.m:
+        (+[WebView _canHandleRequest:]):
+	like NSURLConnection canHandleRequest, but also takes into account the
+	schemes that were registered without an NSURLProtocol
+        * Plugins.subproj/WebNetscapePluginStream.m:
+        (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]):
+	use +[WebView _canHandleRequest] instead of +[NSURLConnection canHandleRequest]
+        * WebView.subproj/WebDefaultContextMenuDelegate.m:
+        (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]):
+	ditto
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
+	ditto
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _continueAfterNavigationPolicy:]):
+	ditto
+
 2003-05-12  Darin Adler  <darin at apple.com>
 
         Reviewed by John.
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginStream.m b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
index ad4a88d..9003960 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
@@ -21,7 +21,7 @@
 {
     [super init];
 
-    if(!theRequest || !thePluginPointer || ![NSURLConnection canHandleRequest:theRequest]){
+    if(!theRequest || !thePluginPointer || ![WebView _canHandleRequest:theRequest]){
         return nil;
     }
 
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
index f4ef2db..42a0a8a 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
@@ -82,7 +82,7 @@
     NSURL *linkURL = [element objectForKey:WebElementLinkURLKey];
 
     if (linkURL) {
-        if([NSURLConnection canHandleRequest:[NSURLRequest requestWithURL:linkURL]]) {
+        if([WebView _canHandleRequest:[NSURLRequest requestWithURL:linkURL]]) {
             [menuItems addObject:[self menuItemWithTag:WebMenuItemTagOpenLinkInNewWindow]];
             [menuItems addObject:[self menuItemWithTag:WebMenuItemTagDownloadLinkToDisk]];
             [menuItems addObject:[self menuItemWithTag:WebMenuItemTagCopyLinkToClipboard]];
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index d07612e..72d0722 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -7,6 +7,7 @@
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebPolicyDelegatePrivate.h>
 #import <WebKit/WebView.h>
+#import <WebKit/WebViewPrivate.h>
 
 #import <WebFoundation/NSURLConnection.h>
 #import <WebFoundation/NSURLRequest.h>
@@ -62,7 +63,7 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
                                                          frame:(WebFrame *)frame
                                               decisionListener:(WebPolicyDecisionListener *)listener
 {
-    if ([NSURLConnection canHandleRequest:request]) {
+    if ([WebView _canHandleRequest:request]) {
 	[listener use];
     } else {
 	// A file URL shouldn't fall through to here, but if it did,
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 741edb8..584e2ae 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -1484,7 +1484,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         [[self webView] _downloadURL:[request URL]];
         break;
     case WebPolicyUse:
-        if (![NSURLConnection canHandleRequest:request]) {
+        if (![WebView _canHandleRequest:request]) {
             [self _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowURL forURL:[request URL]];
         } else {
             shouldContinue = YES;
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 0c3df9e..f783f69 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -177,6 +177,21 @@ Could be worth adding to the API.
 
 + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme;
 + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme;
+/*!
+     @method _canHandleRequest:
+     @abstract Performs a "preflight" operation that performs some
+     speculative checks to see if a request can be used to create
+     a WebDocumentView and WebDocumentRepresentation.
+     @discussion The result of this method is valid only as long as no
+     protocols or schemes are registered or unregistered, and as long as
+     the request is not mutated (if the request is mutable). Hence, clients
+     should be prepared to handle failures even if they have performed request
+     preflighting by caling this method.
+     @param request The request to preflight.
+     @result YES if it is likely that a WebDocumentView and WebDocumentRepresentation
+     can be created for the request, NO otherwise.
+*/
++ (BOOL)_canHandleRequest:(NSURLRequest *)request;
 
 @end
 
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 514f723..7235c42 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -588,6 +588,15 @@ static NSMutableSet *schemesWithRepresentationsSet;
     return [schemesWithRepresentationsSet containsObject:[URLScheme lowercaseString]];
 }
 
++ (BOOL)_canHandleRequest:(NSURLRequest *)request
+{
+    if ([NSURLConnection canHandleRequest:request]) {
+        return YES;
+    }
+
+    return [self _representationExistsForURLScheme:[[request URL] scheme]];
+}
+
 @end
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list