[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 07:10:23 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f2954aae44742878ab8aed9d53074c14cc3fe36f
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 2 13:40:19 2002 +0000

    WebKit:
    
    	- added original URL field to action dictionary so that policy delegates
    	can avoid prompting over and over on redirects.
    
            * WebKit.exp:
            * WebView.subproj/WebControllerPolicyDelegate.h:
            * WebView.subproj/WebControllerPolicyDelegate.m:
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource initWithRequest:]):
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _startLoading:]):
            * WebView.subproj/WebFrame.m:
            (-[WebFrame loadRequest:]):
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _actionInformationForNavigationType:event:originalURL:]):
            (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]):
            (-[WebFrame _addExtraFieldsToRequest:]):
            (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
            (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]):
    
    WebBrowser:
    
    	- fixed 3109894 - Insecure form warning prompts twice
    
            * BrowserWebController.m:
            (-[BrowserWebController decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2902 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 33002e3..aa30bb4 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,25 @@
+2002-12-02  Maciej Stachowiak  <mjs at apple.com>
+
+	- added original URL field to action dictionary so that policy delegates
+	can avoid prompting over and over on redirects.
+	
+        * WebKit.exp:
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebControllerPolicyDelegate.m:
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource initWithRequest:]):
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _startLoading:]):
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame loadRequest:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _actionInformationForNavigationType:event:originalURL:]):
+        (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]):
+        (-[WebFrame _addExtraFieldsToRequest:]):
+        (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
+        (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]):
+
 2002-11-28  Darin Adler  <darin at apple.com>
 
         * Downloads.subproj/WebDownloadHandler.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 33002e3..aa30bb4 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,25 @@
+2002-12-02  Maciej Stachowiak  <mjs at apple.com>
+
+	- added original URL field to action dictionary so that policy delegates
+	can avoid prompting over and over on redirects.
+	
+        * WebKit.exp:
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebControllerPolicyDelegate.m:
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource initWithRequest:]):
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _startLoading:]):
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame loadRequest:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _actionInformationForNavigationType:event:originalURL:]):
+        (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]):
+        (-[WebFrame _addExtraFieldsToRequest:]):
+        (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
+        (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]):
+
 2002-11-28  Darin Adler  <darin at apple.com>
 
         * Downloads.subproj/WebDownloadHandler.m:
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index da6f596..f0f9a86 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -48,3 +48,4 @@ _WebActionNavigationTypeKey
 _WebActionElementKey
 _WebActionButtonKey
 _WebActionModifierFlagsKey
+_WebActionOriginalURLKey
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
index f0b762c..50635a8 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
@@ -33,6 +33,7 @@ extern NSString *WebActionNavigationTypeKey; // NSNumber (WebActionType)
 extern NSString *WebActionElementKey; // NSDictionary of element info
 extern NSString *WebActionButtonKey;  // NSEventType
 extern NSString *WebActionModifierFlagsKey; // NSNumber (unsigned)
+extern NSString *WebActionOriginalURLKey; // NSURL
 
 
 /*!
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
index cab4b0d..9f67b99 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
@@ -10,7 +10,7 @@ NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
 NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
 NSString *WebActionButtonKey = @"WebActionButtonKey"; 
 NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
-
+NSString *WebActionOriginalURLKey = @"WebActionOriginalURLKey";
 
 
 @interface WebPolicyDecisionListenerPrivate : NSObject
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index ecc8091..4c6de5a 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -48,8 +48,8 @@
     }
     
     _private = [[WebDataSourcePrivate alloc] init];
-    _private->originalRequest = [request retain];
-    _private->request = [request retain];
+    _private->originalRequest = [request copy];
+    _private->request = [_private->originalRequest retain];
 
     ++WebDataSourceCount;
     
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 15dc075..f221bea 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -157,8 +157,7 @@
     if (pageCache){
         _private->loadingFromPageCache = YES;
         [self _commitIfReady: pageCache];
-    }
-    else if (!_private->mainClient) {
+    } else if (!_private->mainClient) {
         if ([self webFrame] == [[self controller] mainFrame]) {
 	    [_private->request setCookiePolicyBaseURL:[self URL]];
 	} else {
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index c3cfa5a..bb2c69f 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -105,7 +105,9 @@
 
 - (void)loadRequest:(WebResourceRequest *)request
 {
-    WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
+    WebResourceRequest *r = [request copy];
+    [self _addExtraFieldsToRequest:r];
+    WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:r];
     [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeStandard];
     [newDataSource release];
 }
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 6413481..a181374 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -117,11 +117,13 @@ typedef enum {
 - (void)_setLoadType: (WebFrameLoadType)loadType;
 - (WebFrameLoadType)_loadType;
 
+- (void)_addExtraFieldsToRequest:(WebResourceRequest *)request;
+
 - (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource andCall:(id)target withSelector:(SEL)selector;
 
 - (void)_invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call;
 
-- (NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event;
+- (NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event originalURL:(NSURL *)URL;
 - (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type;
 - (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission;
 - (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index e249136..402bc50 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -998,7 +998,7 @@ static const char * const loadTypeNames[] = {
     [newDataSource release];
 }
 
--(NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event
+-(NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event originalURL:(NSURL *)URL
 {
     if (event != nil) {
         NSView *topViewInEventWindow = [[event window] contentView];
@@ -1015,11 +1015,14 @@ static const char * const loadTypeNames[] = {
             elementInfo, WebActionElementKey,
             [NSNumber numberWithInt:[event type]], WebActionButtonKey,
             [NSNumber numberWithInt:[event modifierFlags]], WebActionModifierFlagsKey,
+	    URL, WebActionOriginalURLKey,
             nil];
     }
 
-    return [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:navigationType]
-                                       forKey:WebActionNavigationTypeKey];
+    return [NSDictionary dictionaryWithObjectsAndKeys:
+	[NSNumber numberWithInt:navigationType], WebActionNavigationTypeKey,
+        URL, WebActionOriginalURLKey,
+        nil];
 }
 
 - (void) _invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call
@@ -1048,7 +1051,7 @@ static const char * const loadTypeNames[] = {
 {
     NSDictionary *action = [dataSource _triggeringAction];
     if (action == nil) {
-        action = [self _actionInformationForNavigationType:WebNavigationTypeOther event:nil];
+        action = [self _actionInformationForNavigationType:WebNavigationTypeOther event:nil originalURL:[request URL]];
         [dataSource _setTriggeringAction:action];
     }
 
@@ -1170,11 +1173,22 @@ static const char * const loadTypeNames[] = {
     [[[self controller] locationChangeDelegate] locationChangedWithinPageForDataSource:dataSrc];
 }
 
+- (void)_addExtraFieldsToRequest:(WebResourceRequest *)request
+{
+    [request setUserAgent:[[self controller] userAgentForURL:[request URL]]];
+    if (self == [[self controller] mainFrame]) {
+	[request setCookiePolicyBaseURL:[request URL]];
+    } else {
+	[request setCookiePolicyBaseURL:[[[[self controller] mainFrame] dataSource] URL]];
+    }
+}
+
 // main funnel for navigating via callback from WebCore (e.g., clicking a link, redirect)
 - (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission
 {
     WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
     [request setReferrer:[_private->bridge referrer]];
+    [self _addExtraFieldsToRequest:request];
     if (loadType == WebFrameLoadTypeReload) {
         [request setRequestCachePolicy:WebRequestCachePolicyLoadFromOrigin];
     }
@@ -1182,11 +1196,11 @@ static const char * const loadTypeNames[] = {
     NSDictionary *action = nil;
 
     if (isFormSubmission) {
-        action = [self _actionInformationForNavigationType:WebNavigationTypeFormSubmitted event:event];
+        action = [self _actionInformationForNavigationType:WebNavigationTypeFormSubmitted event:event originalURL:URL];
     } else if (event == nil) {
-        action = [self _actionInformationForNavigationType:WebNavigationTypeOther event:event];
+        action = [self _actionInformationForNavigationType:WebNavigationTypeOther event:event originalURL:URL];
     } else {
-        action = [self _actionInformationForNavigationType:WebNavigationTypeLinkClicked event:event];
+        action = [self _actionInformationForNavigationType:WebNavigationTypeLinkClicked event:event originalURL:URL];
     }
 
     // FIXME: This logic doesn't exactly match what KHTML does in openURL, so it's possible
@@ -1276,7 +1290,7 @@ static const char * const loadTypeNames[] = {
     [request setContentType:contentType];
     [request setReferrer:[_private->bridge referrer]];
 
-    NSDictionary *action = [self _actionInformationForNavigationType:WebNavigationTypeFormSubmitted event:event];
+    NSDictionary *action = [self _actionInformationForNavigationType:WebNavigationTypeFormSubmitted event:event originalURL:URL];
 
     [self _loadRequest:request triggeringAction:action loadType:WebFrameLoadTypeStandard];
 
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.h b/WebKit/WebView.subproj/WebPolicyDelegate.h
index f0b762c..50635a8 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.h
@@ -33,6 +33,7 @@ extern NSString *WebActionNavigationTypeKey; // NSNumber (WebActionType)
 extern NSString *WebActionElementKey; // NSDictionary of element info
 extern NSString *WebActionButtonKey;  // NSEventType
 extern NSString *WebActionModifierFlagsKey; // NSNumber (unsigned)
+extern NSString *WebActionOriginalURLKey; // NSURL
 
 
 /*!
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.m b/WebKit/WebView.subproj/WebPolicyDelegate.m
index cab4b0d..9f67b99 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.m
@@ -10,7 +10,7 @@ NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
 NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
 NSString *WebActionButtonKey = @"WebActionButtonKey"; 
 NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
-
+NSString *WebActionOriginalURLKey = @"WebActionOriginalURLKey";
 
 
 @interface WebPolicyDecisionListenerPrivate : NSObject

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list