Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: third_party/WebKit/Source/core/page/Page.cpp

Issue 2580703003: Make sure pages that are closing but not yet closed are still suspended. (Closed)
Patch Set: revert no longer needed test change Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..49b054f6f50e87d2a90b8310bfdead61725c6342 100644
--- a/third_party/WebKit/Source/core/page/Page.cpp
+++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -63,13 +63,13 @@ 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;
}
void Page::networkStateChanged(bool online) {
@@ -150,6 +150,17 @@ Page::~Page() {
ASSERT(!m_mainFrame);
}
+void Page::closeSoon() {
+ // Make sure this Page can no longer be found by JS.
+ m_isClosing = true;
+
+ // TODO(dcheng): Try to remove this in a followup, it's not obviously needed.
+ if (m_mainFrame->isLocalFrame())
+ toLocalFrame(m_mainFrame)->loader().stopAllLoaders();
kinuko 2016/12/21 13:38:17 Is the TODO the reason you replaced mainFrame->sto
dcheng 2016/12/22 08:39:11 Yes: we were calling generically through mainFrame
+
+ chromeClient().closeWindowSoon();
+}
+
ViewportDescription Page::viewportDescription() const {
return mainFrame() && mainFrame()->isLocalFrame() &&
deprecatedLocalMainFrame()->document()
@@ -511,10 +522,6 @@ void Page::willCloseLayerTreeView(WebLayerTreeView& layerTreeView) {
m_scrollingCoordinator->willCloseLayerTreeView(layerTreeView);
}
-void Page::willBeClosed() {
- ordinaryPages().remove(this);
-}
-
void Page::willBeDestroyed() {
Frame* mainFrame = m_mainFrame;

Powered by Google App Engine
This is Rietveld 408576698