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


The following commit has been merged in the debian/unstable branch:
commit 4ff2746c0acebe39acaab47cf24122f60e805f59
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 25 08:22:30 2002 +0000

    Tests:
    
            * CookieManager/wkcookiemanager-test.m:
            (main): Adjust for API change.
    
    WebFoundation:
    
    	- fixed 2854536 - New cookie policy: "accept cookies only from the
    	same domain as the main page"
    
            * CacheLoader.subproj/WebResourceRequest.h:
            * CacheLoader.subproj/WebResourceRequest.m:
            (-[WebResourceRequest cookiePolicyBaseURL]):
            (-[WebResourceRequest setCookiePolicyBaseURL:]):
            (-[WebResourceRequest copyWithZone:]):
            * CookieManager.subproj/IFCookieManagerC.m:
            (IFCookieManagerSetCookiesFromResponseHeaders):
            * CookieManager.subproj/WebCookieConstants.h:
            * CookieManager.subproj/WebCookieManager.h:
            * CookieManager.subproj/WebCookieManager.m:
            (-[WebCookieManager _readAcceptCookiesPreference]):
            (-[WebCookieManager _setCookies:forURL:policyBaseURL:]):
            (-[WebCookieManager setCookie:]):
            (-[WebCookieManager setCookiesFromResponseHeaders:forURL:policyBaseURL:]):
            (-[WebCookieManager setAcceptPolicy:]):
            * Misc.subproj/WebNSStringExtras.h:
            * Misc.subproj/WebNSStringExtras.m:
            (-[NSString _web_domainFromHost]):
            * ProtocolHandlers.subproj/WebCFNetworkHTTPProtocolHandler.m:
            (-[WebCFNetworkHTTPProtocolHandler setResponseHeadersUsingHTTPResponse:andCall:context:]):
            * ProtocolHandlers.subproj/WebSimpleHTTPProtocolHandler.m:
            (-[WebSimpleHTTPProtocolHandler _parseHeadersFromData:]):
    
    WebCore:
    
    	- fixed 2854536 - New cookie policy: "accept cookies only from the
    	same domain as the main page"
    
            * khtml/html/html_documentimpl.cpp:
            (HTMLDocumentImpl::setCookie):
            * kwq/KWQKCookieJar.h:
            * kwq/KWQKCookieJar.mm:
            (KWQKCookieJar::setCookie):
            * kwq/WebCoreCookieAdapter.h:
            * kwq/WebCoreCookieAdapter.m:
            (-[WebCoreCookieAdapter setCookies:forURL:policyBaseURL:]):
    
    WebKit:
    
    	- fixed 2854536 - New cookie policy: "accept cookies only from the
    	same domain as the main page"
    
            * WebCoreSupport.subproj/WebCookieAdapter.h:
            * WebCoreSupport.subproj/WebCookieAdapter.m:
            (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]):
            * WebCoreSupport.subproj/WebSubresourceClient.m:
            (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]):
            (-[WebSubresourceClient handleDidRedirect:toURL:]):
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _startLoading]):
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient handleDidRedirect:toURL:]):
    
    WebBrowser:
    
    	- fixed 2854536 - New cookie policy: "accept cookies only from the
    	same domain as the main page"
    
            * Preferences.subproj/English.lproj/SecurityPreferences.nib:
            * Preferences.subproj/SecurityPreferences.h:
            * Preferences.subproj/SecurityPreferences.m:
            (-[SecurityPreferences takeCookiePolicyFrom:]):
            (-[SecurityPreferences updateCookiesViews]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index ac8dfb4..5643ea7 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-09-25  Maciej Stachowiak  <mjs at apple.com>
+
+	- fixed 2854536 - New cookie policy: "accept cookies only from the
+	same domain as the main page"
+	
+        * khtml/html/html_documentimpl.cpp:
+        (HTMLDocumentImpl::setCookie):
+        * kwq/KWQKCookieJar.h:
+        * kwq/KWQKCookieJar.mm:
+        (KWQKCookieJar::setCookie):
+        * kwq/WebCoreCookieAdapter.h:
+        * kwq/WebCoreCookieAdapter.m:
+        (-[WebCoreCookieAdapter setCookies:forURL:policyBaseURL:]):
+
 2002-09-24  Darin Adler  <darin at apple.com>
 
 	- fixed 3057928 -- lstat private/etc/localtime repeatedly reported
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ac8dfb4..5643ea7 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2002-09-25  Maciej Stachowiak  <mjs at apple.com>
+
+	- fixed 2854536 - New cookie policy: "accept cookies only from the
+	same domain as the main page"
+	
+        * khtml/html/html_documentimpl.cpp:
+        (HTMLDocumentImpl::setCookie):
+        * kwq/KWQKCookieJar.h:
+        * kwq/KWQKCookieJar.mm:
+        (KWQKCookieJar::setCookie):
+        * kwq/WebCoreCookieAdapter.h:
+        * kwq/WebCoreCookieAdapter.m:
+        (-[WebCoreCookieAdapter setCookies:forURL:policyBaseURL:]):
+
 2002-09-24  Darin Adler  <darin at apple.com>
 
 	- fixed 3057928 -- lstat private/etc/localtime repeatedly reported
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ac8dfb4..5643ea7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2002-09-25  Maciej Stachowiak  <mjs at apple.com>
+
+	- fixed 2854536 - New cookie policy: "accept cookies only from the
+	same domain as the main page"
+	
+        * khtml/html/html_documentimpl.cpp:
+        (HTMLDocumentImpl::setCookie):
+        * kwq/KWQKCookieJar.h:
+        * kwq/KWQKCookieJar.mm:
+        (KWQKCookieJar::setCookie):
+        * kwq/WebCoreCookieAdapter.h:
+        * kwq/WebCoreCookieAdapter.m:
+        (-[WebCoreCookieAdapter setCookies:forURL:policyBaseURL:]):
+
 2002-09-24  Darin Adler  <darin at apple.com>
 
 	- fixed 3057928 -- lstat private/etc/localtime repeatedly reported
diff --git a/WebCore/khtml/html/html_documentimpl.cpp b/WebCore/khtml/html/html_documentimpl.cpp
index 0280c9d..66439b5 100644
--- a/WebCore/khtml/html/html_documentimpl.cpp
+++ b/WebCore/khtml/html/html_documentimpl.cpp
@@ -174,7 +174,13 @@ DOMString HTMLDocumentImpl::cookie() const
 void HTMLDocumentImpl::setCookie( const DOMString & value )
 {
 #ifdef APPLE_CHANGES
-    return KWQKCookieJar::setCookie(URL(), value.string());
+    KHTMLPart *topLevelPart = view()->part();
+
+    while (topLevelPart->parentPart() != NULL) {
+	topLevelPart = topLevelPart->parentPart();
+    }
+
+    return KWQKCookieJar::setCookie(URL(), topLevelPart->htmlDocument().URL().string(), value.string());
 #else
     long windowId = 0;
     KHTMLView *v = view ();
diff --git a/WebCore/kwq/KWQKCookieJar.h b/WebCore/kwq/KWQKCookieJar.h
index 7681221..88a3ddb 100644
--- a/WebCore/kwq/KWQKCookieJar.h
+++ b/WebCore/kwq/KWQKCookieJar.h
@@ -30,6 +30,6 @@ class KWQKCookieJar
 {
 public:
     static QString cookie(const KURL &);
-    static void setCookie(const KURL &, const QString &);
+    static void setCookie(const KURL &, const KURL &policyBaseURL, const QString &);
     static bool cookieEnabled();
 };
diff --git a/WebCore/kwq/KWQKCookieJar.mm b/WebCore/kwq/KWQKCookieJar.mm
index f87fea3..f0ca8db 100644
--- a/WebCore/kwq/KWQKCookieJar.mm
+++ b/WebCore/kwq/KWQKCookieJar.mm
@@ -37,9 +37,9 @@ QString KWQKCookieJar::cookie(const KURL &url)
     }
 }
 
-void KWQKCookieJar::setCookie(const KURL &url, const QString &cookie)
+void KWQKCookieJar::setCookie(const KURL &url, const KURL &policyBaseURL, const QString &cookie)
 {
-    [[WebCoreCookieAdapter sharedAdapter] setCookies:cookie.getNSString() forURL:url.getNSURL()];
+    [[WebCoreCookieAdapter sharedAdapter] setCookies:cookie.getNSString() forURL:url.getNSURL() policyBaseURL:policyBaseURL.getNSURL()];
 }
 
 bool KWQKCookieJar::cookieEnabled()
diff --git a/WebCore/kwq/WebCoreCookieAdapter.h b/WebCore/kwq/WebCoreCookieAdapter.h
index 92a7515..5aa64ba 100644
--- a/WebCore/kwq/WebCoreCookieAdapter.h
+++ b/WebCore/kwq/WebCoreCookieAdapter.h
@@ -33,6 +33,6 @@
 
 - (BOOL)cookiesEnabled;
 - (NSString *)cookiesForURL:(NSURL *)url;
-- (void)setCookies:(NSString *)cookies forURL:(NSURL *)url;
+- (void)setCookies:(NSString *)cookies forURL:(NSURL *)url policyBaseURL:(NSURL *)url;
 
 @end
