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
Родитель 5029ed0f9a
Коммит c94c65bb77
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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.