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

Changeset 286604 in webkit


Ignore:
Timestamp:
Dec 7, 2021, 12:11:07 PM (5 years ago)
Author:
Chris Dumez
Message:

Make WebLockRegistryProxy::processDidExit() return early if process never registered any locks
https://bugs.webkit.org/show_bug.cgi?id=233832

Reviewed by Darin Adler.

Make WebLockRegistryProxy::processDidExit() return early if process never registered any locks.
This avoids calling LocalWebLockRegistry::clientsAreGoingAway() (which can be expensive) in the
case we know for sure no locks were registered by this process.

  • UIProcess/WebLockRegistryProxy.cpp:

(WebKit::WebLockRegistryProxy::requestLock):
(WebKit::WebLockRegistryProxy::processDidExit):

  • UIProcess/WebLockRegistryProxy.h:
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r286602 r286604  
     12021-12-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Make WebLockRegistryProxy::processDidExit() return early if process never registered any locks
     4        https://bugs.webkit.org/show_bug.cgi?id=233832
     5
     6        Reviewed by Darin Adler.
     7
     8        Make WebLockRegistryProxy::processDidExit() return early if process never registered any locks.
     9        This avoids calling LocalWebLockRegistry::clientsAreGoingAway() (which can be expensive) in the
     10        case we know for sure no locks were registered by this process.
     11
     12        * UIProcess/WebLockRegistryProxy.cpp:
     13        (WebKit::WebLockRegistryProxy::requestLock):
     14        (WebKit::WebLockRegistryProxy::processDidExit):
     15        * UIProcess/WebLockRegistryProxy.h:
     16
    1172021-12-07  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/WebLockRegistryProxy.cpp

    r286455 r286604  
    5454    MESSAGE_CHECK(lockIdentifier.processIdentifier() == m_process.coreProcessIdentifier());
    5555    MESSAGE_CHECK(clientID.processIdentifier() == m_process.coreProcessIdentifier());
     56    m_hasEverRequestedLocks = true;
    5657
    5758    m_process.websiteDataStore().webLockRegistry().requestLock(WTFMove(clientOrigin), lockIdentifier, clientID, WTFMove(name), lockMode, steal, ifAvailable, [weakThis = WeakPtr { *this }, lockIdentifier, clientID](bool success) {
     
    9192void WebLockRegistryProxy::processDidExit()
    9293{
    93     m_process.websiteDataStore().webLockRegistry().clientsAreGoingAway(m_process.coreProcessIdentifier());
     94    if (m_hasEverRequestedLocks)
     95        m_process.websiteDataStore().webLockRegistry().clientsAreGoingAway(m_process.coreProcessIdentifier());
    9496}
    9597
  • trunk/Source/WebKit/UIProcess/WebLockRegistryProxy.h

    r286455 r286604  
    5858
    5959    WebProcessProxy& m_process;
     60    bool m_hasEverRequestedLocks { false };
    6061};
    6162
Note: See TracChangeset for help on using the changeset viewer.