source: webkit/trunk/JavaScriptCore/wtf/RefCountedLeakCounter.h@ 36124

Last change on this file since 36124 was 35148, checked in by Stephanie Lewis, 17 years ago

2008-07-11 Stephanie Lewis <Stephanie Lewis>

Reviewed by Darin Adler and Oliver Hunt.

JavaScriptCore:

Refactor RefCounting Leak counting code into a common class.

In order to export the symbols I needed to put the debug defines inside the function names


Before we had a separate channel for each Logging each Leak type. Since the leak channels were only used in one location, and only at quit for simplicity I combined them all into one leak channel.

  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj: add new class
  • kjs/nodes.cpp: remove old leak counting code
  • wtf/RefCountedLeakCounter.cpp: Added. create a common leak counting class
  • wtf/RefCountedLeakCounter.h: Added.

WebCore:

No Functionality Changed. Change all the leak counting code to use the new WTF leak counter class.

  • bindings/js/JSCustomSQLTransactionCallback.cpp: (WebCore::JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback): (WebCore::JSCustomSQLTransactionCallback::~JSCustomSQLTransactionCallback):
  • bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::JSEventListener): (WebCore::JSEventListener::~JSEventListener):
  • dom/Node.cpp: (WebCore::Node::Node): (WebCore::Node::~Node):
  • dom/Range.cpp: (WebCore::Range::Range): (WebCore::Range::~Range):
  • history/CachedPage.cpp: (WebCore::CachedPage::CachedPage): (WebCore::CachedPage::~CachedPage):
  • loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::SubresourceLoader): (WebCore::SubresourceLoader::~SubresourceLoader):
  • page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::~Frame):
  • page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::~Page):
  • rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject):
  • rendering/bidi.cpp: (WebCore::throw): (WebCore::BidiRun::operator delete):

WebKit

Move WebPreferences.m to objc++ so it can include the new WTF leak counting class.

  • WebKit.xcodeproj/project.pbxproj:

Disable WTF leak messages when using fast teardown. Use full document teardown while running in debug.

  • WebView/WebPreferences.m: Removed.
  • WebView/WebPreferences.mm: Copied from http:/svn.webkit.org/repository/webkit/trunk/WebKit/mac/WebView/WebPreferences.m. (+[WebPreferences initialize]): if running in Default enable full document teardown (-[WebPreferences editableLinkBehavior]): (-[WebPreferences setFullDocumentTeardownEnabled:]):
  • WebView/WebView.mm: (-[WebView _close]): disable leak messages if using fast teardown

WebKitTools:

Make sure we read WebCore Leak messages. Force full document teardown for DumpRenderTree.

Up timeout limit, some slower machines were timing out before crashtracer finished writing out to disk and quitting DRT.

  • DumpRenderTree/mac/DumpRenderTree.mm: (setDefaultsToConsistentValuesForTesting): (resetWebViewToConsistentStateBeforeTesting):
  • Scripts/run-webkit-tests:
File size: 1.3 KB
Line 
1/*
2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
21#ifndef REF_COUNTED_LEAK_COUNTER_H_
22#define REF_COUNTED_LEAK_COUNTER_H_
23
24#include "Assertions.h"
25#include "Threading.h"
26
27namespace WTF {
28
29 void setLogLeakMessages(bool _logLeakMessages);
30
31 struct RefCountedLeakCounter {
32 RefCountedLeakCounter(const char* desc);
33 ~RefCountedLeakCounter();
34
35 void increment();
36 void decrement();
37
38 private:
39#ifndef NDEBUG
40 volatile int count;
41 const char* description;
42#endif
43 };
44
45} // namespace WTF
46
47#endif
Note: See TracBrowser for help on using the repository browser.