Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4b2d4dc authored by Steve Block's avatar Steve Block
Browse files

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
parent 4b9f74a2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
    }
+2 −2
Original line number Diff line number Diff line
@@ -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);
        }