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

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

Issue 2752543003: Move FrameHost::m_subframeCount to Page (Closed)
Patch Set: Rebase 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/frame/FrameHost.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameHost.cpp b/third_party/WebKit/Source/core/frame/FrameHost.cpp
index 226ca9134f15aeed4ccd08009595bb12047f8e0a..f7885f68cb8875ae1fd27158514b0cb6479a992d 100644
--- a/third_party/WebKit/Source/core/frame/FrameHost.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameHost.cpp
@@ -42,9 +42,7 @@ FrameHost* FrameHost::create(Page& page) {
return new FrameHost(page);
}
-FrameHost::FrameHost(Page& page)
- : m_page(&page),
- m_subframeCount(0) {}
+FrameHost::FrameHost(Page& page) : m_page(&page) {}
// Explicitly in the .cpp to avoid default constructor in .h
FrameHost::~FrameHost() {}
@@ -85,23 +83,15 @@ DEFINE_TRACE(FrameHost) {
visitor->trace(m_page);
}
-#if DCHECK_IS_ON()
-void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) {
- ASSERT(expectedFrameCount >= 0);
-
- int actualFrameCount = 0;
- for (; frame; frame = frame->tree().traverseNext())
- ++actualFrameCount;
-
- ASSERT(expectedFrameCount == actualFrameCount);
+void FrameHost::incrementSubframeCount() {
+ page().incrementSubframeCount();
}
-#endif
+void FrameHost::decrementSubframeCount() {
+ page().decrementSubframeCount();
+}
int FrameHost::subframeCount() const {
-#if DCHECK_IS_ON()
- checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame());
-#endif
- return m_subframeCount;
+ return page().subframeCount();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameHost.h ('k') | third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698