Title: [238817] trunk/Source/WebKit
- Revision
- 238817
- Author
- [email protected]
- Date
- 2018-12-03 13:20:02 -0800 (Mon, 03 Dec 2018)
Log Message
Update process assertions after swapping processes
https://bugs.webkit.org/show_bug.cgi?id=192318
<rdar://problem/46377552>
Reviewed by Chris Dumez.
If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
after navigation and process swapping we need the new WebProcess to update its process assertions.
* UIProcess/API/Cocoa/PageLoadStateObserver.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::didSwapWebProcesses):
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didSwapWebProcesses):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (238816 => 238817)
--- trunk/Source/WebKit/ChangeLog 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/ChangeLog 2018-12-03 21:20:02 UTC (rev 238817)
@@ -1,3 +1,24 @@
+2018-12-03 Alex Christensen <[email protected]>
+
+ Update process assertions after swapping processes
+ https://bugs.webkit.org/show_bug.cgi?id=192318
+ <rdar://problem/46377552>
+
+ Reviewed by Chris Dumez.
+
+ If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
+ after navigation and process swapping we need the new WebProcess to update its process assertions.
+
+ * UIProcess/API/Cocoa/PageLoadStateObserver.h:
+ * UIProcess/Cocoa/NavigationState.h:
+ * UIProcess/Cocoa/NavigationState.mm:
+ (WebKit::NavigationState::didSwapWebProcesses):
+ * UIProcess/PageLoadState.cpp:
+ (WebKit::PageLoadState::didSwapWebProcesses):
+ * UIProcess/PageLoadState.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::finishAttachingToWebProcess):
+
2018-12-03 Daniel Bates <[email protected]>
[iOS] Do not handle key events that are key commands
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h (238816 => 238817)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h 2018-12-03 21:20:02 UTC (rev 238817)
@@ -97,6 +97,7 @@
void didChangeNetworkRequestsInProgress() override { }
void willChangeCertificateInfo() override { }
void didChangeCertificateInfo() override { }
+ void didSwapWebProcesses() override { }
void willChangeWebProcessIsResponsive() override
{
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (238816 => 238817)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2018-12-03 21:20:02 UTC (rev 238817)
@@ -354,6 +354,7 @@
void didChangeCertificateInfo() override { }
void willChangeWebProcessIsResponsive() override { }
void didChangeWebProcessIsResponsive() override { }
+ void didSwapWebProcesses() override { };
WebKitWebView* m_webView;
};
Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h (238816 => 238817)
--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h 2018-12-03 21:20:02 UTC (rev 238817)
@@ -176,6 +176,7 @@
void didChangeCertificateInfo() override;
void willChangeWebProcessIsResponsive() override;
void didChangeWebProcessIsResponsive() override;
+ void didSwapWebProcesses() override;
#if PLATFORM(IOS_FAMILY)
void releaseNetworkActivityTokenAfterLoadCompletion() { releaseNetworkActivityToken(NetworkActivityTokenReleaseReason::LoadCompleted); }
Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (238816 => 238817)
--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2018-12-03 21:20:02 UTC (rev 238817)
@@ -1226,6 +1226,15 @@
[m_webView didChangeValueForKey:@"_webProcessIsResponsive"];
}
+void NavigationState::didSwapWebProcesses()
+{
+#if PLATFORM(IOS_FAMILY)
+ // Transfer our background assertion from the old process to the new one.
+ if (m_activityToken)
+ m_activityToken = m_webView->_page->process().throttler().backgroundActivityToken();
+#endif
+}
+
} // namespace WebKit
#endif
Modified: trunk/Source/WebKit/UIProcess/PageLoadState.cpp (238816 => 238817)
--- trunk/Source/WebKit/UIProcess/PageLoadState.cpp 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/UIProcess/PageLoadState.cpp 2018-12-03 21:20:02 UTC (rev 238817)
@@ -407,6 +407,11 @@
return false;
}
+void PageLoadState::didSwapWebProcesses()
+{
+ callObserverCallback(&Observer::didSwapWebProcesses);
+}
+
void PageLoadState::willChangeProcessIsResponsive()
{
callObserverCallback(&Observer::willChangeWebProcessIsResponsive);
Modified: trunk/Source/WebKit/UIProcess/PageLoadState.h (238816 => 238817)
--- trunk/Source/WebKit/UIProcess/PageLoadState.h 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/UIProcess/PageLoadState.h 2018-12-03 21:20:02 UTC (rev 238817)
@@ -78,6 +78,8 @@
virtual void willChangeWebProcessIsResponsive() = 0;
virtual void didChangeWebProcessIsResponsive() = 0;
+
+ virtual void didSwapWebProcesses() = 0;
};
class Transaction {
@@ -165,6 +167,8 @@
void didFinishProgress(const Transaction::Token&);
void setNetworkRequestsInProgress(const Transaction::Token&, bool);
+ void didSwapWebProcesses();
+
bool committedHasInsecureContent() const { return m_committedState.hasInsecureContent; }
// FIXME: We piggy-back off PageLoadState::Observer so that both WKWebView and WKObservablePageState
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (238816 => 238817)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-12-03 21:12:46 UTC (rev 238816)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-12-03 21:20:02 UTC (rev 238817)
@@ -852,6 +852,7 @@
createInspectorTargets();
pageClient().didRelaunchProcess();
+ m_pageLoadState.didSwapWebProcesses();
m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes