Changeset 247375 in webkit


Ignore:
Timestamp:
Jul 11, 2019 4:58:35 PM (5 years ago)
Author:
Chris Dumez
Message:

ASSERTION FAILED: RunLoop::isMain() under IPC::Connection::sendWithAsyncReply()
https://bugs.webkit.org/show_bug.cgi?id=199734
<rdar://problem/52977439>

Reviewed by Geoffrey Garen.

It appears WKProcessTaskStateObserverDelegate's taskStateDidChange handler can get called
on a background thread so we need to make sure we go back to the main thread before we
go into WebKit and do IPC.

  • Shared/Cocoa/ProcessTaskStateObserver.mm:

(-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r247370 r247375  
     12019-07-11  Chris Dumez  <cdumez@apple.com>
     2
     3        ASSERTION FAILED: RunLoop::isMain() under IPC::Connection::sendWithAsyncReply()
     4        https://bugs.webkit.org/show_bug.cgi?id=199734
     5        <rdar://problem/52977439>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        It appears WKProcessTaskStateObserverDelegate's taskStateDidChange handler can get called
     10        on a background thread so we need to make sure we go back to the main thread before we
     11        go into WebKit and do IPC.
     12
     13        * Shared/Cocoa/ProcessTaskStateObserver.mm:
     14        (-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
     15
    1162019-07-11  Sihui Liu  <sihui_liu@apple.com>
    217
  • trunk/Source/WebKit/Shared/Cocoa/ProcessTaskStateObserver.mm

    r244091 r247375  
    4848    RELEASE_LOG(ProcessSuspension, "%p -[WKProcessTaskStateObserverDelegate process:taskStateDidChange:], process(%p), newState(%d)", self, process, (int)newState);
    4949
    50     if (self.taskStateChangedCallback)
    51         self.taskStateChangedCallback(newState);
     50    dispatch_async(dispatch_get_main_queue(), ^{
     51        if (self.taskStateChangedCallback)
     52            self.taskStateChangedCallback(newState);
     53    });
    5254}
    5355@end
Note: See TracChangeset for help on using the changeset viewer.