[ MimeHandlerView ] Cleaning up MimeHandlerViewEmbedder when disallowed
The process of creating MimeHandlerView is: * Navigation to resource starts * MimeHandlerViewEmbedder is created * HTMLPlugInElement::UpdatePlugin is called * MimeHandlerViewContainerManager is notified * HTMLPlugInElement creates a frame * MimeHandlerViewEmbedder observes the new frame and attaches GuestView, and destroys itself. These steps are legitimately disturbed when the embedder is not authorized to load plugins (e.g., in <webview> when using permissions). In such cases, the update from HTMLPlugInElement does not reach the MimeHandlerViewContainerManager and also a plugin frame is not created. Therefore, MimeHandlerViewEmbedder does not get destroyed. This CL will change the update process so that even for blocked plugins the MHVCM is notified (of the failure) which gives it a chance to notify the browser in turn and clean up the MimeHandlerViewEmbedder. In line with the change, the test: WebViewPluginTest.TestLoadPluginInternalResource is modified to assert no MimeHandlerViewEmbedders are lying around. Bug: 967045 Change-Id: Ic63a980883240fe8098a4ee8d5e3ae3b9cc46415 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1629071Reviewed-by:Karan Bhatia <karandeepb@chromium.org> Reviewed-by:
Lei Zhang <thestig@chromium.org> Reviewed-by:
Ehsan Karamad <ekaramad@chromium.org> Reviewed-by:
Ken Buchanan <kenrb@chromium.org> Reviewed-by:
James MacLean <wjmaclean@chromium.org> Commit-Queue: Ehsan Karamad <ekaramad@chromium.org> Cr-Commit-Position: refs/heads/master@{#663982}
Showing
Please register or sign in to comment