Changeset 250209 in webkit


Ignore:
Timestamp:
Sep 23, 2019 1:39:11 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r249953 - [GTK] Initial view loading is slow
https://bugs.webkit.org/show_bug.cgi?id=201451

Reviewed by Sergio Villar Senin.

The problem is that now we are always calling DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() after a
new process is launched and we used to do that only when launching a new process after a crash. This makes
m_hasReceivedFirstUpdate useless, because it's always set to true right after a process is launched. Then, we
wait up to half a second (which is usually the case for the initial load) until the first update. We only want
to do that when recovering from a crash or when swapping processes to avoid flashing effect.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::launchProcess): Add ProcessLaunchReason parameter and pass it to
finishAttachingToWebProcess instead of IsProcessSwap.
(WebKit::WebPageProxy::swapToWebProcess): Pass ProcessLaunchReason::ProcessSwap to
finishAttachingToWebProcess().
(WebKit::WebPageProxy::finishAttachingToWebProcess): Do not call
DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() when process launch reason is ProcessLaunchReason::InitialProcess.
(WebKit::WebPageProxy::launchProcessForReload): Pass ProcessLaunchReason::Reload to launchProcess().

  • UIProcess/WebPageProxy.h: Remove IsProcessSwap and add ProcessLaunchReason instead that is passed to

launchProcess and finishAttachingToWebProcess.

