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

87 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 14645
// Function ID: 14646
2026-07-29 08:29:29 +00:00
// Name: installSystrace
2026-10-12 06:59:38 +00:00
// Dependencies: [17, 1382, 14646, 2]
2026-07-20 16:05:17 +00:00
// Exports: installSystrace
2026-10-12 06:59:38 +00:00
// Module 14645 (installSystrace)
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
2026-10-09 10:00:15 +00:00
import PlatformUtils from "PlatformUtils" /* 1382 */;
2026-10-12 06:59:38 +00:00
import react_native2 from "react-native" /* 14646 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const Systrace = react_native.Systrace;
const result = size.fileFinishedImporting("modules/systrace/native/installSystrace.tsx");
2026-07-20 16:05:17 +00:00
export const installSystrace = function installSystrace() {
2026-10-03 08:58:59 +00:00
const obj = PlatformUtils;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
Systrace.isEnabled = () => {
2026-10-03 08:58:59 +00:00
const _default = react_native2.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) => {
2026-10-03 08:58:59 +00:00
const _default = react_native2.default;
2026-07-29 08:29:29 +00:00
if (_default != null) {
2026-08-04 21:03:28 +00:00
let tmp2 = fn;
2026-10-03 08:58:59 +00:00
const beginEvent = _default.beginEvent;
2026-08-04 21:03:28 +00:00
if (typeof fn !== "string") {
tmp2 = fn();
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
beginEvent(tmp2);
2026-07-20 16:05:17 +00:00
}
};
Systrace.endEvent = () => {
2026-10-03 08:58:59 +00:00
const _default = react_native2.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) => {
2026-10-03 08:58:59 +00:00
const _default = react_native2.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;
2026-10-03 08:58:59 +00:00
const beginAsyncEvent = _default.beginAsyncEvent;
2026-08-04 21:03:28 +00:00
if (typeof fn !== "string") {
tmp2 = fn();
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
num = 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) => {
2026-10-03 08:58:59 +00:00
const _default = react_native2.default;
2026-07-29 08:29:29 +00:00
if (_default != null) {
2026-08-04 21:03:28 +00:00
let tmp2 = fn;
2026-10-03 08:58:59 +00:00
const endAsyncEvent = _default.endAsyncEvent;
2026-08-04 21:03:28 +00:00
if (typeof fn !== "string") {
tmp2 = fn();
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
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) => {
2026-10-03 08:58:59 +00:00
const _default = react_native2.default;
2026-07-29 08:29:29 +00:00
if (_default != null) {
let tmp2 = pending_js_to_native_queue;
2026-10-03 08:58:59 +00:00
const counterEvent = _default.counterEvent;
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();
}
2026-10-03 08:58:59 +00:00
counterEvent(tmp2, length);
2026-07-20 16:05:17 +00:00
}
};
}
};