WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
47299
Screensaver starts while watching fullscreen playback
https://bugs.webkit.org/show_bug.cgi?id=47299
Summary
Screensaver starts while watching fullscreen playback
Jer Noble
Reported
2010-10-06 13:39:01 PDT
9/25/10 7:25 PM Les Leposo: Somehow I thought this used to work well: i.e. screensaver never started while I was watching a fullscreen stream/video. But if it's not a regression, then it's definitely worth fixing since it is frustratingly microsoftesque. <
rdar://problem/8478956
>
Attachments
Patch
(3.54 KB, patch)
2010-10-06 13:48 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(3.66 KB, patch)
2010-10-06 17:27 PDT
,
Jer Noble
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2010-10-06 13:48:41 PDT
Created
attachment 69984
[details]
Patch
WebKit Review Bot
Comment 2
2010-10-06 14:01:30 PDT
Attachment 69984
[details]
did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit/mac/WebView/WebVideoFullscreenController.h:52: _idleSystemSleepAssertion is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] WebKit/mac/WebView/WebVideoFullscreenController.h:53: _tickleTimer is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 2 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3
2010-10-06 16:54:14 PDT
Comment on
attachment 69984
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=69984&action=review
> WebKit/mac/WebView/WebVideoFullscreenController.h:53 > + NSTimer* _tickleTimer;
Our style is to put spaces before the "*" for Objective-C types like this. Maybe we should change that style, but we have not yet done that.
> WebKit/mac/WebView/WebVideoFullscreenController.mm:46 > +static NSTimeInterval kTickleTimerInterval = 1.0;
This should be static const, not just static. Also, we don’t use “k” for such things in WebKit.
> WebKit/mac/WebView/WebVideoFullscreenController.mm:86 > + [_tickleTimer invalidate];
This needs to release the timer.
> WebKit/mac/WebView/WebVideoFullscreenController.mm:387 > + [_tickleTimer invalidate]; > + _tickleTimer = [NSTimer scheduledTimerWithTimeInterval:kTickleTimerInterval target:self selector:@selector(_tickleTimerFired) userInfo:nil repeats:YES];
This needs to release the old timer and retain the new timer.
> WebKit/mac/WebView/WebVideoFullscreenController.mm:393 > + [_tickleTimer invalidate]; > + _tickleTimer = nil;
This needs to release the timer.
Jer Noble
Comment 4
2010-10-06 17:12:45 PDT
(In reply to
comment #3
)
> (From update of
attachment 69984
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=69984&action=review
> > > WebKit/mac/WebView/WebVideoFullscreenController.h:53 > > + NSTimer* _tickleTimer; > > Our style is to put spaces before the "*" for Objective-C types like this. Maybe we should change that style, but we have not yet done that.
Whoops, right; Changed.
> > WebKit/mac/WebView/WebVideoFullscreenController.mm:46 > > +static NSTimeInterval kTickleTimerInterval = 1.0; > > This should be static const, not just static. Also, we don’t use “k” for such things in WebKit.
Changed.
> > WebKit/mac/WebView/WebVideoFullscreenController.mm:86 > > + [_tickleTimer invalidate]; > > This needs to release the timer.
The NSTimer is retained by the NSRunLoop which it is attached to. The run loop will release its reference when invalidate is called.
> > WebKit/mac/WebView/WebVideoFullscreenController.mm:387 > > + [_tickleTimer invalidate]; > > + _tickleTimer = [NSTimer scheduledTimerWithTimeInterval:kTickleTimerInterval target:self selector:@selector(_tickleTimerFired) userInfo:nil repeats:YES]; > > This needs to release the old timer and retain the new timer.
The scheduledTimerWithTimeInterval: method adds the new timer to the current NSRunLoop, which retains it. Do we really need to retain and release the timer twice?
> > WebKit/mac/WebView/WebVideoFullscreenController.mm:393 > > + [_tickleTimer invalidate]; > > + _tickleTimer = nil; > > This needs to release the timer.
This should be the same as the -dealloc case. (i.e. the NSRunLoop will release the timer.)
Jer Noble
Comment 5
2010-10-06 17:22:08 PDT
Looking through the WebKit source, it looks like everywhere else explicitly retains the results of +scheduledTimerWithInterval:. I've changed my patch to match.
Jer Noble
Comment 6
2010-10-06 17:27:00 PDT
Created
attachment 70018
[details]
Patch
WebKit Review Bot
Comment 7
2010-10-06 17:29:43 PDT
Attachment 70018
[details]
did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit/mac/WebView/WebVideoFullscreenController.h:52: _idleSystemSleepAssertion is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jer Noble
Comment 8
2010-10-07 10:40:04 PDT
Committed
r69318
: <
http://trac.webkit.org/changeset/69318
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug