Bug 1570091 Part 1 - Add public API for whether a global has instrumentation enabled, r=tcampbell.

Differential Revision: https://phabricator.services.mozilla.com/D39932

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2019-08-03 23:54:31 +00:00
parent fbc5c77152
commit 9663682447
2 changed files with 11 additions and 0 deletions

View File

@ -2685,6 +2685,12 @@ extern JS_FRIEND_API void LogDtor(void* self, const char* type, uint32_t sz);
*/
extern JS_FRIEND_API uint64_t GetGCHeapUsageForObjectZone(JSObject* obj);
/**
* Return whether a global object's realm has had instrumentation enabled by a
* Debugger.
*/
extern JS_FRIEND_API bool GlobalHasInstrumentation(JSObject* global);
} /* namespace js */
#endif /* jsfriendapi_h */

View File

@ -267,4 +267,9 @@ bool InstrumentationScriptIdOperation(JSContext* cx, HandleScript script,
return true;
}
bool GlobalHasInstrumentation(JSObject* global) {
return global->is<js::GlobalObject>() &&
global->as<js::GlobalObject>().getInstrumentationHolder();
}
} // namespace js