Fix another unsafe base::Unretained() in RenderProcessHostImpl.
This CL converts an unsafe base::Unretained() to target the MediaStreamTrackMetricsHost object directly which is deleted on the same thread as the callback. This comes at the cost of pre-allocating the object instead of lazily creating it when the first receiver is bound. This cost does not seem too great since the object consists of an empty std::map and mojo::ReceiverSet. In addition, the CL attempts to document why the remaining base::Unretained() usage is safe. Bug: 1040396 Change-Id: I094091c4672c412086059c56804efb3d743a2c11 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2005291 Commit-Queue: Ben Kelly <wanderview@chromium.org> Reviewed-by:Nasko Oskov <nasko@chromium.org> Cr-Commit-Position: refs/heads/master@{#732710}
Showing
Please register or sign in to comment