<!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>[168118] 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/168118">168118</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-05-01 13:39:55 -0700 (Thu, 01 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>WKWebView doesn't track visited links (for visited link coloring)
https://bugs.webkit.org/show_bug.cgi?id=132438
<rdar://problem/16704519>
Reviewed by Dan Bernstein.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIHistoryClient.h:
(API::HistoryClient::addsVisitedLinks):
(API::HistoryClient::shouldTrackVisitedLinks): Deleted.
* UIProcess/API/C/WKContext.cpp:
(WKContextSetHistoryClient):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _addsVisitedLinks]):
(-[WKWebView _setAddsVisitedLinks:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:context:configuration:webView:]):
* UIProcess/Cocoa/HistoryClient.h:
* UIProcess/Cocoa/HistoryClient.mm:
(WebKit::HistoryClient::shouldTrackVisitedLinks): Deleted.
* UIProcess/VisitedLinkProvider.cpp:
(WebKit::VisitedLinkProvider::addVisitedLinkHashFromPage):
* UIProcess/VisitedLinkProvider.h:
* UIProcess/VisitedLinkProvider.messages.in:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::setHistoryClient):
(WebKit::WebContext::createNewWebProcess):
* UIProcess/WebContext.h:
(WebKit::WebContext::processes):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::addsVisitedLinks):
(WebKit::WebPageProxy::setAddsVisitedLinks):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::addVisitedLink):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParameterscpp">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParametersh">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIHistoryClienth">trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKContextcpp">trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaHistoryClienth">trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaHistoryClientmm">trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.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="#trunkSourceWebKit2UIProcessVisitedLinkProvidermessagesin">trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in</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="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp</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>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2014-05-01 Anders Carlsson <andersca@apple.com>
+
+ WKWebView doesn't track visited links (for visited link coloring)
+ https://bugs.webkit.org/show_bug.cgi?id=132438
+ <rdar://problem/16704519>
+
+ Reviewed by Dan Bernstein.
+
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
+ (WebKit::WebProcessCreationParameters::encode):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h:
+ * UIProcess/API/APIHistoryClient.h:
+ (API::HistoryClient::addsVisitedLinks):
+ (API::HistoryClient::shouldTrackVisitedLinks): Deleted.
+ * UIProcess/API/C/WKContext.cpp:
+ (WKContextSetHistoryClient):
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _addsVisitedLinks]):
+ (-[WKWebView _setAddsVisitedLinks:]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView initWithFrame:context:configuration:webView:]):
+ * UIProcess/Cocoa/HistoryClient.h:
+ * UIProcess/Cocoa/HistoryClient.mm:
+ (WebKit::HistoryClient::shouldTrackVisitedLinks): Deleted.
+ * UIProcess/VisitedLinkProvider.cpp:
+ (WebKit::VisitedLinkProvider::addVisitedLinkHashFromPage):
+ * UIProcess/VisitedLinkProvider.h:
+ * UIProcess/VisitedLinkProvider.messages.in:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::setHistoryClient):
+ (WebKit::WebContext::createNewWebProcess):
+ * UIProcess/WebContext.h:
+ (WebKit::WebContext::processes):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy):
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::addsVisitedLinks):
+ (WebKit::WebPageProxy::setAddsVisitedLinks):
+ * WebProcess/WebPage/VisitedLinkTableController.cpp:
+ (WebKit::VisitedLinkTableController::addVisitedLink):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::initializeWebProcess):
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in:
+
</ins><span class="cx"> 2014-05-01 Benjamin Poulain <bpoulain@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS][WK2] The highlight view needs to be in WKWebView coordinates
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -32,8 +32,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> WebProcessCreationParameters::WebProcessCreationParameters()
</span><del>- : shouldTrackVisitedLinks(false)
- , shouldAlwaysUseComplexTextCodePath(false)
</del><ins>+ : shouldAlwaysUseComplexTextCodePath(false)
</ins><span class="cx"> , shouldUseFontSmoothing(true)
</span><span class="cx"> , defaultRequestTimeoutInterval(INT_MAX)
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -93,7 +92,6 @@
</span><span class="cx"> encoder << ignoreTLSErrors;
</span><span class="cx"> #endif
</span><span class="cx"> encoder.encodeEnum(cacheModel);
</span><del>- encoder << shouldTrackVisitedLinks;
</del><span class="cx"> encoder << shouldAlwaysUseComplexTextCodePath;
</span><span class="cx"> encoder << shouldUseFontSmoothing;
</span><span class="cx"> encoder << iconDatabaseEnabled;
</span><span class="lines">@@ -206,8 +204,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> if (!decoder.decodeEnum(parameters.cacheModel))
</span><span class="cx"> return false;
</span><del>- if (!decoder.decode(parameters.shouldTrackVisitedLinks))
- return false;
</del><span class="cx"> if (!decoder.decode(parameters.shouldAlwaysUseComplexTextCodePath))
</span><span class="cx"> return false;
</span><span class="cx"> if (!decoder.decode(parameters.shouldUseFontSmoothing))
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -100,7 +100,6 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> CacheModel cacheModel;
</span><del>- bool shouldTrackVisitedLinks;
</del><span class="cx">
</span><span class="cx"> bool shouldAlwaysUseComplexTextCodePath;
</span><span class="cx"> bool shouldUseFontSmoothing;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIHistoryClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -46,7 +46,10 @@
</span><span class="cx"> virtual void didPerformServerRedirect(WebKit::WebContext*, WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*) { }
</span><span class="cx"> virtual void didUpdateHistoryTitle(WebKit::WebContext*, WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*) { }
</span><span class="cx"> virtual void populateVisitedLinks(WebKit::WebContext*) { }
</span><del>- virtual bool shouldTrackVisitedLinks() const { return false; }
</del><ins>+
+ // FIXME: This is only used by the legacy SPI. We should add an API::Context object that
+ // can hold these things so we won't have to get it through API::HistoryClient.
+ virtual bool addsVisitedLinks() const { return false; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -146,13 +146,21 @@
</span><span class="cx"> m_client.populateVisitedLinks(toAPI(context), m_client.base.clientInfo);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual bool shouldTrackVisitedLinks() const
</del><ins>+ virtual bool addsVisitedLinks() const override
</ins><span class="cx"> {
</span><span class="cx"> return m_client.populateVisitedLinks;
</span><span class="cx"> }
</span><span class="cx"> };
</span><del>-
- toImpl(contextRef)->setHistoryClient(std::make_unique<HistoryClient>(wkClient));
</del><ins>+
+ WebKit::WebContext& context = *toImpl(contextRef);
+ context.setHistoryClient(std::make_unique<HistoryClient>(wkClient));
+
+ bool addsVisitedLinks = context.historyClient().addsVisitedLinks();
+
+ for (auto& process : context.processes()) {
+ for (auto& page : process->pages())
+ page->setAddsVisitedLinks(addsVisitedLinks);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKContextSetDownloadClient(WKContextRef contextRef, const WKContextDownloadClientBase* wkClient)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -93,7 +93,6 @@
</span><span class="cx"> _WKRenderingProgressEvents _observedRenderingProgressEvents;
</span><span class="cx">
</span><span class="cx"> WebKit::WeakObjCPtr<id <_WKFormDelegate>> _formDelegate;
</span><del>-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> RetainPtr<WKScrollView> _scrollView;
</span><span class="cx"> RetainPtr<WKContentView> _contentView;
</span><span class="lines">@@ -1006,6 +1005,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (BOOL)_addsVisitedLinks
+{
+ return _page->addsVisitedLinks();
+}
+
+- (void)_setAddsVisitedLinks:(BOOL)addsVisitedLinks
+{
+ _page->setAddsVisitedLinks(addsVisitedLinks);
+}
+
</ins><span class="cx"> static inline WebCore::LayoutMilestones layoutMilestones(_WKRenderingProgressEvents events)
</span><span class="cx"> {
</span><span class="cx"> WebCore::LayoutMilestones milestones = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -90,6 +90,8 @@
</span><span class="cx">
</span><span class="cx"> @property (nonatomic, setter=_setAllowsRemoteInspection:) BOOL _allowsRemoteInspection;
</span><span class="cx">
</span><ins>+@property (nonatomic, setter=_setAddsVisitedLinks:) BOOL _addsVisitedLinks;
+
</ins><span class="cx"> - (void)_close;
</span><span class="cx">
</span><span class="cx"> #if TARGET_OS_IPHONE
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import <AppKit/NSAttributedString.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#import "APIHistoryClient.h"
</ins><span class="cx"> #import "AttributedString.h"
</span><span class="cx"> #import "ColorSpaceData.h"
</span><span class="cx"> #import "DataReference.h"
</span><span class="lines">@@ -3407,6 +3408,8 @@
</span><span class="cx"> _data = [[WKViewData alloc] init];
</span><span class="cx"> _data->_pageClient = std::make_unique<PageClientImpl>(self, webView);
</span><span class="cx"> _data->_page = context.createWebPage(*_data->_pageClient, std::move(webPageConfiguration));
</span><ins>+ _data->_page->setAddsVisitedLinks(context.historyClient().addsVisitedLinks());
+
</ins><span class="cx"> _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
</span><span class="cx"> _data->_page->initializeWebPage();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaHistoryClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> virtual void didPerformServerRedirect(WebContext*, WebPageProxy*, const WTF::String& sourceURL, const WTF::String& destinationURL, WebFrameProxy*) override;
</span><span class="cx"> virtual void didUpdateHistoryTitle(WebContext*, WebPageProxy*, const WTF::String& title, const WTF::String& url, WebFrameProxy*) override;
</span><span class="cx"> virtual void populateVisitedLinks(WebContext*) override;
</span><del>- virtual bool shouldTrackVisitedLinks() const override;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaHistoryClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.mm (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.mm        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/HistoryClient.mm        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -86,11 +86,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool HistoryClient::shouldTrackVisitedLinks() const
-{
- return false;
-}
-
</del><span class="cx"> } // namespace webKit
</span><span class="cx">
</span><span class="cx"> #endif // WK_API_ENABLED
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessVisitedLinkProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.cpp (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.cpp        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.cpp        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -97,6 +97,16 @@
</span><span class="cx"> m_pendingVisitedLinksTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void VisitedLinkProvider::addVisitedLinkHashFromPage(uint64_t pageID, LinkHash linkHash)
+{
+ if (WebPageProxy* webPageProxy = WebProcessProxy::webPage(pageID)) {
+ if (!webPageProxy->addsVisitedLinks())
+ return;
+ }
+
+ addVisitedLinkHash(linkHash);
+}
+
</ins><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></pre></div>
<a id="trunkSourceWebKit2UIProcessVisitedLinkProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx"> // IPC::MessageReceiver
</span><span class="cx"> virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
</span><span class="cx">
</span><ins>+ void addVisitedLinkHashFromPage(uint64_t pageID, WebCore::LinkHash);
+
</ins><span class="cx"> void pendingVisitedLinksTimerFired();
</span><span class="cx">
</span><span class="cx"> void resizeTable(unsigned newTableSize);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessVisitedLinkProvidermessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/VisitedLinkProvider.messages.in        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -21,5 +21,5 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">
</span><span class="cx"> messages -> VisitedLinkProvider {
</span><del>- AddVisitedLinkHash(uint64_t linkHash)
</del><ins>+ AddVisitedLinkHashFromPage(uint64_t pageID, uint64_t linkHash)
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -281,8 +281,6 @@
</span><span class="cx"> m_historyClient = std::make_unique<API::HistoryClient>();
</span><span class="cx"> else
</span><span class="cx"> m_historyClient = std::move(historyClient);
</span><del>-
- sendToAllProcesses(Messages::WebProcess::SetShouldTrackVisitedLinks(m_historyClient->shouldTrackVisitedLinks()));
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebContext::setDownloadClient(std::unique_ptr<API::DownloadClient> downloadClient)
</span><span class="lines">@@ -578,7 +576,6 @@
</span><span class="cx">
</span><span class="cx"> parameters.shouldUseTestingNetworkSession = m_shouldUseTestingNetworkSession;
</span><span class="cx">
</span><del>- parameters.shouldTrackVisitedLinks = m_historyClient->shouldTrackVisitedLinks();
</del><span class="cx"> parameters.cacheModel = m_cacheModel;
</span><span class="cx"> parameters.languages = userPreferredLanguages();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -139,6 +139,8 @@
</span><span class="cx"> void setMaximumNumberOfProcesses(unsigned); // Can only be called when there are no processes running.
</span><span class="cx"> unsigned maximumNumberOfProcesses() const { return m_webProcessCountLimit; }
</span><span class="cx">
</span><ins>+ const Vector<RefPtr<WebProcessProxy>>& processes() const { return m_processes; }
+
</ins><span class="cx"> // WebProcess or NetworkProcess as approporiate for current process model. The connection must be non-null.
</span><span class="cx"> IPC::Connection* networkingProcessConnection();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -313,6 +313,7 @@
</span><span class="cx"> , m_pageID(pageID)
</span><span class="cx"> , m_session(*configuration.session)
</span><span class="cx"> , m_isPageSuspended(false)
</span><ins>+ , m_addsVisitedLinks(true)
</ins><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx"> , m_allowsRemoteInspection(true)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -459,6 +459,9 @@
</span><span class="cx">
</span><span class="cx"> WebBackForwardList& backForwardList() { return m_backForwardList.get(); }
</span><span class="cx">
</span><ins>+ bool addsVisitedLinks() const { return m_addsVisitedLinks; }
+ void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
+
</ins><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx"> WebInspectorProxy* inspector();
</span><span class="cx"> #endif
</span><span class="lines">@@ -1597,6 +1600,7 @@
</span><span class="cx"> Ref<API::Session> m_session;
</span><span class="cx">
</span><span class="cx"> bool m_isPageSuspended;
</span><ins>+ bool m_addsVisitedLinks;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx"> bool m_allowsRemoteInspection;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "VisitedLinkProviderMessages.h"
</span><span class="cx"> #include "VisitedLinkTableControllerMessages.h"
</span><ins>+#include "WebPage.h"
</ins><span class="cx"> #include "WebProcess.h"
</span><span class="cx"> #include <WebCore/PageCache.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="lines">@@ -75,7 +76,7 @@
</span><span class="cx"> return m_visitedLinkTable.isLinkVisited(linkHash);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void VisitedLinkTableController::addVisitedLink(Page&, LinkHash linkHash)
</del><ins>+void VisitedLinkTableController::addVisitedLink(Page& page, LinkHash linkHash)
</ins><span class="cx"> {
</span><span class="cx"> if (m_visitedLinkTable.isLinkVisited(linkHash))
</span><span class="cx"> return;
</span><span class="lines">@@ -83,7 +84,11 @@
</span><span class="cx"> if (!WebProcess::shared().shouldTrackVisitedLinks())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- WebProcess::shared().parentProcessConnection()->send(Messages::VisitedLinkProvider::AddVisitedLinkHash(linkHash), m_identifier);
</del><ins>+ WebPage* webPage = WebPage::fromCorePage(&page);
+ if (!webPage)
+ return;
+
+ WebProcess::shared().parentProcessConnection()->send(Messages::VisitedLinkProvider::AddVisitedLinkHashFromPage(webPage->pageID(), linkHash), m_identifier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void VisitedLinkTableController::setVisitedLinkTable(const SharedMemory::Handle& handle)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -296,7 +296,6 @@
</span><span class="cx"> if (!parameters.applicationCacheDirectory.isEmpty())
</span><span class="cx"> cacheStorage().setCacheDirectory(parameters.applicationCacheDirectory);
</span><span class="cx">
</span><del>- setShouldTrackVisitedLinks(parameters.shouldTrackVisitedLinks);
</del><span class="cx"> setCacheModel(static_cast<uint32_t>(parameters.cacheModel));
</span><span class="cx">
</span><span class="cx"> if (!parameters.languages.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -115,6 +115,8 @@
</span><span class="cx"> mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ // FIXME: This is only used by the injected bundle for layout tests.
+ // WebKitTestRunner should just post a message to change whether visited links should be added.
</ins><span class="cx"> bool shouldTrackVisitedLinks() const { return m_shouldTrackVisitedLinks; }
</span><span class="cx"> void setShouldTrackVisitedLinks(bool);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (168117 => 168118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2014-05-01 20:32:57 UTC (rev 168117)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2014-05-01 20:39:55 UTC (rev 168118)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> CreateWebPage(uint64_t newPageID, WebKit::WebPageCreationParameters pageCreationParameters)
</span><span class="cx">
</span><span class="cx"> # Global preferences.
</span><del>- SetShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
</del><span class="cx"> SetCacheModel(uint32_t cacheModel)
</span><span class="cx"> RegisterURLSchemeAsEmptyDocument(String scheme)
</span><span class="cx"> RegisterURLSchemeAsSecure(String scheme)
</span></span></pre>
</div>
</div>
</body>
</html>