Changeset 249077 in webkit
- Timestamp:
- Aug 23, 2019, 5:24:11 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/network/ios/NetworkStateNotifierIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r249076 r249077 1 2019-08-23 Chris Dumez <cdumez@apple.com> 2 3 Crash under TimerBase::setNextFireTime() in the NetworkProcess 4 https://bugs.webkit.org/show_bug.cgi?id=201097 5 <rdar://problem/54658339> 6 7 Reviewed by Ryosuke Niwa. 8 9 NetworkStateNotifier is a WebCore/platform class used by both WebKitLegacy and WebKit2 in the NetworkProcess. 10 On iOS, the lambda in the implementation of NetworkStateNotifier::startObserving() may get called by the 11 underlying framework on a non-main thread and we therefore want to go back to the main thread before calling 12 NetworkStateNotifier::singleton().updateStateSoon(). This is important because updateStateSoon() will schedule 13 a WebCore::Timer. The issue is that the code was using WebThreadRun() to go back the the main thread. While 14 this works fine in iOS WK1, it does not do what we want in WebKit2 in the network process. Indeed, before there 15 is no WebThread in the network process, WebThreadRun() will simply run the block on whatever thread we're one. 16 This would lead to crashes when trying to schedule the Timer in updateStateSoon(). To address the issue, we now 17 use callOnMainThread(). 18 19 * platform/network/ios/NetworkStateNotifierIOS.mm: 20 (WebCore::NetworkStateNotifier::startObserving): 21 1 22 2019-08-23 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm
r240355 r249077 85 85 return; 86 86 m_observer = adoptNS([[WebNetworkStateObserver alloc] initWithBlock:^ { 87 WebThreadRun(^{87 callOnMainThread([] { 88 88 NetworkStateNotifier::singleton().updateStateSoon(); 89 89 });
Note:
See TracChangeset
for help on using the changeset viewer.