diff options
author | michaelbai <michaelbai@chromium.org> | 2015-07-23 15:38:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-23 22:39:58 +0000 |
commit | 2b11e017ff2c8d4ec5322b7cdbf477b1b32a9c17 (patch) | |
tree | f0752ae0a87c709500343a9d75eb2a0c7e5ce1e2 | |
parent | be6cffe20f379b585b4dc4fdffd233516e777f2f (diff) | |
download | chromium_src-2b11e017ff2c8d4ec5322b7cdbf477b1b32a9c17.zip chromium_src-2b11e017ff2c8d4ec5322b7cdbf477b1b32a9c17.tar.gz chromium_src-2b11e017ff2c8d4ec5322b7cdbf477b1b32a9c17.tar.bz2 |
Invoke the geolocation callback only if there is pending request.
BUG=511338
Review URL: https://codereview.chromium.org/1248803004
Cr-Commit-Position: refs/heads/master@{#340194}
-rw-r--r-- | android_webview/native/aw_contents.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index 42992ae..d926404 100644 --- a/android_webview/native/aw_contents.cc +++ b/android_webview/native/aw_contents.cc @@ -491,6 +491,11 @@ void AwContents::InvokeGeolocationCallback(JNIEnv* env, jboolean value, jstring origin) { DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (pending_geolocation_prompts_.empty()) { + LOG(WARNING) << "Response for this geolocation request has been received." + << " Ignoring subsequent responses"; + return; + } GURL callback_origin(base::android::ConvertJavaStringToUTF16(env, origin)); if (callback_origin.GetOrigin() == @@ -501,6 +506,9 @@ void AwContents::InvokeGeolocationCallback(JNIEnv* env, ShowGeolocationPromptHelper(java_ref_, pending_geolocation_prompts_.front().first); } + } else { + LOG(WARNING) << "Response for this geolocation request has been received." + << " Ignoring subsequent responses"; } } |