diff --git a/WebCore/kwq/WebCoreCookieAdapter.m b/WebCore/kwq/WebCoreCookieAdapter.m
index 9e9efe2..ad0b4c3 100644
--- a/WebCore/kwq/WebCoreCookieAdapter.m
+++ b/WebCore/kwq/WebCoreCookieAdapter.m
@@ -55,7 +55,7 @@ static WebCoreCookieAdapter *sharedAdapter;
     return nil;
 }
 
-- (void)setCookies:(NSString *)cookies forURL:(NSURL *)url
+- (void)setCookies:(NSString *)cookies forURL:(NSURL *)url policyBaseURL:(NSURL *)policyBaseURL
 {
 }
 
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9d29fb9..d0cf578 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2002-09-25  Maciej Stachowiak  <mjs at apple.com>
+
+	- fixed 2854536 - New cookie policy: "accept cookies only from the
+	same domain as the main page"
+	
+        * WebCoreSupport.subproj/WebCookieAdapter.h:
+        * WebCoreSupport.subproj/WebCookieAdapter.m:
+        (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]):
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]):
+        (-[WebSubresourceClient handleDidRedirect:toURL:]):
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _startLoading]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handleDidRedirect:toURL:]):
+
 2002-09-24  Richard Williamson   <rjw at apple.com>
 
         More documentation tweaks.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 9d29fb9..d0cf578 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-09-25  Maciej Stachowiak  <mjs at apple.com>
+
+	- fixed 2854536 - New cookie policy: "accept cookies only from the
+	same domain as the main page"
+	
+        * WebCoreSupport.subproj/WebCookieAdapter.h:
+        * WebCoreSupport.subproj/WebCookieAdapter.m:
+        (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]):
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]):
+        (-[WebSubresourceClient handleDidRedirect:toURL:]):
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _startLoading]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient handleDidRedirect:toURL:]):
+
 2002-09-24  Richard Williamson   <rjw at apple.com>
 
         More documentation tweaks.
diff --git a/WebKit/WebCoreSupport.subproj/WebCookieAdapter.h b/WebKit/WebCoreSupport.subproj/WebCookieAdapter.h
index 31fab66..1a8de1a 100644
--- a/WebKit/WebCoreSupport.subproj/WebCookieAdapter.h
+++ b/WebKit/WebCoreSupport.subproj/WebCookieAdapter.h
@@ -15,9 +15,4 @@
 
 + (void)createSharedAdapter;
 
-- (BOOL)cookiesEnabled;
-- (NSString *)cookiesForURL:(NSURL *)URL;
-- (void)setCookies:(NSString *)cookies forURL:(NSURL *)URL;
-
-
 @end
diff --git a/WebKit/WebCoreSupport.subproj/WebCookieAdapter.m b/WebKit/WebCoreSupport.subproj/WebCookieAdapter.m
index 1cc474a..3a5098b 100644
--- a/WebKit/WebCoreSupport.subproj/WebCookieAdapter.m
+++ b/WebKit/WebCoreSupport.subproj/WebCookieAdapter.m
@@ -36,9 +36,9 @@
     return [[[WebCookieManager sharedCookieManager] cookieRequestHeadersForURL:URL] objectForKey:@"Cookie"];
 }
 
