Changeset 269993 in webkit


Ignore:
Timestamp:
Nov 18, 2020 3:01:01 PM (3 years ago)
Author:
Chris Dumez
Message:

Drop redundant code that tries to bump the QoS of the WebContent main thread of UserInteractive when handling a sync IPC
https://bugs.webkit.org/show_bug.cgi?id=219110

Reviewed by Alex Christensen.

Drop redundant code that tries to bump the QoS of the WebContent main thread of UserInteractive when
handling a sync IPC. Nowadays, we always run the main thread of the WebContent at UserInteractive QoS
(see WTF::Thread::setCurrentThreadIsUserInteractive() call in WebProcess::initializeWebProcess()) so
there is no need to boost the QoS during a sync IPC.

  • Platform/IPC/Connection.cpp:

(IPC::Connection::processIncomingMessage):

  • Platform/IPC/Connection.h:

(IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Deleted.

  • Platform/IPC/Decoder.h:

(IPC::Decoder::setQOSClassOverride): Deleted.

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeConnection):

Location:
trunk/Source/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r269985 r269993  
     12020-11-18  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop redundant code that tries to bump the QoS of the WebContent main thread of UserInteractive when handling a sync IPC
     4        https://bugs.webkit.org/show_bug.cgi?id=219110
     5
     6        Reviewed by Alex Christensen.
     7
     8        Drop redundant code that tries to bump the QoS of the WebContent main thread of UserInteractive when
     9        handling a sync IPC. Nowadays, we always run the main thread of the WebContent at UserInteractive QoS
     10        (see WTF::Thread::setCurrentThreadIsUserInteractive() call in WebProcess::initializeWebProcess()) so
     11        there is no need to boost the QoS during a sync IPC.
     12
     13        * Platform/IPC/Connection.cpp:
     14        (IPC::Connection::processIncomingMessage):
     15        * Platform/IPC/Connection.h:
     16        (IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Deleted.
     17        * Platform/IPC/Decoder.h:
     18        (IPC::Decoder::setQOSClassOverride): Deleted.
     19        * WebProcess/WebProcess.cpp:
     20        (WebKit::WebProcess::initializeConnection):
     21
    1222020-11-18  Darin Adler  <darin@apple.com>
    223
  • trunk/Source/WebKit/Platform/IPC/Connection.cpp

    r268848 r269993  
    749749        return;
    750750
    751 #if HAVE(QOS_CLASSES)
    752     if (message->isSyncMessage() && m_shouldBoostMainThreadOnSyncMessage) {
    753         pthread_override_t override = pthread_override_qos_class_start_np(m_mainThread, Thread::adjustedQOSClass(QOS_CLASS_USER_INTERACTIVE), 0);
    754         message->setQOSClassOverride(override);
    755     }
    756 #endif
    757 
    758751    if (message->isSyncMessage()) {
    759752        auto locker = holdLock(m_incomingSyncMessageCallbackMutex);
  • trunk/Source/WebKit/Platform/IPC/Connection.h

    r268848 r269993  
    283283    bool isValid() const { return m_isValid; }
    284284
    285 #if HAVE(QOS_CLASSES)
    286     void setShouldBoostMainThreadOnSyncMessage(bool b) { m_shouldBoostMainThreadOnSyncMessage = b; }
    287 #endif
    288 
    289285    uint64_t installIncomingSyncMessageCallback(WTF::Function<void()>&&);
    290286    void uninstallIncomingSyncMessageCallback(uint64_t);
     
    436432#if HAVE(QOS_CLASSES)
    437433    pthread_t m_mainThread { 0 };
    438     bool m_shouldBoostMainThreadOnSyncMessage { false };
    439434#endif
    440435
  • trunk/Source/WebKit/Platform/IPC/Decoder.cpp

    r269327 r269993  
    9595
    9696    // FIXME: We need to dispose of the mach ports in cases of failure.
    97 
    98 #if HAVE(QOS_CLASSES)
    99     if (m_qosClassOverride)
    100         pthread_override_qos_class_end_np(m_qosClassOverride);
    101 #endif
    10297}
    10398
  • trunk/Source/WebKit/Platform/IPC/Decoder.h

    r269327 r269993  
    6868#endif
    6969
    70 #if HAVE(QOS_CLASSES)
    71     void setQOSClassOverride(pthread_override_t override) { m_qosClassOverride = override; }
    72 #endif
    73 
    7470    static std::unique_ptr<Decoder> unwrapForTesting(Decoder&);
    7571
     
    209205    std::unique_ptr<ImportanceAssertion> m_importanceAssertion;
    210206#endif
    211 
    212 #if HAVE(QOS_CLASSES)
    213     pthread_override_t m_qosClassOverride { nullptr };
    214 #endif
    215207};
    216208
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r269807 r269993  
    313313#endif
    314314
    315 #if HAVE(QOS_CLASSES)
    316     connection->setShouldBoostMainThreadOnSyncMessage(true);
    317 #endif
    318 
    319315    m_eventDispatcher->initializeConnection(connection);
    320316#if PLATFORM(IOS_FAMILY)
Note: See TracChangeset for help on using the changeset viewer.