From d4ef6710aa8c088f9f4a9006b4541aef0278e56c Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Wed, 25 Nov 2015 12:37:24 +0100 Subject: [PATCH] Backed out changeset 50441cd0d6a1 (bug 1212321) for causing regressions --- dom/apps/Webapps.js | 5 ++- .../BrowserElementChildPreload.js | 34 ++----------------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/dom/apps/Webapps.js b/dom/apps/Webapps.js index f529c7cf3c39..e46e99966de8 100644 --- a/dom/apps/Webapps.js +++ b/dom/apps/Webapps.js @@ -573,6 +573,8 @@ WebappsApplication.prototype = { launch: function(aStartPoint) { let request = this.createRequest(); + this.addMessageListeners(["Webapps:Launch:Return:OK", + "Webapps:Launch:Return:KO"]); cpmm.sendAsyncMessage("Webapps:Launch", { origin: this.origin, manifestURL: this.manifestURL, startPoint: aStartPoint || "", @@ -580,9 +582,6 @@ WebappsApplication.prototype = { topId: this._topId, timestamp: Date.now(), requestID: this.getRequestId(request) }); - Services.obs.notifyObservers(null, "will-launch-app", null); - this.addMessageListeners(["Webapps:Launch:Return:OK", - "Webapps:Launch:Return:KO"]); return request; }, diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index e96c08bef584..8d64f55cbe8a 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -27,10 +27,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "ManifestObtainer", var kLongestReturnedString = 128; -const Timer = Components.Constructor("@mozilla.org/timer;1", - "nsITimer", - "initWithCallback"); - function debug(msg) { //dump("BrowserElementChildPreload - " + msg + "\n"); } @@ -69,8 +65,7 @@ const OBSERVED_EVENTS = [ 'xpcom-shutdown', 'audio-playback', 'activity-done', - 'invalid-widget', - 'will-launch-app' + 'invalid-widget' ]; const COMMAND_MAP = { @@ -337,14 +332,11 @@ BrowserElementChild.prototype = { this.forwarder.init(); }, - _paintFrozenTimer: null, observe: function(subject, topic, data) { // Ignore notifications not about our document. (Note that |content| /can/ // be null; see bug 874900.) - if (topic !== 'activity-done' && - topic !== 'audio-playback' && - topic !== 'will-launch-app' && + if (topic !== 'activity-done' && topic !== 'audio-playback' && (!content || subject !== content.document)) { return; } @@ -365,26 +357,9 @@ BrowserElementChild.prototype = { case 'invalid-widget': sendAsyncMsg('error', { type: 'invalid-widget' }); break; - case 'will-launch-app': - // If the launcher is not visible, let's ignore the message. - if (!docShell.isActive) { - return; - } - - docShell.contentViewer.pausePainting(); - - this._paintFrozenTimer && this._paintFrozenTimer.cancel(); - this._paintFrozenTimer = new Timer(this, 3000, Ci.nsITimer.TYPE_ONE_SHOT); - break; } }, - notify: function(timer) { - docShell.contentViewer.resumePainting(); - this._paintFrozenTimer.cancel(); - this._paintFrozenTimer = null; - }, - /** * Called when our TabChildGlobal starts to die. This is not called when the * page inside |content| unloads. @@ -1403,11 +1378,6 @@ BrowserElementChild.prototype = { if (docShell && docShell.isActive !== visible) { docShell.isActive = visible; sendAsyncMsg('visibilitychange', {visible: visible}); - - // Ensure painting is not frozen if the app goes visible. - if (visible && this._paintFrozenTimer) { - this.notify(); - } } },