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

Unified Diff: chrome/browser/ui/webui/constrained_web_dialog_ui.cc

Issue 2798583002: WebUI: prevent WebContent to hold invalid pointer. (Closed)
Patch Set: Fix compilation on mac 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
Index: chrome/browser/ui/webui/constrained_web_dialog_ui.cc
diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui.cc b/chrome/browser/ui/webui/constrained_web_dialog_ui.cc
index 08a533067e37084f8b166a90db0443e24d1751bf..5ab3cb4cad4ef4869284d9018b45e94af7fe9a1e 100644
--- a/chrome/browser/ui/webui/constrained_web_dialog_ui.cc
+++ b/chrome/browser/ui/webui/constrained_web_dialog_ui.cc
@@ -108,6 +108,12 @@ void ConstrainedWebDialogUI::SetConstrainedDelegate(
new ConstrainedWebDialogDelegateUserData(delegate));
}
+// static
+void ConstrainedWebDialogUI::ClearConstrainedDelegate(
+ content::WebContents* web_contents) {
+ web_contents->RemoveUserData(&kConstrainedWebDialogDelegateUserDataKey);
+}
+
ConstrainedWebDialogDelegate* ConstrainedWebDialogUI::GetConstrainedDelegate() {
ConstrainedWebDialogDelegateUserData* user_data =
static_cast<ConstrainedWebDialogDelegateUserData*>(

Powered by Google App Engine
This is Rietveld 408576698