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

Changeset 275839 in webkit


Ignore:
Timestamp:
Apr 12, 2021, 2:28:41 PM (5 years ago)
Author:
Chris Dumez
Message:

Make sure AuxiliaryProcessProxy::sendMessage() is called on the main thread
https://bugs.webkit.org/show_bug.cgi?id=224448

Reviewed by Geoffrey Garen.

Make sure AuxiliaryProcessProxy::sendMessage() is called on the main thread. This is a follow-up to
Bug 224377 but for trunk.

  • UIProcess/AuxiliaryProcessProxy.cpp:

(WebKit::AuxiliaryProcessProxy::sendMessage):
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
(WebKit::AuxiliaryProcessProxy::replyToPendingMessages):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r275835 r275839  
     12021-04-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Make sure AuxiliaryProcessProxy::sendMessage() is called on the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=224448
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Make sure AuxiliaryProcessProxy::sendMessage() is called on the main thread. This is a follow-up to
     9        Bug 224377 but for trunk.
     10
     11        * UIProcess/AuxiliaryProcessProxy.cpp:
     12        (WebKit::AuxiliaryProcessProxy::sendMessage):
     13        (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
     14        (WebKit::AuxiliaryProcessProxy::replyToPendingMessages):
     15
    1162021-04-12  Ada Chan  <ada.chan@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp

    r275805 r275839  
    161161bool AuxiliaryProcessProxy::sendMessage(UniqueRef<IPC::Encoder>&& encoder, OptionSet<IPC::SendOption> sendOptions, Optional<std::pair<CompletionHandler<void(IPC::Decoder*)>, uint64_t>>&& asyncReplyInfo, ShouldStartProcessThrottlerActivity shouldStartProcessThrottlerActivity)
    162162{
    163     // FIXME: We should turn this into a RELEASE_ASSERT().
    164     ASSERT(isMainRunLoop());
    165     if (!isMainRunLoop()) {
    166         callOnMainRunLoop([protectedThis = makeRef(*this), encoder = WTFMove(encoder), sendOptions, asyncReplyInfo = WTFMove(asyncReplyInfo), shouldStartProcessThrottlerActivity]() mutable {
    167             protectedThis->sendMessage(WTFMove(encoder), sendOptions, WTFMove(asyncReplyInfo), shouldStartProcessThrottlerActivity);
    168         });
    169         return true;
    170     }
     163    RELEASE_ASSERT(isMainRunLoop());
    171164
    172165    if (asyncReplyInfo && canSendMessage() && shouldStartProcessThrottlerActivity == ShouldStartProcessThrottlerActivity::Yes) {
     
    236229{
    237230    ASSERT(!m_connection);
    238     ASSERT(isMainRunLoop());
     231    RELEASE_ASSERT(isMainRunLoop());
    239232
    240233    if (!IPC::Connection::identifierIsValid(connectionIdentifier))
     
    257250void AuxiliaryProcessProxy::replyToPendingMessages()
    258251{
    259     ASSERT(isMainRunLoop());
     252    RELEASE_ASSERT(isMainRunLoop());
    260253    for (auto& pendingMessage : std::exchange(m_pendingMessages, { })) {
    261254        if (pendingMessage.asyncReplyInfo)
Note: See TracChangeset for help on using the changeset viewer.