RESOLVED FIXED 118266
[WK2] Clean up private browsing session tracking
https://bugs.webkit.org/show_bug.cgi?id=118266
Summary [WK2] Clean up private browsing session tracking
Alexey Proskuryakov
Reported 2013-07-01 16:08:33 PDT
Currently, WebContext counts how many times API for enabling/disabling private browsing was called. This is unnecessarily roundabout - we can watch actual WebPreferences objects instead. <rdar://problem/13078036>
Attachments
proposed patch (12.41 KB, patch)
2013-07-01 16:47 PDT, Alexey Proskuryakov
beidson: review+
Alexey Proskuryakov
Comment 1 2013-07-01 16:47:43 PDT
Created attachment 205844 [details] proposed patch
WebKit Commit Bot
Comment 2 2013-07-01 16:50:25 PDT
Attachment 205844 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/UIProcess/API/C/WKPreferences.cpp', u'Source/WebKit2/UIProcess/WebContext.cpp', u'Source/WebKit2/UIProcess/WebContext.h', u'Source/WebKit2/UIProcess/WebPreferences.cpp', u'Source/WebKit2/UIProcess/WebPreferences.h', u'Source/WebKit2/WebProcess/WebPage/WebPage.cpp']" exit_code: 1 Source/WebKit2/UIProcess/WebContext.cpp:53: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Brady Eidson
Comment 3 2013-07-01 17:01:14 PDT
Comment on attachment 205844 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=205844&action=review > Source/WebKit2/ChangeLog:17 > + API was called, rely on WebPrefences tracking. typo WebPreferences* > Source/WebKit2/ChangeLog:36 > + WebContext to know when any page groups are in provate brosing mode. provate brosing!!! > Source/WebKit2/UIProcess/WebPreferences.cpp:67 > + if (privateBrowsingEnabled()) { > + if (!privateBrowsingPageGroupCount++) > + WebContext::willStartUsingPrivateBrowsing(); > + } I think doing a compare with the postincrement makes this less readable than: if (privateBrowsingEnabled()) { if (!privateBrowsingPageGroupCount) WebContext::willStartUsingPrivateBrowsing(); ++privateBrowsingPageGroupCount; } > Source/WebKit2/UIProcess/WebPreferences.cpp:76 > + if (privateBrowsingEnabled()) { > + if (!--privateBrowsingPageGroupCount) > + WebContext::willStopUsingPrivateBrowsing(); > + } I think doing a compare with the preincrement makes this less readable than: if (privateBrowsingEnabled()) { --privateBrowsingPageGroupCount; if (!privateBrowsingPageGroupCount) WebContext::willStopUsingPrivateBrowsing(); }
Alexey Proskuryakov
Comment 4 2013-07-01 17:10:25 PDT
Committed <http://trac.webkit.org/changeset/152273>. In addition to addressing review feedback, made one more change - in WebPreferences::addPageGroup and WebPreferences::removePageGroup, I check that the group is actually added or removed.
Note You need to log in before you can comment on or make changes to this bug.