Loading core/java/android/webkit/WebStorage.java +4 −9 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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: Loading Loading @@ -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))); Loading @@ -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))); Loading @@ -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)); } Loading Loading @@ -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(); Loading Loading
core/java/android/webkit/WebStorage.java +4 −9 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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: Loading Loading @@ -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))); Loading @@ -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))); Loading @@ -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)); } Loading Loading @@ -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(); Loading