Trust Tokens: Split the metrics recording helper classes' initialization
This is the first of a series of two CLs adding support for slicing Trust Tokens operation outcome metrics by whether an operation is platform-provided (https://bit.ly/platform-provided-trust-tokens). The overall implementation approach is to add a new delegate to TrustTokenRequestIssuanceHelper that it notifies once it discovers a particular operation will be platform-provided; this delegate will be implemented by TrustTokenOperationMetricsRecorder, which will update the names of the metrics it writes to depending on whether the operation at hand is platform-provided. This change refactors refactors OperationTimingRequestHelperWrapper to take a metrics recorder as an input instead of default-initializing one as a member. This allows the child CL, crrev.com/c/2603584, to pass a handle to a MetricsRecorder to TrustTokenRequestIssuanceHelpers it creates before wrapping the RequestIssuanceHelpers in their OperationTimingRequestHelperWrappers. (Before this change, there would be a cyclic dependency: the OperationTimingRequestHelperWrapper and the RequestIssuanceHelper would both need handles to each other. Refactoring MetricsRecorder to be initialized separately from OperationTimingRequestHelperWrapper allows getting around this without needing a kludge like adding an IssuanceHelper::SetDelegate(Delegate*) method.) The child CL will update TrustTokenRequestIssuanceHelper with the new delegate interface and add the new metrics. Bug: 1163019 Change-Id: I2fc40399e48c6b4722a1147633eac678ee960200 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2606141 Auto-Submit: David Van Cleve <davidvc@chromium.org> Commit-Queue: Matt Menke <mmenke@chromium.org> Reviewed-by:Matt Menke <mmenke@chromium.org> Reviewed-by:
Charlie Harrison <csharrison@chromium.org> Cr-Commit-Position: refs/heads/master@{#841901}
Showing
Please register or sign in to comment