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

Unified Diff: android_webview/browser/aw_javascript_dialog_manager.cc

Issue 545963002: Android WebView: clean up the AwContentsClientBridge webcontents userdata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add another missing callback run Created 6 years, 3 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 | « android_webview/browser/aw_contents_client_bridge_base.cc ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_javascript_dialog_manager.cc
diff --git a/android_webview/browser/aw_javascript_dialog_manager.cc b/android_webview/browser/aw_javascript_dialog_manager.cc
index 630c7bfd7af03df9a97e5f78c64ebcf21fbb755f..476935a53c8068e8db3295c6e211af7f0691e40d 100644
--- a/android_webview/browser/aw_javascript_dialog_manager.cc
+++ b/android_webview/browser/aw_javascript_dialog_manager.cc
@@ -25,6 +25,11 @@ void AwJavaScriptDialogManager::RunJavaScriptDialog(
bool* did_suppress_message) {
AwContentsClientBridgeBase* bridge =
AwContentsClientBridgeBase::FromWebContents(web_contents);
+ if (!bridge) {
+ callback.Run(false, base::string16());
+ return;
+ }
+
bridge->RunJavaScriptDialog(message_type,
origin_url,
message_text,
@@ -39,6 +44,11 @@ void AwJavaScriptDialogManager::RunBeforeUnloadDialog(
const DialogClosedCallback& callback) {
AwContentsClientBridgeBase* bridge =
AwContentsClientBridgeBase::FromWebContents(web_contents);
+ if (!bridge) {
+ callback.Run(false, base::string16());
+ return;
+ }
+
bridge->RunBeforeUnloadDialog(web_contents->GetURL(),
message_text,
callback);
« no previous file with comments | « android_webview/browser/aw_contents_client_bridge_base.cc ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698