Bug 735112 - Add some thread synchronization for plugin layers

This commit is contained in:
James Willcox 2012-06-15 11:27:40 -04:00
parent 1652c368d1
commit 526dcb9217

View File

@ -553,19 +553,27 @@ public final class Tab {
}
public void addPluginLayer(Object surfaceOrView, Layer layer) {
mPluginLayers.put(surfaceOrView, layer);
synchronized(mPluginLayers) {
mPluginLayers.put(surfaceOrView, layer);
}
}
public Layer getPluginLayer(Object surfaceOrView) {
return mPluginLayers.get(surfaceOrView);
synchronized(mPluginLayers) {
return mPluginLayers.get(surfaceOrView);
}
}
public Collection<Layer> getPluginLayers() {
return mPluginLayers.values();
synchronized(mPluginLayers) {
return new ArrayList<Layer>(mPluginLayers.values());
}
}
public Layer removePluginLayer(Object surfaceOrView) {
return mPluginLayers.remove(surfaceOrView);
synchronized(mPluginLayers) {
return mPluginLayers.remove(surfaceOrView);
}
}
public int getCheckerboardColor() {