Index: third_party/WebKit/Source/core/page/Page.cpp |
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp |
index 0fb749217d8d06e6504136175415ac9bfb220106..b50ea01041ec455c10b03e7af81fb8cdfc95eca5 100644 |
--- a/third_party/WebKit/Source/core/page/Page.cpp |
+++ b/third_party/WebKit/Source/core/page/Page.cpp |
@@ -63,13 +63,18 @@ namespace blink { |
// Set of all live pages; includes internal Page objects that are |
// not observable from scripts. |
static Page::PageSet& allPages() { |
- DEFINE_STATIC_LOCAL(Page::PageSet, allPages, ()); |
- return allPages; |
+ DEFINE_STATIC_LOCAL(Page::PageSet, pages, ()); |
+ return pages; |
} |
Page::PageSet& Page::ordinaryPages() { |
- DEFINE_STATIC_LOCAL(Page::PageSet, ordinaryPages, ()); |
- return ordinaryPages; |
+ DEFINE_STATIC_LOCAL(Page::PageSet, pages, ()); |
+ return pages; |
+} |
+ |
+Page::PageSet& Page::willBeClosedOrdinaryPages() { |
+ DEFINE_STATIC_LOCAL(Page::PageSet, pages, ()); |
+ return pages; |
} |
void Page::networkStateChanged(bool online) { |
@@ -512,10 +517,13 @@ void Page::willCloseLayerTreeView(WebLayerTreeView& layerTreeView) { |
} |
void Page::willBeClosed() { |
+ DCHECK(!ScopedPageSuspender::isActive()); |
ordinaryPages().remove(this); |
+ willBeClosedOrdinaryPages().add(this); |
} |
void Page::willBeDestroyed() { |
+ DCHECK(!ScopedPageSuspender::isActive()); |
Frame* mainFrame = m_mainFrame; |
mainFrame->detach(FrameDetachType::Remove); |
@@ -523,6 +531,7 @@ void Page::willBeDestroyed() { |
ASSERT(allPages().contains(this)); |
allPages().remove(this); |
ordinaryPages().remove(this); |
+ willBeClosedOrdinaryPages().remove(this); |
if (m_scrollingCoordinator) |
m_scrollingCoordinator->willBeDestroyed(); |