RESOLVED FIXED 146259
Add a class that tracks whether we're a background or foreground application
https://bugs.webkit.org/show_bug.cgi?id=146259
Summary Add a class that tracks whether we're a background or foreground application
Anders Carlsson
Reported 2015-06-23 16:35:35 PDT
Add a class that tracks whether we're a background or foreground application
Attachments
Patch (19.94 KB, patch)
2015-06-23 16:38 PDT, Anders Carlsson
darin: review+
Anders Carlsson
Comment 1 2015-06-23 16:38:24 PDT
WebKit Commit Bot
Comment 2 2015-06-23 16:41:13 PDT
Attachment 255448 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/ApplicationStateTracker.mm:51: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/WebKit2/UIProcess/ApplicationStateTracker.mm:55: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 2 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3 2015-06-23 17:12:43 PDT
Comment on attachment 255448 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255448&action=review > Source/WebKit2/UIProcess/ApplicationStateTracker.h:45 > + void addListener(id, SEL willEnterForegroundSelector, SEL didEnterBackgroundSelector); Why not blocks instead of id/SEL? > Source/WebKit2/UIProcess/ios/WKContentView.mm:213 > + ApplicationStateTracker::singleton().addListener(self, @selector(_applicationDidEnterBackground), @selector(_applicationWillEnterForeground)); Need WebCore:: here or in a using above.
Anders Carlsson
Comment 4 2015-06-23 17:23:31 PDT
(In reply to comment #3) > Comment on attachment 255448 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=255448&action=review > > > Source/WebKit2/UIProcess/ApplicationStateTracker.h:45 > > + void addListener(id, SEL willEnterForegroundSelector, SEL didEnterBackgroundSelector); > > Why not blocks instead of id/SEL? Because I didn't want to have to think about retain cycles and figure out a way to remove the observers. (That's done automatically). > > > Source/WebKit2/UIProcess/ios/WKContentView.mm:213 > > + ApplicationStateTracker::singleton().addListener(self, @selector(_applicationDidEnterBackground), @selector(_applicationWillEnterForeground)); > > Need WebCore:: here or in a using above. Yes (Well, WebKit::).
Anders Carlsson
Comment 5 2015-06-23 17:51:23 PDT
Note You need to log in before you can comment on or make changes to this bug.