Changeset 253224 in webkit
- Timestamp:
- Dec 6, 2019 3:02:10 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r253219 r253224 1 2019-12-06 Chris Dumez <cdumez@apple.com> 2 3 Reduce timeout for page to handle beforeunload events when trying to close a page 4 https://bugs.webkit.org/show_bug.cgi?id=204950 5 <rdar://problem/57700419> 6 7 Reviewed by Ryosuke Niwa. 8 9 Reduce timeout for page to handle beforeunload events when trying to close a page. It would previously 10 take up to 3 seconds to actually close a tab after the user would click on the "X" to close it. This 11 is because we would wait for the page to fire and handle the beforeunload events and only give up after 12 3 seconds. This patch reduces this timeout to something more reasonable from a user standpoint (500ms). 13 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::m_tryCloseTimeoutTimer): 16 (WebKit::WebPageProxy::tryClose): 17 (WebKit::WebPageProxy::tryCloseTimedOut): 18 (WebKit::WebPageProxy::closePage): 19 (WebKit::m_resetRecentCrashCountTimer): Deleted. 20 * UIProcess/WebPageProxy.h: 21 1 22 2019-12-06 Jonathan Bedard <jbedard@apple.com> 2 23 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r253195 r253224 272 272 static unsigned maximumWebProcessRelaunchAttempts = 1; 273 273 static const Seconds audibleActivityClearDelay = 10_s; 274 static const Seconds tryCloseTimeoutDelay = 500_ms; 274 275 275 276 namespace WebKit { … … 450 451 #endif 451 452 , m_resetRecentCrashCountTimer(RunLoop::main(), this, &WebPageProxy::resetRecentCrashCount) 453 , m_tryCloseTimeoutTimer(RunLoop::main(), this, &WebPageProxy::tryCloseTimedOut) 452 454 { 453 455 RELEASE_LOG_IF_ALLOWED(Loading, "constructor:"); … … 1075 1077 return true; 1076 1078 1077 RELEASE_LOG_IF_ALLOWED( Loading, "tryClose:");1079 RELEASE_LOG_IF_ALLOWED(Process, "tryClose:"); 1078 1080 1079 1081 // Close without delay if the process allows it. Our goal is to terminate … … 1082 1084 return true; 1083 1085 1084 m_ process->responsivenessTimer().start();1086 m_tryCloseTimeoutTimer.startOneShot(tryCloseTimeoutDelay); 1085 1087 sendWithAsyncReply(Messages::WebPage::TryClose(), [this, weakThis = makeWeakPtr(*this)](bool shouldClose) { 1086 1088 if (!weakThis) 1087 1089 return; 1088 1090 1089 m_ process->responsivenessTimer().stop();1091 m_tryCloseTimeoutTimer.stop(); 1090 1092 if (shouldClose) 1091 1093 closePage(); 1092 1094 }); 1093 1095 return false; 1096 } 1097 1098 void WebPageProxy::tryCloseTimedOut() 1099 { 1100 RELEASE_LOG_ERROR_IF_ALLOWED(Process, "tryCloseTimedOut: Timed out waiting for the process to respond to the WebPage::TryClose IPC, closing the page now"); 1101 closePage(); 1094 1102 } 1095 1103 … … 5322 5330 void WebPageProxy::closePage() 5323 5331 { 5332 if (isClosed()) 5333 return; 5334 5335 RELEASE_LOG_IF_ALLOWED(Process, "closePage:"); 5324 5336 pageClient().clearAllEditCommands(); 5325 5337 m_uiClient->close(this); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r253187 r253224 2178 2178 #endif 2179 2179 2180 void tryCloseTimedOut(); 2180 2181 void makeStorageSpaceRequest(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, CompletionHandler<void(uint64_t)>&&); 2181 2182 … … 2595 2596 bool m_mayHaveUniversalFileReadSandboxExtension { false }; 2596 2597 2598 RunLoop::Timer<WebPageProxy> m_tryCloseTimeoutTimer; 2599 2597 2600 std::unique_ptr<ProvisionalPageProxy> m_provisionalPage; 2598 2601 std::unique_ptr<SuspendedPageProxy> m_suspendedPageKeptToPreventFlashing;
Note: See TracChangeset
for help on using the changeset viewer.