Bug 1618445 - pt 4. Use the new logger for existing E10SUtils debug messages r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D65442

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Paul Bone 2020-03-17 04:32:24 +00:00
Родитель 065927a4a5
Коммит acbeea528b
1 изменённых файлов: 12 добавлений и 12 удалений

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

@ -80,10 +80,6 @@ XPCOMUtils.defineLazyServiceGetter(
"nsIExternalProtocolService"
);
function debug(msg) {
Cu.reportError(new Error("E10SUtils: " + msg));
}
function getAboutModule(aURL) {
// Needs to match NS_GetAboutModuleName
let moduleName = aURL.pathQueryRef.replace(/[#?].*/, "").toLowerCase();
@ -327,7 +323,7 @@ var E10SUtils = {
serializedCSP = serializationHelper.serializeToString(csp);
}
} catch (e) {
debug(`Failed to serialize csp '${csp}' ${e}`);
this.log().error(`Failed to serialize csp '${csp}' ${e}`);
}
return serializedCSP;
},
@ -349,7 +345,7 @@ var E10SUtils = {
csp.QueryInterface(Ci.nsIContentSecurityPolicy);
return csp;
} catch (e) {
debug(`Failed to deserialize csp_b64 '${csp_b64}' ${e}`);
this.log().error(`Failed to deserialize csp_b64 '${csp_b64}' ${e}`);
}
return null;
},
@ -641,7 +637,7 @@ var E10SUtils = {
);
}
} catch (e) {
debug(`Failed to serialize principal '${principal}' ${e}`);
this.log().error(`Failed to serialize principal '${principal}' ${e}`);
}
return serializedPrincipal;
@ -657,7 +653,7 @@ var E10SUtils = {
deserializePrincipal(principal_b64, fallbackPrincipalCallback = null) {
if (!principal_b64) {
if (!fallbackPrincipalCallback) {
debug(
this.log().warn(
"No principal passed to deserializePrincipal and no fallbackPrincipalCallback"
);
return null;
@ -681,10 +677,12 @@ var E10SUtils = {
principal.QueryInterface(Ci.nsIPrincipal);
return principal;
} catch (e) {
debug(`Failed to deserialize principal_b64 '${principal_b64}' ${e}`);
this.log().error(
`Failed to deserialize principal_b64 '${principal_b64}' ${e}`
);
}
if (!fallbackPrincipalCallback) {
debug(
this.log().warn(
"No principal passed to deserializePrincipal and no fallbackPrincipalCallback"
);
return null;
@ -913,7 +911,9 @@ var E10SUtils = {
try {
serialized = serializationHelper.serializeToString(referrerInfo);
} catch (e) {
debug(`Failed to serialize referrerInfo '${referrerInfo}' ${e}`);
this.log().error(
`Failed to serialize referrerInfo '${referrerInfo}' ${e}`
);
}
}
return serialized;
@ -931,7 +931,7 @@ var E10SUtils = {
deserialized = serializationHelper.deserializeObject(referrerInfo_b64);
deserialized.QueryInterface(Ci.nsIReferrerInfo);
} catch (e) {
debug(
this.log().error(
`Failed to deserialize referrerInfo_b64 '${referrerInfo_b64}' ${e}`
);
}