⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243461 in webkit


Ignore:
Timestamp:
Mar 25, 2019, 2:28:09 PM (7 years ago)
Author:
Chris Dumez
Message:

Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
https://bugs.webkit.org/show_bug.cgi?id=196210
<rdar://problem/48681326>

Reviewed by Geoffrey Garen.

Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.

This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
communicate via DrawingArea IPC.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::setIsSuspended):

  • WebProcess/WebPage/WebPage.h:
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r243460 r243461  
     12019-03-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
     4        https://bugs.webkit.org/show_bug.cgi?id=196210
     5        <rdar://problem/48681326>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
     10        instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
     11
     12        This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
     13        communicate via DrawingArea IPC.
     14
     15        * WebProcess/WebPage/WebPage.cpp:
     16        (WebKit::WebPage::reinitializeWebPage):
     17        (WebKit::WebPage::setIsSuspended):
     18        * WebProcess/WebPage/WebPage.h:
     19
    1202019-03-25  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r243354 r243461  
    725725    setSize(parameters.viewSize);
    726726
    727     if (m_shouldResetDrawingAreaAfterSuspend) {
     727    // If the UIProcess created a new DrawingArea, then we need to do the same.
     728    if (m_drawingArea->identifier() != parameters.drawingAreaIdentifier) {
    728729        auto oldDrawingArea = std::exchange(m_drawingArea, nullptr);
    729730        oldDrawingArea->removeMessageReceiverIfNeeded();
    730         m_shouldResetDrawingAreaAfterSuspend = false;
    731731
    732732        m_drawingArea = DrawingArea::create(*this, parameters);
     
    740740        unfreezeLayerTree(LayerTreeFreezeReason::PageSuspended);
    741741    }
    742     RELEASE_ASSERT(m_drawingArea->identifier() == parameters.drawingAreaIdentifier);
    743742
    744743    setViewLayoutSize(parameters.viewLayoutSize);
     
    63226321    m_isSuspended = suspended;
    63236322
    6324     if (m_isSuspended) {
    6325         // Unfrozen on drawing area reset.
    6326         freezeLayerTree(LayerTreeFreezeReason::PageSuspended);
    6327 
    6328         WebProcess::singleton().sendPrewarmInformation(mainWebFrame()->url());
    6329 
    6330         suspendForProcessSwap();
    6331     } else
    6332         m_shouldResetDrawingAreaAfterSuspend = true;
     6323    if (!suspended)
     6324        return;
     6325
     6326    // Unfrozen on drawing area reset.
     6327    freezeLayerTree(LayerTreeFreezeReason::PageSuspended);
     6328
     6329    WebProcess::singleton().sendPrewarmInformation(mainWebFrame()->url());
     6330
     6331    suspendForProcessSwap();
    63336332}
    63346333
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r243354 r243461  
    15621562    WebCore::IntSize m_viewSize;
    15631563    std::unique_ptr<DrawingArea> m_drawingArea;
    1564     bool m_shouldResetDrawingAreaAfterSuspend { false };
    15651564
    15661565    HashSet<PluginView*> m_pluginViews;
Note: See TracChangeset for help on using the changeset viewer.