Open Bug 1251141 Opened 4 years ago Updated 4 years ago
Chrome Script's send Async Message actually uses _send Sync Message
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.
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.
You need to log in before you can comment on or make changes to this bug.