Changeset 202331 in webkit


Ignore:
Timestamp:
Jun 22, 2016 10:00:23 AM (8 years ago)
Author:
Chris Dumez
Message:

Add logging related to process assertions to help debug process suspension issues
https://bugs.webkit.org/show_bug.cgi?id=159001

Reviewed by Antti Koivisto.

Add logging related to process assertions to help debug process suspension issues.

  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::didChangeIsLoading):

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::updateActivityToken):

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::setIsHoldingLockedFiles):

Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r202329 r202331  
     12016-06-22  Chris Dumez  <cdumez@apple.com>
     2
     3        Add logging related to process assertions to help debug process suspension issues
     4        https://bugs.webkit.org/show_bug.cgi?id=159001
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Add logging related to process assertions to help debug process suspension issues.
     9
     10        * UIProcess/Cocoa/NavigationState.mm:
     11        (WebKit::NavigationState::didChangeIsLoading):
     12        * UIProcess/Network/NetworkProcessProxy.cpp:
     13        (WebKit::NetworkProcessProxy::fetchWebsiteData):
     14        (WebKit::NetworkProcessProxy::deleteWebsiteData):
     15        (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
     16        (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::updateActivityToken):
     19        * UIProcess/WebProcessProxy.cpp:
     20        (WebKit::WebProcessProxy::setIsHoldingLockedFiles):
     21
    1222016-06-21  Sam Weinig  <sam@webkit.org>
    223
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm

    r200463 r202331  
    822822{
    823823#if PLATFORM(IOS)
    824     if (m_webView->_page->pageLoadState().isLoading())
     824    if (m_webView->_page->pageLoadState().isLoading()) {
     825        LOG_ALWAYS(m_webView->_page->isAlwaysOnLoggingAllowed(), "UIProcess is taking a background assertion because a page load started");
    825826        m_activityToken = m_webView->_page->process().throttler().backgroundActivityToken();
    826     else
     827    } else {
     828        LOG_ALWAYS(m_webView->_page->isAlwaysOnLoggingAllowed(), "UIProcess is releasing a background assertion because a page load completed");
    827829        m_activityToken = nullptr;
     830    }
    828831#endif
    829832
  • trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp

    r202242 r202331  
    127127    uint64_t callbackID = generateCallbackID();
    128128    auto token = throttler().backgroundActivityToken();
    129 
    130     m_pendingFetchWebsiteDataCallbacks.add(callbackID, [token, completionHandler](WebsiteData websiteData) {
     129    LOG_ALWAYS(sessionID.isAlwaysOnLoggingAllowed(), "UIProcess is taking a background assertion because the Network process is fetching Website data");
     130
     131    m_pendingFetchWebsiteDataCallbacks.add(callbackID, [token, completionHandler, sessionID](WebsiteData websiteData) {
    131132        completionHandler(WTFMove(websiteData));
     133        LOG_ALWAYS(sessionID.isAlwaysOnLoggingAllowed(), "UIProcess is releasing a background assertion because the Network process is done fetching Website data");
    132134    });
    133135
     
    139141    auto callbackID = generateCallbackID();
    140142    auto token = throttler().backgroundActivityToken();
    141 
    142     m_pendingDeleteWebsiteDataCallbacks.add(callbackID, [token, completionHandler] {
     143    LOG_ALWAYS(sessionID.isAlwaysOnLoggingAllowed(), "UIProcess is taking a background assertion because the Network process is deleting Website data");
     144
     145    m_pendingDeleteWebsiteDataCallbacks.add(callbackID, [token, completionHandler, sessionID] {
    143146        completionHandler();
     147        LOG_ALWAYS(sessionID.isAlwaysOnLoggingAllowed(), "UIProcess is releasing a background assertion because the Network process is done deleting Website data");
    144148    });
    145149    send(Messages::NetworkProcess::DeleteWebsiteData(sessionID, dataTypes, modifiedSince, callbackID), 0);
     
    152156    uint64_t callbackID = generateCallbackID();
    153157    auto token = throttler().backgroundActivityToken();
    154 
    155     m_pendingDeleteWebsiteDataForOriginsCallbacks.add(callbackID, [token, completionHandler] {
     158    LOG_ALWAYS(sessionID.isAlwaysOnLoggingAllowed(), "UIProcess is taking a background assertion because the Network process is deleting Website data for several origins");
     159
     160    m_pendingDeleteWebsiteDataForOriginsCallbacks.add(callbackID, [token, completionHandler, sessionID] {
    156161        completionHandler();
     162        LOG_ALWAYS(sessionID.isAlwaysOnLoggingAllowed(), "UIProcess is releasing a background assertion because the Network process is done deleting Website data for several origins");
    157163    });
    158164
     
    384390{
    385391    if (!isHoldingLockedFiles) {
     392        LOG_ALWAYS(true, "UIProcess is releasing a background assertion because the Network process is no longer holding locked files");
    386393        m_tokenForHoldingLockedFiles = nullptr;
    387394        return;
    388395    }
    389     if (!m_tokenForHoldingLockedFiles)
     396    if (!m_tokenForHoldingLockedFiles) {
     397        LOG_ALWAYS(true, "UIProcess is taking a background assertion because the Network process is holding locked files");
    390398        m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
     399    }
    391400}
    392401
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r202316 r202331  
    181181#define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
    182182
     183#define WEBPAGEPROXY_LOG_ALWAYS(...) LOG_ALWAYS(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     184
    183185using namespace WebCore;
    184186
     
    14861488}
    14871489
     1490bool WebPageProxy::isAlwaysOnLoggingAllowed() const
     1491{
     1492    return sessionID().isAlwaysOnLoggingAllowed();
     1493}
     1494
    14881495void WebPageProxy::updateActivityToken()
    14891496{
     
    14941501
    14951502#if PLATFORM(IOS)
    1496     if (!isViewVisible() && !m_alwaysRunsAtForegroundPriority)
     1503    if (!isViewVisible() && !m_alwaysRunsAtForegroundPriority) {
     1504        WEBPAGEPROXY_LOG_ALWAYS("UIProcess is releasing a foreground assertion because the view is no longer visible");
    14971505        m_activityToken = nullptr;
    1498     else if (!m_activityToken)
     1506    } else if (!m_activityToken) {
     1507        if (isViewVisible())
     1508            WEBPAGEPROXY_LOG_ALWAYS("UIProcess is taking a foreground assertion because the view is visible");
     1509        else
     1510            WEBPAGEPROXY_LOG_ALWAYS("UIProcess is taking a foreground assertion even though the view is not visible because m_alwaysRunsAtForegroundPriority is true");
    14991511        m_activityToken = m_process->throttler().foregroundActivityToken();
     1512    }
    15001513#endif
    15011514}
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r202185 r202331  
    11171117    bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
    11181118
     1119    bool isAlwaysOnLoggingAllowed() const;
     1120
    11191121private:
    11201122    WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r201575 r202331  
    988988{
    989989    if (!isHoldingLockedFiles) {
     990        LOG_ALWAYS(true, "UIProcess is releasing a background assertion because the WebContent process is no longer holding locked files");
    990991        m_tokenForHoldingLockedFiles = nullptr;
    991992        return;
    992993    }
    993     if (!m_tokenForHoldingLockedFiles)
     994    if (!m_tokenForHoldingLockedFiles) {
     995        LOG_ALWAYS(true, "UIProcess is taking a background assertion because the WebContent process is holding locked files");
    994996        m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
     997    }
    995998}
    996999
Note: See TracChangeset for help on using the changeset viewer.