зеркало из https://github.com/mozilla/pjs.git
Bug 568863 follow-up: add reset() to the JavaScript API. r=waldo a2.0=sayrer
This commit is contained in:
Родитель
ea1e385e8b
Коммит
a7770b97f9
|
@ -126,6 +126,17 @@ pm_stop(JSContext* cx, uintN /*unused*/, jsval* vp)
|
|||
return JS_TRUE;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
pm_reset(JSContext* cx, uintN /*unused*/, jsval* vp)
|
||||
{
|
||||
PerfMeasurement* p = GetPMFromThis(cx, vp);
|
||||
if (!p)
|
||||
return JS_FALSE;
|
||||
|
||||
p->reset();
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
pm_canMeasureSomething(JSContext* cx, uintN /*unused*/, jsval* vp)
|
||||
{
|
||||
|
@ -141,6 +152,7 @@ const uint8 PM_FATTRS = JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED;
|
|||
static JSFunctionSpec pm_fns[] = {
|
||||
JS_FN("start", pm_start, 0, PM_FATTRS),
|
||||
JS_FN("stop", pm_stop, 0, PM_FATTRS),
|
||||
JS_FN("reset", pm_reset, 0, PM_FATTRS),
|
||||
JS_FN("canMeasureSomething", pm_canMeasureSomething, 0, PM_FATTRS),
|
||||
JS_FS_END
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче