Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[xulrunner] Don't try to access undefined app list of AppsServiceChil…
…d. Fixes MER#1609
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
rpm/0019-xulrunner-Don-t-try-to-access-undefined-app-list-of-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
From f3f7b3e0737f25af44092339aeac3287de064e96 Mon Sep 17 00:00:00 2001 | ||
From: Raine Makelainen <raine.makelainen@jolla.com> | ||
Date: Fri, 1 Jul 2016 10:39:47 +0300 | ||
Subject: [PATCH 19/19] [xulrunner] Don't try to access undefined app list of | ||
AppsServiceChild. Fixes MER#1609 | ||
|
||
When accessing e.g. imgur.com for the first time list build up fails | ||
(.mozilla/mozembed is still clean). Subsequental access are ok. | ||
|
||
This backout partically changes from upstream commit sha1 55152ad9d9a23874 | ||
|
||
Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com> | ||
--- | ||
dom/apps/AppsServiceChild.jsm | 28 +++++++++++++--------------- | ||
1 file changed, 13 insertions(+), 15 deletions(-) | ||
|
||
diff --git a/dom/apps/AppsServiceChild.jsm b/dom/apps/AppsServiceChild.jsm | ||
index 8681622..1d9726c 100644 | ||
--- a/dom/apps/AppsServiceChild.jsm | ||
+++ b/dom/apps/AppsServiceChild.jsm | ||
@@ -103,28 +103,26 @@ this.DOMApplicationRegistry = { | ||
this.cpmm.addMessageListener(aMsgName, this); | ||
}).bind(this)); | ||
|
||
- this.resetList(); | ||
- | ||
- Services.obs.addObserver(this, "xpcom-shutdown", false); | ||
- }, | ||
- | ||
- resetList: function() { | ||
this.cpmm.sendAsyncMessage("Webapps:RegisterForMessages", { | ||
messages: APPS_IPC_MSG_NAMES | ||
}); | ||
|
||
// We need to prime the cache with the list of apps. | ||
let list = this.cpmm.sendSyncMessage("Webapps:GetList", { })[0]; | ||
- this.webapps = list.webapps; | ||
- | ||
- // We need a fast mapping from localId -> app, so we add an index. | ||
- // We also add the manifest to the app object. | ||
- this.localIdIndex = { }; | ||
- for (let id in this.webapps) { | ||
- let app = this.webapps[id]; | ||
- this.localIdIndex[app.localId] = app; | ||
- app.manifest = list.manifests[id]; | ||
+ try { | ||
+ this.webapps = list.webapps; | ||
+ // We need a fast mapping from localId -> app, so we add an index. | ||
+ // We also add the manifest to the app object. | ||
+ this.localIdIndex = { }; | ||
+ for (let id in this.webapps) { | ||
+ let app = this.webapps[id]; | ||
+ this.localIdIndex[app.localId] = app; | ||
+ app.manifest = list.manifests[id]; | ||
+ } | ||
+ } catch (e) { | ||
+ debug("Error while building fast maps: " + e + "\n"); | ||
} | ||
+ Services.obs.addObserver(this, "xpcom-shutdown", false); | ||
}, | ||
|
||
observe: function(aSubject, aTopic, aData) { | ||
-- | ||
2.7.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters