Commit 28da6a5c authored by Committed by Grisha KruglovBrowse files
Perform browser-toolbar autocompletion off the UI thread
At this point in the stack, we're not in control over what our autocomplete providers are, what actions they'll do in order to field our queries, etc. For example, some providers may hit the disk and perform expensive DB queries internally. Some may even hit the network, in theory! In order to keep things perceptively speedy, let's run the actual work off the main thread. This patch sets up a new pool thread to process autocomplete requests. More than one thread is selected so that we maintain liveliness during quick user input. Background tasks are cancelled as new queries come in, and stale results are discarded.
components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/AsyncFilterListenerTest.kt 0 → 100644