<!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>[179786] 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/179786">179786</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-02-07 15:46:18 -0800 (Sat, 07 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add API::HistoryClient and split some things out of API::NavigationClient
https://bugs.webkit.org/show_bug.cgi?id=141264
Reviewed by Darin Adler.
* UIProcess/API/APIHistoryClient.h: Added.
(API::HistoryClient::~HistoryClient):
(API::HistoryClient::didNavigateWithNavigationData):
(API::HistoryClient::didPerformClientRedirect):
(API::HistoryClient::didPerformServerRedirect):
(API::HistoryClient::didUpdateHistoryTitle):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didNavigateWithNavigationData): Deleted.
(API::NavigationClient::didPerformClientRedirect): Deleted.
(API::NavigationClient::didPerformServerRedirect): Deleted.
(API::NavigationClient::didUpdateHistoryTitle): Deleted.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::createHistoryClient):
(WebKit::NavigationState::HistoryClient::HistoryClient):
(WebKit::NavigationState::HistoryClient::~HistoryClient):
(WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
(WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
(WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
(WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
(WebKit::NavigationState::NavigationClient::didNavigateWithNavigationData): Deleted.
(WebKit::NavigationState::NavigationClient::didPerformClientRedirect): Deleted.
(WebKit::NavigationState::NavigationClient::didPerformServerRedirect): Deleted.
(WebKit::NavigationState::NavigationClient::didUpdateHistoryTitle): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setHistoryClient):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
* UIProcess/WebPageProxy.h:
Add a API::HistoryClient and move the few things that belong on it out of API::NavigationClient.
Adjust accordingly in WebPageProxy and NavigationState.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView setNavigationDelegate:]):
(-[WKWebView setUIDelegate:]):
(-[WKWebView _setHistoryDelegate:]):
Lazily push the NavigationState/UIDelegate clients down to WebPageProxy upon
installation of a delegate, so that alternative (C SPI) delegate setters can
be separately created.
* WebKit2.xcodeproj/project.pbxproj:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPINavigationClienth">trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStateh">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStatemm">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm</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="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIHistoryClienth">trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2015-02-07 Tim Horton <timothy_horton@apple.com>
+
+ Add API::HistoryClient and split some things out of API::NavigationClient
+ https://bugs.webkit.org/show_bug.cgi?id=141264
+
+ Reviewed by Darin Adler.
+
+ * UIProcess/API/APIHistoryClient.h: Added.
+ (API::HistoryClient::~HistoryClient):
+ (API::HistoryClient::didNavigateWithNavigationData):
+ (API::HistoryClient::didPerformClientRedirect):
+ (API::HistoryClient::didPerformServerRedirect):
+ (API::HistoryClient::didUpdateHistoryTitle):
+ * UIProcess/API/APINavigationClient.h:
+ (API::NavigationClient::didNavigateWithNavigationData): Deleted.
+ (API::NavigationClient::didPerformClientRedirect): Deleted.
+ (API::NavigationClient::didPerformServerRedirect): Deleted.
+ (API::NavigationClient::didUpdateHistoryTitle): Deleted.
+ * UIProcess/Cocoa/NavigationState.h:
+ * UIProcess/Cocoa/NavigationState.mm:
+ (WebKit::NavigationState::createHistoryClient):
+ (WebKit::NavigationState::HistoryClient::HistoryClient):
+ (WebKit::NavigationState::HistoryClient::~HistoryClient):
+ (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
+ (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
+ (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
+ (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
+ (WebKit::NavigationState::NavigationClient::didNavigateWithNavigationData): Deleted.
+ (WebKit::NavigationState::NavigationClient::didPerformClientRedirect): Deleted.
+ (WebKit::NavigationState::NavigationClient::didPerformServerRedirect): Deleted.
+ (WebKit::NavigationState::NavigationClient::didUpdateHistoryTitle): Deleted.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setHistoryClient):
+ (WebKit::WebPageProxy::didNavigateWithNavigationData):
+ (WebKit::WebPageProxy::didPerformClientRedirect):
+ (WebKit::WebPageProxy::didPerformServerRedirect):
+ (WebKit::WebPageProxy::didUpdateHistoryTitle):
+ * UIProcess/WebPageProxy.h:
+ Add a API::HistoryClient and move the few things that belong on it out of API::NavigationClient.
+ Adjust accordingly in WebPageProxy and NavigationState.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView initWithFrame:configuration:]):
+ (-[WKWebView setNavigationDelegate:]):
+ (-[WKWebView setUIDelegate:]):
+ (-[WKWebView _setHistoryDelegate:]):
+ Lazily push the NavigationState/UIDelegate clients down to WebPageProxy upon
+ installation of a delegate, so that alternative (C SPI) delegate setters can
+ be separately created.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2015-02-07 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> And as a further followup restore the 8bit test too.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIHistoryClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h (0 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIHistoryClient.h        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2014, 2015 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.
+ */
+
+#ifndef APIHistoryClient_h
+#define APIHistoryClient_h
+
+#include <wtf/Forward.h>
+
+namespace WebKit {
+class WebPageProxy;
+struct WebNavigationDataStore;
+}
+
+namespace API {
+
+class HistoryClient {
+public:
+ virtual ~HistoryClient() { }
+
+ virtual void didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore&) { }
+ virtual void didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&) { }
+ virtual void didPerformServerRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&) { }
+ virtual void didUpdateHistoryTitle(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&) { }
+};
+
+} // namespace API
+
+#endif // APIHistoryClient_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPINavigationClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -85,11 +85,6 @@
</span><span class="cx">
</span><span class="cx"> virtual PassRefPtr<Data> webCryptoMasterKey(WebKit::WebPageProxy&) { return nullptr; }
</span><span class="cx">
</span><del>- virtual void didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore&) { }
- virtual void didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&) { }
- virtual void didPerformServerRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&) { }
- virtual void didUpdateHistoryTitle(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&) { }
-
</del><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& fileName, const WTF::String& uti) { }
</span><span class="cx"> virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&) { }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -357,11 +357,7 @@
</span><span class="cx"> _page->setApplicationNameForUserAgent(applicationNameForUserAgent);
</span><span class="cx">
</span><span class="cx"> _navigationState = std::make_unique<WebKit::NavigationState>(self);
</span><del>- _page->setNavigationClient(_navigationState->createNavigationClient());
-
</del><span class="cx"> _uiDelegate = std::make_unique<WebKit::UIDelegate>(self);
</span><del>- _page->setUIClient(_uiDelegate->createUIClient());
-
</del><span class="cx"> _page->setFindClient(std::make_unique<WebKit::FindClient>(self));
</span><span class="cx"> _page->setDiagnosticLoggingClient(std::make_unique<WebKit::DiagnosticLoggingClient>(self));
</span><span class="cx">
</span><span class="lines">@@ -412,6 +408,7 @@
</span><span class="cx">
</span><span class="cx"> - (void)setNavigationDelegate:(id <WKNavigationDelegate>)navigationDelegate
</span><span class="cx"> {
</span><ins>+ _page->setNavigationClient(_navigationState->createNavigationClient());
</ins><span class="cx"> _navigationState->setNavigationDelegate(navigationDelegate);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -422,6 +419,7 @@
</span><span class="cx">
</span><span class="cx"> - (void)setUIDelegate:(id<WKUIDelegate>)UIDelegate
</span><span class="cx"> {
</span><ins>+ _page->setUIClient(_uiDelegate->createUIClient());
</ins><span class="cx"> _uiDelegate->setDelegate(UIDelegate);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1667,6 +1665,7 @@
</span><span class="cx">
</span><span class="cx"> - (void)_setHistoryDelegate:(id <WKHistoryDelegatePrivate>)historyDelegate
</span><span class="cx"> {
</span><ins>+ _page->setHistoryClient(_navigationState->createHistoryClient());
</ins><span class="cx"> _navigationState->setHistoryDelegate(historyDelegate);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">
</span><ins>+#import "APIHistoryClient.h"
</ins><span class="cx"> #import "APINavigationClient.h"
</span><span class="cx"> #import "PageLoadState.h"
</span><span class="cx"> #import "ProcessThrottler.h"
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> static NavigationState& fromWebPage(WebPageProxy&);
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<API::NavigationClient> createNavigationClient();
</span><ins>+ std::unique_ptr<API::HistoryClient> createHistoryClient();
</ins><span class="cx">
</span><span class="cx"> RetainPtr<id <WKNavigationDelegate> > navigationDelegate();
</span><span class="cx"> void setNavigationDelegate(id <WKNavigationDelegate>);
</span><span class="lines">@@ -94,11 +96,6 @@
</span><span class="cx"> virtual void processDidCrash(WebPageProxy&) override;
</span><span class="cx"> virtual PassRefPtr<API::Data> webCryptoMasterKey(WebPageProxy&) override;
</span><span class="cx">
</span><del>- virtual void didNavigateWithNavigationData(WebPageProxy&, const WebNavigationDataStore&) override;
- virtual void didPerformClientRedirect(WebPageProxy&, const WTF::String&, const WTF::String&) override;
- virtual void didPerformServerRedirect(WebPageProxy&, const WTF::String&, const WTF::String&) override;
- virtual void didUpdateHistoryTitle(WebPageProxy&, const WTF::String&, const WTF::String&) override;
-
</del><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& fileName, const WTF::String& uti) override;
</span><span class="cx"> virtual void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&) override;
</span><span class="lines">@@ -109,6 +106,20 @@
</span><span class="cx">
</span><span class="cx"> NavigationState& m_navigationState;
</span><span class="cx"> };
</span><ins>+
+ class HistoryClient final : public API::HistoryClient {
+ public:
+ explicit HistoryClient(NavigationState&);
+ ~HistoryClient();
+
+ private:
+ virtual void didNavigateWithNavigationData(WebPageProxy&, const WebNavigationDataStore&) override;
+ virtual void didPerformClientRedirect(WebPageProxy&, const WTF::String&, const WTF::String&) override;
+ virtual void didPerformServerRedirect(WebPageProxy&, const WTF::String&, const WTF::String&) override;
+ virtual void didUpdateHistoryTitle(WebPageProxy&, const WTF::String&, const WTF::String&) override;
+
+ NavigationState& m_navigationState;
+ };
</ins><span class="cx">
</span><span class="cx"> // PageLoadState::Observer
</span><span class="cx"> virtual void willChangeIsLoading() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -108,6 +108,11 @@
</span><span class="cx"> {
</span><span class="cx"> return std::make_unique<NavigationClient>(*this);
</span><span class="cx"> }
</span><ins>+
+std::unique_ptr<API::HistoryClient> NavigationState::createHistoryClient()
+{
+ return std::make_unique<HistoryClient>(*this);
+}
</ins><span class="cx">
</span><span class="cx"> RetainPtr<id <WKNavigationDelegate> > NavigationState::navigationDelegate()
</span><span class="cx"> {
</span><span class="lines">@@ -634,9 +639,18 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // HistoryDelegatePrivate support
</span><ins>+
+NavigationState::HistoryClient::HistoryClient(NavigationState& navigationState)
+ : m_navigationState(navigationState)
+{
+}
</ins><span class="cx">
</span><del>-void NavigationState::NavigationClient::didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore& navigationDataStore)
</del><ins>+NavigationState::HistoryClient::~HistoryClient()
</ins><span class="cx"> {
</span><ins>+}
+
+void NavigationState::HistoryClient::didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore& navigationDataStore)
+{
</ins><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidNavigateWithNavigationData)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -647,7 +661,7 @@
</span><span class="cx"> [historyDelegate _webView:m_navigationState.m_webView didNavigateWithNavigationData:wrapper(*API::NavigationData::create(navigationDataStore))];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::NavigationClient::didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL)
</del><ins>+void NavigationState::HistoryClient::didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidPerformClientRedirectFromURLToURL)
</span><span class="cx"> return;
</span><span class="lines">@@ -659,7 +673,7 @@
</span><span class="cx"> [historyDelegate _webView:m_navigationState.m_webView didPerformClientRedirectFromURL:[NSURL _web_URLWithWTFString:sourceURL] toURL:[NSURL _web_URLWithWTFString:destinationURL]];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::NavigationClient::didPerformServerRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL)
</del><ins>+void NavigationState::HistoryClient::didPerformServerRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidPerformServerRedirectFromURLToURL)
</span><span class="cx"> return;
</span><span class="lines">@@ -671,7 +685,7 @@
</span><span class="cx"> [historyDelegate _webView:m_navigationState.m_webView didPerformServerRedirectFromURL:[NSURL _web_URLWithWTFString:sourceURL] toURL:[NSURL _web_URLWithWTFString:destinationURL]];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::NavigationClient::didUpdateHistoryTitle(WebKit::WebPageProxy&, const WTF::String& title, const WTF::String& url)
</del><ins>+void NavigationState::HistoryClient::didUpdateHistoryTitle(WebKit::WebPageProxy&, const WTF::String& title, const WTF::String& url)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidUpdateHistoryTitleForURL)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "APIFormClient.h"
</span><span class="cx"> #include "APIFrameInfo.h"
</span><span class="cx"> #include "APIGeometry.h"
</span><ins>+#include "APIHistoryClient.h"
</ins><span class="cx"> #include "APILegacyContextHistoryClient.h"
</span><span class="cx"> #include "APILoaderClient.h"
</span><span class="cx"> #include "APINavigation.h"
</span><span class="lines">@@ -508,6 +509,11 @@
</span><span class="cx">
</span><span class="cx"> preferencesDidChange();
</span><span class="cx"> }
</span><ins>+
+void WebPageProxy::setHistoryClient(std::unique_ptr<API::HistoryClient> historyClient)
+{
+ m_historyClient = WTF::move(historyClient);
+}
</ins><span class="cx">
</span><span class="cx"> void WebPageProxy::setNavigationClient(std::unique_ptr<API::NavigationClient> navigationClient)
</span><span class="cx"> {
</span><span class="lines">@@ -3155,9 +3161,9 @@
</span><span class="cx"> MESSAGE_CHECK(frame);
</span><span class="cx"> MESSAGE_CHECK(frame->page() == this);
</span><span class="cx">
</span><del>- if (m_navigationClient) {
</del><ins>+ if (m_historyClient) {
</ins><span class="cx"> if (frame->isMainFrame())
</span><del>- m_navigationClient->didNavigateWithNavigationData(*this, store);
</del><ins>+ m_historyClient->didNavigateWithNavigationData(*this, store);
</ins><span class="cx"> } else
</span><span class="cx"> m_loaderClient->didNavigateWithNavigationData(*this, store, *frame);
</span><span class="cx"> process().processPool().historyClient().didNavigateWithNavigationData(process().processPool(), *this, store, *frame);
</span><span class="lines">@@ -3175,9 +3181,9 @@
</span><span class="cx"> MESSAGE_CHECK_URL(sourceURLString);
</span><span class="cx"> MESSAGE_CHECK_URL(destinationURLString);
</span><span class="cx">
</span><del>- if (m_navigationClient) {
</del><ins>+ if (m_historyClient) {
</ins><span class="cx"> if (frame->isMainFrame())
</span><del>- m_navigationClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString);
</del><ins>+ m_historyClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString);
</ins><span class="cx"> } else
</span><span class="cx"> m_loaderClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString, *frame);
</span><span class="cx"> process().processPool().historyClient().didPerformClientRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
</span><span class="lines">@@ -3195,9 +3201,9 @@
</span><span class="cx"> MESSAGE_CHECK_URL(sourceURLString);
</span><span class="cx"> MESSAGE_CHECK_URL(destinationURLString);
</span><span class="cx">
</span><del>- if (m_navigationClient) {
</del><ins>+ if (m_historyClient) {
</ins><span class="cx"> if (frame->isMainFrame())
</span><del>- m_navigationClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString);
</del><ins>+ m_historyClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString);
</ins><span class="cx"> } else
</span><span class="cx"> m_loaderClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString, *frame);
</span><span class="cx"> process().processPool().historyClient().didPerformServerRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
</span><span class="lines">@@ -3211,9 +3217,9 @@
</span><span class="cx">
</span><span class="cx"> MESSAGE_CHECK_URL(url);
</span><span class="cx">
</span><del>- if (m_navigationClient) {
</del><ins>+ if (m_historyClient) {
</ins><span class="cx"> if (frame->isMainFrame())
</span><del>- m_navigationClient->didUpdateHistoryTitle(*this, title, url);
</del><ins>+ m_historyClient->didUpdateHistoryTitle(*this, title, url);
</ins><span class="cx"> } else
</span><span class="cx"> m_loaderClient->didUpdateHistoryTitle(*this, title, url, *frame);
</span><span class="cx"> process().processPool().historyClient().didUpdateHistoryTitle(process().processPool(), *this, title, url, *frame);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -115,6 +115,7 @@
</span><span class="cx"> class ContextMenuClient;
</span><span class="cx"> class FindClient;
</span><span class="cx"> class FormClient;
</span><ins>+class HistoryClient;
</ins><span class="cx"> class LoaderClient;
</span><span class="cx"> class Navigation;
</span><span class="cx"> class NavigationClient;
</span><span class="lines">@@ -316,6 +317,7 @@
</span><span class="cx"> void initializeFindMatchesClient(const WKPageFindMatchesClientBase*);
</span><span class="cx"> void setFormClient(std::unique_ptr<API::FormClient>);
</span><span class="cx"> void setNavigationClient(std::unique_ptr<API::NavigationClient>);
</span><ins>+ void setHistoryClient(std::unique_ptr<API::HistoryClient>);
</ins><span class="cx"> void setLoaderClient(std::unique_ptr<API::LoaderClient>);
</span><span class="cx"> void setPolicyClient(std::unique_ptr<API::PolicyClient>);
</span><span class="cx">
</span><span class="lines">@@ -1374,6 +1376,7 @@
</span><span class="cx"> std::unique_ptr<API::LoaderClient> m_loaderClient;
</span><span class="cx"> std::unique_ptr<API::PolicyClient> m_policyClient;
</span><span class="cx"> std::unique_ptr<API::NavigationClient> m_navigationClient;
</span><ins>+ std::unique_ptr<API::HistoryClient> m_historyClient;
</ins><span class="cx"> std::unique_ptr<API::FormClient> m_formClient;
</span><span class="cx"> std::unique_ptr<API::UIClient> m_uiClient;
</span><span class="cx"> #if PLATFORM(EFL)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (179785 => 179786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-02-07 23:17:26 UTC (rev 179785)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-02-07 23:46:18 UTC (rev 179786)
</span><span class="lines">@@ -649,6 +649,7 @@
</span><span class="cx">                 2DA944BD188511E700ED86DB /* NetworkProcessIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944BC188511E700ED86DB /* NetworkProcessIOS.mm */; };
</span><span class="cx">                 2DABA7721A817B1700EF0F1A /* WKPageRenderingProgressEventsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DABA7711A817B1700EF0F1A /* WKPageRenderingProgressEventsInternal.h */; };
</span><span class="cx">                 2DABA7741A817EE600EF0F1A /* WKPluginLoadPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DABA7731A817EE600EF0F1A /* WKPluginLoadPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                2DABA7761A82B42100EF0F1A /* APIHistoryClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DABA7751A82B42100EF0F1A /* APIHistoryClient.h */; };
</ins><span class="cx">                 2DACE64E18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DACE64D18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h */; };
</span><span class="cx">                 2DAF06D618BD1A470081CEB1 /* SmartMagnificationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAF06D418BD1A470081CEB1 /* SmartMagnificationController.h */; };
</span><span class="cx">                 2DAF06D718BD1A470081CEB1 /* SmartMagnificationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */; };
</span><span class="lines">@@ -2771,6 +2772,7 @@
</span><span class="cx">                 2DA944BC188511E700ED86DB /* NetworkProcessIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkProcessIOS.mm; path = NetworkProcess/ios/NetworkProcessIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">                 2DABA7711A817B1700EF0F1A /* WKPageRenderingProgressEventsInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageRenderingProgressEventsInternal.h; sourceTree = "<group>"; };
</span><span class="cx">                 2DABA7731A817EE600EF0F1A /* WKPluginLoadPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPluginLoadPolicy.h; sourceTree = "<group>"; };
</span><ins>+                2DABA7751A82B42100EF0F1A /* APIHistoryClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIHistoryClient.h; sourceTree = "<group>"; };
</ins><span class="cx">                 2DACE64D18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKThumbnailViewInternal.h; sourceTree = "<group>"; };
</span><span class="cx">                 2DAF06D418BD1A470081CEB1 /* SmartMagnificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmartMagnificationController.h; path = ios/SmartMagnificationController.h; sourceTree = "<group>"; };
</span><span class="cx">                 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SmartMagnificationController.mm; path = ios/SmartMagnificationController.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -6184,6 +6186,7 @@
</span><span class="cx">                                 37E25D6D18FDE5D6005D3A00 /* APIFormClient.h */,
</span><span class="cx">                                 2DF9EEE31A781FB400B6CFBE /* APIFrameInfo.cpp */,
</span><span class="cx">                                 2DF9EEE41A781FB400B6CFBE /* APIFrameInfo.h */,
</span><ins>+                                2DABA7751A82B42100EF0F1A /* APIHistoryClient.h */,
</ins><span class="cx">                                 7CE4D2061A46775700C7F152 /* APILegacyContextHistoryClient.h */,
</span><span class="cx">                                 1A2464F21891E45100234C5B /* APILoaderClient.h */,
</span><span class="cx">                                 7CD3A4801A5D02FA009623B8 /* APINavigation.cpp */,
</span><span class="lines">@@ -7786,6 +7789,7 @@
</span><span class="cx">                                 1AE00D6C18327C1200087DD7 /* StringReference.h in Headers */,
</span><span class="cx">                                 296BD85D15019BC30071F424 /* StringUtilities.h in Headers */,
</span><span class="cx">                                 CE1A0BD61A48E6C60054EF74 /* TCCSPI.h in Headers */,
</span><ins>+                                2DABA7761A82B42100EF0F1A /* APIHistoryClient.h in Headers */,
</ins><span class="cx">                                 1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */,
</span><span class="cx">                                 1QQ417CB12C00CCA002BE67B /* TextCheckerCompletion.h in Headers */,
</span><span class="cx">                                 1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */,
</span></span></pre>
</div>
</div>
</body>
</html>