Bug 1642828 - continuous console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for URL" r=dimi

Differential Revision: https://phabricator.services.mozilla.com/D145905
This commit is contained in:
Sergey Galich 2022-05-10 15:48:26 +00:00
Родитель e8e0fa80c5
Коммит 2b96454111
2 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -1439,7 +1439,6 @@ this.LoginManagerChild = class LoginManagerChild extends JSWindowActorChild {
let doc = acForm.ownerDocument;
let formOrigin = LoginHelper.getLoginOrigin(doc.documentURI);
let recipes = LoginRecipesContent.getRecipes(
this,
formOrigin,
doc.defaultView
);
@ -1994,7 +1993,7 @@ this.LoginManagerChild = class LoginManagerChild extends JSWindowActorChild {
}
// Get the appropriate fields from the form.
let recipes = LoginRecipesContent.getRecipes(this, origin, win);
let recipes = LoginRecipesContent.getRecipes(origin, win);
let fields = {
targetField,
...this._getFormFields(form, true, recipes, { ignoreConnect }),
@ -3052,7 +3051,6 @@ this.LoginManagerChild = class LoginManagerChild extends JSWindowActorChild {
let doc = aField.ownerDocument;
let formOrigin = LoginHelper.getLoginOrigin(doc.documentURI);
let recipes = LoginRecipesContent.getRecipes(
this,
formOrigin,
doc.defaultView
);

Просмотреть файл

@ -275,14 +275,13 @@ this.LoginRecipesContent = {
* Tries to fetch recipes for a given host, using a local cache if possible.
* Otherwise, the recipes are cached for later use.
*
* @param {JSWindowActor} aActor - actor making request
* @param {String} aHost (e.g. example.com:8080 [non-default port] or sub.example.com)
* @param {Object} win - the window of the host
* @return {Set} of recipes that apply to the host
*/
getRecipes(aActor, aHost, win) {
getRecipes(aHost, win) {
let recipes;
let recipeMap = this._recipeCache.get(win);
const recipeMap = this._recipeCache.get(win);
if (recipeMap) {
recipes = recipeMap.get(aHost);
@ -292,7 +291,11 @@ this.LoginRecipesContent = {
}
}
log.warn("getRecipes: falling back to a synchronous message for:", aHost);
if (!Cu.isInAutomation) {
// this is a blocking call we expect in tests and rarely expect in
// production, for example when Remote Settings are updated.
log.warn("getRecipes: falling back to a synchronous message for:", aHost);
}
recipes = Services.cpmm.sendSyncMessage("PasswordManager:findRecipes", {
formOrigin: aHost,
})[0];