Fix Print Preview refresh
Previously, it was not possible to refresh Print Preview using dev tools. However, it is now possible to do so, and as a result renderer/compositor messages can return to a refreshed Print Preview page that is not expecting any messages, leading to a renderer kill. Since the preview ui id is used only for routing messages from the PrintPreviewMessageHandler back to the appropriate PrintPreviewUI instance, which then forwards them to the PrintPreviewHandler that ultimately sends them to the Print Preview Web UI, it should not be initialized until the web UI is ready to receive messages. It should also be reset whenever the web UI is reloaded. This can be accomplished by setting the preview ui id in OnJavascriptAllowed() and clearing it in OnJavascriptDisallowed() or the PrintPreviewUI destructor, whichever occurs first. Refreshed Preview UIs will then have a different unique identifier after each refresh, which ensures renderer messages intended for previous instances of the web UI page will be dropped instead of being received by the handler and causing a renderer kill. Bug: 874744 Change-Id: Ia43aa9abb97e7952ec3761e5fb016f6513c1c982 Reviewed-on: https://chromium-review.googlesource.com/c/1302676Reviewed-by:Lei Zhang <thestig@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Cr-Commit-Position: refs/heads/master@{#603609}
Showing
Please register or sign in to comment