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

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
Index: Source/core/frame/FrameHost.h
diff --git a/Source/core/frame/FrameHost.h b/Source/core/frame/FrameHost.h
index 37dccda148597cfef4abfaba53e356e1e805a49f..9f1792f8e0279cb11a2bf95013104d28148343c8 100644
--- a/Source/core/frame/FrameHost.h
+++ b/Source/core/frame/FrameHost.h
@@ -82,6 +82,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 incrementFrameCount() { ++m_frameCount; }
+ void decrementFrameCount() { ASSERT(m_frameCount); --m_frameCount; }
+ int frameCount() const;
+
private:
explicit FrameHost(Page&);
@@ -90,6 +99,7 @@ private:
const OwnPtrWillBeMember<EventHandlerRegistry> m_eventHandlerRegistry;
AtomicString m_overrideEncoding;
+ int m_frameCount;
};
}

Powered by Google App Engine
This is Rietveld 408576698