<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163656] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163656">163656</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-02-07 15:26:25 -0800 (Fri, 07 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make it possible for each web page to have different preferences
https://bugs.webkit.org/show_bug.cgi?id=128403

Reviewed by Tim Horton.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesCreate):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::ensureNetworkProcess):
(WebKit::WebContext::createNewWebProcess):
* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::setDatabasePath):
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::WebPageGroup):
(WebKit::WebPageGroup::~WebPageGroup):
(WebKit::WebPageGroup::setPreferences):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::~WebPageProxy):
(WebKit::WebPageProxy::setPreferences):
(WebKit::WebPageProxy::preferencesDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::~WebPreferences):
(WebKit::WebPreferences::addPage):
(WebKit::WebPreferences::removePage):
(WebKit::WebPreferences::update):
(WebKit::WebPreferences::updatePrivateBrowsingValue):
(WebKit::WebPreferences::anyPagesAreUsingPrivateBrowsing):
* UIProcess/WebPreferences.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencescpp">trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebContextcpp">trunk/Source/WebKit2/UIProcess/WebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebIconDatabasecpp">trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageGroupcpp">trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPreferencescpp">trunk/Source/WebKit2/UIProcess/WebPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPreferencesh">trunk/Source/WebKit2/UIProcess/WebPreferences.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-02-07  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Make it possible for each web page to have different preferences
+        https://bugs.webkit.org/show_bug.cgi?id=128403
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesCreate):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::ensureNetworkProcess):
+        (WebKit::WebContext::createNewWebProcess):
+        * UIProcess/WebIconDatabase.cpp:
+        (WebKit::WebIconDatabase::setDatabasePath):
+        * UIProcess/WebPageGroup.cpp:
+        (WebKit::WebPageGroup::WebPageGroup):
+        (WebKit::WebPageGroup::~WebPageGroup):
+        (WebKit::WebPageGroup::setPreferences):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::~WebPageProxy):
+        (WebKit::WebPageProxy::setPreferences):
+        (WebKit::WebPageProxy::preferencesDidChange):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPreferences.cpp:
+        (WebKit::WebPreferences::~WebPreferences):
+        (WebKit::WebPreferences::addPage):
+        (WebKit::WebPreferences::removePage):
+        (WebKit::WebPreferences::update):
+        (WebKit::WebPreferences::updatePrivateBrowsingValue):
+        (WebKit::WebPreferences::anyPagesAreUsingPrivateBrowsing):
+        * UIProcess/WebPreferences.h:
+
</ins><span class="cx"> 2014-02-07  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2] Add support for text document viewport configuration
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> WKPreferencesRef WKPreferencesCreate()
</span><span class="cx"> {
</span><del>-    RefPtr&lt;WebPreferences&gt; preferences = WebPreferences::create();
</del><ins>+    RefPtr&lt;WebPreferences&gt; preferences = WebPreferences::create(String());
</ins><span class="cx">     return toAPI(preferences.release().leakRef());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -377,7 +377,7 @@
</span><span class="cx"> 
</span><span class="cx">     NetworkProcessCreationParameters parameters;
</span><span class="cx"> 
</span><del>-    parameters.privateBrowsingEnabled = WebPreferences::anyPageGroupsAreUsingPrivateBrowsing();
</del><ins>+    parameters.privateBrowsingEnabled = WebPreferences::anyPagesAreUsingPrivateBrowsing();
</ins><span class="cx"> 
</span><span class="cx">     parameters.cacheModel = m_cacheModel;
</span><span class="cx"> 
</span><span class="lines">@@ -619,7 +619,7 @@
</span><span class="cx">     process-&gt;send(Messages::WebProcess::SetQOS(webProcessLatencyQOS(), webProcessThroughputQOS()), 0);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (WebPreferences::anyPageGroupsAreUsingPrivateBrowsing())
</del><ins>+    if (WebPreferences::anyPagesAreUsingPrivateBrowsing())
</ins><span class="cx">         process-&gt;send(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionTracker::legacyPrivateSessionID), 0);
</span><span class="cx"> 
</span><span class="cx">     m_processes.append(process);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebIconDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: WebIconDatabases are per-WebContext but WebContext's don't have their own notion of the current private browsing setting.
</span><span class="cx">     // As we clean up private browsing throughout the stack we need to clean it up here.
</span><del>-    m_iconDatabaseImpl-&gt;setPrivateBrowsingEnabled(WebPreferences::anyPageGroupsAreUsingPrivateBrowsing());
</del><ins>+    m_iconDatabaseImpl-&gt;setPrivateBrowsingEnabled(WebPreferences::anyPagesAreUsingPrivateBrowsing());
</ins><span class="cx"> 
</span><span class="cx">     if (!m_iconDatabaseImpl-&gt;open(directoryName(path), pathGetFileName(path))) {
</span><span class="cx">         LOG_ERROR(&quot;Unable to open WebKit2 icon database on disk&quot;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -86,13 +86,11 @@
</span><span class="cx">     : m_data(pageGroupData(identifier, visibleToInjectedBundle, visibleToHistoryClient))
</span><span class="cx">     , m_preferences(WebPreferences::create(m_data.identifer))
</span><span class="cx"> {
</span><del>-    m_preferences-&gt;addPageGroup(this);
</del><span class="cx">     webPageGroupMap().set(m_data.pageGroupID, this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebPageGroup::~WebPageGroup()
</span><span class="cx"> {
</span><del>-    m_preferences-&gt;removePageGroup(this);
</del><span class="cx">     webPageGroupMap().remove(pageGroupID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -111,14 +109,10 @@
</span><span class="cx">     if (preferences == m_preferences)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_preferences-&gt;removePageGroup(this);
</del><span class="cx">     m_preferences = preferences;
</span><del>-    m_preferences-&gt;addPageGroup(this);
</del><span class="cx"> 
</span><span class="cx">     for (auto&amp; webPageProxy : m_pages)
</span><span class="cx">         webPageProxy-&gt;setPreferences(*m_preferences);
</span><del>-
-    preferencesDidChange();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebPreferences&amp; WebPageGroup::preferences() const
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -349,6 +349,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebContext::statistics().wkPageCount++;
</span><span class="cx"> 
</span><ins>+    m_preferences-&gt;addPage(*this);
</ins><span class="cx">     m_pageGroup-&gt;addPage(this);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="lines">@@ -381,6 +382,7 @@
</span><span class="cx">     if (m_hasSpellDocumentTag)
</span><span class="cx">         TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
</span><span class="cx"> 
</span><ins>+    m_preferences-&gt;removePage(*this);
</ins><span class="cx">     m_pageGroup-&gt;removePage(this);
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -405,6 +407,18 @@
</span><span class="cx">     return m_isValid;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::setPreferences(WebPreferences&amp; preferences)
+{
+    if (&amp;preferences == &amp;m_preferences.get())
+        return;
+
+    m_preferences-&gt;removePage(*this);
+    m_preferences = preferences;
+    m_preferences-&gt;addPage(*this);
+
+    preferencesDidChange();
+}
+
</ins><span class="cx"> PassRefPtr&lt;API::Array&gt; WebPageProxy::relatedPages() const
</span><span class="cx"> {
</span><span class="cx">     // pages() returns a list of pages in WebProcess, so this page may or may not be among them - a client can use a reference to WebPageProxy after the page has closed.
</span><span class="lines">@@ -2067,7 +2081,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR_SERVER)
</span><del>-    if (m_pageGroup-&gt;preferences().developerExtrasEnabled())
</del><ins>+    if (m_preferences-&gt;developerExtrasEnabled())
</ins><span class="cx">         inspector()-&gt;enableRemoteInspection();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -729,7 +729,7 @@
</span><span class="cx">     PlatformProcessIdentifier processIdentifier() const;
</span><span class="cx"> 
</span><span class="cx">     WebPreferences&amp; preferences() { return m_preferences.get(); }
</span><del>-    void setPreferences(WebPreferences&amp; preferences) { m_preferences = preferences; }
</del><ins>+    void setPreferences(WebPreferences&amp;);
</ins><span class="cx"> 
</span><span class="cx">     WebPageGroup&amp; pageGroup() { return m_pageGroup.get(); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPreferences.cpp (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPreferences.cpp        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/WebPreferences.cpp        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -34,13 +34,8 @@
</span><span class="cx"> 
</span><span class="cx"> // FIXME: Manipulating this variable is not thread safe.
</span><span class="cx"> // Instead of tracking private browsing state as a boolean preference, we should let the client provide storage sessions explicitly.
</span><del>-static unsigned privateBrowsingPageGroupCount;
</del><ins>+static unsigned privateBrowsingPageCount;
</ins><span class="cx"> 
</span><del>-WebPreferences::WebPreferences()
-{
-    platformInitializeStore();
-}
-
</del><span class="cx"> WebPreferences::WebPreferences(const String&amp; identifier)
</span><span class="cx">     : m_identifier(identifier)
</span><span class="cx"> {
</span><span class="lines">@@ -55,7 +50,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebPreferences::~WebPreferences()
</span><span class="cx"> {
</span><del>-    ASSERT(m_pageGroups.isEmpty());
</del><ins>+    ASSERT(m_pages.isEmpty());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;WebPreferences&gt; WebPreferences::copy() const
</span><span class="lines">@@ -63,30 +58,35 @@
</span><span class="cx">     return adoptRef(new WebPreferences(*this));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPreferences::addPageGroup(WebPageGroup* pageGroup)
</del><ins>+void WebPreferences::addPage(WebPageProxy&amp; webPageProxy)
</ins><span class="cx"> {
</span><del>-    bool didAddPageGroup = m_pageGroups.add(pageGroup).isNewEntry;
-    if (didAddPageGroup &amp;&amp; privateBrowsingEnabled()) {
-        if (!privateBrowsingPageGroupCount)
</del><ins>+    ASSERT(!m_pages.contains(&amp;webPageProxy));
+    m_pages.add(&amp;webPageProxy);
+
+    if (privateBrowsingEnabled()) {
+        if (!privateBrowsingPageCount)
</ins><span class="cx">             WebContext::willStartUsingPrivateBrowsing();
</span><del>-        ++privateBrowsingPageGroupCount;
</del><ins>+
+        ++privateBrowsingPageCount;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPreferences::removePageGroup(WebPageGroup* pageGroup)
</del><ins>+void WebPreferences::removePage(WebPageProxy&amp; webPageProxy)
</ins><span class="cx"> {
</span><del>-    bool didRemovePageGroup = m_pageGroups.remove(pageGroup);
-    if (didRemovePageGroup &amp;&amp; privateBrowsingEnabled()) {
-        --privateBrowsingPageGroupCount;
-        if (!privateBrowsingPageGroupCount)
</del><ins>+    ASSERT(m_pages.contains(&amp;webPageProxy));
+    m_pages.remove(&amp;webPageProxy);
+
+    if (privateBrowsingEnabled()) {
+        --privateBrowsingPageCount;
+        if (!privateBrowsingPageCount)
</ins><span class="cx">             WebContext::willStopUsingPrivateBrowsing();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPreferences::update()
</span><span class="cx"> {
</span><del>-    for (HashSet&lt;WebPageGroup*&gt;::iterator it = m_pageGroups.begin(), end = m_pageGroups.end(); it != end; ++it)
-        (*it)-&gt;preferencesDidChange();
</del><ins>+    for (auto&amp; webPageProxy : m_pages)
+        webPageProxy-&gt;preferencesDidChange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPreferences::updateStringValueForKey(const String&amp; key, const String&amp; value)
</span><span class="lines">@@ -128,22 +128,22 @@
</span><span class="cx"> {
</span><span class="cx">     platformUpdateBoolValueForKey(WebPreferencesKey::privateBrowsingEnabledKey(), value);
</span><span class="cx"> 
</span><del>-    unsigned pageGroupsChanged = m_pageGroups.size();
-    if (!pageGroupsChanged)
</del><ins>+    unsigned pagesChanged = m_pages.size();
+    if (!pagesChanged)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (value) {
</span><del>-        if (!privateBrowsingPageGroupCount)
</del><ins>+        if (!privateBrowsingPageCount)
</ins><span class="cx">             WebContext::willStartUsingPrivateBrowsing();
</span><del>-        privateBrowsingPageGroupCount += pageGroupsChanged;
</del><ins>+        privateBrowsingPageCount += pagesChanged;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     update(); // FIXME: Only send over the changed key and value.
</span><span class="cx"> 
</span><span class="cx">     if (!value) {
</span><del>-        ASSERT(privateBrowsingPageGroupCount &gt;= pageGroupsChanged);
-        privateBrowsingPageGroupCount -= pageGroupsChanged;
-        if (!privateBrowsingPageGroupCount)
</del><ins>+        ASSERT(privateBrowsingPageCount &gt;= pagesChanged);
+        privateBrowsingPageCount -= pagesChanged;
+        if (!privateBrowsingPageCount)
</ins><span class="cx">             WebContext::willStopUsingPrivateBrowsing();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -166,9 +166,9 @@
</span><span class="cx"> 
</span><span class="cx"> #undef DEFINE_PREFERENCE_GETTER_AND_SETTERS
</span><span class="cx"> 
</span><del>-bool WebPreferences::anyPageGroupsAreUsingPrivateBrowsing()
</del><ins>+bool WebPreferences::anyPagesAreUsingPrivateBrowsing()
</ins><span class="cx"> {
</span><del>-    return privateBrowsingPageGroupCount;
</del><ins>+    return privateBrowsingPageCount;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPreferencesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPreferences.h (163655 => 163656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPreferences.h        2014-02-07 23:07:29 UTC (rev 163655)
+++ trunk/Source/WebKit2/UIProcess/WebPreferences.h        2014-02-07 23:26:25 UTC (rev 163656)
</span><span class="lines">@@ -39,14 +39,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class WebPageGroup;
</del><ins>+class WebPageProxy;
</ins><span class="cx"> 
</span><span class="cx"> class WebPreferences : public API::ObjectImpl&lt;API::Object::Type::Preferences&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;WebPreferences&gt; create()
-    {
-        return adoptRef(new WebPreferences);
-    }
</del><span class="cx">     static PassRefPtr&lt;WebPreferences&gt; create(const String&amp; identifier)
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(new WebPreferences(identifier));
</span><span class="lines">@@ -56,8 +52,8 @@
</span><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;WebPreferences&gt; copy() const;
</span><span class="cx"> 
</span><del>-    void addPageGroup(WebPageGroup*);
-    void removePageGroup(WebPageGroup*);
</del><ins>+    void addPage(WebPageProxy&amp;);
+    void removePage(WebPageProxy&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const WebPreferencesStore&amp; store() const { return m_store; }
</span><span class="cx"> 
</span><span class="lines">@@ -72,10 +68,9 @@
</span><span class="cx">     // Exposed for WebKitTestRunner use only.
</span><span class="cx">     void forceUpdate() { update(); }
</span><span class="cx"> 
</span><del>-    static bool anyPageGroupsAreUsingPrivateBrowsing();
</del><ins>+    static bool anyPagesAreUsingPrivateBrowsing();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    WebPreferences();
</del><span class="cx">     explicit WebPreferences(const String&amp;);
</span><span class="cx">     WebPreferences(const WebPreferences&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -96,9 +91,10 @@
</span><span class="cx"> 
</span><span class="cx">     void updatePrivateBrowsingValue(bool value);
</span><span class="cx"> 
</span><del>-    HashSet&lt;WebPageGroup*&gt; m_pageGroups;
-    WebPreferencesStore m_store;
</del><span class="cx">     String m_identifier;
</span><ins>+    WebPreferencesStore m_store;
+
+    HashSet&lt;WebPageProxy*&gt; m_pages;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>

</body>
</html>