Bug 1836783 - Removing unused options in nsIAutoCompleteSearch.startSearch r=credential-management-reviewers,joschmidt

Differential Revision: https://phabricator.services.mozilla.com/D179962
This commit is contained in:
Sergey Galich 2023-06-05 15:45:14 +00:00
parent 9f2abeb1ff
commit a4e75bfbec
5 changed files with 9 additions and 33 deletions

View File

@ -972,8 +972,7 @@ nsresult nsAutoCompleteController::StartSearch(uint16_t aSearchType) {
}
rv = search->StartSearch(mSearchString, searchParam, result,
static_cast<nsIAutoCompleteObserver*>(this),
nullptr);
static_cast<nsIAutoCompleteObserver*>(this));
if (NS_FAILED(rv)) {
++mSearchesFailed;
MOZ_ASSERT(mSearchesOngoing > 0);

View File

@ -19,14 +19,11 @@ interface nsIAutoCompleteSearch : nsISupports
* @param searchParam - An extra parameter
* @param previousResult - A previous result to use for faster searching
* @param listener - A listener to notify when the search is complete
* @param options An optional set of additional search parameters that may be
* passed to the underlying implementation.
*/
void startSearch(in AString searchString,
in AString searchParam,
in nsIAutoCompleteResult previousResult,
in nsIAutoCompleteObserver listener,
[optional] in nsIPropertyBag2 options);
in nsIAutoCompleteObserver listener);
/*
* Stop all searches that are in progress

View File

@ -344,8 +344,6 @@ export class FormAutoComplete {
* aDatalistResult -- results from list=datalist for aField.
* aListener -- nsIFormAutoCompleteObserver that listens for the nsIAutoCompleteResult
* that may be returned asynchronously.
* options -- an optional nsIPropertyBag2 containing additional search
* parameters.
*/
autoCompleteSearchAsync(
aInputName,
@ -353,8 +351,7 @@ export class FormAutoComplete {
aField,
aPreviousResult,
aDatalistResult,
aListener,
aOptions
aListener
) {
// Guard against void DOM strings filtering into this code.
if (typeof aInputName === "object") {
@ -363,17 +360,6 @@ export class FormAutoComplete {
if (typeof aUntrimmedSearchString === "object") {
aUntrimmedSearchString = "";
}
const params = {};
if (aOptions) {
try {
aOptions.QueryInterface(Ci.nsIPropertyBag2);
for (const { name, value } of aOptions.enumerator) {
params[name] = value;
}
} catch (ex) {
console.error("Invalid options object: " + ex);
}
}
const client = new FormHistoryClient({
formField: aField,
@ -530,7 +516,6 @@ export class FormAutoComplete {
client,
aInputName,
searchString,
params,
processEntry
);
}
@ -599,18 +584,15 @@ export class FormAutoComplete {
* Get the values for an autocomplete list given a search string.
*
* client - a FormHistoryClient instance to perform the search with
* fieldName - fieldname field within form history (the form input name)
* fieldname - fieldname field within form history (the form input name)
* searchString - string to search for
* params - object containing additional properties to query autocomplete.
* callback - called when the values are available. Passed an array of objects,
* containing properties for each result. The callback is only called
* when successful.
*/
getAutoCompleteValues(client, fieldName, searchString, params, callback) {
params = Object.assign({ fieldname: fieldName }, params);
getAutoCompleteValues(client, fieldname, searchString, callback) {
this.stopAutoCompleteSearch();
client.requestAutoCompleteResults(searchString, params, entries => {
client.requestAutoCompleteResults(searchString, { fieldname }, entries => {
this.#pendingClient = null;
callback(entries);
});

View File

@ -697,8 +697,7 @@ NS_IMETHODIMP
nsFormFillController::StartSearch(const nsAString& aSearchString,
const nsAString& aSearchParam,
nsIAutoCompleteResult* aPreviousResult,
nsIAutoCompleteObserver* aListener,
nsIPropertyBag2* aOptions) {
nsIAutoCompleteObserver* aListener) {
MOZ_LOG(sLogger, LogLevel::Debug, ("StartSearch for %p", mFocusedInput));
nsresult rv;
@ -745,7 +744,7 @@ nsFormFillController::StartSearch(const nsAString& aSearchString,
formAutoComplete->AutoCompleteSearchAsync(aSearchParam, aSearchString,
mFocusedInput, aPreviousResult,
datalistResult, this, aOptions);
datalistResult, this);
mLastFormAutoComplete = formAutoComplete;
}

View File

@ -21,8 +21,7 @@ interface nsIFormAutoComplete: nsISupports {
in HTMLInputElement aField,
in nsIAutoCompleteResult aPreviousResult,
in nsIAutoCompleteResult aDatalistResult,
in nsIFormAutoCompleteObserver aListener,
[optional] in nsIPropertyBag2 options);
in nsIFormAutoCompleteObserver aListener);
/**
* If a search is in progress, stop it. Otherwise, do nothing. This is used