Commit 4308706e authored by benm@chromium.org's avatar benm@chromium.org

[Android WebView] Fix hang in popup window flow.

It's possible that we end up hanging the browser
process waiting for the response to a popup window
due to a bug in the AwContents hand-over when swapping
out the popup content into the user-supplied WebView.

This patch ensures that we don't end up with two AwContents
instances pointing to the same java AwContentsClientBridge
java object during deletion.

BUG=

Review URL: https://codereview.chromium.org/305823005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277816 0039d316-1c4b-4281-b951-d872f2087c98
parent a60b8186
...@@ -294,6 +294,13 @@ jlong AwContents::GetWebContents(JNIEnv* env, jobject obj) { ...@@ -294,6 +294,13 @@ jlong AwContents::GetWebContents(JNIEnv* env, jobject obj) {
void AwContents::Destroy(JNIEnv* env, jobject obj) { void AwContents::Destroy(JNIEnv* env, jobject obj) {
java_ref_.reset(); java_ref_.reset();
// We clear the contents_client_bridge_ here so that we break the link with
// the java peer. This is important for the popup window case, where we are
// swapping AwContents out that share the same java AwContentsClientBridge.
// See b/15074651.
contents_client_bridge_.reset();
// We do not delete AwContents immediately. Some applications try to delete // We do not delete AwContents immediately. Some applications try to delete
// Webview in ShouldOverrideUrlLoading callback, which is a sync IPC from // Webview in ShouldOverrideUrlLoading callback, which is a sync IPC from
// Webkit. // Webkit.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment