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

Unified Diff: chrome/browser/guestview/guestview.cc

Issue 139603002: <webview>: Speculative crash fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adddressed comment Created 6 years, 11 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 | « chrome/browser/guestview/guestview.h ('k') | content/browser/browser_plugin/browser_plugin_guest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/guestview/guestview.cc
diff --git a/chrome/browser/guestview/guestview.cc b/chrome/browser/guestview/guestview.cc
index ecf5991efbbe151ccfddeefc92467ba83e4672e9..096e6747fff69931da8d3cb5b67c553ec5354dee 100644
--- a/chrome/browser/guestview/guestview.cc
+++ b/chrome/browser/guestview/guestview.cc
@@ -52,7 +52,8 @@ GuestView::GuestView(WebContents* guest_web_contents,
embedder_render_process_id_(0),
browser_context_(guest_web_contents->GetBrowserContext()),
guest_instance_id_(guest_web_contents->GetEmbeddedInstanceID()),
- view_instance_id_(guestview::kInstanceIDNone) {
+ view_instance_id_(guestview::kInstanceIDNone),
+ weak_ptr_factory_(this) {
webcontents_guestview_map.Get().insert(
std::make_pair(guest_web_contents, this));
}
@@ -157,7 +158,7 @@ void GuestView::Attach(content::WebContents* embedder_web_contents,
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&GuestView::SendQueuedEvents,
- base::Unretained(this)));
+ weak_ptr_factory_.GetWeakPtr()));
}
GuestView::Type GuestView::GetViewType() const {
« no previous file with comments | « chrome/browser/guestview/guestview.h ('k') | content/browser/browser_plugin/browser_plugin_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698