From 09fcb7fb271acd71962135bb0c9126fdefe1a0f1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 25 Jan 2017 10:44:58 +0900 Subject: [PATCH] Fix crash when using webview --- atom/browser/web_view_guest_delegate.cc | 12 ++++++++++++ atom/browser/web_view_guest_delegate.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/atom/browser/web_view_guest_delegate.cc b/atom/browser/web_view_guest_delegate.cc index 7f5a9261b93d..cfb326496355 100644 --- a/atom/browser/web_view_guest_delegate.cc +++ b/atom/browser/web_view_guest_delegate.cc @@ -151,4 +151,16 @@ gfx::Size WebViewGuestDelegate::GetDefaultSize() const { } } +bool WebViewGuestDelegate::CanBeEmbeddedInsideCrossProcessFrames() { + return true; +} + +content::RenderWidgetHost* WebViewGuestDelegate::GetOwnerRenderWidgetHost() { + return embedder_web_contents_->GetRenderViewHost()->GetWidget(); +} + +content::SiteInstance* WebViewGuestDelegate::GetOwnerSiteInstance() { + return embedder_web_contents_->GetSiteInstance(); +} + } // namespace atom diff --git a/atom/browser/web_view_guest_delegate.h b/atom/browser/web_view_guest_delegate.h index f63a46cf76ce..eade31234c2c 100644 --- a/atom/browser/web_view_guest_delegate.h +++ b/atom/browser/web_view_guest_delegate.h @@ -59,6 +59,9 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate, int element_instance_id, bool is_full_page_plugin, const base::Closure& completion_callback) final; + bool CanBeEmbeddedInsideCrossProcessFrames() override; + content::RenderWidgetHost* GetOwnerRenderWidgetHost() override; + content::SiteInstance* GetOwnerSiteInstance() override; private: // This method is invoked when the contents auto-resized to give the container