Changeset 195790 in webkit
- Timestamp:
- Jan 28, 2016 3:30:45 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r195787 r195790 1 2016-01-28 Antti Koivisto <antti@apple.com> 2 3 Tab suspension code hits asserts 4 5 6 Reviewed by Chris Dumez. 7 8 Enabling tab suspension and navigating around in a few tabs hits an assert in 9 ScriptExecutionContext::suspendActiveDOMObject. This is because suspend/resume reasons don't pair properly 10 11 * dom/Document.cpp: 12 (WebCore::Document::documentWillBecomeInactive): 13 (WebCore::Document::suspend): 14 (WebCore::Document::resume): 15 16 Provide the reason as argument. 17 18 * dom/Document.h: 19 * history/CachedFrame.cpp: 20 (WebCore::CachedFrameBase::restore): 21 22 No need to call resumeActiveDOMObjects/resumeScriptedAnimationControllerCallbacks explicitly as Document::resume does that. 23 24 (WebCore::CachedFrame::CachedFrame): 25 * loader/FrameLoader.cpp: 26 (WebCore::FrameLoader::commitProvisionalLoad): 27 * page/Page.cpp: 28 (WebCore::Page::canTabSuspend): 29 (WebCore::Page::setIsTabSuspended): 30 1 31 2016-01-28 Brady Eidson <beidson@apple.com> 2 32 -
trunk/Source/WebCore/dom/Document.cpp
r195743 r195790 4656 4656 } 4657 4657 4658 void Document::suspend( )4658 void Document::suspend(ActiveDOMObject::ReasonForSuspension reason) 4659 4659 { 4660 4660 if (m_isSuspended) … … 4681 4681 4682 4682 suspendScriptedAnimationControllerCallbacks(); 4683 suspendActiveDOMObjects( ActiveDOMObject::PageCache);4683 suspendActiveDOMObjects(reason); 4684 4684 4685 4685 ASSERT(m_frame); … … 4692 4692 } 4693 4693 4694 void Document::resume( )4694 void Document::resume(ActiveDOMObject::ReasonForSuspension reason) 4695 4695 { 4696 4696 if (!m_isSuspended) … … 4712 4712 m_frame->animation().resumeAnimationsForDocument(this); 4713 4713 4714 resumeActiveDOMObjects( ActiveDOMObject::PageWillBeSuspended);4714 resumeActiveDOMObjects(reason); 4715 4715 resumeScriptedAnimationControllerCallbacks(); 4716 4716 -
trunk/Source/WebCore/dom/Document.h
r195560 r195790 1012 1012 1013 1013 void documentWillBecomeInactive(); 1014 void suspend( );1015 void resume( );1014 void suspend(ActiveDOMObject::ReasonForSuspension); 1015 void resume(ActiveDOMObject::ReasonForSuspension); 1016 1016 1017 1017 void registerForMediaVolumeCallbacks(Element*); -
trunk/Source/WebCore/history/CachedFrame.cpp
r195605 r195790 93 93 94 94 frame.animation().resumeAnimationsForDocument(m_document.get()); 95 m_document->resumeActiveDOMObjects(ActiveDOMObject::PageCache); 96 m_document->resume ScriptedAnimationControllerCallbacks();95 96 m_document->resume(ActiveDOMObject::PageCache); 97 97 98 98 // It is necessary to update any platform script objects after restoring the … … 136 136 #endif 137 137 138 m_document->resume();139 138 } 140 139 … … 162 161 163 162 // Active DOM objects must be suspended before we cache the frame script data. 164 m_document->suspend( );163 m_document->suspend(ActiveDOMObject::PageCache); 165 164 166 165 m_cachedFrameScriptData = std::make_unique<ScriptCachedFrameData>(frame); -
trunk/Source/WebCore/loader/FrameLoader.cpp
r195722 r195790 1846 1846 m_frame.page()->chrome().didReceiveDocType(&m_frame); 1847 1847 #endif 1848 m_frame.document()->resume( );1848 m_frame.document()->resume(ActiveDOMObject::PageCache); 1849 1849 1850 1850 // Force a layout to update view size and thereby update scrollbars. -
trunk/Source/WebCore/page/Page.cpp
r195694 r195790 1864 1864 bool Page::canTabSuspend() 1865 1865 { 1866 return s_tabSuspensionIsEnabled && !m_isPrerender && (m_pageThrottler.activityState() == PageActivityState::NoFlags) && PageCache::singleton().canCache(*this); 1866 if (!s_tabSuspensionIsEnabled) 1867 return false; 1868 if (m_isPrerender) 1869 return false; 1870 if (m_pageThrottler.activityState() != PageActivityState::NoFlags) 1871 return false; 1872 // FIXME: PageCache::canCache does a bunch of checks that are not needed for the tab suspension case. There should be a specific check. 1873 if (!PageCache::singleton().canCache(*this)) 1874 return false; 1875 1876 return true; 1867 1877 } 1868 1878 … … 1872 1882 if (auto* document = frame->document()) { 1873 1883 if (shouldSuspend) 1874 document->suspend( );1884 document->suspend(ActiveDOMObject::PageWillBeSuspended); 1875 1885 else 1876 document->resume( );1886 document->resume(ActiveDOMObject::PageWillBeSuspended); 1877 1887 } 1878 1888 }
Note: See TracChangeset
for help on using the changeset viewer.