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

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

Issue 2848723002: Use a weak pointer when binding GuestViewBase::DidAttach. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « components/guest_view/browser/guest_view_message_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/guest_view/browser/guest_view_message_filter.cc
diff --git a/components/guest_view/browser/guest_view_message_filter.cc b/components/guest_view/browser/guest_view_message_filter.cc
index 03aefe803a3c3b5b7eba3cde8fc6d3cfaf05885b..c2124ed258fc52d15093b9ea00dff28f8f4b5491 100644
--- a/components/guest_view/browser/guest_view_message_filter.cc
+++ b/components/guest_view/browser/guest_view_message_filter.cc
@@ -144,7 +144,8 @@ void GuestViewMessageFilter::OnAttachToEmbedderFrame(
guest->WillAttach(
owner_web_contents, element_instance_id, false,
- base::Bind(&GuestViewMessageFilter::WillAttachCallback, this, guest));
+ base::Bind(&GuestViewBase::DidAttach,
+ guest->weak_ptr_factory_.GetWeakPtr(), MSG_ROUTING_NONE));
// Attach this inner WebContents |guest_web_contents| to the outer
// WebContents |owner_web_contents|. The outer WebContents's
@@ -155,8 +156,4 @@ void GuestViewMessageFilter::OnAttachToEmbedderFrame(
embedder_frame);
}
-void GuestViewMessageFilter::WillAttachCallback(GuestViewBase* guest) {
- guest->DidAttach(MSG_ROUTING_NONE);
-}
-
} // namespace guest_view
« no previous file with comments | « components/guest_view/browser/guest_view_message_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698