Title: [136148] trunk/Source/WebCore
Revision
136148
Author
[email protected]
Date
2012-11-29 12:15:27 -0800 (Thu, 29 Nov 2012)

Log Message

[BlackBerry] Cookies in private mode should not have access to public cookies
https://bugs.webkit.org/show_bug.cgi?id=103649

Patch by Otto Derek Cheung <[email protected]> on 2012-11-29
Reviewed by Rob Buis.

PR 253983

When CookieManager switches back from public to private mode,
we will clear the cookie tree so the browser won't have access
to the public cookies.

Tested using browser.swlab.rim.net cookie tests and the steps in
the PR.

* platform/blackberry/CookieManager.cpp:
(WebCore::CookieManager::setPrivateMode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136147 => 136148)


--- trunk/Source/WebCore/ChangeLog	2012-11-29 20:12:54 UTC (rev 136147)
+++ trunk/Source/WebCore/ChangeLog	2012-11-29 20:15:27 UTC (rev 136148)
@@ -1,3 +1,22 @@
+2012-11-29  Otto Derek Cheung  <[email protected]>
+
+        [BlackBerry] Cookies in private mode should not have access to public cookies
+        https://bugs.webkit.org/show_bug.cgi?id=103649
+
+        Reviewed by Rob Buis.
+
+        PR 253983
+
+        When CookieManager switches back from public to private mode,
+        we will clear the cookie tree so the browser won't have access
+        to the public cookies.
+
+        Tested using browser.swlab.rim.net cookie tests and the steps in
+        the PR.
+
+        * platform/blackberry/CookieManager.cpp:
+        (WebCore::CookieManager::setPrivateMode):
+
 2012-11-29  Brent Fulgham  <[email protected]>
 
         Be consistent in handling of frameAtIndex (and related) returns.

Modified: trunk/Source/WebCore/platform/blackberry/CookieManager.cpp (136147 => 136148)


--- trunk/Source/WebCore/platform/blackberry/CookieManager.cpp	2012-11-29 20:12:54 UTC (rev 136147)
+++ trunk/Source/WebCore/platform/blackberry/CookieManager.cpp	2012-11-29 20:15:27 UTC (rev 136148)
@@ -502,16 +502,18 @@
     }
 }
 
-void CookieManager::setPrivateMode(bool mode)
+void CookieManager::setPrivateMode(bool privateMode)
 {
-    if (m_privateMode == mode)
+    if (m_privateMode == privateMode)
         return;
 
-    m_privateMode = mode;
-    if (!mode) {
-        removeAllCookies(DoNotRemoveFromBackingStore);
+    m_privateMode = privateMode;
+
+    removeAllCookies(DoNotRemoveFromBackingStore);
+
+    // If we are switching back to public mode, reload the database to memory.
+    if (!m_privateMode)
         getBackingStoreCookies();
-    }
 }
 
 CookieMap* CookieManager::findOrCreateCookieMap(CookieMap* protocolMap, const ParsedCookie& candidateCookie)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to