Title: [181607] trunk/Source/WebKit2
Revision
181607
Author
[email protected]
Date
2015-03-16 19:58:07 -0700 (Mon, 16 Mar 2015)

Log Message

Don't pass nil as a fireDate for NSTimer
https://bugs.webkit.org/show_bug.cgi?id=142765

Reviewed by Dan Bernstein.

While we're here, switch to a selector that conforms to documented NSTimer API.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController cancelOperation:]):
Set the timer's fireDate as the future date matching the former interval; update the selector.
(-[WKFullScreenWindowController _watchdogTimerFired:]):
Timer callback; wrap -exitFullScreen.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (181606 => 181607)


--- trunk/Source/WebKit2/ChangeLog	2015-03-17 02:27:03 UTC (rev 181606)
+++ trunk/Source/WebKit2/ChangeLog	2015-03-17 02:58:07 UTC (rev 181607)
@@ -1,3 +1,18 @@
+2015-03-16  Conrad Shultz  <[email protected]>
+
+        Don't pass nil as a fireDate for NSTimer
+        https://bugs.webkit.org/show_bug.cgi?id=142765
+
+        Reviewed by Dan Bernstein.
+
+        While we're here, switch to a selector that conforms to documented NSTimer API.
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController cancelOperation:]):
+        Set the timer's fireDate as the future date matching the former interval; update the selector.
+        (-[WKFullScreenWindowController _watchdogTimerFired:]):
+        Timer callback; wrap -exitFullScreen.
+
 2015-03-16  Alex Christensen  <[email protected]>
 
         Progress towards CMake on Mac

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (181606 => 181607)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2015-03-17 02:27:03 UTC (rev 181606)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2015-03-17 02:58:07 UTC (rev 181607)
@@ -154,7 +154,7 @@
     // the WebProcess has hung, so exit anyway.
     if (!_watchdogTimer) {
         [self _manager]->requestExitFullScreen();
-        _watchdogTimer = adoptNS([[NSTimer alloc] initWithFireDate:nil interval:DefaultWatchdogTimerInterval target:self selector:@selector(exitFullScreen) userInfo:nil repeats:NO]);
+        _watchdogTimer = adoptNS([[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:DefaultWatchdogTimerInterval] interval:0 target:self selector:@selector(_watchdogTimerFired:) userInfo:nil repeats:NO]);
         [[NSRunLoop mainRunLoop] addTimer:_watchdogTimer.get() forMode:NSDefaultRunLoopMode];
     }
 }
@@ -671,6 +671,12 @@
     [[self window] displayIfNeeded];
     NSEnableScreenUpdates();
 }
+
+- (void)_watchdogTimerFired:(NSTimer *)timer
+{
+    [self exitFullScreen];
+}
+
 @end
 
 #endif // ENABLE(FULLSCREEN_API) && !PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to