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

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

Issue 618253002: Revert of Streamline frame detach (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | « Source/core/loader/FrameLoaderClient.h ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/Page.h
diff --git a/Source/core/page/Page.h b/Source/core/page/Page.h
index 9da896b3381744e891752622dcc107efe3470d08..c0bf5bfe39e49f0ed6242e56dd4639fb18a395a5 100644
--- a/Source/core/page/Page.h
+++ b/Source/core/page/Page.h
@@ -134,6 +134,10 @@
bool openedByDOM() const;
void setOpenedByDOM();
+ void incrementSubframeCount() { ++m_subframeCount; }
+ void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; }
+ int subframeCount() const { checkSubframeCountConsistency(); return m_subframeCount; }
+
PageAnimator& animator() { return m_animator; }
Chrome& chrome() const { return *m_chrome; }
AutoscrollController& autoscrollController() const { return *m_autoscrollController; }
@@ -181,6 +185,12 @@
StorageNamespace* sessionStorage(bool optionalCreate = true);
StorageClient& storageClient() const { return *m_storageClient; }
+ // Don't allow more than a certain number of frames in a page.
+ // This seems like a reasonable upper bound, and otherwise mutually
+ // recursive frameset pages can quickly bring the program to its knees
+ // with exponential growth in the number of frames.
+ static const int maxNumberOfFrames = 1000;
+
PageVisibilityState visibilityState() const;
void setVisibilityState(PageVisibilityState, bool);
@@ -217,6 +227,12 @@
private:
void initGroup();
+
+#if ENABLE(ASSERT)
+ void checkSubframeCountConsistency() const;
+#else
+ void checkSubframeCountConsistency() const { }
+#endif
void setTimerAlignmentInterval(double);
@@ -261,6 +277,7 @@
UseCounter m_useCounter;
+ int m_subframeCount;
bool m_openedByDOM;
bool m_tabKeyCyclesThroughElements;
« no previous file with comments | « Source/core/loader/FrameLoaderClient.h ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698