| Index: components/guest_view/browser/guest_view_base.cc
|
| diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
|
| index 201e08108e395fef62f7aa205fbb4cb6907a7c12..0f272a370056268400b9db57b0878386addc6e51 100644
|
| --- a/components/guest_view/browser/guest_view_base.cc
|
| +++ b/components/guest_view/browser/guest_view_base.cc
|
| @@ -110,15 +110,17 @@ class GuestViewBase::OwnerContentsObserver : public WebContentsObserver {
|
| return;
|
|
|
| destroyed_ = true;
|
| - guest_->EmbedderWillBeDestroyed();
|
| + GuestViewManager::FromBrowserContext(web_contents()->GetBrowserContext())
|
| + ->EmbedderWillBeDestroyed(
|
| + web_contents()->GetRenderProcessHost()->GetID());
|
| guest_->Destroy();
|
| }
|
|
|
| DISALLOW_COPY_AND_ASSIGN(OwnerContentsObserver);
|
| };
|
|
|
| -// This observer ensures that the GuestViewBase destroys itself when its
|
| -// embedder goes away.
|
| +// This observer ensures that the GuestViewBase destroys itself if its opener
|
| +// WebContents goes away before the GuestViewBase is attached.
|
| class GuestViewBase::OpenerLifetimeObserver : public WebContentsObserver {
|
| public:
|
| OpenerLifetimeObserver(GuestViewBase* guest)
|
| @@ -318,6 +320,11 @@ void GuestViewBase::SetSize(const SetSizeParams& params) {
|
| }
|
|
|
| // static
|
| +void GuestViewBase::CleanUp(int embedder_process_id, int view_instance_id) {
|
| + // TODO(paulmeyer): Add in any general GuestView cleanup work here.
|
| +}
|
| +
|
| +// static
|
| GuestViewBase* GuestViewBase::FromWebContents(const WebContents* web_contents) {
|
| WebContentsGuestViewMap* guest_map = webcontents_guestview_map.Pointer();
|
| auto it = guest_map->find(web_contents);
|
|
|