[UserTimingL3] Centralize PerformanceMark construction logic
Before this change, running javascript like `performance.mark(...)` would result in a callstack like MakeGarbageCollected<PerformanceMark>(...) PerformanceMark::Create(<overload-1>) UserTiming::CreatePerformanceMark(...) Performance::mark() <v8-bindings-layer> `performance.mark(...)` while running script like `new PerformanceMark(...)` would result in a callstack like MakeGarbageCollected<PerformanceMark>(...) PerformanceMark::Create(<overload-1>) UserTiming::CreatePerformanceMark(...) PerformanceMark::Create(<overload-2>) `new PerformanceMark(...)` Note that, since the bindings layer calls into PerformanceMark::Create directly, PerformanceMark had to call UserTiming which had to call back to PerformanceMark. Apart from being a cyclic dependency, this also lead to confusion around which constraints needed to be checked at which points. This CL breaks the cyclic dependency between UserTiming and PerformanceMark by pushing all the validation into a single PerformanceMark::Create function. Along with this change comes better UseCount tracking for UserTimingL3 in the case where script runs `new PerformanceMark(...)`. Bug: 805566 Change-Id: Ic648b097734655b2c0e55db95e738b48bc8826c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003552 Commit-Queue: Tom McKee <tommckee@chromium.org> Reviewed-by:Nicolás Peña Moreno <npm@chromium.org> Cr-Commit-Position: refs/heads/master@{#744117}
Showing
Please register or sign in to comment