Don't crash when attempting to prerender the PDF viewer
We update the inner WebContents attachment code to no longer assume the
frame to swap out is in the primary frame tree.
We also add some tests to guard against crashes here, but additional
work is required to get the viewer to successfully load a PDF and
generally behave correctly. Notably, we should not clear
MimeHandlerViewGuest state on activation (e.g. dropping the
StreamInfo). There also appears to be an issue with postMessage which
requires further investigation.
Bug: 1206312, 1205920
Change-Id: I1f3944b4c5aee2484a20eb0b6a01031688c598a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2875649
Commit-Queue: Kevin McNee <[email protected]>
Reviewed-by: Matt Falkenhagen <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: Lucas Gadani <[email protected]>
Cr-Commit-Position: refs/heads/master@{#882718}
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 9663a9a5..a328efa 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -653,7 +653,7 @@
virtual void DispatchBeforeUnload(bool auto_cancel) = 0;
// Attaches |inner_web_contents| to the container frame |render_frame_host|,
- // which should be in this WebContents' FrameTree. This outer WebContents
+ // which must be in a FrameTree for this WebContents. This outer WebContents
// takes ownership of |inner_web_contents|.
// Note: |render_frame_host| will be swapped out and destroyed during the
// process. Generally a frame same-process with its parent is the right choice