summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-07-22 11:26:16 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-07-22 11:26:16 -0700
commiteda75723659c537d3e57abe8a123be1235243e4f (patch)
tree90b60fb6c9cabefb194850672791d2634af7b851 /core/java/android/webkit
parent90443e67a5fe826b9c0a4fce38febeeedac8f498 (diff)
parent9a56bb838c099a318d4f961f290d324ed5f1949d (diff)
downloadframeworks_base-eda75723659c537d3e57abe8a123be1235243e4f.zip
frameworks_base-eda75723659c537d3e57abe8a123be1235243e4f.tar.gz
frameworks_base-eda75723659c537d3e57abe8a123be1235243e4f.tar.bz2
Merge change 8211
* changes: cleanup the WebStorage Java class. There were too many calls to syncValues().
Diffstat (limited to 'core/java/android/webkit')
-rw-r--r--core/java/android/webkit/WebStorage.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/core/java/android/webkit/WebStorage.java b/core/java/android/webkit/WebStorage.java
index 7522b5a..1a60dba 100644
--- a/core/java/android/webkit/WebStorage.java
+++ b/core/java/android/webkit/WebStorage.java
@@ -51,8 +51,9 @@ public final class WebStorage {
// Global instance of a WebStorage
private static WebStorage sWebStorage;
- // We keep a copy of the origins, quotas and usages
- // that we protect via a lock and update in syncValues()
+ // We keep the origins, quotas and usages as member values
+ // that we protect via a lock and update in syncValues().
+ // This is needed to transfer this data across threads.
private static Lock mLock = new ReentrantLock();
private static Condition mCacheUpdated = mLock.newCondition();
@@ -104,18 +105,15 @@ public final class WebStorage {
Origin website = (Origin) msg.obj;
nativeSetQuotaForOrigin(website.getOrigin(),
website.getQuota());
- syncValues();
} break;
case DELETE_ORIGIN: {
Origin website = (Origin) msg.obj;
nativeDeleteOrigin(website.getOrigin());
- syncValues();
} break;
case DELETE_ALL:
nativeDeleteAllData();
- syncValues();
break;
case UPDATE:
@@ -204,7 +202,6 @@ public final class WebStorage {
if (origin != null) {
if (WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName())) {
nativeSetQuotaForOrigin(origin, quota);
- syncValues();
} else {
postMessage(Message.obtain(null, SET_QUOTA_ORIGIN,
new Origin(origin, quota)));
@@ -220,7 +217,6 @@ public final class WebStorage {
if (origin != null) {
if (WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName())) {
nativeDeleteOrigin(origin);
- syncValues();
} else {
postMessage(Message.obtain(null, DELETE_ORIGIN,
new Origin(origin)));
@@ -235,7 +231,6 @@ public final class WebStorage {
public void deleteAllData() {
if (WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName())) {
nativeDeleteAllData();
- syncValues();
} else {
postMessage(Message.obtain(null, DELETE_ALL));
}
@@ -276,7 +271,7 @@ public final class WebStorage {
/**
* Run on the webcore thread
- * sync the local cached values with the real ones
+ * set the local values with the current ones
*/
private void syncValues() {
mLock.lock();