-- (void)setCookies:(NSString *)cookies forURL:(NSURL *)URL
+- (void)setCookies:(NSString *)cookies forURL:(NSURL *)URL policyBaseURL:(NSURL *)policyBaseURL
 {
-    [[WebCookieManager sharedCookieManager] setCookiesFromResponseHeaders:[NSDictionary dictionaryWithObject:cookies forKey:@"Set-Cookie"] forURL:URL];    
+    [[WebCookieManager sharedCookieManager] setCookiesFromResponseHeaders:[NSDictionary dictionaryWithObject:cookies forKey:@"Set-Cookie"] forURL:URL policyBaseURL:policyBaseURL];    
 }
 
 @end
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 1afa011..b04a38e 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -19,6 +19,7 @@
 #import <WebKit/WebControllerPrivate.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebFrame.h>
 #import <WebFoundation/WebAssertions.h>
 
 @implementation WebSubresourceClient
@@ -73,6 +74,7 @@
     [request setRequestCachePolicy:[[source request] requestCachePolicy]];
     [request setResponseCachePolicy:[[source request] responseCachePolicy]];
     [request setReferrer:referrer];
+    [request setCookiePolicyBaseURL:[[[[source controller] mainFrame] dataSource] URL]];
     WebResourceHandle *h = [[WebResourceHandle alloc] initWithRequest:request client:client];
     [request release];
     
@@ -179,7 +181,11 @@
     // just disabling this. Before, we had code that tried to send the
     // redirect, but sent it to the wrong object.
     //[[dataSource _locationChangeHandler] serverRedirectTo:toURL forDataSource:dataSource];
-    
+
+    // FIXME: Need to make sure client sets cookie policy base URL
+    // properly on redirect when we have the new redirect
+    // request-adjusting API
+
     [self didStopLoading];
     [self didStartLoadingWithURL:URL];
 }
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 1afa011..b04a38e 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -19,6 +19,7 @@
 #import <WebKit/WebControllerPrivate.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebFrame.h>
 #import <WebFoundation/WebAssertions.h>
 
 @implementation WebSubresourceClient
@@ -73,6 +74,7 @@
     [request setRequestCachePolicy:[[source request] requestCachePolicy]];
     [request setResponseCachePolicy:[[source request] responseCachePolicy]];
     [request setReferrer:referrer];
+    [request setCookiePolicyBaseURL:[[[[source controller] mainFrame] dataSource] URL]];
     WebResourceHandle *h = [[WebResourceHandle alloc] initWithRequest:request client:client];
     [request release];
     
@@ -179,7 +181,11 @@
     // just disabling this. Before, we had code that tried to send the
     // redirect, but sent it to the wrong object.
     //[[dataSource _locationChangeHandler] serverRedirectTo:toURL forDataSource:dataSource];
-    
+
+    // FIXME: Need to make sure client sets cookie policy base URL
+    // properly on redirect when we have the new redirect
+    // request-adjusting API
+
     [self didStopLoading];
     [self didStartLoadingWithURL:URL];
 }
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 572d790..4ff4489 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -187,6 +187,13 @@
     // Fire this guy up.
     if (!_private->mainHandle) {
         _private->mainClient = [[WebMainResourceClient alloc] initWithDataSource:self];
+
+	if ([self isMainDocument]) {
+	    [_private->request setCookiePolicyBaseURL:[self URL]];
+	} else {
+	    [_private->request setCookiePolicyBaseURL:[[[_private->controller mainFrame] dataSource] URL]];
+	}
+
         _private->mainHandle = [[WebResourceHandle alloc] initWithRequest:_private->request client:_private->mainClient];
     }
     [_private->mainClient didStartLoadingWithURL:[_private->mainHandle URL]];
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 392d881..5d06764 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -300,6 +300,9 @@
 {
     LOG(Redirect, "URL = %@", URL);
 
+    // FIXME: need to update main document URL here, or cookies set
+    // via redirects might not work in main document mode
+
     ASSERT(currentURL != nil);
     ASSERT([URL isEqual:[handle URL]]);
     
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 392d881..5d06764 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -300,6 +300,9 @@
 {
     LOG(Redirect, "URL = %@", URL);
 
+    // FIXME: need to update main document URL here, or cookies set
+    // via redirects might not work in main document mode
+
     ASSERT(currentURL != nil);
     ASSERT([URL isEqual:[handle URL]]);
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list