loadChromeScript's sendAsyncMessage actually uses _sendSyncMessage

NEW
Unassigned

Status

3 years ago
3 years ago

People

(Reporter: MattN, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

loadChromeScript's sendAsyncMessage calls this._sendSyncMessage so we have the method name declaring that it's asynchronous but then the implementation is actually synchronous. I'm guessing this was a mistake. Alex, can you confirm?

For some tests I need synchronous behaviour so I think we should add sendSyncMessage in bug 1153128.

In this bug I think we should make sendAsyncMessage actually async (or remove it) and update all existing references to use sendSyncMessage since at this point some consumers may be relying on it's synchronous implementation.
Flags: needinfo?(poirot.alex)
Oh! Yes, it looks like a mistake. My very first usage of this API doesn't rely on it being sync.

Be careful if you just replace its internal sendSync by sendAsync, it may break the world.
I would say it is better to keep it and use it everywhere we don't have to be sync.
Flags: needinfo?(poirot.alex)
You need to log in before you can comment on or make changes to this bug.