Title: [238827] tags/Safari-607.1.16/Source/WebKit
Revision
238827
Author
alanc...@apple.com
Date
2018-12-03 16:08:37 -0800 (Mon, 03 Dec 2018)

Log Message

Cherry-pick r238817. rdar://problem/46377552

    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):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238817 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: tags/Safari-607.1.16/Source/WebKit/ChangeLog (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/ChangeLog	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/ChangeLog	2018-12-04 00:08:37 UTC (rev 238827)
@@ -1,3 +1,51 @@
+2018-12-03  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r238817. rdar://problem/46377552
+
+    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):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-12-03  Alex Christensen  <achristen...@webkit.org>
+
+            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  Keith Rollin  <krol...@apple.com>
 
         Remove Network Capture

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h	2018-12-04 00:08:37 UTC (rev 238827)
@@ -97,6 +97,7 @@
     void didChangeNetworkRequestsInProgress() override { }
     void willChangeCertificateInfo() override { }
     void didChangeCertificateInfo() override { }
+    void didSwapWebProcesses() override { }
 
     void willChangeWebProcessIsResponsive() override
     {

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp	2018-12-04 00:08:37 UTC (rev 238827)
@@ -354,6 +354,7 @@
     void didChangeCertificateInfo() override { }
     void willChangeWebProcessIsResponsive() override { }
     void didChangeWebProcessIsResponsive() override { }
+    void didSwapWebProcesses() override { };
 
     WebKitWebView* m_webView;
 };

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/NavigationState.h (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-12-04 00:08:37 UTC (rev 238827)
@@ -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: tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-12-04 00:08:37 UTC (rev 238827)
@@ -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: tags/Safari-607.1.16/Source/WebKit/UIProcess/PageLoadState.cpp (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/PageLoadState.cpp	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/PageLoadState.cpp	2018-12-04 00:08:37 UTC (rev 238827)
@@ -407,6 +407,11 @@
     return false;
 }
 
+void PageLoadState::didSwapWebProcesses()
+{
+    callObserverCallback(&Observer::didSwapWebProcesses);
+}
+
 void PageLoadState::willChangeProcessIsResponsive()
 {
     callObserverCallback(&Observer::willChangeWebProcessIsResponsive);

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/PageLoadState.h (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/PageLoadState.h	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/PageLoadState.h	2018-12-04 00:08:37 UTC (rev 238827)
@@ -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: tags/Safari-607.1.16/Source/WebKit/UIProcess/WebPageProxy.cpp (238826 => 238827)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-12-03 23:57:41 UTC (rev 238826)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-12-04 00:08:37 UTC (rev 238827)
@@ -852,6 +852,7 @@
     createInspectorTargets();
 
     pageClient().didRelaunchProcess();
+    m_pageLoadState.didSwapWebProcesses();
     m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to