Backed out changeset 50441cd0d6a1 (bug 1212321) for causing regressions

This commit is contained in:
Carsten "Tomcat" Book 2015-11-25 12:37:24 +01:00
Родитель fcb2a5060a
Коммит d4ef6710aa
2 изменённых файлов: 4 добавлений и 35 удалений

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

@ -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;
},

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

@ -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();
}
}
},