Changeset 248358 in webkit
- Timestamp:
- Aug 6, 2019, 11:53:01 PM (7 years ago)
- Location:
- branches/safari-608.1-branch
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/history/page-cache-MessagePort-pending-message-expected.txt (added)
-
LayoutTests/fast/history/page-cache-MessagePort-pending-message.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/MessagePort.cpp (modified) (3 diffs)
-
Source/WebCore/dom/ScriptExecutionContext.cpp (modified) (1 diff)
-
Source/WebCore/loader/DocumentLoader.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608.1-branch/LayoutTests/ChangeLog
r248354 r248358 1 2019-08-06 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r248148. rdar://problem/54017841 4 5 Pages using MessagePorts should be PageCacheable 6 https://bugs.webkit.org/show_bug.cgi?id=200366 7 <rdar://problem/53837882> 8 9 Reviewed by Geoffrey Garen. 10 11 Source/WebCore: 12 13 Allow a page to enter PageCache, even if it has MessagePorts (potentially with 14 pending messages). If there are pending messages on the MessagePorts when 15 entering PageCache, those will get dispatched upon restoring from PageCache. 16 17 Test: fast/history/page-cache-MessagePort-pending-message.html 18 19 * dom/MessagePort.cpp: 20 (WebCore::MessagePort::messageAvailable): 21 (WebCore::MessagePort::dispatchMessages): 22 Do not dispatch messages while in PageCache. 23 24 (WebCore::MessagePort::canSuspendForDocumentSuspension const): 25 Allow pages with MessagePort objects to enter PageCache. 26 27 * dom/ScriptExecutionContext.cpp: 28 (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): 29 Make sure pending messages on MessagePorts get dispatched asynchronously after restoring 30 from PageCache. 31 32 * loader/DocumentLoader.cpp: 33 (WebCore::areAllLoadersPageCacheAcceptable): 34 Make sure only CachedResources that are still loading upon load cancelation prevent 35 entering PageCache. 36 37 LayoutTests: 38 39 Add layout test coverage. 40 41 * fast/history/page-cache-MessagePort-pending-message-expected.txt: Added. 42 * fast/history/page-cache-MessagePort-pending-message.html: Added. 43 44 45 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248148 268f45cc-cd09-0410-ab3c-d52691b4dbfc 46 47 2019-08-01 Chris Dumez <cdumez@apple.com> 48 49 Pages using MessagePorts should be PageCacheable 50 https://bugs.webkit.org/show_bug.cgi?id=200366 51 <rdar://problem/53837882> 52 53 Reviewed by Geoffrey Garen. 54 55 Add layout test coverage. 56 57 * fast/history/page-cache-MessagePort-pending-message-expected.txt: Added. 58 * fast/history/page-cache-MessagePort-pending-message.html: Added. 59 1 60 2019-08-06 Kocsen Chung <kocsen_chung@apple.com> 2 61 -
branches/safari-608.1-branch/Source/WebCore/ChangeLog
r248356 r248358 1 2019-08-06 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r248148. rdar://problem/54017841 4 5 Pages using MessagePorts should be PageCacheable 6 https://bugs.webkit.org/show_bug.cgi?id=200366 7 <rdar://problem/53837882> 8 9 Reviewed by Geoffrey Garen. 10 11 Source/WebCore: 12 13 Allow a page to enter PageCache, even if it has MessagePorts (potentially with 14 pending messages). If there are pending messages on the MessagePorts when 15 entering PageCache, those will get dispatched upon restoring from PageCache. 16 17 Test: fast/history/page-cache-MessagePort-pending-message.html 18 19 * dom/MessagePort.cpp: 20 (WebCore::MessagePort::messageAvailable): 21 (WebCore::MessagePort::dispatchMessages): 22 Do not dispatch messages while in PageCache. 23 24 (WebCore::MessagePort::canSuspendForDocumentSuspension const): 25 Allow pages with MessagePort objects to enter PageCache. 26 27 * dom/ScriptExecutionContext.cpp: 28 (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): 29 Make sure pending messages on MessagePorts get dispatched asynchronously after restoring 30 from PageCache. 31 32 * loader/DocumentLoader.cpp: 33 (WebCore::areAllLoadersPageCacheAcceptable): 34 Make sure only CachedResources that are still loading upon load cancelation prevent 35 entering PageCache. 36 37 LayoutTests: 38 39 Add layout test coverage. 40 41 * fast/history/page-cache-MessagePort-pending-message-expected.txt: Added. 42 * fast/history/page-cache-MessagePort-pending-message.html: Added. 43 44 45 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248148 268f45cc-cd09-0410-ab3c-d52691b4dbfc 46 47 2019-08-01 Chris Dumez <cdumez@apple.com> 48 49 Pages using MessagePorts should be PageCacheable 50 https://bugs.webkit.org/show_bug.cgi?id=200366 51 <rdar://problem/53837882> 52 53 Reviewed by Geoffrey Garen. 54 55 Allow a page to enter PageCache, even if it has MessagePorts (potentially with 56 pending messages). If there are pending messages on the MessagePorts when 57 entering PageCache, those will get dispatched upon restoring from PageCache. 58 59 Test: fast/history/page-cache-MessagePort-pending-message.html 60 61 * dom/MessagePort.cpp: 62 (WebCore::MessagePort::messageAvailable): 63 (WebCore::MessagePort::dispatchMessages): 64 Do not dispatch messages while in PageCache. 65 66 (WebCore::MessagePort::canSuspendForDocumentSuspension const): 67 Allow pages with MessagePort objects to enter PageCache. 68 69 * dom/ScriptExecutionContext.cpp: 70 (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): 71 Make sure pending messages on MessagePorts get dispatched asynchronously after restoring 72 from PageCache. 73 74 * loader/DocumentLoader.cpp: 75 (WebCore::areAllLoadersPageCacheAcceptable): 76 Make sure only CachedResources that are still loading upon load cancelation prevent 77 entering PageCache. 78 1 79 2019-08-06 Kocsen Chung <kocsen_chung@apple.com> 2 80 -
branches/safari-608.1-branch/Source/WebCore/dom/MessagePort.cpp
r246490 r248358 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 -
branches/safari-608.1-branch/Source/WebCore/dom/ScriptExecutionContext.cpp
r243887 r248358 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 -
branches/safari-608.1-branch/Source/WebCore/loader/DocumentLoader.cpp
r247617 r248358 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.