Add a class that tracks whether we're a background or foreground application
Created attachment 255448 [details] Patch
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.
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.
(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::).
Committed r185894: <http://trac.webkit.org/changeset/185894>