Changeset 248148 in webkit
- Timestamp:
- Aug 1, 2019 10:46:32 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r248145 r248148 1 2019-08-01 Chris Dumez <cdumez@apple.com> 2 3 Pages using MessagePorts should be PageCacheable 4 https://bugs.webkit.org/show_bug.cgi?id=200366 5 <rdar://problem/53837882> 6 7 Reviewed by Geoffrey Garen. 8 9 Add layout test coverage. 10 11 * fast/history/page-cache-MessagePort-pending-message-expected.txt: Added. 12 * fast/history/page-cache-MessagePort-pending-message.html: Added. 13 1 14 2019-08-01 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r248147 r248148 1 2019-08-01 Chris Dumez <cdumez@apple.com> 2 3 Pages using MessagePorts should be PageCacheable 4 https://bugs.webkit.org/show_bug.cgi?id=200366 5 <rdar://problem/53837882> 6 7 Reviewed by Geoffrey Garen. 8 9 Allow a page to enter PageCache, even if it has MessagePorts (potentially with 10 pending messages). If there are pending messages on the MessagePorts when 11 entering PageCache, those will get dispatched upon restoring from PageCache. 12 13 Test: fast/history/page-cache-MessagePort-pending-message.html 14 15 * dom/MessagePort.cpp: 16 (WebCore::MessagePort::messageAvailable): 17 (WebCore::MessagePort::dispatchMessages): 18 Do not dispatch messages while in PageCache. 19 20 (WebCore::MessagePort::canSuspendForDocumentSuspension const): 21 Allow pages with MessagePort objects to enter PageCache. 22 23 * dom/ScriptExecutionContext.cpp: 24 (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): 25 Make sure pending messages on MessagePorts get dispatched asynchronously after restoring 26 from PageCache. 27 28 * loader/DocumentLoader.cpp: 29 (WebCore::areAllLoadersPageCacheAcceptable): 30 Make sure only CachedResources that are still loading upon load cancelation prevent 31 entering PageCache. 32 1 33 2019-08-01 Konstantin Tokarev <annulen@yandex.ru> 2 34 -
trunk/Source/WebCore/dom/MessagePort.cpp
r246490 r248148 196 196 // This MessagePort object might be disentangled because the port is being transferred, 197 197 // in which case we'll notify it that messages are available once a new end point is created. 198 if (!m_scriptExecutionContext )198 if (!m_scriptExecutionContext || m_scriptExecutionContext->activeDOMObjectsAreSuspended()) 199 199 return; 200 200 … … 244 244 ASSERT(started()); 245 245 246 if (! isEntangled())246 if (!m_scriptExecutionContext || m_scriptExecutionContext->activeDOMObjectsAreSuspended() || !isEntangled()) 247 247 return; 248 248 … … 431 431 bool MessagePort::canSuspendForDocumentSuspension() const 432 432 { 433 return !hasPendingActivity() || (!m_started || m_closed);433 return true; 434 434 } 435 435 -
trunk/Source/WebCore/dom/ScriptExecutionContext.cpp
r243887 r248148 308 308 return ShouldContinue::Yes; 309 309 }); 310 311 // In case there were pending messages at the time the script execution context entered PageCache, 312 // make sure those get dispatched shortly after restoring from PageCache. 313 processMessageWithMessagePortsSoon(); 310 314 } 311 315 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r247555 r248148 136 136 return false; 137 137 138 // Only image and XHR loads do prevent the page from entering the PageCache.138 // Only image and XHR loads do not prevent the page from entering the PageCache. 139 139 // All non-image loads will prevent the page from entering the PageCache. 140 if ( !cachedResource->isImage() && !cachedResource->areAllClientsXMLHttpRequests())140 if (cachedResource->isLoading() && !cachedResource->isImage() && !cachedResource->areAllClientsXMLHttpRequests()) 141 141 return false; 142 142 }
Note: See TracChangeset
for help on using the changeset viewer.