Bug 886156 - Part 1: belt-and-braces safety in initialization of ProfileInformationCache. r=nalexander

This commit is contained in:
Richard Newman 2013-06-25 22:34:42 -07:00
parent ed8cee1639
commit ccf78e8bcd
2 changed files with 10 additions and 6 deletions

View File

@ -564,7 +564,7 @@ public class BrowserHealthRecorder implements GeckoEventListener {
PREF_BLOCKLIST_ENABLED PREF_BLOCKLIST_ENABLED
}, },
handler); handler);
Log.d(LOG_TAG, "Done initializing profile cache. Beginning storage init."); Log.d(LOG_TAG, "Requested prefs.");
} }
@Override @Override
@ -574,7 +574,7 @@ public class BrowserHealthRecorder implements GeckoEventListener {
Log.d(LOG_TAG, "Got all add-ons."); Log.d(LOG_TAG, "Got all add-ons.");
try { try {
JSONObject addons = message.getJSONObject("json"); JSONObject addons = message.getJSONObject("json");
Log.d(LOG_TAG, "Persisting " + addons.length() + " add-ons."); Log.i(LOG_TAG, "Persisting " + addons.length() + " add-ons.");
profileCache.setJSONForAddons(addons); profileCache.setJSONForAddons(addons);
profileCache.completeInitialization(); profileCache.completeInitialization();
} catch (java.io.IOException e) { } catch (java.io.IOException e) {

View File

@ -5238,11 +5238,15 @@ let HealthReportStatusListener = {
if (aAddons) { if (aAddons) {
for (let i = 0; i < aAddons.length; ++i) { for (let i = 0; i < aAddons.length; ++i) {
let addon = aAddons[i]; let addon = aAddons[i];
let addonJSON = HealthReportStatusListener.jsonForAddon(addon); try {
if (HealthReportStatusListener._shouldIgnore(addon)) { let addonJSON = HealthReportStatusListener.jsonForAddon(addon);
addonJSON.ignore = true; if (HealthReportStatusListener._shouldIgnore(addon)) {
addonJSON.ignore = true;
}
json[addon.id] = addonJSON;
} catch (e) {
// Just skip this add-on.
} }
json[addon.id] = addonJSON;
} }
} }
sendMessageToJava({ type: "Addons:All", json: json }); sendMessageToJava({ type: "Addons:All", json: json });