diff options
author | Steve Block <steveblock@google.com> | 2010-02-19 12:21:35 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-19 12:21:35 +0000 |
commit | e4b2d4dc7db426052d1dfebc40f6b64a001b6d73 (patch) | |
tree | 59ad589016d81f7bee1a7db4af2fbd2c47412972 /core | |
parent | 4b9f74a2d3bd9672ec392b657eedefb31cd5b516 (diff) | |
download | frameworks_base-e4b2d4dc7db426052d1dfebc40f6b64a001b6d73.zip frameworks_base-e4b2d4dc7db426052d1dfebc40f6b64a001b6d73.tar.gz frameworks_base-e4b2d4dc7db426052d1dfebc40f6b64a001b6d73.tar.bz2 |
Adds synchronization around message handler in GeolocationPermissions and WebStorage
The message handler is instantiated on the WebCore thread and its presence is
checked on the browser thread. This requires synchronization.
Change-Id: I4b71c7a2470b60fa273dc2bcb46f645ed135ee11
Diffstat (limited to 'core')
-rwxr-xr-x | core/java/android/webkit/GeolocationPermissions.java | 4 | ||||
-rw-r--r-- | core/java/android/webkit/WebStorage.java | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/webkit/GeolocationPermissions.java b/core/java/android/webkit/GeolocationPermissions.java index d12d828..817fb3c 100755 --- a/core/java/android/webkit/GeolocationPermissions.java +++ b/core/java/android/webkit/GeolocationPermissions.java @@ -126,7 +126,7 @@ public final class GeolocationPermissions { * Creates the message handler. Must be called on the WebKit thread. * @hide */ - public void createHandler() { + public synchronized void createHandler() { if (mHandler == null) { mHandler = new Handler() { @Override @@ -180,7 +180,7 @@ public final class GeolocationPermissions { /** * Utility function to send a message to our handler. */ - private void postMessage(Message msg) { + private synchronized void postMessage(Message msg) { assert(mHandler != null); mHandler.sendMessage(msg); } diff --git a/core/java/android/webkit/WebStorage.java b/core/java/android/webkit/WebStorage.java index cf71a84..9314d7b 100644 --- a/core/java/android/webkit/WebStorage.java +++ b/core/java/android/webkit/WebStorage.java @@ -146,7 +146,7 @@ public final class WebStorage { * @hide * Message handler, webcore side */ - public void createHandler() { + public synchronized void createHandler() { if (mHandler == null) { mHandler = new Handler() { @Override @@ -342,7 +342,7 @@ public final class WebStorage { /** * Utility function to send a message to our handler */ - private void postMessage(Message msg) { + private synchronized void postMessage(Message msg) { if (mHandler != null) { mHandler.sendMessage(msg); } |