Changeset 19364 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Feb 2, 2007, 9:55:33 AM (18 years ago)
Author:
ggaren
Message:

JavaScriptCore:

Reviewed by Maciej Stachowiak.


Use WTFLog instead of fprintf for logging KJS::Node leaks.

  • kjs/nodes.cpp: (NodeCounter::~NodeCounter): Changed count to unsigned, updated to match style guidelines.

WebCore:

Reviewed by Maciej Stachowiak.


Added support for selectively ignoring WebCore::Node leaks during layout
tests, so that we can ignore known leaks in other components.

  • WebCore.exp:
  • dom/Node.cpp: (WebCore::Node::isSupported): Moved isSupported up with the rest of the static functions.

(WebCore::): Added an ignoreSet, which collects WebCore::Nodes whose lifetime
we want to ignore. We need to track which nodes to ignore rather than, say,
just suspending the count, because node destruction depends on lots of
different variables, so it would be nearly impossible to know when exactly
to suspend the count and when exactly to resume it.

(WebCore::NodeCounter::~NodeCounter): Changed to use WTFLog instead of fprintf.

(WebCore::Node::startIgnoringLeaks): Do the ignoring.
(WebCore::Node::stopIgnoringLeaks): ditto
(WebCore::Node::Node): ditto
(WebCore::Node::~Node): ditto

  • dom/Node.h: Moved isSupported up with the rest of the static functions.
  • platform/mac/LoggingMac.mm: (WebCore::initializeWithUserDefault): Renamed from "initializeLoggingChannel" because the real goal here is to honor a user default -- WTFLoggingChannels need no run-time initialization. Also replaced "off by default, on if a user default says so" behavior with "only override existing setting if a user default says so" behavior. It seemed like a bug that you would specify a channel's on/off state in its definition, but this function would unconditionally blow that state away. (WebCore::InitializeLoggingChannelsIfNecessary):

WebKit:

Reviewed by Maciej Stachowiak.


Added support for selectively ignoring WebCore::Node leaks during layout
tests, so that we can ignore known leaks in other components.

  • Misc/WebCoreStatistics.h:
  • Misc/WebCoreStatistics.mm: (+[WebCoreStatistics startIgnoringWebCoreNodeLeaks]): (+[WebCoreStatistics stopIgnoringWebCoreNodeLeaks]):

WebKitTools:

Reviewed by Maciej Stachowiak.


Added support for selectively ignoring WebCore::Node leaks during layout
tests, so that we can ignore known leaks in other components.

  • DumpRenderTree/DumpRenderTree.m: (shouldIgnoreWebCoreNodeLeaks): Implements a black list of tests whose WebCore::Node leaks we have to ignore. Does this CFString gobbledy-gook confuse anyone else? (runTest):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r15698 r19364  
    8484// ------------------------------ Node -----------------------------------------
    8585
    86 
    8786#ifndef NDEBUG
     87#ifndef LOG_CHANNEL_PREFIX
     88#define LOG_CHANNEL_PREFIX Log
     89#endif
     90static WTFLogChannel LogKJSNodeLeaks = { 0x00000000, "", WTFLogChannelOn };
     91
    8892struct NodeCounter {
    89     static int count;
    90     ~NodeCounter() { if (count != 0) fprintf(stderr, "LEAK: %d KJS::Node\n", count); }
     93    static unsigned count;
     94    ~NodeCounter()
     95    {
     96        if (count)
     97            LOG(KJSNodeLeaks, "LEAK: %u KJS::Node\n", count);
     98    }
    9199};
    92 int NodeCounter::count = 0;
    93 static NodeCounter nodeImplCounter;
     100unsigned NodeCounter::count = 0;
     101static NodeCounter nodeCounter;
    94102#endif
    95103
Note: See TracChangeset for help on using the changeset viewer.