Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Unified Diff: components/guest_view/browser/guest_view_base.cc

Issue 1143333008: Getting rid of more webview memory leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e271a6d8fdd5364712d8293e76bccde8484fc4cc 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 opening
lazyboy 2015/06/09 14:19:32 s/opening/opener
paulmeyer 2015/06/09 14:49:42 Done.
+// 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);

Powered by Google App Engine
This is Rietveld 408576698