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

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

Issue 2616513002: Make sure pages that are closing but not yet closed are still suspended. (Closed)
Patch Set: Created 3 years, 12 months 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
« no previous file with comments | « third_party/WebKit/Source/core/page/FrameTree.cpp ('k') | third_party/WebKit/Source/core/page/Page.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/Page.h
diff --git a/third_party/WebKit/Source/core/page/Page.h b/third_party/WebKit/Source/core/page/Page.h
index 69e603bfc81921b7e1cc668dbaa8ee6dc62ee935..2c402f710641810b8318150be96c33d55ac8c989 100644
--- a/third_party/WebKit/Source/core/page/Page.h
+++ b/third_party/WebKit/Source/core/page/Page.h
@@ -60,6 +60,7 @@ class Frame;
class FrameHost;
class PluginData;
class PointerLockController;
+class ScopedPageSuspender;
class ScrollingCoordinator;
class Settings;
class SpellCheckerClient;
@@ -104,7 +105,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
~Page() override;
- void willBeClosed();
+ void closeSoon();
+ bool isClosing() const { return m_isClosing; }
using PageSet = PersistentHeapHashSet<WeakMember<Page>>;
@@ -187,10 +189,13 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
return m_tabKeyCyclesThroughElements;
}
- // DefersLoading is used to delay loads during modal dialogs.
- // Modal dialogs are supposed to freeze all background processes
- // in the page, including prevent additional loads from staring/continuing.
- void setSuspended(bool);
+ // Suspension is used to implement the "Optionally, pause while waiting for
+ // the user to acknowledge the message" step of simple dialog processing:
+ // https://html.spec.whatwg.org/multipage/webappapis.html#simple-dialogs
+ //
+ // Per https://html.spec.whatwg.org/multipage/webappapis.html#pause, no loads
+ // are allowed to start/continue in this state, and all background processing
+ // is also suspended.
bool suspended() const { return m_suspended; }
void setPageScaleFactor(float);
@@ -228,6 +233,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
void willBeDestroyed();
private:
+ friend class ScopedPageSuspender;
+
explicit Page(PageClients&);
void initGroup();
@@ -235,6 +242,9 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
// SettingsDelegate overrides.
void settingsChanged(SettingsDelegate::ChangeType) override;
+ // ScopedPageSuspender helpers.
+ void setSuspended(bool);
+
Member<PageAnimator> m_animator;
const Member<AutoscrollController> m_autoscrollController;
Member<ChromeClient> m_chromeClient;
@@ -270,6 +280,12 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
HostsUsingFeatures m_hostsUsingFeatures;
bool m_openedByDOM;
+ // Set to true when window.close() has been called and the Page will be
+ // destroyed. The browsing contexts in this page should no longer be
+ // discoverable via JS.
+ // TODO(dcheng): Try to remove |DOMWindow::m_windowIsClosing| in favor of
+ // this. However, this depends on resolving https://crbug.com/674641
+ bool m_isClosing;
bool m_tabKeyCyclesThroughElements;
bool m_suspended;
« no previous file with comments | « third_party/WebKit/Source/core/page/FrameTree.cpp ('k') | third_party/WebKit/Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698