summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authoralexeypa@google.com <alexeypa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 18:20:45 +0000
committeralexeypa@google.com <alexeypa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 18:20:45 +0000
commite0521140e09b03dca21735082e672e3bbaf908e8 (patch)
treeb84ca52e54dae310cf3063ae39c8b768bfb44548 /android_webview
parent2488c7c2856ec37f59b3ea48d39925d37f0e8cb1 (diff)
downloadchromium_src-e0521140e09b03dca21735082e672e3bbaf908e8.zip
chromium_src-e0521140e09b03dca21735082e672e3bbaf908e8.tar.gz
chromium_src-e0521140e09b03dca21735082e672e3bbaf908e8.tar.bz2
Revert 174978. r174937 does not seem to be releated to content_browsertests failures in any way.
> Speculative revert of r174937 to see if it clears up content_browsertests failure at Linux ASAN Tests (3). > > > small improvement to GeolocationPermissions.clearAll() to > > avoid thread & disk churn when clearing many entries, and fix > > some warnings. > > > > BUG= > > > > Review URL: https://chromiumcodereview.appspot.com/11724003 > > TBR=joth@chromium.org > Review URL: https://codereview.chromium.org/11740024 TBR=alexeypa@google.com Review URL: https://codereview.chromium.org/11742021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java b/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java
index 7b4b945..133f597 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwGeolocationPermissions.java
@@ -7,7 +7,6 @@ package org.chromium.android_webview;
import android.content.SharedPreferences;
import android.webkit.ValueCallback;
-import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils;
import org.chromium.net.GURLUtils;
@@ -51,11 +50,18 @@ public final class AwGeolocationPermissions {
}
public void clearAll() {
+ SharedPreferences.Editor editor = null;
for (String name : mSharedPreferences.getAll().keySet()) {
if (name.startsWith(PREF_PREFIX)) {
- mSharedPreferences.edit().remove(name).apply();
+ if (editor == null) {
+ editor = mSharedPreferences.edit();
+ }
+ editor.remove(name);
}
}
+ if (editor != null) {
+ editor.apply();
+ }
}
public void getAllowed(String origin, final ValueCallback<Boolean> callback) {
@@ -70,6 +76,7 @@ public final class AwGeolocationPermissions {
}
final boolean finalAllowed = allowed;
ThreadUtils.postOnUiThread(new Runnable() {
+ @Override
public void run() {
callback.onReceiveValue(finalAllowed);
}
@@ -84,6 +91,7 @@ public final class AwGeolocationPermissions {
}
}
ThreadUtils.postOnUiThread(new Runnable() {
+ @Override
public void run() {
callback.onReceiveValue(origins);
}