Index: third_party/WebKit/Source/core/page/Page.cpp |
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp |
index 0aa6889799c7803c12dd4efcd087669cca815225..d8c2dfa769ffdfa66e2c35d5991748887a5ee653 100644 |
--- a/third_party/WebKit/Source/core/page/Page.cpp |
+++ b/third_party/WebKit/Source/core/page/Page.cpp |
@@ -120,6 +120,7 @@ Page::Page(PageClients& pageClients) |
m_deviceScaleFactor(1), |
m_visibilityState(PageVisibilityStateVisible), |
m_isCursorVisible(true), |
+ m_subframeCount(0), |
m_frameHost(FrameHost::create(*this)) { |
ASSERT(m_editorClient); |
@@ -388,6 +389,25 @@ bool Page::isCursorVisible() const { |
return m_isCursorVisible; |
} |
+#if DCHECK_IS_ON() |
+void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) { |
+ DCHECK_GE(expectedFrameCount, 0); |
+ |
+ int actualFrameCount = 0; |
+ for (; frame; frame = frame->tree().traverseNext()) |
+ ++actualFrameCount; |
+ |
+ DCHECK_EQ(expectedFrameCount, actualFrameCount); |
+} |
+#endif |
+ |
+int Page::subframeCount() const { |
+#if DCHECK_IS_ON() |
+ checkFrameCountConsistency(m_subframeCount + 1, mainFrame()); |
+#endif |
+ return m_subframeCount; |
+} |
+ |
void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { |
switch (changeType) { |
case SettingsDelegate::StyleChange: |