Diff
Modified: trunk/Source/WebKit/ChangeLog (219870 => 219871)
--- trunk/Source/WebKit/ChangeLog 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/ChangeLog 2017-07-25 17:17:55 UTC (rev 219871)
@@ -1,3 +1,54 @@
+2017-07-25 Alex Christensen <achristen...@webkit.org>
+
+ Modernize NavigationAction code
+ https://bugs.webkit.org/show_bug.cgi?id=174807
+
+ Reviewed by Darin Adler.
+
+ Mostly just use more move semantics.
+
+ * Platform/IPC/HandleMessage.h:
+ (IPC::callMemberFunctionImpl):
+ * Shared/API/APIURLRequest.h:
+ * Shared/NavigationActionData.h:
+ * UIProcess/API/APINavigation.cpp:
+ (API::Navigation::Navigation):
+ * UIProcess/API/APINavigation.h:
+ (API::Navigation::create):
+ * UIProcess/API/APINavigationAction.h:
+ * UIProcess/API/APINavigationClient.h:
+ (API::NavigationClient::decidePolicyForNavigationAction):
+ * UIProcess/API/APIPolicyClient.h:
+ * UIProcess/API/APIUIClient.h:
+ (API::UIClient::createNewPage):
+ (API::UIClient::createNewPageAsync):
+ (API::UIClient::canCreateNewPageAsync):
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageLoadURLRequest):
+ (WKPageLoadURLRequestWithUserData):
+ (WKPageSetPageUIClient):
+ (WKPageSetPageNavigationClient):
+ * UIProcess/Cocoa/NavigationState.h:
+ * UIProcess/Cocoa/NavigationState.mm:
+ (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
+ * UIProcess/Cocoa/UIDelegate.h:
+ * UIProcess/Cocoa/UIDelegate.mm:
+ (WebKit::UIDelegate::UIClient::createNewPageCommon):
+ (WebKit::UIDelegate::UIClient::createNewPage):
+ (WebKit::UIDelegate::UIClient::canCreateNewPageAsync):
+ (WebKit::UIDelegate::UIClient::createNewPageAsync):
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::decidePolicyForNavigationAction):
+ * UIProcess/WebNavigationState.cpp:
+ (WebKit::WebNavigationState::createLoadRequestNavigation):
+ * UIProcess/WebNavigationState.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::loadRequest):
+ (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+ (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
+ (WebKit::WebPageProxy::createNewPage):
+ * UIProcess/WebPageProxy.h:
+
2017-07-25 Carlos Garcia Campos <cgar...@igalia.com>
REGRESSION(r218629): [GTK] ASSERTION FAILED: m_eglDisplay == EGL_NO_DISPLAY in WebCore::PlatformDisplay::~PlatformDisplay
Modified: trunk/Source/WebKit/Platform/IPC/HandleMessage.h (219870 => 219871)
--- trunk/Source/WebKit/Platform/IPC/HandleMessage.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/Platform/IPC/HandleMessage.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -65,7 +65,7 @@
template <typename C, typename MF, typename R, typename ArgsTuple, size_t... ArgsIndex>
void callMemberFunctionImpl(C* object, MF function, Ref<R>&& delayedReply, ArgsTuple&& args, std::index_sequence<ArgsIndex...>)
{
- (object->*function)(std::get<ArgsIndex>(args)..., WTFMove(delayedReply));
+ (object->*function)(std::get<ArgsIndex>(std::forward<ArgsTuple>(args))..., WTFMove(delayedReply));
}
template<typename C, typename MF, typename R, typename ArgsTuple, typename ArgsIndicies = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
Modified: trunk/Source/WebKit/Shared/API/APIURLRequest.h (219870 => 219871)
--- trunk/Source/WebKit/Shared/API/APIURLRequest.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/Shared/API/APIURLRequest.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef APIURLRequest_h
-#define APIURLRequest_h
+#pragma once
#include "APIObject.h"
#include <WebCore/ResourceRequest.h>
@@ -59,5 +58,3 @@
};
} // namespace API
-
-#endif // APIURLRequest_h
Modified: trunk/Source/WebKit/Shared/NavigationActionData.h (219870 => 219871)
--- trunk/Source/WebKit/Shared/NavigationActionData.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/Shared/NavigationActionData.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef NavigationActionData_h
-#define NavigationActionData_h
+#pragma once
#include "WebEvent.h"
#include <WebCore/FloatPoint.h>
@@ -53,5 +52,3 @@
};
}
-
-#endif // NavigationActionData_h
Modified: trunk/Source/WebKit/UIProcess/API/APINavigation.cpp (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/APINavigation.cpp 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/APINavigation.cpp 2017-07-25 17:17:55 UTC (rev 219871)
@@ -35,9 +35,9 @@
{
}
-Navigation::Navigation(WebKit::WebNavigationState& state, const WebCore::ResourceRequest& request)
+Navigation::Navigation(WebKit::WebNavigationState& state, WebCore::ResourceRequest&& request)
: m_navigationID(state.generateNavigationID())
- , m_request(request)
+ , m_request(WTFMove(request))
{
}
Modified: trunk/Source/WebKit/UIProcess/API/APINavigation.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/APINavigation.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/APINavigation.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef APINavigation_h
-#define APINavigation_h
+#pragma once
#include "APIObject.h"
#include <WebCore/ResourceRequest.h>
@@ -43,9 +42,9 @@
return adoptRef(*new Navigation(state));
}
- static Ref<Navigation> create(WebKit::WebNavigationState& state, const WebCore::ResourceRequest& request)
+ static Ref<Navigation> create(WebKit::WebNavigationState& state, WebCore::ResourceRequest&& request)
{
- return adoptRef(*new Navigation(state, request));
+ return adoptRef(*new Navigation(state, WTFMove(request)));
}
virtual ~Navigation();
@@ -56,7 +55,7 @@
private:
explicit Navigation(WebKit::WebNavigationState&);
- explicit Navigation(WebKit::WebNavigationState&, const WebCore::ResourceRequest&);
+ explicit Navigation(WebKit::WebNavigationState&, WebCore::ResourceRequest&&);
uint64_t m_navigationID;
WebCore::ResourceRequest m_request;
@@ -63,6 +62,3 @@
};
} // namespace API
-
-
-#endif // APINavigation_h
Modified: trunk/Source/WebKit/UIProcess/API/APINavigationAction.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/APINavigationAction.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/APINavigationAction.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef APINavigationAction_h
-#define APINavigationAction_h
+#pragma once
#include "APIFrameInfo.h"
#include "APIObject.h"
@@ -37,22 +36,11 @@
class NavigationAction final : public ObjectImpl<Object::Type::NavigationAction> {
public:
- static Ref<NavigationAction> create(const WebKit::NavigationActionData& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, const WebCore::ResourceRequest& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction> userInitiatedAction)
+ static Ref<NavigationAction> create(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, WebCore::ResourceRequest&& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction)
{
- return adoptRef(*new NavigationAction(navigationActionData, sourceFrame, targetFrame, request, originalURL, shouldOpenAppLinks, WTFMove(userInitiatedAction)));
+ return adoptRef(*new NavigationAction(WTFMove(navigationActionData), sourceFrame, targetFrame, WTFMove(request), originalURL, shouldOpenAppLinks, WTFMove(userInitiatedAction)));
}
- NavigationAction(const WebKit::NavigationActionData& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, const WebCore::ResourceRequest& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction> userInitiatedAction)
- : m_sourceFrame(sourceFrame)
- , m_targetFrame(targetFrame)
- , m_request(request)
- , m_originalURL(originalURL)
- , m_shouldOpenAppLinks(shouldOpenAppLinks)
- , m_userInitiatedAction(WTFMove(userInitiatedAction))
- , m_navigationActionData(navigationActionData)
- {
- }
-
FrameInfo* sourceFrame() const { return m_sourceFrame.get(); }
FrameInfo* targetFrame() const { return m_targetFrame.get(); }
@@ -73,6 +61,17 @@
UserInitiatedAction* userInitiatedAction() const { return m_userInitiatedAction.get(); }
private:
+ NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, WebCore::ResourceRequest&& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction)
+ : m_sourceFrame(sourceFrame)
+ , m_targetFrame(targetFrame)
+ , m_request(WTFMove(request))
+ , m_originalURL(originalURL)
+ , m_shouldOpenAppLinks(shouldOpenAppLinks)
+ , m_userInitiatedAction(WTFMove(userInitiatedAction))
+ , m_navigationActionData(WTFMove(navigationActionData))
+ {
+ }
+
RefPtr<FrameInfo> m_sourceFrame;
RefPtr<FrameInfo> m_targetFrame;
@@ -87,5 +86,3 @@
};
} // namespace API
-
-#endif // APINavigationAction_h
Modified: trunk/Source/WebKit/UIProcess/API/APINavigationClient.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/APINavigationClient.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/APINavigationClient.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -67,16 +67,16 @@
public:
virtual ~NavigationClient() { }
- virtual void didStartProvisionalNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*) { }
- virtual void didReceiveServerRedirectForProvisionalNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*) { }
- virtual void didPerformClientRedirectForNavigation(WebKit::WebPageProxy&, API::Navigation*) { }
- virtual void didFailProvisionalNavigationWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Navigation*, const WebCore::ResourceError&, API::Object*) { }
- virtual void didFailProvisionalLoadInSubframeWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, const WebCore::SecurityOriginData&, 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 didStartProvisionalNavigation(WebKit::WebPageProxy&, Navigation*, Object*) { }
+ virtual void didReceiveServerRedirectForProvisionalNavigation(WebKit::WebPageProxy&, Navigation*, Object*) { }
+ virtual void didPerformClientRedirectForNavigation(WebKit::WebPageProxy&, Navigation*) { }
+ virtual void didFailProvisionalNavigationWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, Navigation*, const WebCore::ResourceError&, Object*) { }
+ virtual void didFailProvisionalLoadInSubframeWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, const WebCore::SecurityOriginData&, Navigation*, const WebCore::ResourceError&, Object*) { }
+ virtual void didCommitNavigation(WebKit::WebPageProxy&, Navigation*, Object*) { }
+ virtual void didFinishDocumentLoad(WebKit::WebPageProxy&, Navigation*, Object*) { }
+ virtual void didFinishNavigation(WebKit::WebPageProxy&, Navigation*, Object*) { }
+ virtual void didFailNavigationWithError(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, Navigation*, const WebCore::ResourceError&, Object*) { }
+ virtual void didSameDocumentNavigation(WebKit::WebPageProxy&, Navigation*, WebKit::SameDocumentNavigationType, Object*) { }
virtual void renderingProgressDidChange(WebKit::WebPageProxy&, WebCore::LayoutMilestones) { }
@@ -95,18 +95,18 @@
virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&) { }
#endif
- virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy&, API::NavigationAction&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object*)
+ virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy&, Ref<NavigationAction>&&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, Object*)
{
listener->use({ });
}
- virtual void decidePolicyForNavigationResponse(WebKit::WebPageProxy&, API::NavigationResponse&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object*)
+ virtual void decidePolicyForNavigationResponse(WebKit::WebPageProxy&, NavigationResponse&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, Object*)
{
listener->use({ });
}
#if ENABLE(NETSCAPE_PLUGIN_API)
- virtual WebKit::PluginModuleLoadPolicy decidePolicyForPluginLoad(WebKit::WebPageProxy&, WebKit::PluginModuleLoadPolicy currentPluginLoadPolicy, API::Dictionary*, WTF::String&)
+ virtual WebKit::PluginModuleLoadPolicy decidePolicyForPluginLoad(WebKit::WebPageProxy&, WebKit::PluginModuleLoadPolicy currentPluginLoadPolicy, Dictionary*, WTF::String&)
{
return currentPluginLoadPolicy;
}
Modified: trunk/Source/WebKit/UIProcess/API/APIPolicyClient.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/APIPolicyClient.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/APIPolicyClient.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef APIPolicyClient_h
-#define APIPolicyClient_h
+#pragma once
#include "WebEvent.h"
#include "WebFramePolicyListenerProxy.h"
@@ -68,5 +67,3 @@
};
} // namespace API
-
-#endif // APIPolicyClient_h
Modified: trunk/Source/WebKit/UIProcess/API/APIUIClient.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/APIUIClient.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/APIUIClient.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -72,8 +72,9 @@
public:
virtual ~UIClient() { }
- virtual RefPtr<WebKit::WebPageProxy> createNewPage(WebKit::WebPageProxy*, API::FrameInfo&, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const WebKit::NavigationActionData&) { return nullptr; }
- virtual bool createNewPageAsync(WebKit::WebPageProxy*, API::FrameInfo&, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const WebKit::NavigationActionData&, WTF::Function<void (RefPtr<WebKit::WebPageProxy>)>&& completionHandler) { return false; }
+ virtual RefPtr<WebKit::WebPageProxy> createNewPage(WebKit::WebPageProxy*, FrameInfo&, WebCore::ResourceRequest&&, const WebCore::WindowFeatures&, WebKit::NavigationActionData&&) { return nullptr; }
+ virtual void createNewPageAsync(WebKit::WebPageProxy*, FrameInfo&, WebCore::ResourceRequest&&, const WebCore::WindowFeatures&, WebKit::NavigationActionData&&, WTF::Function<void(RefPtr<WebKit::WebPageProxy>&&)>&& completionHandler) { }
+ virtual bool canCreateNewPageAsync() { return false; }
virtual void showPage(WebKit::WebPageProxy*) { }
virtual void fullscreenMayReturnToInline(WebKit::WebPageProxy*) { }
virtual void didEnterFullscreen(WebKit::WebPageProxy*) { }
@@ -90,9 +91,9 @@
virtual void runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*, const WebCore::SecurityOriginData&, Function<void (const WTF::String&)>&& completionHandler) { completionHandler(WTF::String()); }
virtual void setStatusText(WebKit::WebPageProxy*, const WTF::String&) { }
- virtual void mouseDidMoveOverElement(WebKit::WebPageProxy*, const WebKit::WebHitTestResultData&, WebKit::WebEvent::Modifiers, API::Object*) { }
+ virtual void mouseDidMoveOverElement(WebKit::WebPageProxy*, const WebKit::WebHitTestResultData&, WebKit::WebEvent::Modifiers, Object*) { }
#if ENABLE(NETSCAPE_PLUGIN_API)
- virtual void unavailablePluginButtonClicked(WebKit::WebPageProxy*, WKPluginUnavailabilityReason, API::Dictionary*) { }
+ virtual void unavailablePluginButtonClicked(WebKit::WebPageProxy*, WKPluginUnavailabilityReason, Dictionary*) { }
#endif // ENABLE(NETSCAPE_PLUGIN_API)
virtual bool implementsDidNotHandleKeyEvent() const { return false; }
@@ -144,7 +145,7 @@
virtual bool canRunModal() const { return false; }
virtual void runModal(WebKit::WebPageProxy*) { }
- virtual void saveDataToFileInDownloadsFolder(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, const WTF::String&, API::Data*) { }
+ virtual void saveDataToFileInDownloadsFolder(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, const WTF::String&, Data*) { }
virtual void pinnedStateDidChange(WebKit::WebPageProxy&) { }
@@ -173,7 +174,7 @@
virtual void didLosePointerLock(WebKit::WebPageProxy*) { }
#endif
- virtual void didClickAutoFillButton(WebKit::WebPageProxy&, API::Object*) { }
+ virtual void didClickAutoFillButton(WebKit::WebPageProxy&, Object*) { }
virtual void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&) { }
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp 2017-07-25 17:17:55 UTC (rev 219871)
@@ -167,12 +167,14 @@
void WKPageLoadURLRequest(WKPageRef pageRef, WKURLRequestRef urlRequestRef)
{
- toImpl(pageRef)->loadRequest(toImpl(urlRequestRef)->resourceRequest());
+ auto resourceRequest = toImpl(urlRequestRef)->resourceRequest();
+ toImpl(pageRef)->loadRequest(WTFMove(resourceRequest));
}
void WKPageLoadURLRequestWithUserData(WKPageRef pageRef, WKURLRequestRef urlRequestRef, WKTypeRef userDataRef)
{
- toImpl(pageRef)->loadRequest(toImpl(urlRequestRef)->resourceRequest(), ShouldOpenExternalURLsPolicy::ShouldNotAllow, toImpl(userDataRef));
+ auto resourceRequest = toImpl(urlRequestRef)->resourceRequest();
+ toImpl(pageRef)->loadRequest(WTFMove(resourceRequest), ShouldOpenExternalURLsPolicy::ShouldNotAllow, toImpl(userDataRef));
}
void WKPageLoadFile(WKPageRef pageRef, WKURLRef fileURL, WKURLRef resourceDirectoryURL)
@@ -1563,7 +1565,7 @@
}
private:
- RefPtr<WebPageProxy> createNewPage(WebPageProxy* page, API::FrameInfo& sourceFrameInfo, const ResourceRequest& resourceRequest, const WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData) override
+ RefPtr<WebPageProxy> createNewPage(WebPageProxy* page, API::FrameInfo& sourceFrameInfo, ResourceRequest&& resourceRequest, const WindowFeatures& windowFeatures, NavigationActionData&& navigationActionData) final
{
if (m_client.createNewPage) {
auto configuration = page->configuration().copy();
@@ -1571,7 +1573,7 @@
auto userInitiatedActivity = page->process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo.request().url(), resourceRequest.url());
- auto apiNavigationAction = API::NavigationAction::create(navigationActionData, &sourceFrameInfo, nullptr, resourceRequest, WebCore::URL(), shouldOpenAppLinks, userInitiatedActivity);
+ auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), &sourceFrameInfo, nullptr, WTFMove(resourceRequest), WebCore::URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
@@ -2157,13 +2159,13 @@
}
private:
- void decidePolicyForNavigationAction(WebPageProxy& page, API::NavigationAction& navigationAction, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
+ void decidePolicyForNavigationAction(WebPageProxy& page, Ref<API::NavigationAction>&& navigationAction, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object* userData) final
{
if (!m_client.decidePolicyForNavigationAction) {
listener->use({ });
return;
}
- m_client.decidePolicyForNavigationAction(toAPI(&page), toAPI(&navigationAction), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
+ m_client.decidePolicyForNavigationAction(toAPI(&page), toAPI(navigationAction.ptr()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
}
void decidePolicyForNavigationResponse(WebPageProxy& page, API::NavigationResponse& navigationResponse, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp 2017-07-25 17:17:55 UTC (rev 219871)
@@ -46,7 +46,7 @@
}
private:
- RefPtr<WebPageProxy> createNewPage(WebPageProxy*, API::FrameInfo&, const WebCore::ResourceRequest& resourceRequest, const WebCore::WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData) override
+ RefPtr<WebPageProxy> createNewPage(WebPageProxy*, API::FrameInfo&, WebCore::ResourceRequest&& resourceRequest, const WebCore::WindowFeatures& windowFeatures, NavigationActionData&& navigationActionData) override
{
GRefPtr<WebKitURIRequest> request = adoptGRef(webkitURIRequestCreateForResourceRequest(resourceRequest));
WebKitNavigationAction navigationAction(request.get(), navigationActionData);
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2017-07-25 17:17:55 UTC (rev 219871)
@@ -2504,7 +2504,7 @@
ResourceRequest resourceRequest;
webkitURIRequestGetResourceRequest(request, resourceRequest);
- getPage(webView).loadRequest(resourceRequest);
+ getPage(webView).loadRequest(WTFMove(resourceRequest));
}
/**
Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -115,7 +115,7 @@
void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&) override;
#endif
- void decidePolicyForNavigationAction(WebPageProxy&, API::NavigationAction&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
+ void decidePolicyForNavigationAction(WebPageProxy&, Ref<API::NavigationAction>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
void decidePolicyForNavigationResponse(WebPageProxy&, API::NavigationResponse&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
NavigationState& m_navigationState;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2017-07-25 17:17:55 UTC (rev 219871)
@@ -304,16 +304,16 @@
#endif
}
-void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageProxy& webPageProxy, API::NavigationAction& navigationAction, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
+void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageProxy& webPageProxy, Ref<API::NavigationAction>&& navigationAction, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
{
String mainFrameURLString = webPageProxy.mainFrame()->url();
if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler
&& !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies) {
- RefPtr<API::NavigationAction> localNavigationAction = &navigationAction;
+ Ref<API::NavigationAction> localNavigationAction = navigationAction.copyRef();
RefPtr<WebFramePolicyListenerProxy> localListener = WTFMove(listener);
- tryAppLink(WTFMove(localNavigationAction), mainFrameURLString, [webPage = RefPtr<WebPageProxy>(&webPageProxy), localListener, localNavigationAction = RefPtr<API::NavigationAction>(&navigationAction)] (bool followedLinkToApp) {
+ tryAppLink(WTFMove(localNavigationAction), mainFrameURLString, [webPage = RefPtr<WebPageProxy>(&webPageProxy), localListener, localNavigationAction = navigationAction.copyRef()] (bool followedLinkToApp) {
if (followedLinkToApp) {
localListener->ignore();
return;
@@ -353,7 +353,7 @@
RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), delegateHasWebsitePolicies ? @selector(_webView:decidePolicyForNavigationAction:decisionHandler:) : @selector(webView:decidePolicyForNavigationAction:decisionHandler:));
- auto decisionHandlerWithPolicies = [localListener = RefPtr<WebFramePolicyListenerProxy>(WTFMove(listener)), localNavigationAction = RefPtr<API::NavigationAction>(&navigationAction), checker = WTFMove(checker), mainFrameURLString](WKNavigationActionPolicy actionPolicy, _WKWebsitePolicies *websitePolicies) mutable {
+ auto decisionHandlerWithPolicies = [localListener = RefPtr<WebFramePolicyListenerProxy>(WTFMove(listener)), localNavigationAction = navigationAction.copyRef(), checker = WTFMove(checker), mainFrameURLString](WKNavigationActionPolicy actionPolicy, _WKWebsitePolicies *websitePolicies) mutable {
if (checker->completionHandlerHasBeenCalled())
return;
checker->didCallCompletionHandler();
@@ -393,12 +393,12 @@
};
if (delegateHasWebsitePolicies)
- [(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:decisionHandlerWithPolicies];
+ [(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:BlockPtr<void(WKNavigationActionPolicy, _WKWebsitePolicies *)>::fromCallable(WTFMove(decisionHandlerWithPolicies)).get()];
else {
- auto decisionHandlerWithoutPolicies = [decisionHandlerWithPolicies] (WKNavigationActionPolicy actionPolicy) mutable {
+ auto decisionHandlerWithoutPolicies = [decisionHandlerWithPolicies = WTFMove(decisionHandlerWithPolicies)] (WKNavigationActionPolicy actionPolicy) mutable {
decisionHandlerWithPolicies(actionPolicy, nil);
};
- [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:decisionHandlerWithoutPolicies];
+ [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) decisionHandler:BlockPtr<void(WKNavigationActionPolicy)>::fromCallable(WTFMove(decisionHandlerWithoutPolicies)).get()];
}
}
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -79,9 +79,10 @@
private:
// API::UIClient
- RefPtr<WebKit::WebPageProxy> createNewPage(WebKit::WebPageProxy*, API::FrameInfo&, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const WebKit::NavigationActionData&) override;
- bool createNewPageAsync(WebKit::WebPageProxy*, API::FrameInfo&, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const WebKit::NavigationActionData&, WTF::Function<void (RefPtr<WebKit::WebPageProxy>)>&& completionHandler) override;
- RefPtr<WebKit::WebPageProxy> createNewPageCommon(WebKit::WebPageProxy*, API::FrameInfo&, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const WebKit::NavigationActionData&, WTF::Function<void (RefPtr<WebKit::WebPageProxy>)>&& completionHandler);
+ RefPtr<WebKit::WebPageProxy> createNewPage(WebKit::WebPageProxy*, API::FrameInfo&, WebCore::ResourceRequest&&, const WebCore::WindowFeatures&, WebKit::NavigationActionData&&) override;
+ void createNewPageAsync(WebKit::WebPageProxy*, API::FrameInfo&, WebCore::ResourceRequest&&, const WebCore::WindowFeatures&, WebKit::NavigationActionData&&, WTF::Function<void(RefPtr<WebKit::WebPageProxy>&&)>&& completionHandler) final;
+ bool canCreateNewPageAsync() final;
+ RefPtr<WebKit::WebPageProxy> createNewPageCommon(WebKit::WebPageProxy*, API::FrameInfo&, WebCore::ResourceRequest&&, const WebCore::WindowFeatures&, WebKit::NavigationActionData&&, WTF::Function<void(RefPtr<WebKit::WebPageProxy>&&)>&& completionHandler);
void close(WebKit::WebPageProxy*) override;
void fullscreenMayReturnToInline(WebKit::WebPageProxy*) override;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm 2017-07-25 17:17:55 UTC (rev 219871)
@@ -174,7 +174,7 @@
{
}
-RefPtr<WebKit::WebPageProxy> UIDelegate::UIClient::createNewPageCommon(WebKit::WebPageProxy* page, API::FrameInfo& sourceFrameInfo, const WebCore::ResourceRequest& request, const WebCore::WindowFeatures& windowFeatures, const WebKit::NavigationActionData& navigationActionData, WTF::Function<void (RefPtr<WebKit::WebPageProxy>)>&& completionHandler)
+RefPtr<WebKit::WebPageProxy> UIDelegate::UIClient::createNewPageCommon(WebKit::WebPageProxy* page, API::FrameInfo& sourceFrameInfo, WebCore::ResourceRequest&& request, const WebCore::WindowFeatures& windowFeatures, WebKit::NavigationActionData&& navigationActionData, WTF::Function<void(RefPtr<WebKit::WebPageProxy>&&)>&& completionHandler)
{
auto delegate = m_uiDelegate.m_delegate.get();
ASSERT(delegate);
@@ -184,7 +184,7 @@
auto userInitiatedActivity = page->process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo.request().url(), request.url());
- auto apiNavigationAction = API::NavigationAction::create(navigationActionData, &sourceFrameInfo, nullptr, request, WebCore::URL(), shouldOpenAppLinks, userInitiatedActivity);
+ auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), &sourceFrameInfo, nullptr, WTFMove(request), WebCore::URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
@@ -221,7 +221,7 @@
return webView->_page.get();
}
-RefPtr<WebKit::WebPageProxy> UIDelegate::UIClient::createNewPage(WebKit::WebPageProxy* page, API::FrameInfo& originatingFrameInfo, const WebCore::ResourceRequest& request, const WebCore::WindowFeatures& windowFeatures, const WebKit::NavigationActionData& navigationActionData)
+RefPtr<WebPageProxy> UIDelegate::UIClient::createNewPage(WebPageProxy* page, API::FrameInfo& originatingFrameInfo, WebCore::ResourceRequest&& request, const WebCore::WindowFeatures& windowFeatures, NavigationActionData&& navigationActionData)
{
if (!m_uiDelegate.m_delegateMethods.webViewCreateWebViewWithConfigurationForNavigationActionWindowFeatures)
return nullptr;
@@ -230,21 +230,24 @@
if (!delegate)
return nullptr;
- return createNewPageCommon(page, originatingFrameInfo, request, windowFeatures, navigationActionData, nullptr);
+ return createNewPageCommon(page, originatingFrameInfo, WTFMove(request), windowFeatures, WTFMove(navigationActionData), nullptr);
}
-bool UIDelegate::UIClient::createNewPageAsync(WebKit::WebPageProxy* page, API::FrameInfo& originatingFrameInfo, const WebCore::ResourceRequest& request, const WebCore::WindowFeatures& windowFeatures, const WebKit::NavigationActionData& navigationActionData, WTF::Function<void (RefPtr<WebKit::WebPageProxy>)>&& completionHandler)
+bool UIDelegate::UIClient::canCreateNewPageAsync()
{
- if (!m_uiDelegate.m_delegateMethods.webViewCreateWebViewWithConfigurationForNavigationActionWindowFeaturesAsync)
- return false;
+ return m_uiDelegate.m_delegateMethods.webViewCreateWebViewWithConfigurationForNavigationActionWindowFeaturesAsync
+ && m_uiDelegate.m_delegate.get();
+}
+void UIDelegate::UIClient::createNewPageAsync(WebPageProxy* page, API::FrameInfo& originatingFrameInfo, WebCore::ResourceRequest&& request, const WebCore::WindowFeatures& windowFeatures, NavigationActionData&& navigationActionData, WTF::Function<void(RefPtr<WebPageProxy>&&)>&& completionHandler)
+{
+ ASSERT(canCreateNewPageAsync());
+ ASSERT(m_uiDelegate.m_delegateMethods.webViewCreateWebViewWithConfigurationForNavigationActionWindowFeaturesAsync);
+
auto delegate = m_uiDelegate.m_delegate.get();
- if (!delegate)
- return false;
+ ASSERT(delegate);
- createNewPageCommon(page, originatingFrameInfo, request, windowFeatures, navigationActionData, WTFMove(completionHandler));
-
- return true;
+ createNewPageCommon(page, originatingFrameInfo, WTFMove(request), windowFeatures, WTFMove(navigationActionData), WTFMove(completionHandler));
}
void UIDelegate::UIClient::runJavaScriptAlert(WebKit::WebPageProxy*, const WTF::String& message, WebKit::WebFrameProxy* webFrameProxy, const WebCore::SecurityOriginData& securityOriginData, Function<void ()>&& completionHandler)
Modified: trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp 2017-07-25 17:17:55 UTC (rev 219871)
@@ -358,7 +358,7 @@
toImpl(listenerRef)->ignore();
// And instead load it in the inspected page.
- webInspectorProxy->inspectedPage()->loadRequest(request);
+ webInspectorProxy->inspectedPage()->loadRequest(WTFMove(request));
}
static void getContextMenuFromProposedMenu(WKPageRef pageRef, WKArrayRef proposedMenuRef, WKArrayRef* newMenuRef, WKHitTestResultRef, WKTypeRef, const void*)
Modified: trunk/Source/WebKit/UIProcess/WebNavigationState.cpp (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/WebNavigationState.cpp 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/WebNavigationState.cpp 2017-07-25 17:17:55 UTC (rev 219871)
@@ -40,9 +40,9 @@
{
}
-Ref<API::Navigation> WebNavigationState::createLoadRequestNavigation(const WebCore::ResourceRequest& request)
+Ref<API::Navigation> WebNavigationState::createLoadRequestNavigation(WebCore::ResourceRequest&& request)
{
- auto navigation = API::Navigation::create(*this, request);
+ auto navigation = API::Navigation::create(*this, WTFMove(request));
m_navigations.set(navigation->navigationID(), navigation.ptr());
Modified: trunk/Source/WebKit/UIProcess/WebNavigationState.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/WebNavigationState.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/WebNavigationState.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebNavigationState_h
-#define WebNavigationState_h
+#pragma once
#include <wtf/HashMap.h>
#include <wtf/Ref.h>
@@ -48,7 +47,7 @@
~WebNavigationState();
Ref<API::Navigation> createBackForwardNavigation();
- Ref<API::Navigation> createLoadRequestNavigation(const WebCore::ResourceRequest&);
+ Ref<API::Navigation> createLoadRequestNavigation(WebCore::ResourceRequest&&);
Ref<API::Navigation> createReloadNavigation();
Ref<API::Navigation> createLoadDataNavigation();
@@ -68,5 +67,3 @@
};
} // namespace WebKit
-
-#endif // WebNavigationState_h
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2017-07-25 17:17:55 UTC (rev 219871)
@@ -819,16 +819,17 @@
}
#endif
-RefPtr<API::Navigation> WebPageProxy::loadRequest(const ResourceRequest& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData)
+RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData)
{
if (m_isClosed)
return nullptr;
- auto navigation = m_navigationState->createLoadRequestNavigation(request);
+ auto navigation = m_navigationState->createLoadRequestNavigation(ResourceRequest(request));
auto transaction = m_pageLoadState.transaction();
- m_pageLoadState.setPendingAPIRequestURL(transaction, request.url());
+ auto url = ""
+ m_pageLoadState.setPendingAPIRequestURL(transaction, url);
if (!isValid())
reattachToWebProcess();
@@ -835,10 +836,10 @@
LoadParameters loadParameters;
loadParameters.navigationID = navigation->navigationID();
- loadParameters.request = request;
+ loadParameters.request = WTFMove(request);
loadParameters.shouldOpenExternalURLsPolicy = (uint64_t)shouldOpenExternalURLsPolicy;
loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get());
- bool createdExtension = maybeInitializeSandboxExtensionHandle(request.url(), loadParameters.sandboxExtensionHandle);
+ bool createdExtension = maybeInitializeSandboxExtensionHandle(url, loadParameters.sandboxExtensionHandle);
if (createdExtension)
m_process->willAcquireUniversalFileReadSandboxExtension();
addPlatformLoadParameters(loadParameters);
@@ -3617,7 +3618,7 @@
m_frameSetLargestFrame = value ? m_mainFrame : 0;
}
-void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const NavigationActionData& navigationActionData, const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, const ResourceRequest& request, uint64_t listenerID, const UserData& userData, Ref<Messages::WebPageProxy::DecidePolicyForNavigationAction::DelayedReply>&& reply)
+void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&& navigationActionData, const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, ResourceRequest&& request, uint64_t listenerID, const UserData& userData, Ref<Messages::WebPageProxy::DecidePolicyForNavigationAction::DelayedReply>&& reply)
{
PageClientProtector protector(m_pageClient);
@@ -3635,7 +3636,7 @@
m_newNavigationID = 0;
Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
if (!navigationID && frame->isMainFrame()) {
- auto navigation = m_navigationState->createLoadRequestNavigation(request);
+ auto navigation = m_navigationState->createLoadRequestNavigation(ResourceRequest(request));
m_newNavigationID = navigation->navigationID();
listener->setNavigation(WTFMove(navigation));
}
@@ -3656,26 +3657,26 @@
WebFrameProxy* originatingFrame = m_process->webFrame(originatingFrameInfoData.frameID);
if (m_navigationClient) {
- RefPtr<API::FrameInfo> destinationFrameInfo = API::FrameInfo::create(*frame, frameSecurityOrigin.securityOrigin());
+ auto destinationFrameInfo = API::FrameInfo::create(*frame, frameSecurityOrigin.securityOrigin());
RefPtr<API::FrameInfo> sourceFrameInfo;
if (!fromAPI && originatingFrame == frame)
- sourceFrameInfo = destinationFrameInfo;
+ sourceFrameInfo = destinationFrameInfo.copyRef();
else if (!fromAPI)
sourceFrameInfo = API::FrameInfo::create(originatingFrameInfoData, originatingPageID ? m_process->webPage(originatingPageID) : nullptr);
auto userInitiatedActivity = m_process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
- bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision && (!destinationFrameInfo || destinationFrameInfo->isMainFrame()) && !hostsAreEqual(URL(ParsedURLString, m_mainFrame->url()), request.url()) && navigationActionData.navigationType != WebCore::NavigationType::BackForward;
+ bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision && destinationFrameInfo->isMainFrame() && !hostsAreEqual(URL(ParsedURLString, m_mainFrame->url()), request.url()) && navigationActionData.navigationType != WebCore::NavigationType::BackForward;
- auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), destinationFrameInfo.get(), request, originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
+ auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
- m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
+ m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navigationAction), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
} else
- m_policyClient->decidePolicyForNavigationAction(*this, frame, navigationActionData, originatingFrame, originalRequest, request, WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
+ m_policyClient->decidePolicyForNavigationAction(*this, frame, WTFMove(navigationActionData), originatingFrame, originalRequest, WTFMove(request), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false;
}
-void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, const NavigationActionData& navigationActionData, const ResourceRequest& request, const String& frameName, uint64_t listenerID, const UserData& userData)
+void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, NavigationActionData&& navigationActionData, ResourceRequest&& request, const String& frameName, uint64_t listenerID, const UserData& userData)
{
PageClientProtector protector(m_pageClient);
@@ -3692,7 +3693,7 @@
auto userInitiatedActivity = m_process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
bool shouldOpenAppLinks = !hostsAreEqual(URL(ParsedURLString, m_mainFrame->url()), request.url());
- auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), nullptr, request, request.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
+ auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), nullptr, WTFMove(request), request.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
@@ -3832,7 +3833,7 @@
// UIClient
-void WebPageProxy::createNewPage(const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, const ResourceRequest& request, const WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData, RefPtr<Messages::WebPageProxy::CreateNewPage::DelayedReply> reply)
+void WebPageProxy::createNewPage(const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, ResourceRequest&& request, const WindowFeatures& windowFeatures, NavigationActionData&& navigationActionData, Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&& reply)
{
MESSAGE_CHECK(m_process->webFrame(originatingFrameInfoData.frameID));
auto originatingFrameInfo = API::FrameInfo::create(originatingFrameInfoData, m_process->webPage(originatingPageID));
@@ -3852,10 +3853,13 @@
};
- if (m_uiClient->createNewPageAsync(this, originatingFrameInfo, request, windowFeatures, navigationActionData, [completionHandler](RefPtr<WebPageProxy> newPage) { completionHandler(newPage); }))
- return;
+ if (m_uiClient->canCreateNewPageAsync()) {
+ m_uiClient->createNewPageAsync(this, originatingFrameInfo, WTFMove(request), windowFeatures, WTFMove(navigationActionData), [completionHandler = WTFMove(completionHandler)](RefPtr<WebPageProxy> newPage) {
+ completionHandler(newPage);
+ });
+ }
- RefPtr<WebPageProxy> newPage = m_uiClient->createNewPage(this, originatingFrameInfo, request, windowFeatures, navigationActionData);
+ RefPtr<WebPageProxy> newPage = m_uiClient->createNewPage(this, originatingFrameInfo, WTFMove(request), windowFeatures, WTFMove(navigationActionData));
completionHandler(WTFMove(newPage));
}
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (219870 => 219871)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2017-07-25 17:07:22 UTC (rev 219870)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2017-07-25 17:17:55 UTC (rev 219871)
@@ -391,7 +391,7 @@
void closePage(bool stopResponsivenessTimer);
void addPlatformLoadParameters(LoadParameters&);
- RefPtr<API::Navigation> loadRequest(const WebCore::ResourceRequest&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
+ RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
RefPtr<API::Navigation> loadData(API::Data*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
RefPtr<API::Navigation> loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
@@ -1276,8 +1276,8 @@
void didDestroyNavigation(uint64_t navigationID);
- void decidePolicyForNavigationAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const NavigationActionData&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, uint64_t listenerID, const UserData&, Ref<Messages::WebPageProxy::DecidePolicyForNavigationAction::DelayedReply>&&);
- void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const NavigationActionData&, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, const UserData&);
+ void decidePolicyForNavigationAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, uint64_t listenerID, const UserData&, Ref<Messages::WebPageProxy::DecidePolicyForNavigationAction::DelayedReply>&&);
+ void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, NavigationActionData&&, WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
void decidePolicyForResponseSync(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&, Ref<Messages::WebPageProxy::DecidePolicyForResponseSync::DelayedReply>&&);
void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
@@ -1291,7 +1291,7 @@
void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
// UI client
- void createNewPage(const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const NavigationActionData&, RefPtr<Messages::WebPageProxy::CreateNewPage::DelayedReply>);
+ void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, const WebCore::WindowFeatures&, NavigationActionData&&, Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&&);
void showPage();
void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>&&);
void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>&&);