Commit 04ee02b
FrameTiming module to subscribe to Inspector tracing lifecycle (#54633)
Summary:
Pull Request resolved: #54633
# Changelog: [Internal]
This introduces a proper lifecycle for a module on Anroid that will emit frames information as part of the trace recording.
Previously we would initialize it on a packager connection, which could be problematic, since there is no guarantee that InspectorTarget exists at this time.
With the current approach, the lifetime of this object is:
- Bound to lifetime of InspectorTarget, it will never outlive it
- The actual frames listener lifetime will be bound to tracing state. We no longer will be going through `jni` to check if `PerformanceTracer` is enabled.
I've renamed it to `FrameTimingsObserver`and moved to inspector package, since this should be considered as part of the inspector stack. Similarly to `LoadNetworkResource` listeners.
I am keeping the `jni` layer with PerformanceTracer for now, but this is about to be removed in the diffs above. The frames information should be propagated through Host, this would allow us to record Frames even if there is no React Native instance, for example, during reloads.
Reviewed By: sbuggay
Differential Revision: D87345177
fbshipit-source-id: e92ffb29e1761ac8a425a1fbfe27d3edca85ddd41 parent 6793f5c commit 04ee02b
4 files changed
Lines changed: 57 additions & 48 deletions
File tree
- packages/react-native/ReactAndroid/src/main
- java/com/facebook/react
- devsupport
- inspector
- runtime
- jni/react/devsupport
Lines changed: 0 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
215 | | - | |
216 | | - | |
217 | 214 | | |
218 | 215 | | |
219 | 216 | | |
| |||
972 | 969 | | |
973 | 970 | | |
974 | 971 | | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | 972 | | |
995 | 973 | | |
996 | 974 | | |
997 | 975 | | |
998 | 976 | | |
999 | 977 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
1006 | 978 | | |
1007 | 979 | | |
1008 | 980 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 19 | + | |
| 20 | + | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
| |||
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 40 | + | |
51 | 41 | | |
52 | 42 | | |
53 | 43 | | |
54 | 44 | | |
| 45 | + | |
55 | 46 | | |
56 | 47 | | |
57 | 48 | | |
58 | 49 | | |
59 | 50 | | |
60 | 51 | | |
61 | 52 | | |
62 | | - | |
| 53 | + | |
63 | 54 | | |
64 | 55 | | |
65 | 56 | | |
| 57 | + | |
66 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
Lines changed: 39 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
1442 | 1446 | | |
1443 | 1447 | | |
1444 | 1448 | | |
1445 | | - | |
1446 | | - | |
| 1449 | + | |
1447 | 1450 | | |
1448 | 1451 | | |
1449 | 1452 | | |
| |||
1554 | 1557 | | |
1555 | 1558 | | |
1556 | 1559 | | |
1557 | | - | |
1558 | | - | |
| 1560 | + | |
1559 | 1561 | | |
1560 | 1562 | | |
1561 | 1563 | | |
1562 | 1564 | | |
1563 | 1565 | | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
1564 | 1599 | | |
1565 | 1600 | | |
1566 | 1601 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments