Bug 702948 - Add telemetry to count how many ranges are detached; r=smaug

This commit is contained in:
Aryeh Gregor 2012-04-17 17:36:22 +03:00
parent 6a9a999215
commit 9c718775c7
2 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,9 @@
#include "nsLayoutUtils.h"
#include "nsTextFrame.h"
#include "nsFontFaceList.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult);
nsresult NS_NewContentSubtreeIterator(nsIContentIterator** aInstancePtrResult);
@ -243,6 +246,9 @@ nsRange::~nsRange()
{
NS_ASSERTION(!IsInSelection(), "deleting nsRange that is in use");
// Maybe we can remove Detach() -- bug 702948.
Telemetry::Accumulate(Telemetry::DOM_RANGE_DETACHED, mIsDetached);
// we want the side effects (releases and list removals)
DoSetRange(nsnull, 0, nsnull, 0, nsnull);
}

View File

@ -401,6 +401,7 @@ HISTOGRAM_BOOLEAN(MULTIPART_XHR_RESPONSE, "XMLHttpRequest response was of type m
*/
HISTOGRAM(DOM_TIMERS_FIRED_PER_NATIVE_TIMEOUT, 1, 3000, 10, EXPONENTIAL, "DOM: Timer handlers called per native timer expiration")
HISTOGRAM(DOM_TIMERS_RECENTLY_SET, 1, 3000, 10, EXPONENTIAL, "DOM: setTimeout/setInterval calls recently (last 30s or more)")
HISTOGRAM_BOOLEAN(DOM_RANGE_DETACHED, "DOM: Ranges that are detached on destruction (bug 702948)")
/**
* DOM Storage telemetry.