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

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: 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..fda196a892db26bdc31f5c476aaa1bdacac0e70d 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())->
lazyboy 2015/06/05 23:09:55 -> goes next line, can you run git cl format on yo
paulmeyer 2015/06/08 17:53:58 Done.
+ 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
+// 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