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

Unified Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 611563002: GuestView: Use Weak Pointers Throughout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed bug where openers become NULL before WillDestroy Created 6 years, 2 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 | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/web_view/web_view_guest.cc
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc
index 0b64df4f7f82f8ec691a1ef313f5563b8bb76046..eb1bd4eddcc31c93cd784335ea52ee3c75f69002 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -516,7 +516,7 @@ void WebViewGuest::CreateNewGuestWebViewWindow(
embedder_web_contents(),
create_params,
base::Bind(&WebViewGuest::NewGuestWebViewCallback,
- base::Unretained(this),
+ weak_ptr_factory_.GetWeakPtr(),
params));
}
@@ -663,7 +663,8 @@ WebViewGuest::WebViewGuest(content::BrowserContext* browser_context,
find_helper_(this),
is_overriding_user_agent_(false),
guest_opaque_(true),
- javascript_dialog_helper_(this) {
+ javascript_dialog_helper_(this),
+ weak_ptr_factory_(this) {
web_view_guest_delegate_.reset(
ExtensionsAPIClient::Get()->CreateWebViewGuestDelegate(this));
}
@@ -1179,7 +1180,7 @@ void WebViewGuest::RequestNewWindowPermission(
RequestPermission(WEB_VIEW_PERMISSION_TYPE_NEW_WINDOW,
request_info,
base::Bind(&WebViewGuest::OnWebViewNewWindowResponse,
- base::Unretained(this),
+ weak_ptr_factory_.GetWeakPtr(),
guest->guest_instance_id()),
false /* allowed_by_default */);
}
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698