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

Unified Diff: third_party/WebKit/Source/core/page/Page.cpp

Issue 2739033003: Move FrameHost::m_subframeCount to Page (Closed)
Patch Set: Created 3 years, 9 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: 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 65140b70f936b57305e88f7500b8f5d792536792..dc655f9a5d8db3fc70e19884559c2b71527583ef 100644
--- a/third_party/WebKit/Source/core/page/Page.cpp
+++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -118,6 +118,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);
@@ -378,6 +379,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:
« third_party/WebKit/Source/core/page/Page.h ('K') | « third_party/WebKit/Source/core/page/Page.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698