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

Unified Diff: Source/core/frame/FrameHost.h

Issue 645623004: Reland "Streamline frame detach" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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/frame/FrameClient.h ('k') | Source/core/frame/FrameHost.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameHost.h
diff --git a/Source/core/frame/FrameHost.h b/Source/core/frame/FrameHost.h
index 40b4ec49e3d805618b6bae898e340fd7ab10eacb..adf7a5c9d52ee6464b5e72644e8f7df42bfafc79 100644
--- a/Source/core/frame/FrameHost.h
+++ b/Source/core/frame/FrameHost.h
@@ -85,6 +85,15 @@ public:
void trace(Visitor*);
+ // 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;
+ void incrementSubframeCount() { ++m_subframeCount; }
+ void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; }
+ int subframeCount() const;
+
private:
explicit FrameHost(Page&);
@@ -94,6 +103,7 @@ private:
const OwnPtrWillBeMember<ConsoleMessageStorage> m_consoleMessageStorage;
AtomicString m_overrideEncoding;
+ int m_subframeCount;
};
}
« no previous file with comments | « Source/core/frame/FrameClient.h ('k') | Source/core/frame/FrameHost.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698