Merge "Adds synchronization around message handler in GeolocationPermissions and WebStorage"

This commit is contained in:
Steve Block
2010-02-19 08:22:37 -08:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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);
}