<!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>[165619] trunk/Source</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/165619">165619</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-03-14 08:41:11 -0700 (Fri, 14 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move visited link handling to VisitedLinkTableController and VisitedLinkProvider
https://bugs.webkit.org/show_bug.cgi?id=130223
&lt;rdar://problem/16315792&gt;

Reviewed by Dan Bernstein.

Source/WebCore:

Export symbols needed by WebKit2.

* WebCore.exp.in:

Source/WebKit2:

* DerivedSources.make:
Generate messages for VisitedLinkProvider and VisitedLinkTableController.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
Set the visited link provider.

* UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
Add addVisitedLinkWithURL: method.

* UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
(-[_WKVisitedLinkProvider addVisitedLinkWithURL:]):
Compute a link hash from the absolute URL string and pass it to the underlying VisitedLinkProvider object.

* UIProcess/VisitedLinkProvider.cpp:
(WebKit::VisitedLinkProvider::addProcess):
Add the process to the m_processes HashCountedSet. If it's the first time we're adding the process,
add the VisitedLinkProvider object as a message receiver and send the visited link table to the process.

(WebKit::VisitedLinkProvider::removeProcess):
Remove the process from the m_processes HashCountedSet. If we're removing the last reference to the process,
remove ourselves as a  message receiver.

(WebKit::VisitedLinkProvider::addVisitedLinkHash):
Rename this from addVisitedLink to better indicate what it's doing.

(WebKit::tableSizeForKeyCount):
Update for constant rename.

(WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
Compute the new pending visited links table size. If it's bigger than our current table, resize the table
by calling resizeTable. Otherwise, simply try to add the pending hashes to our shared hash table. If successful,
add the link hash to the addedVisitedLinks table and eventually send it to all processes associated with the visited link provider.

(WebKit::VisitedLinkProvider::resizeTable):
Create a new shared memory segment, Set it as the table backing store and add all visited links from the old table. Finally,
add our pending visited link hashes and send the new table memory to all processes associated with the visited link provider.

(WebKit::VisitedLinkProvider::sendTable):
Helper function that creates a shared memory handle and sends it to a given web process.

* UIProcess/VisitedLinkProvider.h:
Add new members.

* UIProcess/VisitedLinkProvider.messages.in:
Add messages.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::processDidFinishLaunching):
(WebKit::WebContext::disconnectProcess):
The WebContext no longer needs to inform the visited link provider about the processes coming and going, that's already handled
by the WebPageProxy objects.

(WebKit::WebContext::addVisitedLink):
Call addVisitedLinkHash on the visited link provider.

* UIProcess/WebContext.h:
* UIProcess/WebContext.messages.in:
Remove a message that is now implemented by the visited link provider.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::VisitedLinkTableController):
Add the table controller as a message receiver.

(WebKit::VisitedLinkTableController::~VisitedLinkTableController):
Remove the table controller as a message receiver.

(WebKit::VisitedLinkTableController::isLinkVisited):
Check if the link is visited according to the visited link table.

(WebKit::VisitedLinkTableController::addVisitedLink):
Send the link hash to the UI process if it's not already visited.

(WebKit::VisitedLinkTableController::setVisitedLinkTable):
Set the backing store memory and invalidate all styles.

(WebKit::VisitedLinkTableController::visitedLinkStateChanged):
Invalidate the styles for the given links.

(WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
Invalidate the styles for all links.

* WebProcess/WebPage/VisitedLinkTableController.h:
Add new members.

* WebProcess/WebPage/VisitedLinkTableController.messages.in:
Add new messages.

* WebProcess/WebProcess.cpp:
Remove unused functions; these are handled by VisitedLinkTableController now.

* WebProcess/WebProcess.h:
(WebKit::WebProcess::shouldTrackVisitedLinks):
Add getter.

* WebProcess/WebProcess.messages.in:
Remove messages.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKVisitedLinkProviderh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKVisitedLinkProvidermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessVisitedLinkProvidercpp">trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessVisitedLinkProviderh">trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebContextcpp">trunk/Source/WebKit2/UIProcess/WebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebContexth">trunk/Source/WebKit2/UIProcess/WebContext.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebContextmessagesin">trunk/Source/WebKit2/UIProcess/WebContext.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllerh">trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessmessagesin">trunk/Source/WebKit2/WebProcess/WebProcess.messages.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessVisitedLinkProvidermessagesin">trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllermessagesin">trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebCore/ChangeLog        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-03-13  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Move visited link handling to VisitedLinkTableController and VisitedLinkProvider
+        https://bugs.webkit.org/show_bug.cgi?id=130223
+        &lt;rdar://problem/16315792&gt;
+
+        Reviewed by Dan Bernstein.
+
+        Export symbols needed by WebKit2.
+
+        * WebCore.exp.in:
+
</ins><span class="cx"> 2014-03-12  Martin Robinson  &lt;mrobinson@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Fix unused parameter warnings in the GObject WebKitDOM bindings
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -702,6 +702,8 @@
</span><span class="cx"> __ZN7WebCore16VisibleSelectionC1ERKNS_15VisiblePositionEb
</span><span class="cx"> __ZN7WebCore16VisitedLinkStoreC2Ev
</span><span class="cx"> __ZN7WebCore16VisitedLinkStoreD2Ev
</span><ins>+__ZN7WebCore16VisitedLinkStore23invalidateStylesForLinkEy
+__ZN7WebCore16VisitedLinkStore27invalidateStylesForAllLinksEv
</ins><span class="cx"> __ZN7WebCore16createFullMarkupERKNS_4NodeE
</span><span class="cx"> __ZN7WebCore16createFullMarkupERKNS_5RangeE
</span><span class="cx"> __ZN7WebCore16enclosingIntRectERK6CGRect
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/ChangeLog        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -1,3 +1,112 @@
</span><ins>+2014-03-13  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Move visited link handling to VisitedLinkTableController and VisitedLinkProvider
+        https://bugs.webkit.org/show_bug.cgi?id=130223
+        &lt;rdar://problem/16315792&gt;
+
+        Reviewed by Dan Bernstein.
+
+        * DerivedSources.make:
+        Generate messages for VisitedLinkProvider and VisitedLinkTableController.
+        
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration copyWithZone:]):
+        Set the visited link provider.
+
+        * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
+        Add addVisitedLinkWithURL: method.
+
+        * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
+        (-[_WKVisitedLinkProvider addVisitedLinkWithURL:]):
+        Compute a link hash from the absolute URL string and pass it to the underlying VisitedLinkProvider object.
+
+        * UIProcess/VisitedLinkProvider.cpp:
+        (WebKit::VisitedLinkProvider::addProcess):
+        Add the process to the m_processes HashCountedSet. If it's the first time we're adding the process, 
+        add the VisitedLinkProvider object as a message receiver and send the visited link table to the process.
+
+        (WebKit::VisitedLinkProvider::removeProcess):
+        Remove the process from the m_processes HashCountedSet. If we're removing the last reference to the process,
+        remove ourselves as a  message receiver.
+
+        (WebKit::VisitedLinkProvider::addVisitedLinkHash):
+        Rename this from addVisitedLink to better indicate what it's doing.
+
+        (WebKit::tableSizeForKeyCount):
+        Update for constant rename.
+
+        (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
+        Compute the new pending visited links table size. If it's bigger than our current table, resize the table
+        by calling resizeTable. Otherwise, simply try to add the pending hashes to our shared hash table. If successful,
+        add the link hash to the addedVisitedLinks table and eventually send it to all processes associated with the visited link provider.
+
+        (WebKit::VisitedLinkProvider::resizeTable):
+        Create a new shared memory segment, Set it as the table backing store and add all visited links from the old table. Finally,
+        add our pending visited link hashes and send the new table memory to all processes associated with the visited link provider.
+
+        (WebKit::VisitedLinkProvider::sendTable):
+        Helper function that creates a shared memory handle and sends it to a given web process.
+
+        * UIProcess/VisitedLinkProvider.h:
+        Add new members.
+
+        * UIProcess/VisitedLinkProvider.messages.in:
+        Add messages.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::processDidFinishLaunching):
+        (WebKit::WebContext::disconnectProcess):
+        The WebContext no longer needs to inform the visited link provider about the processes coming and going, that's already handled
+        by the WebPageProxy objects.
+
+        (WebKit::WebContext::addVisitedLink):
+        Call addVisitedLinkHash on the visited link provider.
+
+        * UIProcess/WebContext.h:
+        * UIProcess/WebContext.messages.in:
+        Remove a message that is now implemented by the visited link provider.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * WebProcess/WebPage/VisitedLinkTableController.cpp:
+        (WebKit::VisitedLinkTableController::VisitedLinkTableController):
+        Add the table controller as a message receiver.
+
+        (WebKit::VisitedLinkTableController::~VisitedLinkTableController):
+        Remove the table controller as a message receiver.
+
+        (WebKit::VisitedLinkTableController::isLinkVisited):
+        Check if the link is visited according to the visited link table.
+
+        (WebKit::VisitedLinkTableController::addVisitedLink):
+        Send the link hash to the UI process if it's not already visited.
+
+        (WebKit::VisitedLinkTableController::setVisitedLinkTable):
+        Set the backing store memory and invalidate all styles.
+
+        (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
+        Invalidate the styles for the given links.
+
+        (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
+        Invalidate the styles for all links.
+
+        * WebProcess/WebPage/VisitedLinkTableController.h:
+        Add new members.
+
+        * WebProcess/WebPage/VisitedLinkTableController.messages.in:
+        Add new messages.
+
+        * WebProcess/WebProcess.cpp:
+        Remove unused functions; these are handled by VisitedLinkTableController now.
+
+        * WebProcess/WebProcess.h:
+        (WebKit::WebProcess::shouldTrackVisitedLinks):
+        Add getter.
+
+        * WebProcess/WebProcess.messages.in:
+        Remove messages.
+
</ins><span class="cx"> 2014-03-12  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename DEFINE_STATIC_LOCAL to DEPRECATED_DEFINE_STATIC_LOCAL
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/DerivedSources.make        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -99,6 +99,8 @@
</span><span class="cx">     ViewGestureController \
</span><span class="cx">     ViewGestureGeometryCollector \
</span><span class="cx">     ViewUpdateDispatcher \
</span><ins>+    VisitedLinkProvider \
+    VisitedLinkTableController \
</ins><span class="cx">     WebApplicationCacheManager \
</span><span class="cx">     WebApplicationCacheManagerProxy \
</span><span class="cx">     WebConnection \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">     configuration.processPool = _processPool.get();
</span><span class="cx">     configuration.preferences = _preferences.get();
</span><ins>+    configuration._visitedLinkProvider = _visitedLinkProvider.get();
</ins><span class="cx">     configuration._relatedWebView = _relatedWebView.get().get();
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     configuration._contentProviderRegistry = _contentProviderRegistry.get();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKVisitedLinkProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.h (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.h        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.h        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> WK_API_CLASS
</span><span class="cx"> @interface _WKVisitedLinkProvider : NSObject
</span><span class="cx"> 
</span><ins>+- (void)addVisitedLinkWithURL:(NSURL *)URL;
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKVisitedLinkProvidermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><span class="cx"> #import &quot;VisitedLinkProvider.h&quot;
</span><ins>+#import &lt;WebCore/LinkHash.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> @implementation _WKVisitedLinkProvider
</span><span class="cx"> 
</span><span class="lines">@@ -42,6 +43,13 @@
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)addVisitedLinkWithURL:(NSURL *)URL
+{
+    auto linkHash = WebCore::visitedLinkHash(URL.absoluteString);
+
+    _visitedLinkProvider-&gt;addVisitedLinkHash(linkHash);
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessVisitedLinkProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.cpp (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.cpp        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.cpp        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -27,7 +27,9 @@
</span><span class="cx"> #include &quot;VisitedLinkProvider.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;SharedMemory.h&quot;
</span><ins>+#include &quot;VisitedLinkProviderMessages.h&quot;
</ins><span class="cx"> #include &quot;VisitedLinkTable.h&quot;
</span><ins>+#include &quot;VisitedLinkTableControllerMessages.h&quot;
</ins><span class="cx"> #include &quot;WebContext.h&quot;
</span><span class="cx"> #include &quot;WebProcessMessages.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -35,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static const int VisitedLinkTableMaxLoad = 2;
</del><ins>+static const int visitedLinkTableMaxLoad = 2;
</ins><span class="cx"> 
</span><span class="cx"> static uint64_t generateIdentifier()
</span><span class="cx"> {
</span><span class="lines">@@ -66,38 +68,35 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(process.state() == WebProcessProxy::State::Running);
</span><span class="cx"> 
</span><del>-    m_processes.add(&amp;process);
</del><ins>+    if (!m_processes.add(&amp;process).isNewEntry)
+        return;
+
+    process.addMessageReceiver(Messages::VisitedLinkProvider::messageReceiverName(), m_identifier, *this);
+
+    if (!m_keyCount)
+        return;
+
+    ASSERT(m_table.sharedMemory());
+
+    sendTable(process);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VisitedLinkProvider::removeProcess(WebProcessProxy&amp; process)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_processes.contains(&amp;process));
</span><span class="cx"> 
</span><del>-    m_processes.remove(&amp;process);
</del><ins>+    if (m_processes.remove(&amp;process))
+        process.removeMessageReceiver(Messages::VisitedLinkProvider::messageReceiverName(), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VisitedLinkProvider::processDidFinishLaunching(WebProcessProxy* process)
</del><ins>+void VisitedLinkProvider::addVisitedLinkHash(LinkHash linkHash)
</ins><span class="cx"> {
</span><del>-    m_processesWithoutVisitedLinkState.add(process);
-
-    if (m_keyCount)
-        m_pendingVisitedLinksTimer.startOneShot(0);
-}
-
-void VisitedLinkProvider::addVisitedLink(LinkHash linkHash)
-{
</del><span class="cx">     m_pendingVisitedLinks.add(linkHash);
</span><span class="cx"> 
</span><span class="cx">     if (!m_pendingVisitedLinksTimer.isActive())
</span><span class="cx">         m_pendingVisitedLinksTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VisitedLinkProvider::processDidClose(WebProcessProxy* process)
-{
-    m_processesWithVisitedLinkState.remove(process);
-    m_processesWithoutVisitedLinkState.remove(process);
-}
-
</del><span class="cx"> static unsigned nextPowerOf2(unsigned v)
</span><span class="cx"> {
</span><span class="cx">     // Taken from http://www.cs.utk.edu/~vose/c-stuff/bithacks.html
</span><span class="lines">@@ -117,7 +116,7 @@
</span><span class="cx"> static unsigned tableSizeForKeyCount(unsigned keyCount)
</span><span class="cx"> {
</span><span class="cx">     // We want the table to be at least half empty.
</span><del>-    unsigned tableSize = nextPowerOf2(keyCount * VisitedLinkTableMaxLoad);
</del><ins>+    unsigned tableSize = nextPowerOf2(keyCount * visitedLinkTableMaxLoad);
</ins><span class="cx"> 
</span><span class="cx">     // Ensure that the table size is at least the size of a page.
</span><span class="cx">     size_t minimumTableSize = SharedMemory::systemPageSize() / sizeof(LinkHash);
</span><span class="lines">@@ -129,94 +128,90 @@
</span><span class="cx"> 
</span><span class="cx"> void VisitedLinkProvider::pendingVisitedLinksTimerFired()
</span><span class="cx"> {
</span><del>-    Vector&lt;WebCore::LinkHash&gt; pendingVisitedLinks;
-    copyToVector(m_pendingVisitedLinks, pendingVisitedLinks);
-    m_pendingVisitedLinks.clear();
-
</del><span class="cx">     unsigned currentTableSize = m_tableSize;
</span><ins>+    unsigned newTableSize = tableSizeForKeyCount(m_keyCount + m_pendingVisitedLinks.size());
</ins><span class="cx"> 
</span><del>-    // Upper bound on needed size - some of the links may be duplicates, in which case we could have done with less.
-    unsigned newTableSize = tableSizeForKeyCount(m_keyCount + pendingVisitedLinks.size());
-
-    // Never decrease table size when adding to it, to avoid unneeded churn.
</del><span class="cx">     newTableSize = std::max(currentTableSize, newTableSize);
</span><span class="cx"> 
</span><del>-    // Links that were added.
-    Vector&lt;WebCore::LinkHash&gt; addedVisitedLinks;
-
-    // VisitedLinkTable remains internally consistent when adding, so it's OK to modify it in place
-    // even if a web process is accessing it at the same time.
</del><span class="cx">     if (currentTableSize != newTableSize) {
</span><del>-        RefPtr&lt;SharedMemory&gt; newTableMemory = SharedMemory::create(newTableSize * sizeof(LinkHash));
</del><ins>+        resizeTable(newTableSize);
+        return;
+    }
</ins><span class="cx"> 
</span><del>-        // We failed to create the shared memory.
-        if (!newTableMemory) {
-            LOG_ERROR(&quot;Could not allocate shared memory for visited link table&quot;);
-            return;
</del><ins>+    Vector&lt;WebCore::LinkHash&gt; addedVisitedLinks;
+
+    for (auto linkHash : m_pendingVisitedLinks) {
+        if (m_table.addLinkHash(linkHash)) {
+            addedVisitedLinks.append(linkHash);
+            m_keyCount++;
</ins><span class="cx">         }
</span><ins>+    }
</ins><span class="cx"> 
</span><del>-        memset(newTableMemory-&gt;data(), 0, newTableMemory-&gt;size());
</del><ins>+    m_pendingVisitedLinks.clear();
</ins><span class="cx"> 
</span><del>-        RefPtr&lt;SharedMemory&gt; currentTableMemory = m_table.sharedMemory();
</del><ins>+    if (addedVisitedLinks.isEmpty())
+        return;
</ins><span class="cx"> 
</span><del>-        m_table.setSharedMemory(newTableMemory);
-        m_tableSize = newTableSize;
</del><ins>+    for (auto&amp; processAndCount : m_processes) {
+        if (addedVisitedLinks.size() &gt; 20)
+            processAndCount.key-&gt;connection()-&gt;send(Messages::VisitedLinkTableController::AllVisitedLinkStateChanged(), m_identifier);
+        else
+            processAndCount.key-&gt;connection()-&gt;send(Messages::VisitedLinkTableController::VisitedLinkStateChanged(addedVisitedLinks), m_identifier);
+    }
+}
</ins><span class="cx"> 
</span><del>-        if (currentTableMemory) {
-            ASSERT(currentTableMemory-&gt;size() == currentTableSize * sizeof(LinkHash));
</del><ins>+void VisitedLinkProvider::resizeTable(unsigned newTableSize)
+{
+    RefPtr&lt;SharedMemory&gt; newTableMemory = SharedMemory::create(newTableSize * sizeof(LinkHash));
</ins><span class="cx"> 
</span><del>-            // Go through the current hash table and re-add all entries to the new hash table.
-            const LinkHash* currentLinkHashes = static_cast&lt;const LinkHash*&gt;(currentTableMemory-&gt;data());
-            for (unsigned i = 0; i &lt; currentTableSize; ++i) {
-                LinkHash linkHash = currentLinkHashes[i];
-                
-                if (!linkHash)
-                    continue;
-
-                // It should always be possible to add the link hash to a new table.
-                if (!m_table.addLinkHash(linkHash))
-                    ASSERT_NOT_REACHED();
-            }
-        }
</del><ins>+    if (!newTableMemory) {
+        LOG_ERROR(&quot;Could not allocate shared memory for visited link table&quot;);
+        return;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; pendingVisitedLinks.size(); ++i) {
-        if (m_table.addLinkHash(pendingVisitedLinks[i]))
-            addedVisitedLinks.append(pendingVisitedLinks[i]);
-    }
</del><ins>+    memset(newTableMemory-&gt;data(), 0, newTableMemory-&gt;size());
</ins><span class="cx"> 
</span><del>-    m_keyCount += pendingVisitedLinks.size();
</del><ins>+    RefPtr&lt;SharedMemory&gt; currentTableMemory = m_table.sharedMemory();
+    unsigned currentTableSize = m_tableSize;
</ins><span class="cx"> 
</span><ins>+    m_table.setSharedMemory(newTableMemory);
+    m_tableSize = newTableSize;
</ins><span class="cx"> 
</span><del>-    for (HashSet&lt;WebProcessProxy*&gt;::iterator iter = m_processesWithVisitedLinkState.begin(); iter != m_processesWithVisitedLinkState.end(); ++iter) {
-        WebProcessProxy* process = *iter;
-        if (currentTableSize != newTableSize) {
-            // In the rare case of needing to resize the table, we'll bypass the VisitedLinkStateChanged optimization,
-            // and unconditionally use AllVisitedLinkStateChanged for the process.
-            m_processesWithoutVisitedLinkState.add(process);
-            continue;
-        }
</del><ins>+    if (currentTableMemory) {
+        ASSERT_UNUSED(currentTableSize, currentTableMemory-&gt;size() == currentTableSize * sizeof(LinkHash));
</ins><span class="cx"> 
</span><del>-        if (addedVisitedLinks.size() &lt;= 20)
-            process-&gt;send(Messages::WebProcess::VisitedLinkStateChanged(addedVisitedLinks), 0);
-        else
-            process-&gt;send(Messages::WebProcess::AllVisitedLinkStateChanged(), 0);
-    }
</del><ins>+        // Go through the current hash table and re-add all entries to the new hash table.
+        const LinkHash* currentLinkHashes = static_cast&lt;const LinkHash*&gt;(currentTableMemory-&gt;data());
+        for (unsigned i = 0; i &lt; m_tableSize; ++i) {
+            LinkHash linkHash = currentLinkHashes[i];
</ins><span class="cx"> 
</span><del>-    for (HashSet&lt;WebProcessProxy*&gt;::iterator iter = m_processesWithoutVisitedLinkState.begin(); iter != m_processesWithoutVisitedLinkState.end(); ++iter) {
-        WebProcessProxy* process = *iter;
</del><ins>+            if (!linkHash)
+                continue;
</ins><span class="cx"> 
</span><del>-        SharedMemory::Handle handle;
-        if (!m_table.sharedMemory()-&gt;createHandle(handle, SharedMemory::ReadOnly))
-            return;
</del><ins>+            bool didAddLinkHash = m_table.addLinkHash(linkHash);
</ins><span class="cx"> 
</span><del>-        process-&gt;send(Messages::WebProcess::SetVisitedLinkTable(handle), 0);
-        process-&gt;send(Messages::WebProcess::AllVisitedLinkStateChanged(), 0);
</del><ins>+            // It should always be possible to add the link hash to a new table.
+            ASSERT_UNUSED(didAddLinkHash, didAddLinkHash);
+        }
+    }
</ins><span class="cx"> 
</span><del>-        m_processesWithVisitedLinkState.add(process);
</del><ins>+    for (auto linkHash : m_pendingVisitedLinks) {
+        if (m_table.addLinkHash(linkHash))
+            m_keyCount++;
</ins><span class="cx">     }
</span><del>-    
-    m_processesWithoutVisitedLinkState.clear();
</del><ins>+    m_pendingVisitedLinks.clear();
+
+    for (auto&amp; processAndCount : m_processes)
+        sendTable(*processAndCount.key);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void VisitedLinkProvider::sendTable(WebProcessProxy&amp; process)
+{
+    SharedMemory::Handle handle;
+    if (!m_table.sharedMemory()-&gt;createHandle(handle, SharedMemory::ReadOnly))
+        return;
+
+    process.connection()-&gt;send(Messages::VisitedLinkTableController::SetVisitedLinkTable(handle), m_identifier);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessVisitedLinkProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.h (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.h        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.h        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef VisitedLinkProvider_h
</span><span class="cx"> #define VisitedLinkProvider_h
</span><span class="cx"> 
</span><ins>+#include &quot;MessageReceiver.h&quot;
</ins><span class="cx"> #include &quot;VisitedLinkTable.h&quot;
</span><span class="cx"> #include &lt;WebCore/LinkHash.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -40,7 +41,7 @@
</span><span class="cx"> class WebPageProxy;
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx">     
</span><del>-class VisitedLinkProvider : public RefCounted&lt;VisitedLinkProvider&gt; {
</del><ins>+class VisitedLinkProvider : public RefCounted&lt;VisitedLinkProvider&gt;, private IPC::MessageReceiver {
</ins><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;VisitedLinkProvider&gt; create();
</span><span class="cx">     ~VisitedLinkProvider();
</span><span class="lines">@@ -50,21 +51,21 @@
</span><span class="cx">     void addProcess(WebProcessProxy&amp;);
</span><span class="cx">     void removeProcess(WebProcessProxy&amp;);
</span><span class="cx"> 
</span><del>-    void addVisitedLink(WebCore::LinkHash);
</del><ins>+    void addVisitedLinkHash(WebCore::LinkHash);
</ins><span class="cx"> 
</span><del>-    void processDidFinishLaunching(WebProcessProxy*);
-    void processDidClose(WebProcessProxy*);
-
</del><span class="cx"> private:
</span><span class="cx">     VisitedLinkProvider();
</span><span class="cx"> 
</span><ins>+    // IPC::MessageReceiver
+    virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&amp;) override;
+
</ins><span class="cx">     void pendingVisitedLinksTimerFired();
</span><span class="cx"> 
</span><ins>+    void resizeTable(unsigned newTableSize);
+    void sendTable(WebProcessProxy&amp;);
+
</ins><span class="cx">     HashCountedSet&lt;WebProcessProxy*&gt; m_processes;
</span><span class="cx"> 
</span><del>-    HashSet&lt;WebProcessProxy*&gt; m_processesWithVisitedLinkState;
-    HashSet&lt;WebProcessProxy*&gt; m_processesWithoutVisitedLinkState;
-
</del><span class="cx">     uint64_t m_identifier;
</span><span class="cx"> 
</span><span class="cx">     unsigned m_keyCount;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessVisitedLinkProvidermessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in (0 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+# Copyright (C) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+messages -&gt; VisitedLinkProvider {
+    AddVisitedLinkHash(uint64_t linkHash)
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -700,7 +700,6 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_processes.contains(process));
</span><span class="cx"> 
</span><del>-    m_visitedLinkProvider-&gt;processDidFinishLaunching(process);
</del><span class="cx">     if (!m_visitedLinksPopulated) {
</span><span class="cx">         populateVisitedLinks();
</span><span class="cx">         m_visitedLinksPopulated = true;
</span><span class="lines">@@ -724,8 +723,6 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_processes.contains(process));
</span><span class="cx"> 
</span><del>-    m_visitedLinkProvider-&gt;processDidClose(process);
-
</del><span class="cx">     if (m_haveInitialEmptyProcess &amp;&amp; process == m_processes.last())
</span><span class="cx">         m_haveInitialEmptyProcess = false;
</span><span class="cx"> 
</span><span class="lines">@@ -976,15 +973,9 @@
</span><span class="cx">     if (visitedURL.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LinkHash linkHash = visitedLinkHash(visitedURL);
-    addVisitedLinkHash(linkHash);
</del><ins>+    m_visitedLinkProvider-&gt;addVisitedLinkHash(visitedLinkHash(visitedURL));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebContext::addVisitedLinkHash(LinkHash linkHash)
-{
-    m_visitedLinkProvider-&gt;addVisitedLink(linkHash);
-}
-
</del><span class="cx"> DownloadProxy* WebContext::createDownloadProxy()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.h        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -198,7 +198,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void addVisitedLink(const String&amp;);
</span><del>-    void addVisitedLinkHash(WebCore::LinkHash);
</del><span class="cx"> 
</span><span class="cx">     // MessageReceiver.
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContextmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.messages.in (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.messages.in        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/UIProcess/WebContext.messages.in        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -22,9 +22,6 @@
</span><span class="cx"> 
</span><span class="cx"> messages -&gt; WebContext LegacyReceiver {
</span><span class="cx"> 
</span><del>-    # Visited link provider messages.
-    AddVisitedLinkHash(uint64_t linkHash)
-
</del><span class="cx">     DidGetStatistics(WebKit::StatisticsData statisticsData, uint64_t callbackID)
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -219,6 +219,8 @@
</span><span class="cx">                 1A5B1C5418987EDF004FCF9B /* WebDocumentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5B1C5218987EDF004FCF9B /* WebDocumentLoader.cpp */; };
</span><span class="cx">                 1A5B1C5518987EDF004FCF9B /* WebDocumentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5B1C5318987EDF004FCF9B /* WebDocumentLoader.h */; };
</span><span class="cx">                 1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */; };
</span><ins>+                1A60224C18C16B9F00C3E8C9 /* VisitedLinkProviderMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A60224A18C16B9F00C3E8C9 /* VisitedLinkProviderMessageReceiver.cpp */; };
+                1A60224D18C16B9F00C3E8C9 /* VisitedLinkProviderMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A60224B18C16B9F00C3E8C9 /* VisitedLinkProviderMessages.h */; };
</ins><span class="cx">                 1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */; };
</span><span class="cx">                 1A6420E512DCE2FF00CAAE2C /* ShareableBitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */; };
</span><span class="cx">                 1A64229912DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64229712DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp */; };
</span><span class="lines">@@ -249,6 +251,8 @@
</span><span class="cx">                 1A81B38518BD673A0007FDAC /* _WKVisitedLinkProviderInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A81B38418BD673A0007FDAC /* _WKVisitedLinkProviderInternal.h */; };
</span><span class="cx">                 1A8C728C1738477C000A6554 /* LocalStorageDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C728A1738477C000A6554 /* LocalStorageDatabaseTracker.cpp */; };
</span><span class="cx">                 1A8C728D1738477C000A6554 /* LocalStorageDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C728B1738477C000A6554 /* LocalStorageDatabaseTracker.h */; };
</span><ins>+                1A8E7D3C18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E7D3A18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp */; };
+                1A8E7D3D18C15149005A702A /* VisitedLinkTableControllerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8E7D3B18C15149005A702A /* VisitedLinkTableControllerMessages.h */; };
</ins><span class="cx">                 1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8EF4C91252403700F7067F /* PluginControllerProxy.h */; };
</span><span class="cx">                 1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */; };
</span><span class="cx">                 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */; };
</span><span class="lines">@@ -1947,6 +1951,9 @@
</span><span class="cx">                 1A5B1C5218987EDF004FCF9B /* WebDocumentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDocumentLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A5B1C5318987EDF004FCF9B /* WebDocumentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckerState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1A60224918C16B0800C3E8C9 /* VisitedLinkProvider.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = VisitedLinkProvider.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1A60224A18C16B9F00C3E8C9 /* VisitedLinkProviderMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VisitedLinkProviderMessageReceiver.cpp; path = VisitedLinkProviderMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1A60224B18C16B9F00C3E8C9 /* VisitedLinkProviderMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VisitedLinkProviderMessages.h; path = VisitedLinkProviderMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableBitmap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareableBitmap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A64228A12DD024700CAAE2C /* DrawingArea.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DrawingArea.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1980,6 +1987,9 @@
</span><span class="cx">                 1A81B38418BD673A0007FDAC /* _WKVisitedLinkProviderInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKVisitedLinkProviderInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A8C728A1738477C000A6554 /* LocalStorageDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorageDatabaseTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A8C728B1738477C000A6554 /* LocalStorageDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorageDatabaseTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1A8E7D3818C150BF005A702A /* VisitedLinkTableController.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VisitedLinkTableController.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1A8E7D3A18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkTableControllerMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1A8E7D3B18C15149005A702A /* VisitedLinkTableControllerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkTableControllerMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1A8EF4C91252403700F7067F /* PluginControllerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginControllerProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginControllerProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A8EF9411252AE8400F7067F /* PluginControllerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginControllerProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5172,6 +5182,9 @@
</span><span class="cx">                                 2684054518B85E7E0022C38B /* ViewUpdateDispatcher.cpp */,
</span><span class="cx">                                 2684054618B85E7E0022C38B /* ViewUpdateDispatcher.h */,
</span><span class="cx">                                 2684054818B85FF70022C38B /* ViewUpdateDispatcher.messages.in */,
</span><ins>+                                1AF4CEED18BC481800BC2D34 /* VisitedLinkTableController.cpp */,
+                                1AF4CEEE18BC481800BC2D34 /* VisitedLinkTableController.h */,
+                                1A8E7D3818C150BF005A702A /* VisitedLinkTableController.messages.in */,
</ins><span class="cx">                                 BC72B9F811E6476B001EB4EA /* WebBackForwardListProxy.cpp */,
</span><span class="cx">                                 BC72B9F911E6476B001EB4EA /* WebBackForwardListProxy.h */,
</span><span class="cx">                                 51871B59127CB89D00F76232 /* WebContextMenu.cpp */,
</span><span class="lines">@@ -5193,8 +5206,6 @@
</span><span class="cx">                                 29D55DEE161BF8780031A2E3 /* WebPageGroupProxy.messages.in */,
</span><span class="cx">                                 BCA0EF7E12331E78007D3CFB /* WebUndoStep.cpp */,
</span><span class="cx">                                 BCA0EF7D12331E78007D3CFB /* WebUndoStep.h */,
</span><del>-                                1AF4CEED18BC481800BC2D34 /* VisitedLinkTableController.cpp */,
-                                1AF4CEEE18BC481800BC2D34 /* VisitedLinkTableController.h */,
</del><span class="cx">                         );
</span><span class="cx">                         path = WebPage;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -5247,6 +5258,7 @@
</span><span class="cx">                                 1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */,
</span><span class="cx">                                 1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */,
</span><span class="cx">                                 1A0F29E2120B44420053D1B9 /* VisitedLinkProvider.h */,
</span><ins>+                                1A60224918C16B0800C3E8C9 /* VisitedLinkProvider.messages.in */,
</ins><span class="cx">                                 512E3520130B550100ABD19A /* WebApplicationCacheManagerProxy.cpp */,
</span><span class="cx">                                 512E3521130B550100ABD19A /* WebApplicationCacheManagerProxy.h */,
</span><span class="cx">                                 512E35F0130B638C00ABD19A /* WebApplicationCacheManagerProxy.messages.in */,
</span><span class="lines">@@ -6208,10 +6220,10 @@
</span><span class="cx">                                 1A043B5C124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h */,
</span><span class="cx">                                 1A8EFA6E1252B84100F7067F /* PluginProxyMessageReceiver.cpp */,
</span><span class="cx">                                 1A8EFA6F1252B84100F7067F /* PluginProxyMessages.h */,
</span><ins>+                                0FF24A2B1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp */,
+                                0FF24A2C1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h */,
</ins><span class="cx">                                 1AC1338318590C4600F3EC05 /* RemoteObjectRegistryMessageReceiver.cpp */,
</span><span class="cx">                                 1AC1338418590C4600F3EC05 /* RemoteObjectRegistryMessages.h */,
</span><del>-                                0FF24A2B1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp */,
-                                0FF24A2C1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h */,
</del><span class="cx">                                 0F5947A5187B517600437857 /* RemoteScrollingCoordinatorMessageReceiver.cpp */,
</span><span class="cx">                                 0F5947A6187B517600437857 /* RemoteScrollingCoordinatorMessages.h */,
</span><span class="cx">                                 E18E6911169B667B009B6670 /* SecItemShimMessageReceiver.cpp */,
</span><span class="lines">@@ -6224,8 +6236,14 @@
</span><span class="cx">                                 1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */,
</span><span class="cx">                                 2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */,
</span><span class="cx">                                 2D1B5D5C185869C8006C6596 /* ViewGestureControllerMessages.h */,
</span><ins>+                                2D819B9F1862800E001F03D1 /* ViewGestureGeometryCollectorMessageReceiver.cpp */,
+                                2D819BA01862800E001F03D1 /* ViewGestureGeometryCollectorMessages.h */,
</ins><span class="cx">                                 2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */,
</span><span class="cx">                                 2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */,
</span><ins>+                                1A60224A18C16B9F00C3E8C9 /* VisitedLinkProviderMessageReceiver.cpp */,
+                                1A60224B18C16B9F00C3E8C9 /* VisitedLinkProviderMessages.h */,
+                                1A8E7D3A18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp */,
+                                1A8E7D3B18C15149005A702A /* VisitedLinkTableControllerMessages.h */,
</ins><span class="cx">                                 512E3568130B57F000ABD19A /* WebApplicationCacheManagerMessageReceiver.cpp */,
</span><span class="cx">                                 512E3569130B57F000ABD19A /* WebApplicationCacheManagerMessages.h */,
</span><span class="cx">                                 512E35F6130B642E00ABD19A /* WebApplicationCacheManagerProxyMessageReceiver.cpp */,
</span><span class="lines">@@ -6250,12 +6268,12 @@
</span><span class="cx">                                 BC0E606012D6BA910012A72A /* WebGeolocationManagerMessages.h */,
</span><span class="cx">                                 BC0E618012D6CB1D0012A72A /* WebGeolocationManagerProxyMessageReceiver.cpp */,
</span><span class="cx">                                 BC0E618112D6CB1D0012A72A /* WebGeolocationManagerProxyMessages.h */,
</span><del>-                                51C96116183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp */,
-                                51C96117183D294700D2002E /* WebIDBServerConnectionMessages.h */,
</del><span class="cx">                                 51D02F63132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp */,
</span><span class="cx">                                 51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */,
</span><span class="cx">                                 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */,
</span><span class="cx">                                 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */,
</span><ins>+                                51C96116183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp */,
+                                51C96117183D294700D2002E /* WebIDBServerConnectionMessages.h */,
</ins><span class="cx">                                 1C8E2A311277852400BC7BD0 /* WebInspectorMessageReceiver.cpp */,
</span><span class="cx">                                 1C8E2A321277852400BC7BD0 /* WebInspectorMessages.h */,
</span><span class="cx">                                 1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */,
</span><span class="lines">@@ -6616,6 +6634,7 @@
</span><span class="cx">                                 5179556A162876F300FA43B6 /* NetworkProcess.h in Headers */,
</span><span class="cx">                                 517CF0E4163A486C00C2950E /* NetworkProcessConnectionMessages.h in Headers */,
</span><span class="cx">                                 51795571162877D200FA43B6 /* NetworkProcessCreationParameters.h in Headers */,
</span><ins>+                                1A60224D18C16B9F00C3E8C9 /* VisitedLinkProviderMessages.h in Headers */,
</ins><span class="cx">                                 1A9E329F1822FEDD00F5D04C /* WKRemoteObjectCoder.h in Headers */,
</span><span class="cx">                                 1AC1336818565B5700F3EC05 /* UserData.h in Headers */,
</span><span class="cx">                                 5163199516289A6300E22F00 /* NetworkProcessMessages.h in Headers */,
</span><span class="lines">@@ -6731,6 +6750,7 @@
</span><span class="cx">                                 1A9EA31318BBDE00004F7C95 /* WKProcessClass.h in Headers */,
</span><span class="cx">                                 1ACECD2517162DB1001FC9EF /* StorageAreaMap.h in Headers */,
</span><span class="cx">                                 1A334DEE16DE8F88006A8E38 /* StorageAreaMapMessages.h in Headers */,
</span><ins>+                                1A8E7D3D18C15149005A702A /* VisitedLinkTableControllerMessages.h in Headers */,
</ins><span class="cx">                                 1A44B95C16B73F9F00B7BBD8 /* StorageManager.h in Headers */,
</span><span class="cx">                                 1AB474E6184D44B40051B622 /* WKBundlePageFullScreenClient.h in Headers */,
</span><span class="cx">                                 1AB31A9716BC688100F6DBC9 /* StorageManagerMessages.h in Headers */,
</span><span class="lines">@@ -8159,6 +8179,7 @@
</span><span class="cx">                                 1F7506AF1859162800EC0FF7 /* WKWebProcessPlugInNodeHandle.mm in Sources */,
</span><span class="cx">                                 51217460164C20E30037A5C1 /* ShareableResource.cpp in Sources */,
</span><span class="cx">                                 1A24BF3A120896A600FBB059 /* SharedMemoryMac.cpp in Sources */,
</span><ins>+                                1A60224C18C16B9F00C3E8C9 /* VisitedLinkProviderMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */,
</span><span class="cx">                                 C54256B918BEC18C00DE4179 /* WKFormPopover.mm in Sources */,
</span><span class="cx">                                 1A5B1C5418987EDF004FCF9B /* WebDocumentLoader.cpp in Sources */,
</span><span class="lines">@@ -8383,6 +8404,7 @@
</span><span class="cx">                                 33367655130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 33367635130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp in Sources */,
</span><span class="cx">                                 33367657130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp in Sources */,
</span><ins>+                                1A8E7D3C18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 510AFFB916542048001BA05E /* WebResourceLoader.cpp in Sources */,
</span><span class="cx">                                 3F889D14188778C900FEADAF /* WebVideoFullscreenManagerProxy.mm in Sources */,
</span><span class="cx">                                 51F060E11654318500F3281B /* WebResourceLoaderMessageReceiver.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -26,7 +26,10 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;VisitedLinkTableController.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;VisitedLinkProviderMessages.h&quot;
+#include &quot;VisitedLinkTableControllerMessages.h&quot;
</ins><span class="cx"> #include &quot;WebProcess.h&quot;
</span><ins>+#include &lt;WebCore/PageCache.h&gt;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -55,23 +58,57 @@
</span><span class="cx"> VisitedLinkTableController::VisitedLinkTableController(uint64_t identifier)
</span><span class="cx">     : m_identifier(identifier)
</span><span class="cx"> {
</span><ins>+    WebProcess::shared().addMessageReceiver(Messages::VisitedLinkTableController::messageReceiverName(), m_identifier, *this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VisitedLinkTableController::~VisitedLinkTableController()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(visitedLinkTableControllers().contains(m_identifier));
</span><span class="cx"> 
</span><ins>+    WebProcess::shared().removeMessageReceiver(Messages::VisitedLinkTableController::messageReceiverName(), m_identifier);
+
</ins><span class="cx">     visitedLinkTableControllers().remove(m_identifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool VisitedLinkTableController::isLinkVisited(Page&amp;, LinkHash linkHash, const URL&amp;, const AtomicString&amp;)
</span><span class="cx"> {
</span><del>-    return WebProcess::shared().isLinkVisited(linkHash);
</del><ins>+    return m_visitedLinkTable.isLinkVisited(linkHash);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VisitedLinkTableController::addVisitedLink(Page&amp;, LinkHash linkHash)
</span><span class="cx"> {
</span><del>-    WebProcess::shared().addVisitedLink(linkHash);
</del><ins>+    if (m_visitedLinkTable.isLinkVisited(linkHash))
+        return;
+
+    if (!WebProcess::shared().shouldTrackVisitedLinks())
+        return;
+
+    WebProcess::shared().parentProcessConnection()-&gt;send(Messages::VisitedLinkProvider::AddVisitedLinkHash(linkHash), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void VisitedLinkTableController::setVisitedLinkTable(const SharedMemory::Handle&amp; handle)
+{
+    RefPtr&lt;SharedMemory&gt; sharedMemory = SharedMemory::create(handle, SharedMemory::ReadOnly);
+    if (!sharedMemory)
+        return;
+
+    m_visitedLinkTable.setSharedMemory(sharedMemory.release());
+
+    invalidateStylesForAllLinks();
+    pageCache()-&gt;markPagesForVistedLinkStyleRecalc();
+}
+
+void VisitedLinkTableController::visitedLinkStateChanged(const Vector&lt;WebCore::LinkHash&gt;&amp; linkHashes)
+{
+    for (auto linkHash : linkHashes)
+        invalidateStylesForLink(linkHash);
+    pageCache()-&gt;markPagesForVistedLinkStyleRecalc();
+}
+
+void VisitedLinkTableController::allVisitedLinkStateChanged()
+{
+    invalidateStylesForAllLinks();
+    pageCache()-&gt;markPagesForVistedLinkStyleRecalc();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.h (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.h        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.h        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -26,11 +26,14 @@
</span><span class="cx"> #ifndef VisitedLinkTableController_h
</span><span class="cx"> #define VisitedLinkTableController_h
</span><span class="cx"> 
</span><ins>+#include &quot;MessageReceiver.h&quot;
+#include &quot;SharedMemory.h&quot;
+#include &quot;VisitedLinkTable.h&quot;
</ins><span class="cx"> #include &lt;WebCore/VisitedLinkStore.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class VisitedLinkTableController final : public WebCore::VisitedLinkStore {
</del><ins>+class VisitedLinkTableController final : public WebCore::VisitedLinkStore , private IPC::MessageReceiver {
</ins><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;VisitedLinkTableController&gt; getOrCreate(uint64_t identifier);
</span><span class="cx">     virtual ~VisitedLinkTableController();
</span><span class="lines">@@ -38,12 +41,21 @@
</span><span class="cx"> private:
</span><span class="cx">     explicit VisitedLinkTableController(uint64_t identifier);
</span><span class="cx"> 
</span><ins>+    // WebCore::VisitedLinkStore.
</ins><span class="cx">     virtual bool isLinkVisited(WebCore::Page&amp;, WebCore::LinkHash, const WebCore::URL&amp; baseURL, const AtomicString&amp; attributeURL) override;
</span><span class="cx">     virtual void addVisitedLink(WebCore::Page&amp;, WebCore::LinkHash) override;
</span><span class="cx"> 
</span><ins>+    // IPC::MessageReceiver.
+    virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&amp;) override;
+
+    void setVisitedLinkTable(const SharedMemory::Handle&amp;);
+    void visitedLinkStateChanged(const Vector&lt;WebCore::LinkHash&gt;&amp;);
+    void allVisitedLinkStateChanged();
+
</ins><span class="cx">     uint64_t m_identifier;
</span><ins>+    VisitedLinkTable m_visitedLinkTable;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-} // namepsace WebKit
</del><ins>+} // namespace WebKit
</ins><span class="cx"> 
</span><span class="cx"> #endif // VisitedLinkTableController_h
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllermessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.messages.in (0 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.messages.in        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+# Copyright (C) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+messages -&gt; VisitedLinkTableController {
+    SetVisitedLinkTable(WebKit::SharedMemory::Handle handle)
+    VisitedLinkStateChanged(Vector&lt;WebCore::LinkHash&gt; linkHashes)
+    AllVisitedLinkStateChanged()
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -500,50 +500,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void WebProcess::setVisitedLinkTable(const SharedMemory::Handle&amp; handle)
-{
-    RefPtr&lt;SharedMemory&gt; sharedMemory = SharedMemory::create(handle, SharedMemory::ReadOnly);
-    if (!sharedMemory)
-        return;
-
-    m_visitedLinkTable.setSharedMemory(sharedMemory.release());
-}
-
-void WebProcess::visitedLinkStateChanged(const Vector&lt;WebCore::LinkHash&gt;&amp; linkHashes)
-{
-    // FIXME: We may want to track visited links per WebPageGroup rather than per WebContext.
-    for (const auto&amp; webPage : m_pageMap.values()) {
-        if (Page* page = webPage-&gt;corePage()) {
-            for (auto&amp; linkHash : linkHashes)
-                page-&gt;invalidateStylesForLink(linkHash);
-        }
-    }
-
-    pageCache()-&gt;markPagesForVistedLinkStyleRecalc();
-}
-
-void WebProcess::allVisitedLinkStateChanged()
-{
-    for (const auto&amp; webPage : m_pageMap.values()) {
-        if (Page* page = webPage-&gt;corePage())
-            page-&gt;invalidateStylesForAllLinks();
-    }
-
-    pageCache()-&gt;markPagesForVistedLinkStyleRecalc();
-}
-
-bool WebProcess::isLinkVisited(LinkHash linkHash) const
-{
-    return m_visitedLinkTable.isLinkVisited(linkHash);
-}
-
-void WebProcess::addVisitedLink(WebCore::LinkHash linkHash)
-{
-    if (isLinkVisited(linkHash) || !m_shouldTrackVisitedLinks)
-        return;
-    parentProcessConnection()-&gt;send(Messages::WebContext::AddVisitedLinkHash(linkHash), 0);
-}
-
</del><span class="cx"> void WebProcess::setCacheModel(uint32_t cm)
</span><span class="cx"> {
</span><span class="cx">     CacheModel cacheModel = static_cast&lt;CacheModel&gt;(cm);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include &quot;TextCheckerState.h&quot;
</span><span class="cx"> #include &quot;ViewUpdateDispatcher.h&quot;
</span><span class="cx"> #include &quot;VisitedLinkTable.h&quot;
</span><del>-#include &lt;WebCore/LinkHash.h&gt;
</del><span class="cx"> #include &lt;WebCore/SessionID.h&gt;
</span><span class="cx"> #include &lt;WebCore/Timer.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -115,10 +114,9 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; }
</span><span class="cx"> #endif
</span><del>-    
</del><ins>+
+    bool shouldTrackVisitedLinks() const { return m_shouldTrackVisitedLinks; }
</ins><span class="cx">     void setShouldTrackVisitedLinks(bool);
</span><del>-    void addVisitedLink(WebCore::LinkHash);
-    bool isLinkVisited(WebCore::LinkHash) const;
</del><span class="cx"> 
</span><span class="cx">     bool shouldPlugInAutoStartFromOrigin(const WebPage*, const String&amp; pageOrigin, const String&amp; pluginOrigin, const String&amp; mimeType);
</span><span class="cx">     void plugInDidStartFromOrigin(const String&amp; pageOrigin, const String&amp; pluginOrigin, const String&amp; mimeType);
</span><span class="lines">@@ -214,10 +212,6 @@
</span><span class="cx">     void userPreferredLanguagesChanged(const Vector&lt;String&gt;&amp;) const;
</span><span class="cx">     void fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled);
</span><span class="cx"> 
</span><del>-    void setVisitedLinkTable(const SharedMemory::Handle&amp;);
-    void visitedLinkStateChanged(const Vector&lt;WebCore::LinkHash&gt;&amp; linkHashes);
-    void allVisitedLinkStateChanged();
-
</del><span class="cx">     bool isPlugInAutoStartOriginHash(unsigned plugInOriginHash);
</span><span class="cx">     void didAddPlugInAutoStartOriginHash(unsigned plugInOriginHash, double expirationTime);
</span><span class="cx">     void resetPlugInAutoStartOriginHashes(const HashMap&lt;unsigned, double&gt;&amp; hashes);
</span><span class="lines">@@ -287,8 +281,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_inDidClose;
</span><span class="cx"> 
</span><del>-    // FIXME: The visited link table should not be per process.
-    VisitedLinkTable m_visitedLinkTable;
</del><ins>+    // FIXME: Whether visited links should be tracked or not should be handled in the UI process.
</ins><span class="cx">     bool m_shouldTrackVisitedLinks;
</span><span class="cx"> 
</span><span class="cx">     HashMap&lt;unsigned, double&gt; m_plugInAutoStartOriginHashes;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (165618 => 165619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2014-03-14 15:31:45 UTC (rev 165618)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2014-03-14 15:41:11 UTC (rev 165619)
</span><span class="lines">@@ -27,11 +27,6 @@
</span><span class="cx">     # Create a new page.
</span><span class="cx">     CreateWebPage(uint64_t newPageID, WebKit::WebPageCreationParameters pageCreationParameters)
</span><span class="cx"> 
</span><del>-    # Visited link tracking.
-    SetVisitedLinkTable(WebKit::SharedMemory::Handle handle)
-    VisitedLinkStateChanged(Vector&lt;WebCore::LinkHash&gt; linkHashes)
-    AllVisitedLinkStateChanged()
-
</del><span class="cx">     # Global preferences.
</span><span class="cx">     SetShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
</span><span class="cx">     SetCacheModel(uint32_t cacheModel)
</span></span></pre>
</div>
</div>

</body>
</html>