diff options
author | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 03:39:01 +0000 |
---|---|---|
committer | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 03:39:01 +0000 |
commit | 24e95856aad2baea5b1552f771209a172fa2ecdf (patch) | |
tree | 996af3a45ce9a1e85db8c4dc57cdb61152e1c123 | |
parent | ac46ed654c9e9a34568f30c049b5d817b4425119 (diff) | |
download | chromium_src-24e95856aad2baea5b1552f771209a172fa2ecdf.zip chromium_src-24e95856aad2baea5b1552f771209a172fa2ecdf.tar.gz chromium_src-24e95856aad2baea5b1552f771209a172fa2ecdf.tar.bz2 |
Merge 270159 "Check if java obj is valid before cancel permissio..."
> Check if java obj is valid before cancel permission request.
>
> AwContents could be destoryed while the permission request is pending,
> In this case, Java object is already destoryed.
>
> BUG=
>
> Review URL: https://codereview.chromium.org/279313002
TBR=michaelbai@chromium.org
BUG=373347
Review URL: https://codereview.chromium.org/282173002
git-svn-id: svn://svn.chromium.org/chrome/branches/1985/src@270573 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | android_webview/native/aw_contents.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index 2cfdcd5..a33cc7f 100644 --- a/android_webview/native/aw_contents.cc +++ b/android_webview/native/aw_contents.cc @@ -559,10 +559,10 @@ void AwContents::OnPermissionRequest(AwPermissionRequest* request) { void AwContents::OnPermissionRequestCanceled(AwPermissionRequest* request) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> j_request = request->GetJavaObject(); - if (j_request.is_null()) + ScopedJavaLocalRef<jobject> j_ref = java_ref_.get(env); + if (j_request.is_null() || j_ref.is_null()) return; - ScopedJavaLocalRef<jobject> j_ref = java_ref_.get(env); Java_AwContents_onPermissionRequestCanceled( env, j_ref.obj(), j_request.obj()); } |