mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 03:21:16 +08:00
As part of running the trace engine in a worker we need to remove all SDK code from the handlers. We can run the SDK in a worker, however we cannot pass instances of `SDK.DOMModel.DOMNode` between the worker and the main thread easily. We also felt that it was messy having the handlers contain SDK code, so this was a nice refactor in that regard also. This CL creates `model/trace/sdk_services` which contain some generic helpers and then handler specific code to run on trace events and return some useful data. Each service caches its result, so we can call it multiple times without repeating work, and the cache is keyed on the overall `TraceParseData`, so there's no danger of different traces colliding in the cache. This CL doesn't move all SDK logic out of handlers - there is more in other handlers, but I will remove those in a follow-up once we're happy with this approach and this CL has landed. Bug: 1399455 Change-Id: Iba2fea8ed1b2d5a29ac97ef78130034bf801bdf3 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4085486 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Andres Olivares <andoli@chromium.org>