Changeset 238817 in webkit


Ignore:
Timestamp:
Dec 3, 2018, 1:20:02 PM (7 years ago)
Author:
achristensen@apple.com
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):

Location:
trunk/Source/WebKit
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r238814 r238817  
     12018-12-03  Alex Christensen  <achristensen@webkit.org>
     2
     3        Update process assertions after swapping processes
     4        https://bugs.webkit.org/show_bug.cgi?id=192318
     5        <rdar://problem/46377552>
     6
     7        Reviewed by Chris Dumez.
     8
     9        If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
     10        after navigation and process swapping we need the new WebProcess to update its process assertions.
     11
     12        * UIProcess/API/Cocoa/PageLoadStateObserver.h:
     13        * UIProcess/Cocoa/NavigationState.h:
     14        * UIProcess/Cocoa/NavigationState.mm:
     15        (WebKit::NavigationState::didSwapWebProcesses):
     16        * UIProcess/PageLoadState.cpp:
     17        (WebKit::PageLoadState::didSwapWebProcesses):
     18        * UIProcess/PageLoadState.h:
     19        * UIProcess/WebPageProxy.cpp:
     20        (WebKit::WebPageProxy::finishAttachingToWebProcess):
     21
    1222018-12-03  Daniel Bates  <dabates@apple.com>
    223
  • trunk/Source/WebKit/UIProcess/API/Cocoa/PageLoadStateObserver.h

    r197563 r238817  
    9898    void willChangeCertificateInfo() override { }
    9999    void didChangeCertificateInfo() override { }
     100    void didSwapWebProcesses() override { }
    100101
    101102    void willChangeWebProcessIsResponsive() override
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp

    r238771 r238817  
    355355    void willChangeWebProcessIsResponsive() override { }
    356356    void didChangeWebProcessIsResponsive() override { }
     357    void didSwapWebProcesses() override { };
    357358
    358359    WebKitWebView* m_webView;
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h

    r238771 r238817  
    177177    void willChangeWebProcessIsResponsive() override;
    178178    void didChangeWebProcessIsResponsive() override;
     179    void didSwapWebProcesses() override;
    179180
    180181#if PLATFORM(IOS_FAMILY)
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm

    r238771 r238817  
    12271227}
    12281228
     1229void NavigationState::didSwapWebProcesses()
     1230{
     1231#if PLATFORM(IOS_FAMILY)
     1232    // Transfer our background assertion from the old process to the new one.
     1233    if (m_activityToken)
     1234        m_activityToken = m_webView->_page->process().throttler().backgroundActivityToken();
     1235#endif
     1236}
     1237
    12291238} // namespace WebKit
    12301239
  • trunk/Source/WebKit/UIProcess/PageLoadState.cpp

    r238771 r238817  
    408408}
    409409
     410void PageLoadState::didSwapWebProcesses()
     411{
     412    callObserverCallback(&Observer::didSwapWebProcesses);
     413}
     414
    410415void PageLoadState::willChangeProcessIsResponsive()
    411416{
  • trunk/Source/WebKit/UIProcess/PageLoadState.h

    r206006 r238817  
    7979        virtual void willChangeWebProcessIsResponsive() = 0;
    8080        virtual void didChangeWebProcessIsResponsive() = 0;
     81       
     82        virtual void didSwapWebProcesses() = 0;
    8183    };
    8284
     
    165167    void didFinishProgress(const Transaction::Token&);
    166168    void setNetworkRequestsInProgress(const Transaction::Token&, bool);
     169
     170    void didSwapWebProcesses();
    167171
    168172    bool committedHasInsecureContent() const { return m_committedState.hasInsecureContent; }
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r238771 r238817  
    853853
    854854    pageClient().didRelaunchProcess();
     855    m_pageLoadState.didSwapWebProcesses();
    855856    m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
    856857}
Note: See TracChangeset for help on using the changeset viewer.