Changeset 255222 in webkit
- Timestamp:
- Jan 27, 2020 7:09:35 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r255220 r255222 1 2020-01-27 David Quesada <david_quesada@apple.com> 2 3 Support observing a different set of view service state notifications in ApplicationStateTracker 4 https://bugs.webkit.org/show_bug.cgi?id=201737 5 rdar://problem/54786414 6 7 Reviewed by Chris Dumez. 8 9 * UIProcess/ApplicationStateTracker.mm: 10 Make ApplicationStateTracker conditionally (based on a flag to be defined in WebKitAdditions) 11 use a different pair of notifications when it is in a view service or extension. These 12 notifications report state changes of the individual scene that hosts the web view, rather 13 than the state of the overall host application. This allows for more accurate state tracking 14 for web views in extensions or view services hosted by apps with multiple open scenes. 15 1 16 2020-01-27 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebKit/UIProcess/ApplicationStateTracker.mm
r250187 r255222 41 41 @end 42 42 43 #if HAVE(UISCENE_BASED_VIEW_SERVICE_STATE_NOTIFICATIONS) 44 static NSNotificationName const viewServiceBackgroundNotificationName = @"_UIViewServiceHostSceneDidEnterBackgroundNotification"; 45 static NSNotificationName const viewServiceForegroundNotificationName = @"_UIViewServiceHostSceneWillEnterForegroundNotification"; 46 #else 47 static NSNotificationName const viewServiceBackgroundNotificationName = @"_UIViewServiceHostDidEnterBackgroundNotification"; 48 static NSNotificationName const viewServiceForegroundNotificationName = @"_UIViewServiceHostWillEnterForegroundNotification"; 49 #endif 50 43 51 namespace WebKit { 44 52 … … 169 177 RELEASE_LOG(ProcessSuspension, "%{public}s has PID %d, host application PID: %d, isInBackground: %d", _UIApplicationIsExtension() ? "Extension" : "ViewService", getpid(), applicationPID, m_isInBackground); 170 178 171 m_didEnterBackgroundObserver = [notificationCenter addObserverForName: @"_UIViewServiceHostDidEnterBackgroundNotification"object:serviceViewController queue:nil usingBlock:[this, applicationPID](NSNotification *) {179 m_didEnterBackgroundObserver = [notificationCenter addObserverForName:viewServiceBackgroundNotificationName object:serviceViewController queue:nil usingBlock:[this, applicationPID](NSNotification *) { 172 180 RELEASE_LOG(ProcessSuspension, "%{public}s has PID %d, host application PID: %d, didEnterBackground", _UIApplicationIsExtension() ? "Extension" : "ViewService", getpid(), applicationPID); 173 181 applicationDidEnterBackground(); 174 182 }]; 175 m_willEnterForegroundObserver = [notificationCenter addObserverForName: @"_UIViewServiceHostWillEnterForegroundNotification"object:serviceViewController queue:nil usingBlock:[this, applicationPID](NSNotification *) {183 m_willEnterForegroundObserver = [notificationCenter addObserverForName:viewServiceForegroundNotificationName object:serviceViewController queue:nil usingBlock:[this, applicationPID](NSNotification *) { 176 184 RELEASE_LOG(ProcessSuspension, "%{public}s has PID %d, host application PID: %d, willEnterForeground", _UIApplicationIsExtension() ? "Extension" : "ViewService", getpid(), applicationPID); 177 185 applicationWillEnterForeground();
Note: See TracChangeset
for help on using the changeset viewer.