Browse Source

fixup! Use strong ownership for attached inner WebContents

deepak1556 6 years ago
parent
commit
06a5ade3c6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      atom/browser/web_view_guest_delegate.cc

+ 3 - 2
atom/browser/web_view_guest_delegate.cc

@@ -38,11 +38,12 @@ void WebViewGuestDelegate::AttachToIframe(
   DCHECK_EQ(embedder_web_contents_,
             content::WebContents::FromRenderFrameHost(embedder_frame));
 
+  content::WebContents* guest_web_contents = api_web_contents_->web_contents();
   // Attach this inner WebContents |guest_web_contents| to the outer
   // WebContents |embedder_web_contents|. The outer WebContents's
   // frame |embedder_frame| hosts the inner WebContents.
-  api_web_contents_->web_contents()->AttachToOuterWebContentsFrame(
-      base::WrapUnique<content::WebContents>(embedder_web_contents_),
+  guest_web_contents->AttachToOuterWebContentsFrame(
+      base::WrapUnique<content::WebContents>(guest_web_contents),
       embedder_frame);
 
   ResetZoomController();