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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:55:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f5f41d84d7f0ed15e5674f53a6000fd0f38ed674
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 30 09:43:54 2002 +0000

    WebKit:
    
    	Another step towards the policy API change - add request argument
    	to file URL policy and remove isDirectory argument.
    
            * WebView.subproj/WebControllerPolicyDelegate.h:
            * WebView.subproj/WebDefaultPolicyDelegate.m:
            (-[WebDefaultPolicyDelegate fileURLPolicyForMIMEType:andRequest:inFrame:]):
            * WebView.subproj/WebFrame.m:
            (-[WebFrame setProvisionalDataSource:]):
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _shouldShowRequest:]):
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient handle:willSendRequest:]):
    
    WebBrowser:
    
    	Adjust for API change.
    
            * BrowserWebController.m:
            (-[BrowserWebController fileURLPolicyForMIMEType:andRequest:inFrame:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 49b0a92..778b190 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2002-10-30  Maciej Stachowiak  <mjs at apple.com>
+
+	Another step towards the policy API change - add request argument
+	to file URL policy and remove isDirectory argument.
+	
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate fileURLPolicyForMIMEType:andRequest:inFrame:]):
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame setProvisionalDataSource:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _shouldShowRequest:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handle:willSendRequest:]):
+
 2002-10-29  Maciej Stachowiak  <mjs at apple.com>
 
 	First step towards policy API change. Pass request instead of URL
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 49b0a92..778b190 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-10-30  Maciej Stachowiak  <mjs at apple.com>
+
+	Another step towards the policy API change - add request argument
+	to file URL policy and remove isDirectory argument.
+	
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate fileURLPolicyForMIMEType:andRequest:inFrame:]):
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame setProvisionalDataSource:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _shouldShowRequest:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handle:willSendRequest:]):
+
 2002-10-29  Maciej Stachowiak  <mjs at apple.com>
 
 	First step towards policy API change. Pass request instead of URL
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
index 3bcafc2..934ca41 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
@@ -229,10 +229,12 @@ typedef enum {
      @discussion Called when the response to URLPolicyForURL is WebURLPolicyUseContentPolicy and the URL is
      a file URL. This allows clients to special-case WebKit's behavior for file URLs.
      @param type MIME type for the file.
+     @param request WebResourceRequest to be used to load the item
      @param frame The frame which will load the file.
-     @param isDirectory YES if the file is a directory.
 */
-- (WebFileURLPolicy *)fileURLPolicyForMIMEType: (NSString *)type inFrame:(WebFrame *)frame isDirectory: (BOOL)isDirectory;
+- (WebFileURLPolicy *)fileURLPolicyForMIMEType:(NSString *)type
+                                    andRequest:(WebResourceRequest *)request
+                                       inFrame:(WebFrame *)frame;
 
 /*!
     @method contentPolicyForResponse:andRequest:inFrame:withContentPolicy:
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index 386c76a..29ea81a 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -36,8 +36,11 @@
     return [WebDefaultPolicyDelegate defaultURLPolicyForURL:URL];
 }
 
-- (WebFileURLPolicy *)fileURLPolicyForMIMEType:(NSString *)type inFrame:(WebFrame *)frame isDirectory:(BOOL)isDirectory
+- (WebFileURLPolicy *)fileURLPolicyForMIMEType:(NSString *)type andRequest:(WebResourceRequest *)request inFrame:(WebFrame *)frame
 {
+    BOOL isDirectory;
+    [[NSFileManager defaultManager] fileExistsAtPath:[[request URL] path] isDirectory:&isDirectory];
+
     if(isDirectory)
         return [WebFileURLPolicy webPolicyWithFileAction:WebFileURLPolicyIgnore];
     if([WebController canShowMIMEType:type])
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 5e3273e..4e5195d 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -138,7 +138,7 @@
 
     // _shouldShowURL asks the client for the URL policies and reports errors if there are any
     // returns YES if we should show the data source
-    if (![self _shouldShowURL:[newDataSource URL]]) {
+    if (![self _shouldShowRequest:[newDataSource request]]) {
         return NO;
     }
     
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index cb18ad4..c42f68d 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -13,6 +13,7 @@
 @class WebHistoryItem;
 @class WebPluginController;
 @class WebView;
+ at class WebResourceRequest;
 
 typedef enum {
     WebFrameStateProvisional,
@@ -89,7 +90,7 @@ typedef enum {
 - (void)_checkLoadComplete;
 - (void)_timedLayout: userInfo;
 - (WebBridge *)_bridge;
-- (BOOL)_shouldShowURL:(NSURL *)URL;
+- (BOOL)_shouldShowRequest:(WebResourceRequest *)request;
 - (void)_setProvisionalDataSource:(WebDataSource *)d;
 - (void)_setLoadType: (WebFrameLoadType)loadType;
 - (WebFrameLoadType)_loadType;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 30d3e5c..22c0d86 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -608,71 +608,72 @@ static const char * const stateNames[] = {
     [[[self controller] policyDelegate] unableToImplementPolicy:policy error:error forURL:URL inFrame:self];    
 }
 
-- (BOOL)_shouldShowURL:(NSURL *)URL
+- (BOOL)_shouldShowRequest:(WebResourceRequest *)request
 {
     id <WebControllerPolicyDelegate> policyDelegate = [[self controller] policyDelegate];
-    WebURLPolicy *URLPolicy = [policyDelegate URLPolicyForURL:URL inFrame:self];
+    WebURLPolicy *URLPolicy = [policyDelegate URLPolicyForURL:[request URL] inFrame:self];
 
     switch ([URLPolicy policyAction]) {
         case WebURLPolicyIgnore:
             return NO;
 
         case WebURLPolicyOpenExternally:
-            if(![[NSWorkspace sharedWorkspace] openURL:URL]){
-                [self handleUnimplementablePolicy:URLPolicy errorCode:WebErrorCannotNotFindApplicationForURL forURL:URL];
+            if(![[NSWorkspace sharedWorkspace] openURL:[request URL]]){
+                [self handleUnimplementablePolicy:URLPolicy errorCode:WebErrorCannotNotFindApplicationForURL forURL:[request URL]];
             }
             return NO;
 
         case WebURLPolicyUseContentPolicy:
             // handle non-file case first because it's short and sweet
-            if (![URL isFileURL]) {
-                if (![WebResourceHandle canInitWithRequest:[WebResourceRequest requestWithURL:URL]]) {
-                    [self handleUnimplementablePolicy:URLPolicy errorCode:WebErrorCannotShowURL forURL:URL];
+            if (![[request URL] isFileURL]) {
+                if (![WebResourceHandle canInitWithRequest:request]) {
+                    [self handleUnimplementablePolicy:URLPolicy errorCode:WebErrorCannotShowURL forURL:[request URL]];
                     return NO;
                 }
                 return YES;
             } else {
                 // file URL
                 NSFileManager *fileManager = [NSFileManager defaultManager];
-                NSString *path = [URL path];
-                BOOL isDirectory;
-                BOOL fileExists = [fileManager fileExistsAtPath:path isDirectory:&isDirectory];
+                NSString *path = [[request URL] path];
                 NSString *type = [WebController _MIMETypeForFile: path];
-                WebFileURLPolicy *fileURLPolicy = [policyDelegate fileURLPolicyForMIMEType:type inFrame:self isDirectory:isDirectory];
+                WebFileURLPolicy *fileURLPolicy = [policyDelegate fileURLPolicyForMIMEType:type andRequest:request inFrame:self];
 
                 if([fileURLPolicy policyAction] == WebFileURLPolicyIgnore)
                     return NO;
 
+		BOOL isDirectory;
+		BOOL fileExists = [fileManager fileExistsAtPath:[[request URL] path] isDirectory:&isDirectory];
+
                 if(!fileExists){
-                    [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotFindFile forURL:URL];
+                    [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotFindFile forURL:[request URL]];
                     return NO;
                 }
 
                 if(![fileManager isReadableFileAtPath:path]){
-                    [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotReadFile forURL:URL];
+                    [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotReadFile forURL:[request URL]];
                     return NO;
                 }
 
                 switch ([fileURLPolicy policyAction]) {
                     case WebFileURLPolicyUseContentPolicy:
                         if (isDirectory) {
-                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotShowDirectory forURL:URL];
+                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotShowDirectory forURL:[request URL]];
                             return NO;
                         } else if (![WebController canShowMIMEType: type]) {
-                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotShowMIMEType forURL:URL];
+                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotShowMIMEType forURL:[request URL]];
                             return NO;
                         }
                         return YES;
                         
                     case WebFileURLPolicyOpenExternally:
                         if(![[NSWorkspace sharedWorkspace] openFile:path]){
-                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotFindApplicationForFile forURL:URL];
+                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorCannotFindApplicationForFile forURL:[request URL]];
                         }
                         return NO;
 
                     case WebFileURLPolicyRevealInFinder:
                         if(![[NSWorkspace sharedWorkspace] selectFile:path inFileViewerRootedAtPath:@""]){
-                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorFinderCannotOpenDirectory forURL:URL];
+                            [self handleUnimplementablePolicy:fileURLPolicy errorCode:WebErrorFinderCannotOpenDirectory forURL:[request URL]];
                         }
                         return NO;
 
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 7ece672..cc1f721 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -114,7 +114,7 @@
 
     NSURL *URL = [newRequest URL];
 
-    if (![[dataSource webFrame] _shouldShowURL:URL]) {
+    if (![[dataSource webFrame] _shouldShowRequest:request]) {
         [handle cancel];
         [[dataSource webFrame] _setProvisionalDataSource:nil];
 	[[[dataSource controller] locationChangeDelegate] locationChangeDone:[WebError errorWithCode:WebErrorLocationChangeInterruptedByPolicyChange inDomain:WebErrorDomainWebKit failingURL:nil] forDataSource:dataSource];
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 7ece672..cc1f721 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -114,7 +114,7 @@
 
     NSURL *URL = [newRequest URL];
 
-    if (![[dataSource webFrame] _shouldShowURL:URL]) {
+    if (![[dataSource webFrame] _shouldShowRequest:request]) {
         [handle cancel];
         [[dataSource webFrame] _setProvisionalDataSource:nil];
 	[[[dataSource controller] locationChangeDelegate] locationChangeDone:[WebError errorWithCode:WebErrorLocationChangeInterruptedByPolicyChange inDomain:WebErrorDomainWebKit failingURL:nil] forDataSource:dataSource];
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.h b/WebKit/WebView.subproj/WebPolicyDelegate.h
index 3bcafc2..934ca41 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.h
@@ -229,10 +229,12 @@ typedef enum {
      @discussion Called when the response to URLPolicyForURL is WebURLPolicyUseContentPolicy and the URL is
      a file URL. This allows clients to special-case WebKit's behavior for file URLs.
      @param type MIME type for the file.
+     @param request WebResourceRequest to be used to load the item
      @param frame The frame which will load the file.
-     @param isDirectory YES if the file is a directory.
 */
-- (WebFileURLPolicy *)fileURLPolicyForMIMEType: (NSString *)type inFrame:(WebFrame *)frame isDirectory: (BOOL)isDirectory;
+- (WebFileURLPolicy *)fileURLPolicyForMIMEType:(NSString *)type
+                                    andRequest:(WebResourceRequest *)request
+                                       inFrame:(WebFrame *)frame;
 
 /*!
     @method contentPolicyForResponse:andRequest:inFrame:withContentPolicy:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list