summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichaelbai <michaelbai@chromium.org>2015-07-23 15:38:34 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-23 22:39:58 +0000
commit2b11e017ff2c8d4ec5322b7cdbf477b1b32a9c17 (patch)
treef0752ae0a87c709500343a9d75eb2a0c7e5ce1e2
parentbe6cffe20f379b585b4dc4fdffd233516e777f2f (diff)
downloadchromium_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.cc8
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";
}
}