Commit ea8c0392 authored by ggaren's avatar ggaren

Reviewed by Adam Roben.

        Added a debug-only CachedPage counter. This helped me track down an SVG 
        timer bug in my recent page cache work.
                
        * history/CachedPage.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4c545303
2007-05-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Adam Roben.
Added a debug-only CachedPage counter. This helped me track down an SVG
timer bug in my recent page cache work.
* history/CachedPage.cpp:
2007-05-24 David Hyatt <hyatt@apple.com>
Improve <form> error reporting to catch <form>s inside table parts.
......@@ -33,6 +33,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameView.h"
#include "Logging.h"
#include "Page.h"
#include "SystemTime.h"
#if ENABLE(SVG)
......@@ -50,6 +51,21 @@ using namespace KJS;
namespace WebCore {
#ifndef NDEBUG
WTFLogChannel LogWebCoreCachedPageLeaks = { 0x00000000, "", WTFLogChannelOn };
struct CachedPageCounter {
static int count;
~CachedPageCounter()
{
if (count)
LOG(WebCoreCachedPageLeaks, "LEAK: %d CachedPage\n", count);
}
};
int CachedPageCounter::count = 0;
static CachedPageCounter cachedPageCounter;
#endif
PassRefPtr<CachedPage> CachedPage::create(Page* page)
{
return new CachedPage(page);
......@@ -65,6 +81,10 @@ CachedPage::CachedPage(Page* page)
, m_locationProperties(new SavedProperties)
, m_interpreterBuiltins(new SavedBuiltins)
{
#ifndef NDEBUG
++CachedPageCounter::count;
#endif
Frame* mainFrame = page->mainFrame();
KJSProxy* proxy = mainFrame->scriptProxy();
Window* window = Window::retrieveWindow(mainFrame);
......@@ -90,6 +110,10 @@ CachedPage::CachedPage(Page* page)
CachedPage::~CachedPage()
{
#ifndef NDEBUG
--CachedPageCounter::count;
#endif
close();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment