Changeset 261407 in webkit
- Timestamp:
- May 8, 2020 1:10:24 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r261405 r261407 1 2020-05-08 Chris Dumez <cdumez@apple.com> 2 3 Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority 4 https://bugs.webkit.org/show_bug.cgi?id=211632 5 6 Reviewed by Darin Adler. 7 8 Make WKWebViewConfiguration._alwaysRunsAtForegroundPriority an alias for _clientNavigationsRunAtForegroundPriority. 9 _alwaysRunsAtForegroundPriority is a frequent source of process assertion leaks that get blamed on WebKit. Clients 10 are using this in order to be able to do loads in background views so _clientNavigationsRunAtForegroundPriority 11 should suffice and is not leak prone since the process assertion is released after the navigation has completed. 12 13 * UIProcess/API/APIPageConfiguration.cpp: 14 (API::PageConfiguration::copy const): 15 * UIProcess/API/APIPageConfiguration.h: 16 (API::PageConfiguration::alwaysRunsAtForegroundPriority const): Deleted. 17 (API::PageConfiguration::setAlwaysRunsAtForegroundPriority): Deleted. 18 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: 19 (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]): 20 (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]): 21 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 22 * UIProcess/WebPageProxy.cpp: 23 (WebKit::WebPageProxy::close): 24 (WebKit::WebPageProxy::updateThrottleState): 25 (WebKit::WebPageProxy::resetStateAfterProcessExited): 26 * UIProcess/WebPageProxy.h: 27 1 28 2020-05-08 Alex Christensen <achristensen@webkit.org> 2 29 -
trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp
r260303 r261407 74 74 #if PLATFORM(IOS_FAMILY) 75 75 copy->m_clientNavigationsRunAtForegroundPriority = this->m_clientNavigationsRunAtForegroundPriority; 76 copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority;77 76 copy->m_canShowWhileLocked = this->m_canShowWhileLocked; 78 77 copy->m_clickInteractionDriverForTesting = this->m_clickInteractionDriverForTesting; -
trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h
r260303 r261407 94 94 bool clientNavigationsRunAtForegroundPriority() const { return m_clientNavigationsRunAtForegroundPriority; } 95 95 void setClientNavigationsRunAtForegroundPriority(bool value) { m_clientNavigationsRunAtForegroundPriority = value; } 96 bool alwaysRunsAtForegroundPriority() const { return m_alwaysRunsAtForegroundPriority; } 97 void setAlwaysRunsAtForegroundPriority(bool alwaysRunsAtForegroundPriority) { m_alwaysRunsAtForegroundPriority = alwaysRunsAtForegroundPriority; } 98 96 99 97 bool canShowWhileLocked() const { return m_canShowWhileLocked; } 100 98 void setCanShowWhileLocked(bool canShowWhileLocked) { m_canShowWhileLocked = canShowWhileLocked; } … … 176 174 #if PLATFORM(IOS_FAMILY) 177 175 bool m_clientNavigationsRunAtForegroundPriority { true }; 178 bool m_alwaysRunsAtForegroundPriority { false };179 176 bool m_canShowWhileLocked { false }; 180 177 RetainPtr<_UIClickInteractionDriving> m_clickInteractionDriverForTesting; -
trunk/Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.mm
r249902 r261407 145 145 #if PLATFORM(IOS_FAMILY) 146 146 configuration.allowsInlineMediaPlayback = NO; 147 configuration._ alwaysRunsAtForegroundPriority = YES;147 configuration._clientNavigationsRunAtForegroundPriority = YES; 148 148 #endif 149 149 } -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
r261396 r261407 730 730 - (BOOL)_alwaysRunsAtForegroundPriority 731 731 { 732 return _pageConfiguration-> alwaysRunsAtForegroundPriority();732 return _pageConfiguration->clientNavigationsRunAtForegroundPriority(); 733 733 } 734 734 735 735 - (void)_setAlwaysRunsAtForegroundPriority:(BOOL)alwaysRunsAtForegroundPriority 736 736 { 737 _pageConfiguration->set AlwaysRunsAtForegroundPriority(alwaysRunsAtForegroundPriority);737 _pageConfiguration->setClientNavigationsRunAtForegroundPriority(alwaysRunsAtForegroundPriority); 738 738 } 739 739 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
r260334 r261407 92 92 #if TARGET_OS_IPHONE 93 93 @property (nonatomic, setter=_setClientNavigationsRunAtForegroundPriority:) BOOL _clientNavigationsRunAtForegroundPriority WK_API_AVAILABLE(ios(WK_IOS_TBA)); 94 @property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_API_ AVAILABLE(ios(9_0));94 @property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_API_DEPRECATED_WITH_REPLACEMENT("_clientNavigationsRunAtForegroundPriority", ios(9.0, WK_IOS_TBA)); 95 95 @property (nonatomic, setter=_setInlineMediaPlaybackRequiresPlaysInlineAttribute:) BOOL _inlineMediaPlaybackRequiresPlaysInlineAttribute WK_API_AVAILABLE(ios(10.0)); 96 96 @property (nonatomic, setter=_setAllowsInlineMediaPlaybackAfterFullscreen:) BOOL _allowsInlineMediaPlaybackAfterFullscreen WK_API_AVAILABLE(ios(10.0)); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r261394 r261407 465 465 , m_notificationPermissionRequestManager(*this) 466 466 #if PLATFORM(IOS_FAMILY) 467 , m_alwaysRunsAtForegroundPriority(m_configuration->alwaysRunsAtForegroundPriority())468 467 , m_audibleActivityTimer(RunLoop::main(), this, &WebPageProxy::clearAudibleActivity) 469 468 #endif … … 1127 1126 m_isCapturingActivity = nullptr; 1128 1127 m_openingAppLinkActivity = nullptr; 1129 m_alwaysRunsAtForegroundPriorityActivity = nullptr;1130 1128 m_audibleActivityTimer.stop(); 1131 1129 #endif … … 2082 2080 RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "updateThrottleState: UIProcess is releasing a foreground assertion because media capture is no longer active"); 2083 2081 m_isCapturingActivity = nullptr; 2084 }2085 2086 if (m_alwaysRunsAtForegroundPriority) {2087 if (!m_alwaysRunsAtForegroundPriorityActivity || !m_alwaysRunsAtForegroundPriorityActivity->isValid()) {2088 RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "updateThrottleState: UIProcess is taking a foreground assertion because m_alwaysRunsAtForegroundPriority is true");2089 m_alwaysRunsAtForegroundPriorityActivity = m_process->throttler().foregroundActivity("View always runs at foreground priority"_s).moveToUniquePtr();2090 }2091 } else if (m_alwaysRunsAtForegroundPriorityActivity) {2092 RELEASE_LOG_IF_ALLOWED(ProcessSuspension, "updateThrottleState: UIProcess is releasing a foreground assertion because m_alwaysRunsAtForegroundPriority is no longer true");2093 m_alwaysRunsAtForegroundPriorityActivity = nullptr;2094 2082 } 2095 2083 #endif … … 7661 7649 m_isCapturingActivity = nullptr; 7662 7650 m_openingAppLinkActivity = nullptr; 7663 m_alwaysRunsAtForegroundPriorityActivity = nullptr;7664 7651 #endif 7665 7652 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r261394 r261407 2448 2448 #if PLATFORM(IOS_FAMILY) 2449 2449 bool m_allowsMediaDocumentInlinePlayback { false }; 2450 bool m_alwaysRunsAtForegroundPriority { false };2451 2450 std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isVisibleActivity; 2452 2451 std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isAudibleActivity; 2453 2452 std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isCapturingActivity; 2454 std::unique_ptr<ProcessThrottler::ForegroundActivity> m_alwaysRunsAtForegroundPriorityActivity;2455 2453 RunLoop::Timer<WebPageProxy> m_audibleActivityTimer; 2456 2454 std::unique_ptr<ProcessThrottler::BackgroundActivity> m_openingAppLinkActivity; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm
r260366 r261407 97 97 98 98 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 99 [configuration _set AlwaysRunsAtForegroundPriority:YES];99 [configuration _setClientNavigationsRunAtForegroundPriority:YES]; 100 100 101 101 RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); -
trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
r260900 r261407 87 87 globalWebViewConfiguration._mediaDataLoadsAutomatically = YES; 88 88 globalWebViewConfiguration.requiresUserActionForMediaPlayback = NO; 89 90 // Make sure the view does not get suspended and runs at foreground priority, even if not visible on screen.91 globalWebViewConfiguration._alwaysRunsAtForegroundPriority = YES;92 89 #endif 93 90 globalWebViewConfiguration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
Note: See TracChangeset
for help on using the changeset viewer.