Title: [103448] branches/safari-534.54-branch/Source/WebCore
Diff
Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (103447 => 103448)
--- branches/safari-534.54-branch/Source/WebCore/ChangeLog 2011-12-21 22:21:12 UTC (rev 103447)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog 2011-12-21 22:24:26 UTC (rev 103448)
@@ -1,5 +1,35 @@
2011-12-21 Lucas Forschler <[email protected]>
+ Merge 94892
+
+ 2011-09-09 Jessie Berlin <[email protected]>
+
+ Cookies are not available after turning off Private Browsing after the last window has been
+ closed.
+ https://bugs.webkit.org/show_bug.cgi?id=67874
+
+ Reviewed by Darin Adler.
+
+ The private browsing storage session is a global setting that is being incorrectly set on a
+ per-page basis (see http://webkit.org/b/67870).
+
+ In this case, the global value was getting out of sync with the per-page setting:
+ 1. The global value was getting set to true when setPrivateBrowsingEnabled(true) was called.
+ 2. All Pages were then closed, destroying their Settings objects.
+ 3. When a new Page was created, a new Settings object was created and its
+ m_privateBrowsingEnabled value was getting set to false.
+ 4. The WebPage settings were then applied to the new Settings object, resulting in
+ setPrivateBrowsingEnabled(false) to be called.
+ 5. An if (m_privateBrowsingEnabled == privateBrowsingEnabled) early return prevented the
+ global value for the storage session from being destroyed.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::setPrivateBrowsingEnabled):
+ Move the early return to be after setting the global private browsing values, and add a
+ clearer comment + FIXME.
+
+2011-12-21 Lucas Forschler <[email protected]>
+
Merge 94857
2011-09-08 Abhishek Arya <[email protected]>
Modified: branches/safari-534.54-branch/Source/WebCore/page/Settings.cpp (103447 => 103448)
--- branches/safari-534.54-branch/Source/WebCore/page/Settings.cpp 2011-12-21 22:21:12 UTC (rev 103447)
+++ branches/safari-534.54-branch/Source/WebCore/page/Settings.cpp 2011-12-21 22:24:26 UTC (rev 103448)
@@ -361,16 +361,26 @@
void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
{
- if (m_privateBrowsingEnabled == privateBrowsingEnabled)
- return;
-
+ // FIXME http://webkit.org/b/67870: The private browsing storage session and cookie private
+ // browsing mode (which is used if storage sessions are not available) are global settings, so
+ // it is misleading to have them as per-page settings.
+ // In addition, if they are treated as a per Page settings, the global values can get out of
+ // sync with the per Page value in the following situation:
+ // 1. The global values get set to true when setPrivateBrowsingEnabled(true) is called.
+ // 2. All Pages are closed, so all Settings objects go away.
+ // 3. A new Page is created, and a corresponding new Settings object is created - with
+ // m_privateBrowsingEnabled starting out as false in the constructor.
+ // 4. The WebPage settings get applied to the new Page and setPrivateBrowsingEnabled(false)
+ // is called, but an if (m_privateBrowsingEnabled == privateBrowsingEnabled) early return
+ // prevents the global values from getting changed from true to false.
#if USE(CFURLSTORAGESESSIONS)
ResourceHandle::setPrivateBrowsingEnabled(privateBrowsingEnabled);
#endif
-
- // FIXME: We can only enable cookie private browsing mode globally, so it's misleading to have it as a per-page setting.
setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
+ if (m_privateBrowsingEnabled == privateBrowsingEnabled)
+ return;
+
m_privateBrowsingEnabled = privateBrowsingEnabled;
m_page->privateBrowsingStateChanged();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes