diff options
author | Ben Murdoch <benm@mojito.lon.corp.google.com> | 2009-06-18 17:48:34 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-06-18 18:29:44 +0100 |
commit | 5647bb3cc21428dd5242255323dff13c71a3343d (patch) | |
tree | 1df8087fd2f31abf692b26509a04ee8579dd68e0 /core/java/android/webkit/WebStorage.java | |
parent | 9f655a4a0457d5bcdf1ad5dcf7cb1256aaaa8e7d (diff) | |
download | frameworks_base-5647bb3cc21428dd5242255323dff13c71a3343d.zip frameworks_base-5647bb3cc21428dd5242255323dff13c71a3343d.tar.gz frameworks_base-5647bb3cc21428dd5242255323dff13c71a3343d.tar.bz2 |
Update WebStorage methods used by DumpRenderTree to complete synchronously if they are called on the webcore thread.
Diffstat (limited to 'core/java/android/webkit/WebStorage.java')
-rw-r--r-- | core/java/android/webkit/WebStorage.java | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/core/java/android/webkit/WebStorage.java b/core/java/android/webkit/WebStorage.java index f27360d..0488691 100644 --- a/core/java/android/webkit/WebStorage.java +++ b/core/java/android/webkit/WebStorage.java @@ -200,8 +200,13 @@ public final class WebStorage { */ public void setQuotaForOrigin(String origin, long quota) { if (origin != null) { - postMessage(Message.obtain(null, SET_QUOTA_ORIGIN, - new Origin(origin, quota))); + if (WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName())) { + nativeSetQuotaForOrigin(origin, quota); + syncValues(); + } else { + postMessage(Message.obtain(null, SET_QUOTA_ORIGIN, + new Origin(origin, quota))); + } } } @@ -211,8 +216,13 @@ public final class WebStorage { */ public void deleteOrigin(String origin) { if (origin != null) { - postMessage(Message.obtain(null, DELETE_ORIGIN, - new Origin(origin))); + if (WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName())) { + nativeDeleteOrigin(origin); + syncValues(); + } else { + postMessage(Message.obtain(null, DELETE_ORIGIN, + new Origin(origin))); + } } } @@ -221,7 +231,12 @@ public final class WebStorage { * Delete all databases */ public void deleteAllDatabases() { - postMessage(Message.obtain(null, DELETE_ALL)); + if (WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName())) { + nativeDeleteAllDatabases(); + syncValues(); + } else { + postMessage(Message.obtain(null, DELETE_ALL)); + } } /** @@ -250,7 +265,11 @@ public final class WebStorage { * Post a Sync request */ public void update() { - postMessage(Message.obtain(null, UPDATE)); + if (WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName())) { + syncValues(); + } else { + postMessage(Message.obtain(null, UPDATE)); + } } /** |