[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

bweinstein at apple.com bweinstein at apple.com
Thu Oct 29 20:40:36 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 5555fbcb44cae8a8355b1beeeade3b6ba98fa9bf
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 6 22:48:58 2009 +0000

    2009-10-06  Brian Weinstein  <bweinstein at apple.com>
    
            Reviewed by Brady Eidson.
    
            Preparation for <http://webkit.org/b/30104>.
            Inspector should show cookies of sub-resources on the page.
    
            Implement getRawCookies for CFNetwork for Windows, so we can see more
            than just a key/value pair for Cookies when we are on Windows.
    
            * platform/network/win/CookieJarCFNetWin.cpp:
            (WebCore::getRawCookies):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ae3d2fa..bcb6445 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-06  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Brady Eidson.
+
+        Preparation for <http://webkit.org/b/30104>.
+        Inspector should show cookies of sub-resources on the page.
+        
+        Implement getRawCookies for CFNetwork for Windows, so we can see more
+        than just a key/value pair for Cookies when we are on Windows.
+
+        * platform/network/win/CookieJarCFNetWin.cpp:
+        (WebCore::getRawCookies):
+
 2009-10-06  Dave Hyatt  <hyatt at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebCore/platform/network/win/CookieJarCFNetWin.cpp b/WebCore/platform/network/win/CookieJarCFNetWin.cpp
index 519a1b9..fbbd4b1 100644
--- a/WebCore/platform/network/win/CookieJarCFNetWin.cpp
+++ b/WebCore/platform/network/win/CookieJarCFNetWin.cpp
@@ -114,11 +114,38 @@ bool cookiesEnabled(const Document* /*document*/)
     return policy == CFHTTPCookieStorageAcceptPolicyOnlyFromMainDocumentDomain || policy == CFHTTPCookieStorageAcceptPolicyAlways;
 }
 
-bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
+bool getRawCookies(const Document*, const KURL& url, Vector<Cookie>& rawCookies)
 {
-    // FIXME: Not yet implemented
     rawCookies.clear();
-    return false; // return true when implemented
+    CFHTTPCookieStorageRef cookieStorage = currentCookieStorage();
+    if (!cookieStorage)
+        return false;
+
+    RetainPtr<CFURLRef> urlCF(AdoptCF, url.createCFURL());
+
+    bool sendSecureCookies = url.protocolIs("https");
+    RetainPtr<CFArrayRef> cookiesCF(AdoptCF, CFHTTPCookieStorageCopyCookiesForURL(cookieStorage, urlCF.get(), sendSecureCookies));
+
+    CFIndex count = CFArrayGetCount(cookiesCF.get());
+    rawCookies.reserveCapacity(count);
+
+    for (CFIndex i = 0; i < count; i++) {
+       CFHTTPCookieRef cookie = (CFHTTPCookieRef)CFArrayGetValueAtIndex(cookiesCF.get(), i);
+       String name = CFHTTPCookieGetName(cookie);
+       String value = CFHTTPCookieGetValue(cookie);
+       String domain = CFHTTPCookieGetDomain(cookie);
+       String path = CFHTTPCookieGetPath(cookie);
+
+       double expires = (CFDateGetAbsoluteTime(CFHTTPCookieGetExpiratonDate(cookie)) + kCFAbsoluteTimeIntervalSince1970) * 1000;
+
+       bool httpOnly = CFHTTPCookieIsHTTPOnly(cookie);
+       bool secure = CFHTTPCookieIsSecure(cookie);
+       bool session = false;    // FIXME: Need API for if a cookie is a session cookie.
+
+       rawCookies.uncheckedAppend(Cookie(name, value, domain, path, expires, httpOnly, secure, session));
+    }
+
+    return true;
 }
 
 void deleteCookie(const Document*, const KURL&, const String&)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list