Title: [144772] trunk/Source/WebKit/blackberry
Revision
144772
Author
commit-qu...@webkit.org
Date
2013-03-05 10:05:24 -0800 (Tue, 05 Mar 2013)

Log Message

[BlackBerry] Authentication credentials lost when opening a new tab
https://bugs.webkit.org/show_bug.cgi?id=111445

PR 286627

Patch by Otto Derek Cheung <otche...@rim.com> on 2013-03-05
Reviewed by Rob Buis.
Internally Reviewed by Lianghui Chen.

Prevent changing the private mode boolean value in didChangeSettings if the value
hasn't changed.

Setting the private mode value of credentialstorage every time didChangeSettings gets
called causes the session credential mapping to be cleared on every tab change in
non-private mode.

Tested changing tabs after logging into a site using the HTTP Basic Auth protocol to see
if the credentials are cleared. Also ensured the functionality of private mode is not changed.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::didChangeSettings):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (144771 => 144772)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-03-05 17:54:31 UTC (rev 144771)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-03-05 18:05:24 UTC (rev 144772)
@@ -5929,7 +5929,6 @@
     coreSettings->setLoadsImagesAutomatically(webSettings->loadsImagesAutomatically());
     coreSettings->setShouldDrawBorderWhileLoadingImages(webSettings->shouldDrawBorderWhileLoadingImages());
     coreSettings->setScriptEnabled(webSettings->isJavaScriptEnabled());
-    coreSettings->setPrivateBrowsingEnabled(webSettings->isPrivateBrowsingEnabled());
     coreSettings->setDeviceSupportsMouse(webSettings->deviceSupportsMouse());
     coreSettings->setDefaultFixedFontSize(webSettings->defaultFixedFontSize());
     coreSettings->setDefaultFontSize(webSettings->defaultFontSize());
@@ -5958,6 +5957,12 @@
     coreSettings->setUseCache(webSettings->useWebKitCache());
     coreSettings->setCookieEnabled(webSettings->areCookiesEnabled());
 
+    if (coreSettings->privateBrowsingEnabled() != webSettings->isPrivateBrowsingEnabled()) {
+        coreSettings->setPrivateBrowsingEnabled(webSettings->isPrivateBrowsingEnabled());
+        cookieManager().setPrivateMode(webSettings->isPrivateBrowsingEnabled());
+        CredentialStorage::setPrivateMode(webSettings->isPrivateBrowsingEnabled());
+    }
+
 #if ENABLE(SQL_DATABASE)
     // DatabaseManager can only be initialized for once, so it doesn't
     // make sense to change database path after DatabaseManager has
@@ -6014,10 +6019,6 @@
     coreSettings->setWebSecurityEnabled(!webSettings->allowCrossSiteRequests());
     coreSettings->setApplyPageScaleFactorInCompositor(webSettings->applyDeviceScaleFactorInCompositor());
 
-    cookieManager().setPrivateMode(webSettings->isPrivateBrowsingEnabled());
-
-    CredentialStorage::setPrivateMode(webSettings->isPrivateBrowsingEnabled());
-
     if (m_mainFrame && m_mainFrame->view()) {
         Color backgroundColor(webSettings->backgroundColor());
         m_mainFrame->view()->updateBackgroundRecursively(backgroundColor, backgroundColor.hasAlpha());

Modified: trunk/Source/WebKit/blackberry/ChangeLog (144771 => 144772)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-03-05 17:54:31 UTC (rev 144771)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-03-05 18:05:24 UTC (rev 144772)
@@ -1,3 +1,26 @@
+2013-03-05  Otto Derek Cheung  <otche...@rim.com>
+
+        [BlackBerry] Authentication credentials lost when opening a new tab
+        https://bugs.webkit.org/show_bug.cgi?id=111445
+
+        PR 286627
+
+        Reviewed by Rob Buis.
+        Internally Reviewed by Lianghui Chen.
+
+        Prevent changing the private mode boolean value in didChangeSettings if the value
+        hasn't changed.
+
+        Setting the private mode value of credentialstorage every time didChangeSettings gets
+        called causes the session credential mapping to be cleared on every tab change in
+        non-private mode.
+
+        Tested changing tabs after logging into a site using the HTTP Basic Auth protocol to see
+        if the credentials are cleared. Also ensured the functionality of private mode is not changed.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
+
 2013-03-05  Tiancheng Jiang  <tiji...@rim.com>
 
         [BlackBerry] FatFinger pairs the wrong element with fatfinger rect part.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to