<!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>[179430] 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/179430">179430</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-01-30 17:28:05 -0800 (Fri, 30 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add and hook up APINavigationClient
https://bugs.webkit.org/show_bug.cgi?id=140698
Reviewed by Sam Weinig.
Add a single APINavigationClient that NavigationState implements and
WebPageProxy prefers over APILoaderClient and APIPolicyClient.
* UIProcess/API/APILoaderClient.h:
Fix a comment.
* UIProcess/API/APINavigationClient.h: Added.
APINavigationClient is the union of NavigationState's overrides of APILoaderClient and APIPolicyClient.
Names are adjusted to more closely match the Modern API.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
Instead of having policy and loader clients, NavigationState has a single navigation client.
Adjust as necessary.
Move as much logic as possible (isMainFrame checks, construction of API objects) out of here
and into WebPageProxy.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Install the aforementioned single navigation client.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setNavigationClient):
Add a navigation client setter.
For all policy and loader client calls, if we have a navigation client, use that;
otherwise, fall back on the policy and loader clients.
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPILoaderClienth">trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPINavigationActionh">trunk/Source/WebKit2/UIProcess/API/APINavigationAction.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPINavigationResponseh">trunk/Source/WebKit2/UIProcess/API/APINavigationResponse.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="#trunkSourceWebKit2UIProcessAPIAPINavigationClienth">trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/CMakeLists.txt        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -382,6 +382,7 @@
</span><span class="cx"> UIProcess/WebVibrationProxy.cpp
</span><span class="cx"> UIProcess/WebViewportAttributes.cpp
</span><span class="cx">
</span><ins>+ UIProcess/API/APIFrameInfo.cpp
</ins><span class="cx"> UIProcess/API/APINavigation.cpp
</span><span class="cx"> UIProcess/API/APISessionState.cpp
</span><span class="cx"> UIProcess/API/APIWebsiteDataStore.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/ChangeLog        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2015-01-30 Tim Horton <timothy_horton@apple.com>
+
+ Add and hook up APINavigationClient
+ https://bugs.webkit.org/show_bug.cgi?id=140698
+
+ Reviewed by Sam Weinig.
+
+ Add a single APINavigationClient that NavigationState implements and
+ WebPageProxy prefers over APILoaderClient and APIPolicyClient.
+
+ * UIProcess/API/APILoaderClient.h:
+ Fix a comment.
+
+ * UIProcess/API/APINavigationClient.h: Added.
+ APINavigationClient is the union of NavigationState's overrides of APILoaderClient and APIPolicyClient.
+ Names are adjusted to more closely match the Modern API.
+
+ * UIProcess/Cocoa/NavigationState.h:
+ * UIProcess/Cocoa/NavigationState.mm:
+ Instead of having policy and loader clients, NavigationState has a single navigation client.
+ Adjust as necessary.
+
+ Move as much logic as possible (isMainFrame checks, construction of API objects) out of here
+ and into WebPageProxy.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView initWithFrame:configuration:]):
+ Install the aforementioned single navigation client.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setNavigationClient):
+ Add a navigation client setter.
+
+ For all policy and loader client calls, if we have a navigation client, use that;
+ otherwise, fall back on the policy and loader clients.
+
+ * UIProcess/WebPageProxy.h:
+ * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2015-01-30 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Update MemoryCache code to use more references instead of pointers
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPILoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> virtual void didChangeProgress(WebKit::WebPageProxy&) { }
</span><span class="cx"> virtual void didFinishProgress(WebKit::WebPageProxy&) { }
</span><span class="cx">
</span><del>- // FIXME: These three functions should not be part of this client.
</del><ins>+ // FIXME: These four functions should not be part of this client.
</ins><span class="cx"> virtual void processDidBecomeUnresponsive(WebKit::WebPageProxy&) { }
</span><span class="cx"> virtual void interactionOccurredWhileProcessUnresponsive(WebKit::WebPageProxy&) { }
</span><span class="cx"> virtual void processDidBecomeResponsive(WebKit::WebPageProxy&) { }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPINavigationActionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APINavigationAction.h (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APINavigationAction.h        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/API/APINavigationAction.h        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef APINavigationAction_h
</span><span class="cx"> #define APINavigationAction_h
</span><span class="cx">
</span><ins>+#include "APIFrameInfo.h"
</ins><span class="cx"> #include "APIObject.h"
</span><span class="cx"> #include "NavigationActionData.h"
</span><span class="cx"> #include <WebCore/ResourceRequest.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPINavigationClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h (0 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APINavigationClient.h        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -0,0 +1,111 @@
</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 APINavigationClient_h
+#define APINavigationClient_h
+
+#include "APIData.h"
+#include "PluginModuleInfo.h"
+#include "SameDocumentNavigationType.h"
+#include "WebEvent.h"
+#include "WebFramePolicyListenerProxy.h"
+#include <WebCore/FrameLoaderTypes.h>
+#include <WebCore/LayoutMilestones.h>
+#include <wtf/Forward.h>
+
+namespace WebCore {
+class ResourceError;
+class ResourceRequest;
+class ResourceResponse;
+}
+
+namespace WebKit {
+class AuthenticationChallengeProxy;
+class QuickLookDocumentData;
+class WebBackForwardListItem;
+class WebFramePolicyListenerProxy;
+class WebFrameProxy;
+class WebPageProxy;
+class WebProtectionSpace;
+struct NavigationActionData;
+struct WebNavigationDataStore;
+}
+
+namespace API {
+
+class Dictionary;
+class Navigation;
+class NavigationAction;
+class NavigationResponse;
+class Object;
+
+class NavigationClient {
+public:
+ virtual ~NavigationClient() { }
+
+ virtual void didStartProvisionalNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*) { }
+ virtual void didReceiveServerRedirectForProvisionalNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*) { }
+ virtual void didFailProvisionalNavigationWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) { }
+ virtual void didFailProvisionalLoadInSubframeWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) { }
+ virtual void didCommitNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*) { }
+ virtual void didFinishDocumentLoad(WebKit::WebPageProxy&, API::Navigation*, API::Object*) { }
+ virtual void didFinishNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*) { }
+ virtual void didFailNavigationWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) { }
+ virtual void didSameDocumentNavigation(WebKit::WebPageProxy&, API::Navigation*, WebKit::SameDocumentNavigationType, API::Object*) { }
+
+ virtual void renderingProgressDidChange(WebKit::WebPageProxy&, WebCore::LayoutMilestones, API::Object*) { }
+
+ virtual bool canAuthenticateAgainstProtectionSpace(WebKit::WebPageProxy&, WebKit::WebProtectionSpace*) { return false; }
+ virtual void didReceiveAuthenticationChallenge(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy*) { }
+
+ // FIXME: This function should not be part of this client.
+ virtual void processDidCrash(WebKit::WebPageProxy&) { }
+
+ virtual PassRefPtr<Data> webCryptoMasterKey(WebKit::WebPageProxy&) { return nullptr; }
+
+ 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&) { }
+
+#if USE(QUICK_LOOK)
+ virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& fileName, const WTF::String& uti) { }
+ virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&) { }
+#endif
+
+ virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy&, API::NavigationAction&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object*)
+ {
+ listener->use();
+ }
+
+ virtual void decidePolicyForNavigationResponse(WebKit::WebPageProxy&, API::NavigationResponse&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object*)
+ {
+ listener->use();
+ }
+};
+
+} // namespace API
+
+#endif // APINavigationClient_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPINavigationResponseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APINavigationResponse.h (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APINavigationResponse.h        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/API/APINavigationResponse.h        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef APINavigationResponse_h
</span><span class="cx"> #define APINavigationResponse_h
</span><span class="cx">
</span><ins>+#include "APIFrameInfo.h"
</ins><span class="cx"> #include "APIObject.h"
</span><span class="cx"> #include <WebCore/ResourceRequest.h>
</span><span class="cx"> #include <WebCore/ResourceResponse.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -357,8 +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->setPolicyClient(_navigationState->createPolicyClient());
- _page->setLoaderClient(_navigationState->createLoaderClient());
</del><ins>+ _page->setNavigationClient(_navigationState->createNavigationClient());
</ins><span class="cx">
</span><span class="cx"> _uiDelegate = std::make_unique<WebKit::UIDelegate>(self);
</span><span class="cx"> _page->setUIClient(_uiDelegate->createUIClient());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -30,13 +30,12 @@
</span><span class="cx">
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">
</span><del>-#import <wtf/HashMap.h>
-#import <wtf/RetainPtr.h>
-#import "APILoaderClient.h"
-#import "APIPolicyClient.h"
</del><ins>+#import "APINavigationClient.h"
</ins><span class="cx"> #import "PageLoadState.h"
</span><span class="cx"> #import "ProcessThrottler.h"
</span><span class="cx"> #import "WeakObjCPtr.h"
</span><ins>+#import <wtf/HashMap.h>
+#import <wtf/RetainPtr.h>
</ins><span class="cx">
</span><span class="cx"> @class WKWebView;
</span><span class="cx"> @protocol WKHistoryDelegatePrivate;
</span><span class="lines">@@ -57,8 +56,7 @@
</span><span class="cx">
</span><span class="cx"> static NavigationState& fromWebPage(WebPageProxy&);
</span><span class="cx">
</span><del>- std::unique_ptr<API::PolicyClient> createPolicyClient();
- std::unique_ptr<API::LoaderClient> createLoaderClient();
</del><ins>+ std::unique_ptr<API::NavigationClient> createNavigationClient();
</ins><span class="cx">
</span><span class="cx"> RetainPtr<id <WKNavigationDelegate> > navigationDelegate();
</span><span class="cx"> void setNavigationDelegate(id <WKNavigationDelegate>);
</span><span class="lines">@@ -73,49 +71,41 @@
</span><span class="cx"> void willRecordNavigationSnapshot(WebBackForwardListItem&);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- class PolicyClient final : public API::PolicyClient {
</del><ins>+ class NavigationClient final : public API::NavigationClient {
</ins><span class="cx"> public:
</span><del>- explicit PolicyClient(NavigationState&);
- ~PolicyClient();
</del><ins>+ explicit NavigationClient(NavigationState&);
+ ~NavigationClient();
</ins><span class="cx">
</span><span class="cx"> private:
</span><del>- // API::PolicyClient
- virtual void decidePolicyForNavigationAction(WebPageProxy&, WebFrameProxy* destinationFrame, const NavigationActionData&, WebFrameProxy* sourceFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
- virtual void decidePolicyForNewWindowAction(WebPageProxy&, WebFrameProxy& sourceFrame, const NavigationActionData&, const WebCore::ResourceRequest&, const WTF::String& frameName, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
- virtual void decidePolicyForResponse(WebPageProxy&, WebFrameProxy&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
</del><ins>+ virtual void didStartProvisionalNavigation(WebPageProxy&, API::Navigation*, API::Object*) override;
+ virtual void didReceiveServerRedirectForProvisionalNavigation(WebPageProxy&, API::Navigation*, API::Object*) override;
+ virtual void didFailProvisionalNavigationWithError(WebPageProxy&, WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) override;
+ virtual void didFailProvisionalLoadInSubframeWithError(WebPageProxy&, WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) override;
+ virtual void didCommitNavigation(WebPageProxy&, API::Navigation*, API::Object*) override;
+ virtual void didFinishDocumentLoad(WebPageProxy&, API::Navigation*, API::Object*) override;
+ virtual void didFinishNavigation(WebPageProxy&, API::Navigation*, API::Object*) override;
+ virtual void didFailNavigationWithError(WebPageProxy&, WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) override;
+ virtual void didSameDocumentNavigation(WebPageProxy&, API::Navigation*, SameDocumentNavigationType, API::Object*) override;
</ins><span class="cx">
</span><del>- NavigationState& m_navigationState;
- };
</del><ins>+ virtual void renderingProgressDidChange(WebPageProxy&, WebCore::LayoutMilestones, API::Object*) override;
</ins><span class="cx">
</span><del>- class LoaderClient final : public API::LoaderClient {
- public:
- explicit LoaderClient(NavigationState&);
- ~LoaderClient();
-
- private:
- virtual void didStartProvisionalLoadForFrame(WebPageProxy&, WebFrameProxy&, API::Navigation*, API::Object*) override;
- virtual void didReceiveServerRedirectForProvisionalLoadForFrame(WebPageProxy&, WebFrameProxy&, API::Navigation*, API::Object*) override;
- virtual void didFailProvisionalLoadWithErrorForFrame(WebPageProxy&, WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) override;
- virtual void didCommitLoadForFrame(WebPageProxy&, WebFrameProxy&, API::Navigation*, API::Object*) override;
- virtual void didFinishDocumentLoadForFrame(WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, API::Object*) override;
- virtual void didFinishLoadForFrame(WebPageProxy&, WebFrameProxy&, API::Navigation*, API::Object*) override;
- virtual void didFailLoadWithErrorForFrame(WebPageProxy&, WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) override;
- virtual void didSameDocumentNavigationForFrame(WebPageProxy&, WebFrameProxy&, API::Navigation*, SameDocumentNavigationType, API::Object*) override;
- virtual void didLayout(WebPageProxy&, WebCore::LayoutMilestones, API::Object*) override;
- virtual bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy&, WebKit::WebFrameProxy&, WebKit::WebProtectionSpace*) override;
- virtual void didReceiveAuthenticationChallengeInFrame(WebPageProxy&, WebKit::WebFrameProxy&, WebKit::AuthenticationChallengeProxy*) override;
</del><ins>+ virtual bool canAuthenticateAgainstProtectionSpace(WebPageProxy&, WebProtectionSpace*) override;
+ virtual void didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy*) override;
</ins><span class="cx"> virtual void processDidCrash(WebPageProxy&) override;
</span><span class="cx"> virtual PassRefPtr<API::Data> webCryptoMasterKey(WebPageProxy&) override;
</span><span class="cx">
</span><ins>+ 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;
+
</ins><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& fileName, const WTF::String& uti) override;
</span><del>- virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&) override;
</del><ins>+ virtual void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&) override;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual void didNavigateWithNavigationData(WebPageProxy&, const WebNavigationDataStore&, WebFrameProxy&) override;
- virtual void didPerformClientRedirect(WebPageProxy&, const WTF::String&, const WTF::String&, WebFrameProxy&) override;
- virtual void didPerformServerRedirect(WebPageProxy&, const WTF::String&, const WTF::String&, WebFrameProxy&) override;
- virtual void didUpdateHistoryTitle(WebPageProxy&, const WTF::String&, const WTF::String&, WebFrameProxy&) override;
</del><ins>+ virtual void decidePolicyForNavigationAction(WebPageProxy&, API::NavigationAction&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
+ virtual void decidePolicyForNavigationResponse(WebPageProxy&, API::NavigationResponse&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
</ins><span class="cx">
</span><span class="cx"> NavigationState& m_navigationState;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -104,16 +104,11 @@
</span><span class="cx"> return *navigationStates().get(&webPageProxy);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<API::LoaderClient> NavigationState::createLoaderClient()
</del><ins>+std::unique_ptr<API::NavigationClient> NavigationState::createNavigationClient()
</ins><span class="cx"> {
</span><del>- return std::make_unique<LoaderClient>(*this);
</del><ins>+ return std::make_unique<NavigationClient>(*this);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<API::PolicyClient> NavigationState::createPolicyClient()
-{
- return std::make_unique<PolicyClient>(*this);
-}
-
</del><span class="cx"> RetainPtr<id <WKNavigationDelegate> > NavigationState::navigationDelegate()
</span><span class="cx"> {
</span><span class="cx"> return m_navigationDelegate.get();
</span><span class="lines">@@ -215,21 +210,21 @@
</span><span class="cx"> [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate) _webView:m_webView willSnapshotBackForwardListItem:wrapper(item)];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NavigationState::PolicyClient::PolicyClient(NavigationState& navigationState)
</del><ins>+NavigationState::NavigationClient::NavigationClient(NavigationState& navigationState)
</ins><span class="cx"> : m_navigationState(navigationState)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NavigationState::PolicyClient::~PolicyClient()
</del><ins>+NavigationState::NavigationClient::~NavigationClient()
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::PolicyClient::decidePolicyForNavigationAction(WebPageProxy&, WebFrameProxy* destinationFrame, const NavigationActionData& navigationActionData, WebFrameProxy* sourceFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest& request, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
</del><ins>+void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageProxy&, API::NavigationAction& navigationAction, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler) {
</span><del>- RetainPtr<NSURLRequest> nsURLRequest = adoptNS(wrapper(*API::URLRequest::create(request).leakRef()));
</del><ins>+ RetainPtr<NSURLRequest> nsURLRequest = adoptNS(wrapper(*API::URLRequest::create(navigationAction.request()).leakRef()));
</ins><span class="cx">
</span><del>- if (!destinationFrame) {
</del><ins>+ if (!navigationAction.targetFrame()) {
</ins><span class="cx"> listener->use();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -253,19 +248,6 @@
</span><span class="cx"> if (!navigationDelegate)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<API::FrameInfo> destinationFrameInfo;
- RefPtr<API::FrameInfo> sourceFrameInfo;
-
- if (destinationFrame)
- destinationFrameInfo = API::FrameInfo::create(*destinationFrame);
-
- if (sourceFrame == destinationFrame)
- sourceFrameInfo = destinationFrameInfo;
- else if (sourceFrame)
- sourceFrameInfo = API::FrameInfo::create(*sourceFrame);
-
- auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), destinationFrameInfo.get(), request, originalRequest.url());
-
</del><span class="cx"> RefPtr<WebFramePolicyListenerProxy> localListener = WTF::move(listener);
</span><span class="cx"> RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationAction:decisionHandler:));
</span><span class="cx"> [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:[localListener, checker](WKNavigationActionPolicy actionPolicy) {
</span><span class="lines">@@ -291,27 +273,22 @@
</span><span class="cx"> }];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::PolicyClient::decidePolicyForNewWindowAction(WebPageProxy& webPageProxy, WebFrameProxy& sourceFrame, const NavigationActionData& navigationActionData, const WebCore::ResourceRequest& request, const WTF::String& frameName, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
</del><ins>+void NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebPageProxy&, API::NavigationResponse& navigationResponse, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
</ins><span class="cx"> {
</span><del>- decidePolicyForNavigationAction(webPageProxy, nullptr, navigationActionData, &sourceFrame, request, request, WTF::move(listener), userData);
-}
-
-void NavigationState::PolicyClient::decidePolicyForResponse(WebPageProxy&, WebFrameProxy& frame, const WebCore::ResourceResponse& resourceResponse, const WebCore::ResourceRequest& resourceRequest, bool canShowMIMEType, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
-{
</del><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationResponseDecisionHandler) {
</span><del>- NSURL *url = resourceResponse.nsURLResponse().URL;
</del><ins>+ NSURL *url = navigationResponse.response().nsURLResponse().URL;
</ins><span class="cx"> if ([url isFileURL]) {
</span><span class="cx"> BOOL isDirectory = NO;
</span><span class="cx"> BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:url.path isDirectory:&isDirectory];
</span><span class="cx">
</span><del>- if (exists && !isDirectory && canShowMIMEType)
</del><ins>+ if (exists && !isDirectory && navigationResponse.canShowMIMEType())
</ins><span class="cx"> listener->use();
</span><span class="cx"> else
</span><span class="cx"> listener->ignore();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (canShowMIMEType)
</del><ins>+ if (navigationResponse.canShowMIMEType())
</ins><span class="cx"> listener->use();
</span><span class="cx"> else
</span><span class="cx"> listener->ignore();
</span><span class="lines">@@ -322,8 +299,6 @@
</span><span class="cx"> if (!navigationDelegate)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- auto navigationResponse = API::NavigationResponse::create(API::FrameInfo::create(frame).get(), resourceRequest, resourceResponse, canShowMIMEType);
-
</del><span class="cx"> RefPtr<WebFramePolicyListenerProxy> localListener = WTF::move(listener);
</span><span class="cx"> RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationResponse:decisionHandler:));
</span><span class="cx"> [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationResponse:wrapper(navigationResponse) decisionHandler:[localListener, checker](WKNavigationResponsePolicy responsePolicy) {
</span><span class="lines">@@ -349,20 +324,8 @@
</span><span class="cx"> }];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NavigationState::LoaderClient::LoaderClient(NavigationState& navigationState)
- : m_navigationState(navigationState)
</del><ins>+void NavigationState::NavigationClient::didStartProvisionalNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object*)
</ins><span class="cx"> {
</span><del>-}
-
-NavigationState::LoaderClient::~LoaderClient()
-{
-}
-
-void NavigationState::LoaderClient::didStartProvisionalLoadForFrame(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, API::Object*)
-{
- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDidStartProvisionalNavigation)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -378,11 +341,8 @@
</span><span class="cx"> [navigationDelegate webView:m_navigationState.m_webView didStartProvisionalNavigation:wkNavigation];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame(WebPageProxy& page, WebKit::WebFrameProxy& webFrameProxy, API::Navigation* navigation, API::Object*)
</del><ins>+void NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object*)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveServerRedirectForProvisionalNavigation)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -412,20 +372,9 @@
</span><span class="cx"> return adoptNS([[NSError alloc] initWithDomain:originalError.domain code:originalError.code userInfo:userInfo.get()]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object*)
</del><ins>+// FIXME: Shouldn't need to pass the WebFrameProxy in here. At most, a FrameHandle.
+void NavigationState::NavigationClient::didFailProvisionalNavigationWithError(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object*)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame()) {
- if (!m_navigationState.m_navigationDelegateMethods.webViewNavigationDidFailProvisionalLoadInSubframeWithError)
- return;
-
- auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
- auto errorWithRecoveryAttempter = createErrorWithRecoveryAttempter(m_navigationState.m_webView, webFrameProxy, error);
- // FIXME: Get the main frame's current navigation.
- [(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView navigation:nil didFailProvisionalLoadInSubframe:wrapper(API::FrameInfo::create(webFrameProxy)) withError:errorWithRecoveryAttempter.get()];
-
- return;
- }
-
</del><span class="cx"> // FIXME: We should assert that navigation is not null here, but it's currently null for some navigations through the page cache.
</span><span class="cx"> RetainPtr<WKNavigation> wkNavigation;
</span><span class="cx"> if (navigation)
</span><span class="lines">@@ -444,11 +393,25 @@
</span><span class="cx"> [navigationDelegate webView:m_navigationState.m_webView didFailProvisionalNavigation:wkNavigation.get() withError:errorWithRecoveryAttempter.get()];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didCommitLoadForFrame(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, API::Object*)
</del><ins>+// FIXME: Shouldn't need to pass the WebFrameProxy in here. At most, a FrameHandle.
+void NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object*)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
</del><ins>+ // FIXME: We should assert that navigation is not null here, but it's currently null because WebPageProxy::didFailProvisionalLoadForFrame passes null.
+ RetainPtr<WKNavigation> wkNavigation;
+ if (navigation)
+ wkNavigation = wrapper(*navigation);
+
+ if (!m_navigationState.m_navigationDelegateMethods.webViewNavigationDidFailProvisionalLoadInSubframeWithError)
</ins><span class="cx"> return;
</span><span class="cx">
</span><ins>+ auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
+ auto errorWithRecoveryAttempter = createErrorWithRecoveryAttempter(m_navigationState.m_webView, webFrameProxy, error);
+
+ [(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView navigation:nil didFailProvisionalLoadInSubframe:wrapper(API::FrameInfo::create(webFrameProxy)) withError:errorWithRecoveryAttempter.get()];
+}
+
+void NavigationState::NavigationClient::didCommitNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object*)
+{
</ins><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDidCommitNavigation)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -464,11 +427,8 @@
</span><span class="cx"> [navigationDelegate webView:m_navigationState.m_webView didCommitNavigation:wkNavigation];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didFinishDocumentLoadForFrame(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, API::Object*)
</del><ins>+void NavigationState::NavigationClient::didFinishDocumentLoad(WebPageProxy& page, API::Navigation* navigation, API::Object*)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewNavigationDidFinishDocumentLoad)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -484,11 +444,8 @@
</span><span class="cx"> [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView navigationDidFinishDocumentLoad:wkNavigation];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didFinishLoadForFrame(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, API::Object*)
</del><ins>+void NavigationState::NavigationClient::didFinishNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object*)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDidFinishNavigation)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -504,11 +461,9 @@
</span><span class="cx"> [navigationDelegate webView:m_navigationState.m_webView didFinishNavigation:wkNavigation];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didFailLoadWithErrorForFrame(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object* userData)
</del><ins>+// FIXME: Shouldn't need to pass the WebFrameProxy in here. At most, a FrameHandle.
+void NavigationState::NavigationClient::didFailNavigationWithError(WebPageProxy& page, WebFrameProxy& webFrameProxy, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object* userData)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDidFailNavigationWithError)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -525,11 +480,8 @@
</span><span class="cx"> [navigationDelegate webView:m_navigationState.m_webView didFailNavigation:wkNavigation withError:errorWithRecoveryAttempter.get()];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didSameDocumentNavigationForFrame(WebPageProxy&, WebFrameProxy& webFrameProxy, API::Navigation* navigation, SameDocumentNavigationType navigationType, API::Object*)
</del><ins>+void NavigationState::NavigationClient::didSameDocumentNavigation(WebPageProxy&, API::Navigation* navigation, SameDocumentNavigationType navigationType, API::Object*)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewNavigationDidSameDocumentNavigation)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -545,7 +497,7 @@
</span><span class="cx"> [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView navigation:wkNavigation didSameDocumentNavigation:toWKSameDocumentNavigationType(navigationType)];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didLayout(WebKit::WebPageProxy&, WebCore::LayoutMilestones layoutMilestones, API::Object*)
</del><ins>+void NavigationState::NavigationClient::renderingProgressDidChange(WebKit::WebPageProxy&, WebCore::LayoutMilestones layoutMilestones, API::Object*)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewRenderingProgressDidChange)
</span><span class="cx"> return;
</span><span class="lines">@@ -557,7 +509,7 @@
</span><span class="cx"> [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView renderingProgressDidChange:renderingProgressEvents(layoutMilestones)];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, WebKit::WebProtectionSpace* protectionSpace)
</del><ins>+bool NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace(WebKit::WebPageProxy&, WebKit::WebProtectionSpace* protectionSpace)
</ins><span class="cx"> {
</span><span class="cx"> if (m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler)
</span><span class="cx"> return true;
</span><span class="lines">@@ -572,7 +524,7 @@
</span><span class="cx"> return [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView canAuthenticateAgainstProtectionSpace:protectionSpace->protectionSpace().nsSpace()];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame(WebPageProxy&, WebFrameProxy&, AuthenticationChallengeProxy* authenticationChallenge)
</del><ins>+void NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy* authenticationChallenge)
</ins><span class="cx"> {
</span><span class="cx"> if (m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler) {
</span><span class="cx"> auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
</span><span class="lines">@@ -627,7 +579,7 @@
</span><span class="cx"> [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView didReceiveAuthenticationChallenge:wrapper(*authenticationChallenge)];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::processDidCrash(WebKit::WebPageProxy& page)
</del><ins>+void NavigationState::NavigationClient::processDidCrash(WebKit::WebPageProxy& page)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewWebProcessDidCrash)
</span><span class="cx"> return;
</span><span class="lines">@@ -639,7 +591,7 @@
</span><span class="cx"> [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webViewWebProcessDidCrash:m_navigationState.m_webView];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<API::Data> NavigationState::LoaderClient::webCryptoMasterKey(WebKit::WebPageProxy&)
</del><ins>+PassRefPtr<API::Data> NavigationState::NavigationClient::webCryptoMasterKey(WebKit::WebPageProxy&)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webCryptoMasterKeyForWebView)
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -656,7 +608,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><del>-void NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti)
</del><ins>+void NavigationState::NavigationClient::didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDidStartLoadForQuickLookDocumentInMainFrame)
</span><span class="cx"> return;
</span><span class="lines">@@ -668,7 +620,7 @@
</span><span class="cx"> [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView didStartLoadForQuickLookDocumentInMainFrameWithFileName:fileName uti:uti];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData& data)
</del><ins>+void NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData& data)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_navigationState.m_navigationDelegateMethods.webViewDidFinishLoadForQuickLookDocumentInMainFrame)
</span><span class="cx"> return;
</span><span class="lines">@@ -683,11 +635,8 @@
</span><span class="cx">
</span><span class="cx"> // HistoryDelegatePrivate support
</span><span class="cx">
</span><del>-void NavigationState::LoaderClient::didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore& navigationDataStore, WebKit::WebFrameProxy& webFrameProxy)
</del><ins>+void NavigationState::NavigationClient::didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore& navigationDataStore)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidNavigateWithNavigationData)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -698,11 +647,8 @@
</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::LoaderClient::didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL, WebKit::WebFrameProxy& webFrameProxy)
</del><ins>+void NavigationState::NavigationClient::didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidPerformClientRedirectFromURLToURL)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -713,11 +659,8 @@
</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::LoaderClient::didPerformServerRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL, WebKit::WebFrameProxy& webFrameProxy)
</del><ins>+void NavigationState::NavigationClient::didPerformServerRedirect(WebKit::WebPageProxy&, const WTF::String& sourceURL, const WTF::String& destinationURL)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidPerformServerRedirectFromURLToURL)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -728,11 +671,8 @@
</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::LoaderClient::didUpdateHistoryTitle(WebKit::WebPageProxy&, const WTF::String& title, const WTF::String& url, WebKit::WebFrameProxy& webFrameProxy)
</del><ins>+void NavigationState::NavigationClient::didUpdateHistoryTitle(WebKit::WebPageProxy&, const WTF::String& title, const WTF::String& url)
</ins><span class="cx"> {
</span><del>- if (!webFrameProxy.isMainFrame())
- return;
-
</del><span class="cx"> if (!m_navigationState.m_historyDelegateMethods.webViewDidUpdateHistoryTitleForURL)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -31,10 +31,14 @@
</span><span class="cx"> #include "APIContextMenuClient.h"
</span><span class="cx"> #include "APIFindClient.h"
</span><span class="cx"> #include "APIFormClient.h"
</span><ins>+#include "APIFrameInfo.h"
</ins><span class="cx"> #include "APIGeometry.h"
</span><span class="cx"> #include "APILegacyContextHistoryClient.h"
</span><span class="cx"> #include "APILoaderClient.h"
</span><span class="cx"> #include "APINavigation.h"
</span><ins>+#include "APINavigationAction.h"
+#include "APINavigationClient.h"
+#include "APINavigationResponse.h"
</ins><span class="cx"> #include "APIPolicyClient.h"
</span><span class="cx"> #include "APISecurityOrigin.h"
</span><span class="cx"> #include "APIUIClient.h"
</span><span class="lines">@@ -505,6 +509,11 @@
</span><span class="cx"> preferencesDidChange();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::setNavigationClient(std::unique_ptr<API::NavigationClient> navigationClient)
+{
+ m_navigationClient = WTF::move(navigationClient);
+}
+
</ins><span class="cx"> void WebPageProxy::setLoaderClient(std::unique_ptr<API::LoaderClient> loaderClient)
</span><span class="cx"> {
</span><span class="cx"> if (!loaderClient) {
</span><span class="lines">@@ -2657,7 +2666,11 @@
</span><span class="cx"> frame->didStartProvisionalLoad(url);
</span><span class="cx">
</span><span class="cx"> m_pageLoadState.commitChanges();
</span><del>- m_loaderClient->didStartProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didStartProvisionalNavigation(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_loaderClient->didStartProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const UserData& userData)
</span><span class="lines">@@ -2679,7 +2692,11 @@
</span><span class="cx"> frame->didReceiveServerRedirectForProvisionalLoad(url);
</span><span class="cx">
</span><span class="cx"> m_pageLoadState.commitChanges();
</span><del>- m_loaderClient->didReceiveServerRedirectForProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didReceiveServerRedirectForProvisionalNavigation(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_loaderClient->didReceiveServerRedirectForProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const ResourceError& error, const UserData& userData)
</span><span class="lines">@@ -2700,7 +2717,15 @@
</span><span class="cx"> frame->didFailProvisionalLoad();
</span><span class="cx">
</span><span class="cx"> m_pageLoadState.commitChanges();
</span><del>- m_loaderClient->didFailProvisionalLoadWithErrorForFrame(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didFailProvisionalNavigationWithError(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
+ else {
+ // FIXME: Get the main frame's current navigation.
+ m_navigationClient->didFailProvisionalLoadInSubframeWithError(*this, *frame, nullptr, error, m_process->transformHandlesToObjects(userData.object()).get());
+ }
+ } else
+ m_loaderClient->didFailProvisionalLoadWithErrorForFrame(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::clearLoadDependentCallbacks()
</span><span class="lines">@@ -2773,7 +2798,11 @@
</span><span class="cx"> m_pageScaleFactor = 1;
</span><span class="cx">
</span><span class="cx"> m_pageLoadState.commitChanges();
</span><del>- m_loaderClient->didCommitLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didCommitNavigation(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_loaderClient->didCommitLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData& userData)
</span><span class="lines">@@ -2786,7 +2815,11 @@
</span><span class="cx"> if (frame->isMainFrame() && navigationID)
</span><span class="cx"> navigation = &navigationState().navigation(navigationID);
</span><span class="cx">
</span><del>- m_loaderClient->didFinishDocumentLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didFinishDocumentLoad(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_loaderClient->didFinishDocumentLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData& userData)
</span><span class="lines">@@ -2808,7 +2841,11 @@
</span><span class="cx"> frame->didFinishLoad();
</span><span class="cx">
</span><span class="cx"> m_pageLoadState.commitChanges();
</span><del>- m_loaderClient->didFinishLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (isMainFrame)
+ m_navigationClient->didFinishNavigation(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_loaderClient->didFinishLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx">
</span><span class="cx"> if (isMainFrame)
</span><span class="cx"> m_pageClient.didFinishLoadForMainFrame();
</span><span class="lines">@@ -2834,7 +2871,11 @@
</span><span class="cx"> frame->didFailLoad();
</span><span class="cx">
</span><span class="cx"> m_pageLoadState.commitChanges();
</span><del>- m_loaderClient->didFailLoadWithErrorForFrame(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didFailNavigationWithError(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_loaderClient->didFailLoadWithErrorForFrame(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t opaqueSameDocumentNavigationType, const String& url, const UserData& userData)
</span><span class="lines">@@ -2860,7 +2901,11 @@
</span><span class="cx"> m_pageLoadState.commitChanges();
</span><span class="cx">
</span><span class="cx"> SameDocumentNavigationType navigationType = static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType);
</span><del>- m_loaderClient->didSameDocumentNavigationForFrame(*this, *frame, navigation.get(), navigationType, m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ if (isMainFrame)
+ m_navigationClient->didSameDocumentNavigation(*this, navigation.get(), navigationType, m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_loaderClient->didSameDocumentNavigationForFrame(*this, *frame, navigation.get(), navigationType, m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx">
</span><span class="cx"> if (isMainFrame)
</span><span class="cx"> m_pageClient.didSameDocumentNavigationForMainFrame(navigationType);
</span><span class="lines">@@ -2903,7 +2948,10 @@
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didLayout(uint32_t layoutMilestones, const UserData& userData)
</span><span class="cx"> {
</span><del>- m_loaderClient->didLayout(*this, static_cast<LayoutMilestones>(layoutMilestones), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient)
+ m_navigationClient->renderingProgressDidChange(*this, static_cast<LayoutMilestones>(layoutMilestones), m_process->transformHandlesToObjects(userData.object()).get());
+ else
+ m_loaderClient->didLayout(*this, static_cast<LayoutMilestones>(layoutMilestones), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, const UserData& userData)
</span><span class="lines">@@ -2990,8 +3038,24 @@
</span><span class="cx"> m_inDecidePolicyForNavigationAction = true;
</span><span class="cx"> m_syncNavigationActionPolicyActionIsValid = false;
</span><span class="cx">
</span><del>- m_policyClient->decidePolicyForNavigationAction(*this, frame, navigationActionData, originatingFrame, originalRequest, request, WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ RefPtr<API::FrameInfo> destinationFrameInfo;
+ RefPtr<API::FrameInfo> sourceFrameInfo;
</ins><span class="cx">
</span><ins>+ if (frame)
+ destinationFrameInfo = API::FrameInfo::create(*frame);
+
+ if (originatingFrame == frame)
+ sourceFrameInfo = destinationFrameInfo;
+ else if (originatingFrame)
+ sourceFrameInfo = API::FrameInfo::create(*originatingFrame);
+
+ auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), destinationFrameInfo.get(), request, originalRequest.url());
+
+ m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_policyClient->decidePolicyForNavigationAction(*this, frame, navigationActionData, originatingFrame, originalRequest, request, WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
+
</ins><span class="cx"> m_inDecidePolicyForNavigationAction = false;
</span><span class="cx">
</span><span class="cx"> // Check if we received a policy decision already. If we did, we can just pass it back.
</span><span class="lines">@@ -3010,7 +3074,17 @@
</span><span class="cx">
</span><span class="cx"> Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
</span><span class="cx">
</span><del>- m_policyClient->decidePolicyForNewWindowAction(*this, *frame, navigationActionData, request, frameName, WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ RefPtr<API::FrameInfo> sourceFrameInfo;
+ if (frame)
+ sourceFrameInfo = API::FrameInfo::create(*frame);
+
+ auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), nullptr, request, request.url());
+
+ m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
+
+ } else
+ m_policyClient->decidePolicyForNewWindowAction(*this, *frame, navigationActionData, request, frameName, WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, uint64_t listenerID, const UserData& userData)
</span><span class="lines">@@ -3022,7 +3096,11 @@
</span><span class="cx">
</span><span class="cx"> Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
</span><span class="cx">
</span><del>- m_policyClient->decidePolicyForResponse(*this, *frame, response, request, canShowMIMEType, WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
</del><ins>+ if (m_navigationClient) {
+ auto navigationResponse = API::NavigationResponse::create(API::FrameInfo::create(*frame).get(), request, response, canShowMIMEType);
+ m_navigationClient->decidePolicyForNavigationResponse(*this, navigationResponse.get(), WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
+ } else
+ m_policyClient->decidePolicyForResponse(*this, *frame, response, request, canShowMIMEType, WTF::move(listener), m_process->transformHandlesToObjects(userData.object()).get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::decidePolicyForResponseSync(uint64_t frameID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, uint64_t listenerID, const UserData& userData, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
</span><span class="lines">@@ -3074,7 +3152,11 @@
</span><span class="cx"> MESSAGE_CHECK(frame);
</span><span class="cx"> MESSAGE_CHECK(frame->page() == this);
</span><span class="cx">
</span><del>- m_loaderClient->didNavigateWithNavigationData(*this, store, *frame);
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didNavigateWithNavigationData(*this, store);
+ } else
+ m_loaderClient->didNavigateWithNavigationData(*this, store, *frame);
</ins><span class="cx"> process().processPool().historyClient().didNavigateWithNavigationData(process().processPool(), *this, store, *frame);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3090,7 +3172,11 @@
</span><span class="cx"> MESSAGE_CHECK_URL(sourceURLString);
</span><span class="cx"> MESSAGE_CHECK_URL(destinationURLString);
</span><span class="cx">
</span><del>- m_loaderClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString, *frame);
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString);
+ } else
+ m_loaderClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString, *frame);
</ins><span class="cx"> process().processPool().historyClient().didPerformClientRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3106,7 +3192,11 @@
</span><span class="cx"> MESSAGE_CHECK_URL(sourceURLString);
</span><span class="cx"> MESSAGE_CHECK_URL(destinationURLString);
</span><span class="cx">
</span><del>- m_loaderClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString, *frame);
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString);
+ } else
+ m_loaderClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString, *frame);
</ins><span class="cx"> process().processPool().historyClient().didPerformServerRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3118,7 +3208,11 @@
</span><span class="cx">
</span><span class="cx"> MESSAGE_CHECK_URL(url);
</span><span class="cx">
</span><del>- m_loaderClient->didUpdateHistoryTitle(*this, title, url, *frame);
</del><ins>+ if (m_navigationClient) {
+ if (frame->isMainFrame())
+ m_navigationClient->didUpdateHistoryTitle(*this, title, url);
+ } else
+ m_loaderClient->didUpdateHistoryTitle(*this, title, url, *frame);
</ins><span class="cx"> process().processPool().historyClient().didUpdateHistoryTitle(process().processPool(), *this, title, url, *frame);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4513,7 +4607,10 @@
</span><span class="cx">
</span><span class="cx"> navigationState().clearAllNavigations();
</span><span class="cx">
</span><del>- m_loaderClient->processDidCrash(*this);
</del><ins>+ if (m_navigationClient)
+ m_navigationClient->processDidCrash(*this);
+ else
+ m_loaderClient->processDidCrash(*this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::resetState(ResetStateReason resetStateReason)
</span><span class="lines">@@ -4740,7 +4837,10 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
</span><span class="cx">
</span><del>- canAuthenticate = m_loaderClient->canAuthenticateAgainstProtectionSpaceInFrame(*this, *frame, protectionSpace.get());
</del><ins>+ if (m_navigationClient)
+ canAuthenticate = m_navigationClient->canAuthenticateAgainstProtectionSpace(*this, protectionSpace.get());
+ else
+ canAuthenticate = m_loaderClient->canAuthenticateAgainstProtectionSpaceInFrame(*this, *frame, protectionSpace.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
</span><span class="lines">@@ -4756,7 +4856,10 @@
</span><span class="cx"> MESSAGE_CHECK(frame);
</span><span class="cx">
</span><span class="cx"> RefPtr<AuthenticationChallengeProxy> authenticationChallenge = prpAuthenticationChallenge;
</span><del>- m_loaderClient->didReceiveAuthenticationChallengeInFrame(*this, *frame, authenticationChallenge.get());
</del><ins>+ if (m_navigationClient)
+ m_navigationClient->didReceiveAuthenticationChallenge(*this, authenticationChallenge.get());
+ else
+ m_loaderClient->didReceiveAuthenticationChallengeInFrame(*this, *frame, authenticationChallenge.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> reply)
</span><span class="lines">@@ -5238,7 +5341,10 @@
</span><span class="cx"> {
</span><span class="cx"> Vector<uint8_t> masterKey;
</span><span class="cx">
</span><del>- if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this))
</del><ins>+ if (m_navigationClient) {
+ if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this))
+ masterKey = keyData->dataReference().vector();
+ } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this))
</ins><span class="cx"> masterKey = keyData->dataReference().vector();
</span><span class="cx"> else if (!getDefaultWebCryptoMasterKey(masterKey)) {
</span><span class="cx"> succeeded = false;
</span><span class="lines">@@ -5252,7 +5358,10 @@
</span><span class="cx"> {
</span><span class="cx"> Vector<uint8_t> masterKey;
</span><span class="cx">
</span><del>- if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this))
</del><ins>+ if (m_navigationClient) {
+ if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this))
+ masterKey = keyData->dataReference().vector();
+ } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this))
</ins><span class="cx"> masterKey = keyData->dataReference().vector();
</span><span class="cx"> else if (!getDefaultWebCryptoMasterKey(masterKey)) {
</span><span class="cx"> succeeded = false;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -117,6 +117,7 @@
</span><span class="cx"> class FormClient;
</span><span class="cx"> class LoaderClient;
</span><span class="cx"> class Navigation;
</span><ins>+class NavigationClient;
</ins><span class="cx"> class PolicyClient;
</span><span class="cx"> class UIClient;
</span><span class="cx"> class URLRequest;
</span><span class="lines">@@ -314,6 +315,7 @@
</span><span class="cx"> void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>);
</span><span class="cx"> void initializeFindMatchesClient(const WKPageFindMatchesClientBase*);
</span><span class="cx"> void setFormClient(std::unique_ptr<API::FormClient>);
</span><ins>+ void setNavigationClient(std::unique_ptr<API::NavigationClient>);
</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">@@ -1371,6 +1373,7 @@
</span><span class="cx"> PageClient& m_pageClient;
</span><span class="cx"> std::unique_ptr<API::LoaderClient> m_loaderClient;
</span><span class="cx"> std::unique_ptr<API::PolicyClient> m_policyClient;
</span><ins>+ std::unique_ptr<API::NavigationClient> m_navigationClient;
</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 (179429 => 179430)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-01-31 01:23:56 UTC (rev 179429)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-01-31 01:28:05 UTC (rev 179430)
</span><span class="lines">@@ -645,6 +645,7 @@
</span><span class="cx">                 2DC6D9C318C44A610043BAD4 /* WKWebViewContentProviderRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */; };
</span><span class="cx">                 2DC6D9C418C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */; };
</span><span class="cx">                 2DD13BD518F7DADD00E130A1 /* FindControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DD13BD318F7DADD00E130A1 /* FindControllerIOS.mm */; };
</span><ins>+                2DD9EB2D1A6F012500BB1267 /* APINavigationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD9EB2C1A6F012500BB1267 /* APINavigationClient.h */; };
</ins><span class="cx">                 2DDE0AFA18298CC900F97EAA /* RemoteLayerTreePropertyApplier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE0AF818298CC900F97EAA /* RemoteLayerTreePropertyApplier.h */; };
</span><span class="cx">                 2DDE0AFB18298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE0AF918298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm */; };
</span><span class="cx">                 2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDF731318E95060004F5A66 /* RemoteLayerBackingStoreCollection.h */; };
</span><span class="lines">@@ -2756,6 +2757,7 @@
</span><span class="cx">                 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewContentProviderRegistry.h; sourceTree = "<group>"; };
</span><span class="cx">                 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewContentProviderRegistry.mm; sourceTree = "<group>"; };
</span><span class="cx">                 2DD13BD318F7DADD00E130A1 /* FindControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = FindControllerIOS.mm; path = ios/FindControllerIOS.mm; sourceTree = "<group>"; };
</span><ins>+                2DD9EB2C1A6F012500BB1267 /* APINavigationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APINavigationClient.h; sourceTree = "<group>"; };
</ins><span class="cx">                 2DDE0AF818298CC900F97EAA /* RemoteLayerTreePropertyApplier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreePropertyApplier.h; sourceTree = "<group>"; };
</span><span class="cx">                 2DDE0AF918298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreePropertyApplier.mm; sourceTree = "<group>"; };
</span><span class="cx">                 2DDF731318E95060004F5A66 /* RemoteLayerBackingStoreCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerBackingStoreCollection.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -6166,6 +6168,7 @@
</span><span class="cx">                                 7CD3A4801A5D02FA009623B8 /* APINavigation.cpp */,
</span><span class="cx">                                 7CD3A4811A5D02FA009623B8 /* APINavigation.h */,
</span><span class="cx">                                 2DF9EEEA1A7836EE00B6CFBE /* APINavigationAction.h */,
</span><ins>+                                2DD9EB2C1A6F012500BB1267 /* APINavigationClient.h */,
</ins><span class="cx">                                 BCF69FA11176D01400471A52 /* APINavigationData.cpp */,
</span><span class="cx">                                 BCF69FA01176D01400471A52 /* APINavigationData.h */,
</span><span class="cx">                                 2DF9EEED1A786EAD00B6CFBE /* APINavigationResponse.h */,
</span><span class="lines">@@ -7619,6 +7622,7 @@
</span><span class="cx">                                 517CF0E4163A486C00C2950E /* NetworkProcessConnectionMessages.h in Headers */,
</span><span class="cx">                                 51795571162877D200FA43B6 /* NetworkProcessCreationParameters.h in Headers */,
</span><span class="cx">                                 5163199516289A6300E22F00 /* NetworkProcessMessages.h in Headers */,
</span><ins>+                                2DD9EB2D1A6F012500BB1267 /* APINavigationClient.h in Headers */,
</ins><span class="cx">                                 E14A954A16E016A40068DE82 /* NetworkProcessPlatformStrategies.h in Headers */,
</span><span class="cx">                                 5179556E162877B300FA43B6 /* NetworkProcessProxy.h in Headers */,
</span><span class="cx">                                 513A163D163088F6005D7D22 /* NetworkProcessProxyMessages.h in Headers */,
</span></span></pre>
</div>
</div>
</body>
</html>