Location:
releases/WebKitGTK/webkit-2.26/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog

    r250206 r250209  
     12019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Initial view loading is slow
     4        https://bugs.webkit.org/show_bug.cgi?id=201451
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        The problem is that now we are always calling DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() after a
     9        new process is launched and we used to do that only when launching a new process after a crash. This makes
     10        m_hasReceivedFirstUpdate useless, because it's always set to true right after a process is launched. Then, we
     11        wait up to half a second (which is usually the case for the initial load) until the first update. We only want
     12        to do that when recovering from a crash or when swapping processes to avoid flashing effect.
     13
     14        * UIProcess/WebPageProxy.cpp:
     15        (WebKit::WebPageProxy::launchProcess): Add ProcessLaunchReason parameter and pass it to
     16        finishAttachingToWebProcess instead of IsProcessSwap.
     17        (WebKit::WebPageProxy::swapToWebProcess): Pass ProcessLaunchReason::ProcessSwap to
     18        finishAttachingToWebProcess().
     19        (WebKit::WebPageProxy::finishAttachingToWebProcess): Do not call
     20        DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() when process launch reason is ProcessLaunchReason::InitialProcess.
     21        (WebKit::WebPageProxy::launchProcessForReload): Pass ProcessLaunchReason::Reload to launchProcess().
     22        * UIProcess/WebPageProxy.h: Remove IsProcessSwap and add ProcessLaunchReason instead that is passed to
     23        launchProcess and finishAttachingToWebProcess.
     24
    1252019-09-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    226
  • releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/WebPageProxy.cpp

    r250203 r250209  
    719719}
    720720
    721 void WebPageProxy::launchProcess(const RegistrableDomain& registrableDomain)
     721void WebPageProxy::launchProcess(const RegistrableDomain& registrableDomain, ProcessLaunchReason reason)
    722722{
    723723    ASSERT(!m_isClosed);
     
    741741    m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, *this);
    742742
    743     finishAttachingToWebProcess(IsProcessSwap::No);
     743    finishAttachingToWebProcess(reason);
    744744}
    745745
     
    814814    m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, *this);
    815815
    816     finishAttachingToWebProcess(IsProcessSwap::Yes);
    817 }
    818 
    819 void WebPageProxy::finishAttachingToWebProcess(IsProcessSwap isProcessSwap)
     816    finishAttachingToWebProcess(ProcessLaunchReason::ProcessSwap);
     817}
     818
     819void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason)
    820820{
    821821    ASSERT(m_process->state() != AuxiliaryProcessProxy::State::Terminated);
     
    827827
    828828    // In the process-swap case, the ProvisionalPageProxy already took care of initializing the WebPage in the WebProcess.
    829     if (isProcessSwap != IsProcessSwap::Yes)
     829    if (reason != ProcessLaunchReason::ProcessSwap)
    830830        initializeWebPage();
    831831
     
    841841    pageClient().didRelaunchProcess();
    842842    m_pageLoadState.didSwapWebProcesses();
    843     m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
     843    if (reason != ProcessLaunchReason::InitialProcess)
     844        m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
    844845}
    845846
     
    891892    ASSERT(!hasRunningProcess());
    892893    auto registrableDomain = m_backForwardList->currentItem() ? RegistrableDomain { URL(URL(), m_backForwardList->currentItem()->url()) } : RegistrableDomain { };
    893     launchProcess(registrableDomain);
     894    launchProcess(registrableDomain, ProcessLaunchReason::Crash);
    894895
    895896    if (!m_backForwardList->currentItem()) {
     
    923924
    924925    ASSERT(!hasRunningProcess());
    925     launchProcess(RegistrableDomain { URL(URL(), item.url()) });
     926    launchProcess(RegistrableDomain { URL(URL(), item.url()) }, ProcessLaunchReason::InitialProcess);
    926927
    927928    if (&item != m_backForwardList->currentItem())
     
    11091110{
    11101111    if (!hasRunningProcess())
    1111         launchProcess({ });
     1112        launchProcess({ }, ProcessLaunchReason::InitialProcess);
    11121113
    11131114    return m_process;
     
    11221123
    11231124    if (!hasRunningProcess())
    1124         launchProcess(RegistrableDomain { request.url() });
     1125        launchProcess(RegistrableDomain { request.url() }, ProcessLaunchReason::InitialProcess);
    11251126
    11261127    auto navigation = m_navigationState->createLoadRequestNavigation(ResourceRequest(request), m_backForwardList->currentItem());
     
    11691170
    11701171    if (!hasRunningProcess())
    1171         launchProcess({ });
     1172        launchProcess({ }, ProcessLaunchReason::InitialProcess);
    11721173
    11731174    URL fileURL = URL(URL(), fileURLString);
     
    12241225
    12251226    if (!hasRunningProcess())
    1226         launchProcess({ });
     1227        launchProcess({ }, ProcessLaunchReason::InitialProcess);
    12271228
    12281229    auto navigation = m_navigationState->createLoadDataNavigation(makeUnique<API::SubstituteData>(data.vector(), MIMEType, encoding, baseURL, userData));
     
    12741275
    12751276    if (!hasRunningProcess())
    1276         launchProcess(RegistrableDomain { baseURL });
     1277        launchProcess(RegistrableDomain { baseURL }, ProcessLaunchReason::InitialProcess);
    12771278
    12781279    auto transaction = m_pageLoadState.transaction();
     
    13111312
    13121313    if (!hasRunningProcess())
    1313         launchProcess({ });
     1314        launchProcess({ }, ProcessLaunchReason::InitialProcess);
    13141315
    13151316    auto transaction = m_pageLoadState.transaction();
     
    13411342
    13421343    if (!hasRunningProcess())
    1343         launchProcess(RegistrableDomain { URL(URL(), urlString) });
     1344        launchProcess(RegistrableDomain { URL(URL(), urlString) }, ProcessLaunchReason::InitialProcess);
    13441345
    13451346    m_process->send(Messages::WebPage::NavigateToPDFLinkWithSimulatedClick(urlString, documentPoint, screenPoint), m_pageID);
     
    36503651{
    36513652    if (&process() == process().processPool().dummyProcessProxy())
    3652         launchProcess({ });
     3653        launchProcess({ }, ProcessLaunchReason::InitialProcess);
    36533654}
    36543655
  • releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/WebPageProxy.h

    r249258 r250209  
    17321732    void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
    17331733
    1734     void launchProcess(const WebCore::RegistrableDomain&);
     1734    enum class ProcessLaunchReason {
     1735        InitialProcess,
     1736        ProcessSwap,
     1737        Crash
     1738    };
     1739
     1740    void launchProcess(const WebCore::RegistrableDomain&, ProcessLaunchReason);
    17351741    void swapToWebProcess(Ref<WebProcessProxy>&&, std::unique_ptr<DrawingAreaProxy>&&, RefPtr<WebFrameProxy>&& mainFrame);
    17361742    void didFailToSuspendAfterProcessSwap();
    17371743    void didSuspendAfterProcessSwap();
    1738 
    1739     enum class IsProcessSwap { No, Yes };
    1740     void finishAttachingToWebProcess(IsProcessSwap);
     1744    void finishAttachingToWebProcess(ProcessLaunchReason);
    17411745
    17421746    RefPtr<API::Navigation> launchProcessForReload();
Note: See TracChangeset for help on using the changeset viewer.