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

Unified Diff: chrome/browser/ui/android/javascript_app_modal_dialog_android.cc

Issue 11728004: Fix use after free in JavascriptAppModalDialogAndroid. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing 'virtual' (only needed by the Chromium style Clang plugin) Created 7 years, 12 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/ui/android/javascript_app_modal_dialog_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
diff --git a/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc b/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
index 8a75a3bbbcb152a65735ca681a692a5f85df6a65..dd58decac411288f177c16c6b634e5596ef4b8d1 100644
--- a/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
+++ b/chrome/browser/ui/android/javascript_app_modal_dialog_android.cc
@@ -39,15 +39,6 @@ JavascriptAppModalDialogAndroid::JavascriptAppModalDialogAndroid(
parent_jobject_weak_ref_(env, parent->GetJavaObject().obj()) {
}
-JavascriptAppModalDialogAndroid::~JavascriptAppModalDialogAndroid() {
- JNIEnv* env = AttachCurrentThread();
- // In case the dialog is still displaying, tell it to close itself.
- // This can happen if you trigger a dialog but close the Tab before it's
- // shown, and then accept the dialog.
- if (!dialog_jobject_.is_null())
- Java_JavascriptAppModalDialog_dismiss(env, dialog_jobject_.obj());
-}
-
int JavascriptAppModalDialogAndroid::GetAppModalDialogButtons() const {
NOTIMPLEMENTED();
return 0;
@@ -163,3 +154,12 @@ bool JavascriptAppModalDialogAndroid::RegisterJavascriptAppModalDialog(
JNIEnv* env) {
return RegisterNativesImpl(env);
}
+
+JavascriptAppModalDialogAndroid::~JavascriptAppModalDialogAndroid() {
+ JNIEnv* env = AttachCurrentThread();
+ // In case the dialog is still displaying, tell it to close itself.
+ // This can happen if you trigger a dialog but close the Tab before it's
+ // shown, and then accept the dialog.
+ if (!dialog_jobject_.is_null())
+ Java_JavascriptAppModalDialog_dismiss(env, dialog_jobject_.obj());
+}
« no previous file with comments | « chrome/browser/ui/android/javascript_app_modal_dialog_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698