Diff
Modified: tags/Safari-607.1.16.4/Source/WebKit/ChangeLog (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/ChangeLog 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/ChangeLog 2018-12-17 18:42:34 UTC (rev 239271)
@@ -1,5 +1,87 @@
2018-12-14 Kocsen Chung <kocsen_ch...@apple.com>
+ Cherry-pick r239210. rdar://problem/46715748
+
+ [PSON] WebsitePolicies are lost on process-swap
+ https://bugs.webkit.org/show_bug.cgi?id=192694
+ <rdar://problem/46715748>
+
+ Reviewed by Brady Eidson.
+
+ Source/WebKit:
+
+ In case of process-swap on navigation, instead of sending the websitePolicies to the old
+ process, send them to the new process as we trigger the navigation. We tell the new process
+ that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.
+
+ * Shared/LoadParameters.cpp:
+ (WebKit::LoadParameters::encode const):
+ (WebKit::LoadParameters::decode):
+ * Shared/LoadParameters.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::reattachToWebProcessForReload):
+ (WebKit::WebPageProxy::reattachToWebProcessWithItem):
+ (WebKit::WebPageProxy::loadRequestWithNavigation):
+ (WebKit::WebPageProxy::loadDataWithNavigation):
+ (WebKit::WebPageProxy::goToBackForwardItem):
+ (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
+ (WebKit::WebPageProxy::continueNavigationInNewProcess):
+ * UIProcess/WebPageProxy.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::loadRequest):
+ (WebKit::WebPage::loadDataImpl):
+ (WebKit::WebPage::loadData):
+ (WebKit::WebPage::loadAlternateHTML):
+ (WebKit::WebPage::goToBackForwardItem):
+ (WebKit::WebPage::createDocumentLoader):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
+ Tools:
+
+ Extend existing API test to reproduce the issue.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-12-14 Chris Dumez <cdu...@apple.com>
+
+ [PSON] WebsitePolicies are lost on process-swap
+ https://bugs.webkit.org/show_bug.cgi?id=192694
+ <rdar://problem/46715748>
+
+ Reviewed by Brady Eidson.
+
+ In case of process-swap on navigation, instead of sending the websitePolicies to the old
+ process, send them to the new process as we trigger the navigation. We tell the new process
+ that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.
+
+ * Shared/LoadParameters.cpp:
+ (WebKit::LoadParameters::encode const):
+ (WebKit::LoadParameters::decode):
+ * Shared/LoadParameters.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::reattachToWebProcessForReload):
+ (WebKit::WebPageProxy::reattachToWebProcessWithItem):
+ (WebKit::WebPageProxy::loadRequestWithNavigation):
+ (WebKit::WebPageProxy::loadDataWithNavigation):
+ (WebKit::WebPageProxy::goToBackForwardItem):
+ (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
+ (WebKit::WebPageProxy::continueNavigationInNewProcess):
+ * UIProcess/WebPageProxy.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::loadRequest):
+ (WebKit::WebPage::loadDataImpl):
+ (WebKit::WebPage::loadData):
+ (WebKit::WebPage::loadAlternateHTML):
+ (WebKit::WebPage::goToBackForwardItem):
+ (WebKit::WebPage::createDocumentLoader):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
+2018-12-14 Kocsen Chung <kocsen_ch...@apple.com>
+
Cherry-pick r239197. rdar://problem/46546071
[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
Modified: tags/Safari-607.1.16.4/Source/WebKit/Shared/LoadParameters.cpp (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/Shared/LoadParameters.cpp 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/Shared/LoadParameters.cpp 2018-12-17 18:42:34 UTC (rev 239271)
@@ -49,6 +49,7 @@
encoder << baseURLString;
encoder << unreachableURLString;
encoder << provisionalLoadErrorURLString;
+ encoder << websitePolicies;
encoder << shouldOpenExternalURLsPolicy;
encoder << shouldTreatAsContinuingLoad;
encoder << userData;
@@ -105,6 +106,12 @@
if (!decoder.decode(data.provisionalLoadErrorURLString))
return false;
+ std::optional<std::optional<WebsitePoliciesData>> websitePolicies;
+ decoder >> websitePolicies;
+ if (!websitePolicies)
+ return false;
+ data.websitePolicies = WTFMove(*websitePolicies);
+
if (!decoder.decode(data.shouldOpenExternalURLsPolicy))
return false;
Modified: tags/Safari-607.1.16.4/Source/WebKit/Shared/LoadParameters.h (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/Shared/LoadParameters.h 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/Shared/LoadParameters.h 2018-12-17 18:42:34 UTC (rev 239271)
@@ -28,6 +28,7 @@
#include "DataReference.h"
#include "SandboxExtension.h"
#include "UserData.h"
+#include "WebsitePoliciesData.h"
#include <WebCore/FrameLoaderTypes.h>
#include <WebCore/ResourceRequest.h>
@@ -60,6 +61,8 @@
String unreachableURLString;
String provisionalLoadErrorURLString;
+ std::optional<WebsitePoliciesData> websitePolicies;
+
uint64_t shouldOpenExternalURLsPolicy;
bool shouldTreatAsContinuingLoad { false };
UserData userData;
Modified: tags/Safari-607.1.16.4/Source/WebKit/UIProcess/WebPageProxy.cpp (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-12-17 18:42:34 UTC (rev 239271)
@@ -873,7 +873,7 @@
auto navigation = m_navigationState->createReloadNavigation();
// We allow stale content when reloading a WebProcess that's been killed or crashed.
- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No), m_pageID);
+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No, std::nullopt), m_pageID);
m_process->responsivenessTimer().start();
return WTFMove(navigation);
@@ -892,7 +892,7 @@
auto navigation = m_navigationState->createBackForwardNavigation(item, m_backForwardList->currentItem(), FrameLoadType::IndexedBackForward);
- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item.itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No), m_pageID);
+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item.itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No, std::nullopt), m_pageID);
m_process->responsivenessTimer().start();
return WTFMove(navigation);
@@ -1056,7 +1056,7 @@
return WTFMove(navigation);
}
-void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad)
+void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& websitePolicies)
{
ASSERT(!m_isClosed);
@@ -1074,6 +1074,7 @@
loadParameters.shouldOpenExternalURLsPolicy = (uint64_t)shouldOpenExternalURLsPolicy;
loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get());
loadParameters.shouldTreatAsContinuingLoad = shouldTreatAsContinuingLoad == ShouldTreatAsContinuingLoad::Yes;
+ loadParameters.websitePolicies = WTFMove(websitePolicies);
loadParameters.lockHistory = navigation.lockHistory();
loadParameters.lockBackForwardList = navigation.lockBackForwardList();
loadParameters.clientRedirectSourceForHistory = navigation.clientRedirectSourceForHistory();
@@ -1140,7 +1141,7 @@
return WTFMove(navigation);
}
-void WebPageProxy::loadDataWithNavigation(API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData)
+void WebPageProxy::loadDataWithNavigation(API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, std::optional<WebsitePoliciesData>&& websitePolicies)
{
ASSERT(!m_isClosed);
@@ -1158,6 +1159,7 @@
loadParameters.encodingName = encoding;
loadParameters.baseURLString = baseURL;
loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get());
+ loadParameters.websitePolicies = WTFMove(websitePolicies);
addPlatformLoadParameters(loadParameters);
m_process->assumeReadAccessToBaseURL(baseURL);
@@ -1336,7 +1338,7 @@
if (!m_backForwardList->currentItem()->itemIsInSameDocument(item))
navigation = m_navigationState->createBackForwardNavigation(item, m_backForwardList->currentItem(), frameLoadType);
- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item.itemID(), frameLoadType, ShouldTreatAsContinuingLoad::No), m_pageID);
+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item.itemID(), frameLoadType, ShouldTreatAsContinuingLoad::No, std::nullopt), m_pageID);
m_process->responsivenessTimer().start();
return navigation;
@@ -2623,10 +2625,11 @@
RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "%p - WebPageProxy::decidePolicyForNavigationAction, keep using process %i for navigation, reason: %{public}s", this, processIdentifier(), reason.utf8().data());
}
- receivedPolicyDecision(policyAction, navigation, WTFMove(data), WTFMove(sender));
+ bool shouldProcessSwap = processForNavigation.ptr() != &process();
+ receivedPolicyDecision(policyAction, navigation.ptr(), shouldProcessSwap ? std::nullopt : WTFMove(data), WTFMove(sender));
- if (processForNavigation.ptr() != &process())
- continueNavigationInNewProcess(*navigation, WTFMove(processForNavigation));
+ if (shouldProcessSwap)
+ continueNavigationInNewProcess(*navigation, WTFMove(processForNavigation), WTFMove(data));
}
void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, std::optional<WebsitePoliciesData>&& websitePolicies, Ref<PolicyDecisionSender>&& sender)
@@ -2661,7 +2664,7 @@
sender->send(action, navigation ? navigation->navigationID() : 0, downloadID, WTFMove(websitePolicies));
}
-void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, Ref<WebProcessProxy>&& process)
+void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, Ref<WebProcessProxy>&& process, std::optional<WebsitePoliciesData>&& websitePolicies)
{
LOG(Loading, "Continuing navigation %" PRIu64 " '%s' in a new web process", navigation.navigationID(), navigation.loggingString());
@@ -2686,7 +2689,7 @@
return &item != targetItem;
});
m_process->send(Messages::WebPage::UpdateBackForwardListForReattach(WTFMove(itemStates)), m_pageID);
- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item->itemID(), *navigation->backForwardFrameLoadType(), ShouldTreatAsContinuingLoad::Yes), m_pageID);
+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item->itemID(), *navigation->backForwardFrameLoadType(), ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies)), m_pageID);
m_process->responsivenessTimer().start();
return;
@@ -2705,9 +2708,9 @@
// FIXME: Work out timing of responding with the last policy delegate, etc
ASSERT(!navigation->currentRequest().isEmpty());
if (auto& substituteData = navigation->substituteData())
- loadDataWithNavigation(navigation, { substituteData->content.data(), substituteData->content.size() }, substituteData->MIMEType, substituteData->encoding, substituteData->baseURL, substituteData->userData.get());
+ loadDataWithNavigation(navigation, { substituteData->content.data(), substituteData->content.size() }, substituteData->MIMEType, substituteData->encoding, substituteData->baseURL, substituteData->userData.get(), WTFMove(websitePolicies));
else
- loadRequestWithNavigation(navigation, ResourceRequest { navigation->currentRequest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nullptr, ShouldTreatAsContinuingLoad::Yes);
+ loadRequestWithNavigation(navigation, ResourceRequest { navigation->currentRequest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nullptr, ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies));
ASSERT(!m_mainFrame);
m_mainFrameCreationHandler = [this, protectedThis = WTFMove(protectedThis), navigationID = navigation->navigationID(), request = navigation->currentRequest(), mainFrameURL, isServerRedirect = navigation->currentRequestIsRedirect()]() mutable {
Modified: tags/Safari-607.1.16.4/Source/WebKit/UIProcess/WebPageProxy.h (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/UIProcess/WebPageProxy.h 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/UIProcess/WebPageProxy.h 2018-12-17 18:42:34 UTC (rev 239271)
@@ -1566,8 +1566,8 @@
RefPtr<API::Navigation> reattachToWebProcessForReload();
RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&);
- void loadDataWithNavigation(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
- void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad);
+ void loadDataWithNavigation(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr, std::optional<WebsitePoliciesData>&& = std::nullopt);
+ void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& = std::nullopt);
void requestNotificationPermission(uint64_t notificationID, const String& originString);
void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID);
@@ -1878,7 +1878,7 @@
void reportPageLoadResult(const WebCore::ResourceError& = { });
- void continueNavigationInNewProcess(API::Navigation&, Ref<WebProcessProxy>&&);
+ void continueNavigationInNewProcess(API::Navigation&, Ref<WebProcessProxy>&&, std::optional<WebsitePoliciesData>&&);
void setNeedsFontAttributes(bool);
void updateFontAttributesAfterEditorStateChange();
Modified: tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.cpp (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-12-17 18:42:34 UTC (rev 239271)
@@ -1324,6 +1324,7 @@
SendStopResponsivenessTimer stopper;
m_pendingNavigationID = loadParameters.navigationID;
+ m_pendingWebsitePolicies = WTFMove(loadParameters.websitePolicies);
m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), WTFMove(loadParameters.sandboxExtensionHandle));
@@ -1345,13 +1346,15 @@
corePage()->userInputBridge().loadRequest(WTFMove(frameLoadRequest));
ASSERT(!m_pendingNavigationID);
+ ASSERT(!m_pendingWebsitePolicies);
}
-void WebPage::loadDataImpl(uint64_t navigationID, Ref<SharedBuffer>&& sharedBuffer, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& unreachableURL, const UserData& userData)
+void WebPage::loadDataImpl(uint64_t navigationID, std::optional<WebsitePoliciesData>&& websitePolicies, Ref<SharedBuffer>&& sharedBuffer, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& unreachableURL, const UserData& userData)
{
SendStopResponsivenessTimer stopper;
m_pendingNavigationID = navigationID;
+ m_pendingWebsitePolicies = WTFMove(websitePolicies);
ResourceRequest request(baseURL);
ResourceResponse response(URL(), MIMEType, sharedBuffer->size(), encodingName);
@@ -1371,10 +1374,10 @@
auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size());
URL baseURL = loadParameters.baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), loadParameters.baseURLString);
- loadDataImpl(loadParameters.navigationID, WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userData);
+ loadDataImpl(loadParameters.navigationID, WTFMove(loadParameters.websitePolicies), WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userData);
}
-void WebPage::loadAlternateHTML(const LoadParameters& loadParameters)
+void WebPage::loadAlternateHTML(LoadParameters&& loadParameters)
{
platformDidReceiveLoadParameters(loadParameters);
@@ -1383,7 +1386,7 @@
URL provisionalLoadErrorURL = loadParameters.provisionalLoadErrorURLString.isEmpty() ? URL() : URL(URL(), loadParameters.provisionalLoadErrorURLString);
auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size());
m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL(provisionalLoadErrorURL);
- loadDataImpl(loadParameters.navigationID, WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, unreachableURL, loadParameters.userData);
+ loadDataImpl(loadParameters.navigationID, WTFMove(loadParameters.websitePolicies), WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, unreachableURL, loadParameters.userData);
m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL({ });
}
@@ -1446,7 +1449,7 @@
}
}
-void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemIdentifier& backForwardItemID, FrameLoadType backForwardType, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad)
+void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemIdentifier& backForwardItemID, FrameLoadType backForwardType, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& websitePolicies)
{
SendStopResponsivenessTimer stopper;
@@ -1461,6 +1464,7 @@
ASSERT(!m_pendingNavigationID);
m_pendingNavigationID = navigationID;
+ m_pendingWebsitePolicies = WTFMove(websitePolicies);
m_page->goToItem(*item, backForwardType, shouldTreatAsContinuingLoad);
}
@@ -5950,6 +5954,9 @@
documentLoader->setNavigationID(m_pendingNavigationID);
m_pendingNavigationID = 0;
}
+
+ if (auto pendingWebsitePolicies = WTFMove(m_pendingWebsitePolicies))
+ WebsitePoliciesData::applyToDocumentLoader(WTFMove(*pendingWebsitePolicies), documentLoader);
}
return WTFMove(documentLoader);
Modified: tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.h (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.h 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.h 2018-12-17 18:42:34 UTC (rev 239271)
@@ -50,6 +50,7 @@
#include "WebBackForwardListProxy.h"
#include "WebURLSchemeHandler.h"
#include "WebUserContentController.h"
+#include "WebsitePoliciesData.h"
#include <_javascript_Core/InspectorFrontendChannel.h>
#include <WebCore/ActivityState.h>
#include <WebCore/DictionaryPopupInfo.h>
@@ -1191,7 +1192,7 @@
String sourceForFrame(WebFrame*);
- void loadDataImpl(uint64_t navigationID, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&);
+ void loadDataImpl(uint64_t navigationID, std::optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&);
// Actions
void tryClose();
@@ -1198,10 +1199,10 @@
void platformDidReceiveLoadParameters(const LoadParameters&);
void loadRequest(LoadParameters&&);
void loadData(LoadParameters&&);
- void loadAlternateHTML(const LoadParameters&);
+ void loadAlternateHTML(LoadParameters&&);
void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
- void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad);
+ void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&&);
void tryRestoreScrollPosition();
void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
void updateIsInWindow(bool isInitialState = false);
@@ -1743,6 +1744,7 @@
PAL::HysteresisActivity m_userActivityHysteresis;
uint64_t m_pendingNavigationID { 0 };
+ std::optional<WebsitePoliciesData> m_pendingWebsitePolicies;
bool m_mainFrameProgressCompleted { false };
bool m_shouldDispatchFakeMouseMoveEvents { true };
Modified: tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (239270 => 239271)
--- tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2018-12-17 18:42:34 UTC (rev 239271)
@@ -145,7 +145,7 @@
ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
CenterSelectionInVisibleArea()
- GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum:uint8_t WebCore::FrameLoadType backForwardType, enum:bool WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad)
+ GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum:uint8_t WebCore::FrameLoadType backForwardType, enum:bool WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebKit::WebsitePoliciesData> websitePolicies)
TryRestoreScrollPosition()
LoadURLInFrame(URL url, uint64_t frameID)
Modified: tags/Safari-607.1.16.4/Tools/ChangeLog (239270 => 239271)
--- tags/Safari-607.1.16.4/Tools/ChangeLog 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Tools/ChangeLog 2018-12-17 18:42:34 UTC (rev 239271)
@@ -1,3 +1,62 @@
+2018-12-14 Kocsen Chung <kocsen_ch...@apple.com>
+
+ Cherry-pick r239210. rdar://problem/46715748
+
+ [PSON] WebsitePolicies are lost on process-swap
+ https://bugs.webkit.org/show_bug.cgi?id=192694
+ <rdar://problem/46715748>
+
+ Reviewed by Brady Eidson.
+
+ Source/WebKit:
+
+ In case of process-swap on navigation, instead of sending the websitePolicies to the old
+ process, send them to the new process as we trigger the navigation. We tell the new process
+ that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.
+
+ * Shared/LoadParameters.cpp:
+ (WebKit::LoadParameters::encode const):
+ (WebKit::LoadParameters::decode):
+ * Shared/LoadParameters.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::reattachToWebProcessForReload):
+ (WebKit::WebPageProxy::reattachToWebProcessWithItem):
+ (WebKit::WebPageProxy::loadRequestWithNavigation):
+ (WebKit::WebPageProxy::loadDataWithNavigation):
+ (WebKit::WebPageProxy::goToBackForwardItem):
+ (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
+ (WebKit::WebPageProxy::continueNavigationInNewProcess):
+ * UIProcess/WebPageProxy.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::loadRequest):
+ (WebKit::WebPage::loadDataImpl):
+ (WebKit::WebPage::loadData):
+ (WebKit::WebPage::loadAlternateHTML):
+ (WebKit::WebPage::goToBackForwardItem):
+ (WebKit::WebPage::createDocumentLoader):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
+ Tools:
+
+ Extend existing API test to reproduce the issue.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-12-14 Chris Dumez <cdu...@apple.com>
+
+ [PSON] WebsitePolicies are lost on process-swap
+ https://bugs.webkit.org/show_bug.cgi?id=192694
+ <rdar://problem/46715748>
+
+ Reviewed by Brady Eidson.
+
+ Extend existing API test to reproduce the issue.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
+
2018-12-12 Kocsen Chung <kocsen_ch...@apple.com>
Cherry-pick r239046. rdar://problem/46500832
Modified: tags/Safari-607.1.16.4/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm (239270 => 239271)
--- tags/Safari-607.1.16.4/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm 2018-12-17 17:51:57 UTC (rev 239270)
+++ tags/Safari-607.1.16.4/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm 2018-12-17 18:42:34 UTC (rev 239271)
@@ -972,6 +972,15 @@
while (loadCount != 9U)
TestWebKitAPI::Util::spinRunLoop();
loadCount = 0;
+
+ request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"test://www.google.com/main.html"]];
+ [webView loadRequest:request];
+
+ TestWebKitAPI::Util::run(&finishedNavigation);
+ finishedNavigation = false;
+
+ EXPECT_EQ(1U, loadCount);
+ loadCount = 0;
}
@interface PopUpPoliciesDelegate : NSObject <WKNavigationDelegate, WKUIDelegatePrivate>