| Index: Source/core/frame/FrameHost.cpp
|
| diff --git a/Source/core/frame/FrameHost.cpp b/Source/core/frame/FrameHost.cpp
|
| index 45f7d1cfd3177d19ee2ddf062aca9a06c4214a92..aab5e05e9486f47a6aaf450c9306f90ba8fe44ee 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(PinchViewport::create(*this))
|
| , m_eventHandlerRegistry(adoptPtrWillBeNoop(new EventHandlerRegistry(*this)))
|
| + , m_frameCount(0)
|
| {
|
| }
|
|
|
| @@ -92,4 +93,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;
|
| +}
|
| +
|
| }
|
|
|