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

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

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/FrameHost.h ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameHost.cpp
diff --git a/Source/core/frame/FrameHost.cpp b/Source/core/frame/FrameHost.cpp
index 2576f898a13095d7b49b2cb525811cd8a8f849b1..a2f861fbc8ea6e178388053ba8fd9398762aaeba 100644
--- a/Source/core/frame/FrameHost.cpp
+++ b/Source/core/frame/FrameHost.cpp
@@ -49,6 +49,7 @@ FrameHost::FrameHost(Page& page)
, m_pinchViewport(PinchViewport::create(*this))
, m_eventHandlerRegistry(adoptPtrWillBeNoop(new EventHandlerRegistry(*this)))
, m_consoleMessageStorage(ConsoleMessageStorage::createForFrameHost(this))
+ , m_subframeCount(0)
{
}
@@ -100,4 +101,25 @@ void FrameHost::trace(Visitor* visitor)
visitor->trace(m_consoleMessageStorage);
}
+#if ENABLE(ASSERT)
+void checkFrameCountConsistency(int expectedFrameCount, Frame* frame)
+{
+ ASSERT(expectedFrameCount >= 0);
+
+ int actualFrameCount = 0;
+ for (; frame; frame = frame->tree().traverseNext())
+ ++actualFrameCount;
+
+ ASSERT(expectedFrameCount == actualFrameCount);
+}
+#endif
+
+int FrameHost::subframeCount() const
+{
+#if ENABLE(ASSERT)
+ checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame());
+#endif
+ return m_subframeCount;
+}
+
}
« no previous file with comments | « Source/core/frame/FrameHost.h ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698