Bug 975746 - Remove GATHER_ELEMENT_USEAGE_STATISTICS. r=jst

This commit is contained in:
Andrew McCreight 2014-03-19 06:05:17 -07:00
parent caeca6d43d
commit c87191695c
2 changed files with 8 additions and 76 deletions

View File

@ -106,64 +106,6 @@
using namespace mozilla;
using namespace mozilla::dom;
class nsINodeInfo;
class nsIDOMNodeList;
class nsRuleWalker;
// XXX todo: add in missing out-of-memory checks
//----------------------------------------------------------------------
#ifdef GATHER_ELEMENT_USEAGE_STATISTICS
// static objects that have constructors are kinda bad, but we don't
// care here, this is only debugging code!
static nsHashtable sGEUS_ElementCounts;
void GEUS_ElementCreated(nsINodeInfo *aNodeInfo)
{
nsAutoString name;
aNodeInfo->GetName(name);
nsStringKey key(name);
int32_t count = (int32_t)sGEUS_ElementCounts.Get(&key);
count++;
sGEUS_ElementCounts.Put(&key, (void *)count);
}
bool GEUS_enum_func(nsHashKey *aKey, void *aData, void *aClosure)
{
const char16_t *name_chars = ((nsStringKey *)aKey)->GetString();
NS_ConvertUTF16toUTF8 name(name_chars);
printf ("%s %d\n", name.get(), aData);
return true;
}
void GEUS_DumpElementCounts()
{
printf ("Element count statistics:\n");
sGEUS_ElementCounts.Enumerate(GEUS_enum_func, nullptr);
printf ("End of element count statistics:\n");
}
nsresult
nsGenericHTMLElement::Init(nsINodeInfo *aNodeInfo)
{
GEUS_ElementCreated(aNodeInfo);
return nsGenericHTMLElementBase::Init(aNodeInfo);
}
#endif
/**
* nsAutoFocusEvent is used to dispatch a focus event when a
* nsGenericHTMLFormElement is binded to the tree with the autofocus attribute

View File

@ -19,25 +19,15 @@
#include "mozilla/dom/ValidityState.h"
#include "mozilla/dom/ElementInlines.h"
class nsIDOMAttr;
class nsIDOMEventListener;
class nsIDOMNodeList;
class nsIFrame;
class nsIStyleRule;
class nsChildContentList;
class nsDOMCSSDeclaration;
class nsIDOMCSSStyleDeclaration;
class nsIURI;
class nsIFormControlFrame;
class nsIForm;
class nsPresState;
class nsILayoutHistoryState;
class nsIEditor;
struct nsRect;
struct nsSize;
class nsIDOMHTMLMenuElement;
class nsIDOMHTMLCollection;
class nsDOMSettableTokenList;
class nsIDOMHTMLMenuElement;
class nsIEditor;
class nsIFormControlFrame;
class nsIFrame;
class nsILayoutHistoryState;
class nsIURI;
class nsPresState;
struct nsSize;
namespace mozilla {
class EventChainPostVisitor;