Skip to content

Commit

Permalink
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
rainemak committed Jul 1, 2016
1 parent f0604b7 commit 91df6cf
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
@@ -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

2 changes: 2 additions & 0 deletions rpm/xulrunner-qt5.spec
Expand Up @@ -60,6 +60,7 @@ Patch15: 0015-Add-transition-from-pinching-to-panning.patch
Patch16: 0016-rpm-Update-build-version.-Contributes-to-JB-35001.patch
Patch17: 0017-Bug-1253215-Initialize-RequestSyncService-only-if-it.patch
Patch18: 0018-xulrunner-Don-t-print-errors-from-DataReportingServi.patch
Patch19: 0019-xulrunner-Don-t-try-to-access-undefined-app-list-of-.patch
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(pango)
Expand Down Expand Up @@ -160,6 +161,7 @@ Tests and misc files for xulrunner.
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1

mkdir -p "%BUILD_DIR"
cp -rf "%BASE_CONFIG" "%BUILD_DIR"/mozconfig
Expand Down

0 comments on commit 91df6cf

Please sign in to comment.