Changeset 196714 in webkit


Ignore:
Timestamp:
Feb 17, 2016 12:40:28 PM (8 years ago)
Author:
ddkilzer@apple.com
Message:

[iOS WK1] NSTimer in WebGeolocationProviderIOS.mm fires on the main thread without the WebThreadLock
<http://webkit.org/b/154347>
<rdar://problem/19360382>

Reviewed by Andy Estes.

This isn't testable because the GeolocationClientMock in WebCore
bypasses this code in WebKit1.

  • Misc/WebGeolocationProviderIOS.mm:

(-[WebGeolocationProviderIOS _handlePendingInitialPosition:]):
Assert that this is always called on the WebThread.
(-[WebGeolocationProviderIOS registerWebView:]): Register the
NSTimer on the WebThread NSRunLoop.

Location:
trunk/Source/WebKit/ios
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ios/ChangeLog

    r195180 r196714  
     12016-02-17  David Kilzer  <ddkilzer@apple.com>
     2
     3        [iOS WK1] NSTimer in WebGeolocationProviderIOS.mm fires on the main thread without the WebThreadLock
     4        <http://webkit.org/b/154347>
     5        <rdar://problem/19360382>
     6
     7        Reviewed by Andy Estes.
     8
     9        This isn't testable because the GeolocationClientMock in WebCore
     10        bypasses this code in WebKit1.
     11
     12        * Misc/WebGeolocationProviderIOS.mm:
     13        (-[WebGeolocationProviderIOS _handlePendingInitialPosition:]):
     14        Assert that this is always called on the WebThread.
     15        (-[WebGeolocationProviderIOS registerWebView:]): Register the
     16        NSTimer on the WebThread NSRunLoop.
     17
    1182016-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
    219
  • trunk/Source/WebKit/ios/Misc/WebGeolocationProviderIOS.mm

    r168555 r196714  
    158158{
    159159    ASSERT_UNUSED(timer, timer == _sendLastPositionAsynchronouslyTimer);
     160    ASSERT(WebThreadIsCurrent());
    160161
    161162    if (_lastPosition) {
     
    197198    // On WebKit2, we could skip that and send the position directly from the UIProcess.
    198199    _pendingInitialPositionWebView.add(webView);
    199     if (!_sendLastPositionAsynchronouslyTimer)
    200         _sendLastPositionAsynchronouslyTimer = [NSTimer scheduledTimerWithTimeInterval:0
    201                                                                                 target:self
    202                                                                               selector:@selector(_handlePendingInitialPosition:)
    203                                                                               userInfo:nil
    204                                                                                repeats:NO];
     200    if (!_sendLastPositionAsynchronouslyTimer) {
     201        _sendLastPositionAsynchronouslyTimer = [NSTimer timerWithTimeInterval:0 target:self selector:@selector(_handlePendingInitialPosition:) userInfo:nil repeats:NO];
     202        [WebThreadNSRunLoop() addTimer:_sendLastPositionAsynchronouslyTimer.get() forMode:NSDefaultRunLoopMode];
     203    }
    205204}
    206205
Note: See TracChangeset for help on using the changeset viewer.