Bug 1350243 - Combine e10s and non-e10s code paths when reacting to datalist updates. r?MattN
MozReview-Commit-ID: 1O3wAzzwWAR
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -823,70 +823,28 @@ nsFormFillController::PerformInputListAu
mListNode = node;
}
}
}
return NS_OK;
}
-class UpdateSearchResultRunnable : public mozilla::Runnable
-{
-public:
- UpdateSearchResultRunnable(nsIAutoCompleteObserver* aObserver,
- nsIAutoCompleteSearch* aSearch,
- nsIAutoCompleteResult* aResult)
- : mObserver(aObserver)
- , mSearch(aSearch)
- , mResult(aResult)
- {
- MOZ_ASSERT(mResult, "Should have a valid result");
- MOZ_ASSERT(mObserver, "You shouldn't call this runnable with a null observer!");
- }
-
- NS_IMETHOD Run() override {
- mObserver->OnUpdateSearchResult(mSearch, mResult);
- return NS_OK;
- }
-
-private:
- nsCOMPtr<nsIAutoCompleteObserver> mObserver;
- nsCOMPtr<nsIAutoCompleteSearch> mSearch;
- nsCOMPtr<nsIAutoCompleteResult> mResult;
-};
-
void nsFormFillController::RevalidateDataList()
{
if (!mLastListener) {
return;
}
- if (XRE_IsContentProcess()) {
- nsCOMPtr<nsIAutoCompleteController> controller(do_QueryInterface(mLastListener));
- if (!controller) {
- return;
- }
-
- controller->StartSearch(mLastSearchString);
+ nsCOMPtr<nsIAutoCompleteController> controller(do_QueryInterface(mLastListener));
+ if (!controller) {
return;
}
- nsresult rv;
- nsCOMPtr <nsIInputListAutoComplete> inputListAutoComplete =
- do_GetService("@mozilla.org/satchel/inputlist-autocomplete;1", &rv);
-
- nsCOMPtr<nsIAutoCompleteResult> result;
-
- rv = inputListAutoComplete->AutoCompleteSearch(mLastSearchString,
- mFocusedInput,
- getter_AddRefs(result));
-
- nsCOMPtr<nsIRunnable> event =
- new UpdateSearchResultRunnable(mLastListener, this, result);
- NS_DispatchToCurrentThread(event);
+ controller->StartSearch(mLastSearchString);
}
NS_IMETHODIMP
nsFormFillController::StopSearch()
{
// Make sure to stop and clear this, otherwise the controller will prevent
// mLastFormAutoComplete from being deleted.
if (mLastFormAutoComplete) {