| Index: Source/core/frame/FrameHost.cpp
|
| diff --git a/Source/core/frame/FrameHost.cpp b/Source/core/frame/FrameHost.cpp
|
| index 8e5541d66473281e0c132871f36886729ad4a9b4..353f6407206461795b7af19ab8a47eba020926ef 100644
|
| --- a/Source/core/frame/FrameHost.cpp
|
| +++ b/Source/core/frame/FrameHost.cpp
|
| @@ -47,6 +47,7 @@ FrameHost::FrameHost(Page& page)
|
| : m_page(&page)
|
| , m_pinchViewport(adoptPtr(new PinchViewport(*this)))
|
| , m_eventHandlerRegistry(adoptPtrWillBeNoop(new EventHandlerRegistry(*this)))
|
| + , m_frameCount(0)
|
| {
|
| }
|
|
|
| @@ -91,4 +92,25 @@ void FrameHost::trace(Visitor* visitor)
|
| visitor->trace(m_eventHandlerRegistry);
|
| }
|
|
|
| +#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::frameCount() const
|
| +{
|
| +#if ENABLE(ASSERT)
|
| + checkFrameCountConsistency(m_frameCount, m_page->mainFrame());
|
| +#endif
|
| + return m_frameCount;
|
| +}
|
| +
|
| }
|
|
|