[Workers] Replace RenderProcessHostDestroyed with RenderProcessExited
This change is necessary to add dedicated workers to the performance manager graph. An invariant of the WorkerNode is that its ProcessNode is always valid. This can only be accomplished by making sure that the WorkerNode is destroyed before its ProcessNode. Because the performance_manager::RenderProcessUserData class also subscribes to the RenderProcessHostObserver interface and deletes the ProcessNode when its RenderProcessHost is destroyed, we can't use RenderProcessHostDestroyed in DedicatedWorkerHost because there are no guaranteed ordering on the notification. In fact, since the DedicatedWorkerHost always subscribe to the RenderProcessHost after the performance_manager::RenderProcessUserData class, we always get the wrong ordering in practice. This can be easily fixed by replacing the usage of RenderProcessHostDestroyed by RenderProcessExited in the DedicatedWorkerHost class, which is always invoked first. It also happens that it is a correct change to make because it is when the process exits that the mojo connections with the renderer are closed, not when the RenderProcessHost is destroyed. For consistency, the same change is done with the SharedWorkerHost. Bug: 993029, 1035555 Change-Id: Ib7d71e810cbb8d41f7a7475818d16428eff4e74f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2006069 Commit-Queue: Patrick Monette <pmonette@chromium.org> Reviewed-by:Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#733481}
Showing
Please register or sign in to comment