decord/alpha/source/modules/systrace/native/installSystrace.tsx

81 lines
2.2 KiB
TypeScript
Raw Normal View History

// Module ID: 14677
// Function ID: 14678
2026-07-29 08:29:29 +00:00
// Name: installSystrace
// Dependencies: [17, 1364, 14678, 2]
2026-07-20 16:05:17 +00:00
// Exports: installSystrace
// Module 14677 (installSystrace)
import _mod17 from "module_17" /* 17 */;
import NativeSystraceModule from "NativeSystraceModule" /* 14678 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const Systrace = _mod17.Systrace;
const result = size.fileFinishedImporting("modules/systrace/native/installSystrace.tsx");
2026-07-20 16:05:17 +00:00
export const installSystrace = function installSystrace() {
if (obj.isAndroid()) {
Systrace.isEnabled = () => {
const _default = NativeSystraceModule.default;
2026-07-29 08:29:29 +00:00
let flag;
if (_default != null) {
flag = _default.isEnabled();
}
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return flag;
2026-07-20 16:05:17 +00:00
};
2026-08-04 21:03:28 +00:00
Systrace.beginEvent = (fn) => {
const _default = NativeSystraceModule.default;
2026-07-29 08:29:29 +00:00
if (_default != null) {
2026-08-04 21:03:28 +00:00
let tmp2 = fn;
if (typeof fn !== "string") {
tmp2 = fn();
2026-07-29 08:29:29 +00:00
}
_default.beginEvent(tmp2);
2026-07-20 16:05:17 +00:00
}
};
Systrace.endEvent = () => {
const _default = NativeSystraceModule.default;
2026-07-29 08:29:29 +00:00
if (_default != null) {
_default.endEvent();
2026-07-20 16:05:17 +00:00
}
};
2026-08-04 21:03:28 +00:00
Systrace.beginAsyncEvent = (fn) => {
const _default = NativeSystraceModule.default;
2026-07-29 08:29:29 +00:00
let num;
if (_default != null) {
2026-08-04 21:03:28 +00:00
let tmp2 = fn;
if (typeof fn !== "string") {
tmp2 = fn();
2026-07-29 08:29:29 +00:00
}
num = _default.beginAsyncEvent(tmp2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
return num;
};
Systrace.endAsyncEvent = (fn, arg1) => {
const _default = NativeSystraceModule.default;
2026-07-29 08:29:29 +00:00
if (_default != null) {
2026-08-04 21:03:28 +00:00
let tmp2 = fn;
if (typeof fn !== "string") {
tmp2 = fn();
2026-07-29 08:29:29 +00:00
}
_default.endAsyncEvent(tmp2, arg1);
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
Systrace.counterEvent = (pending_js_to_native_queue, length) => {
const _default = NativeSystraceModule.default;
2026-07-29 08:29:29 +00:00
if (_default != null) {
let tmp2 = pending_js_to_native_queue;
2026-08-04 21:03:28 +00:00
if (typeof pending_js_to_native_queue !== "string") {
2026-07-29 08:29:29 +00:00
tmp2 = pending_js_to_native_queue();
}
_default.counterEvent(tmp2, length);
2026-07-20 16:05:17 +00:00
}
};
}
};