Bug 1257623 - CC / GC between each cycle of tpaint. r=jmaher

MozReview-Commit-ID: L5WBHiVj09J

--HG--
extra : rebase_source : e4e8199bb4a2608cce5b6fa7aff21444d64d0c82
This commit is contained in:
Mike Conley 2016-03-17 17:58:38 -04:00
Родитель a40a974f31
Коммит 4e2ae9580b
7 изменённых файлов: 38 добавлений и 3 удалений

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

@ -2,6 +2,7 @@
<meta charset='utf-8'>
<script language="JavaScript" type="text/javascript" src="../scripts/MozillaFileLogger.js"></script>
<script language="JavaScript" type="text/javascript" src="../scripts/Profiler.js"></script>
<script language="JavaScript" type="text/javascript" src="chrome://talos-powers-content/content/TalosPowersContent.js"></script>
<script language="JavaScript" type="text/javascript" src="../tests/quit.js"></script>
<script>
var OPENER_DELAY = 1000; // ms delay between tests
@ -35,6 +36,8 @@ function scheduleNextWindow() {
window.setTimeout(reportTimes, 0);
return;
}
TalosPowersContent.forceCCAndGC();
window.setTimeout(openWindow, OPENER_DELAY);
}

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

@ -3,4 +3,3 @@
This add-ons purpose is to give talos content some special powers
that are normally restricted to the browser.
Right now, that's just the ability to quit the browser.

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

@ -42,4 +42,11 @@ addMessageListener("TalosContentProfiler:Response", (msg) => {
}, content);
content.dispatchEvent(
new content.CustomEvent("TalosContentProfilerResponse", event));
});
});
addEventListener("TalosPowersContentForceCCAndGC", (e) => {
let name = e.detail.name;
Cu.forceCC();
Cu.forceGC();
sendSyncMessage("TalosPowersContent:ForceCCAndGC", { name });
});

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

@ -39,6 +39,7 @@ TalosPowersService.prototype = {
Services.mm.loadFrameScript(FRAME_SCRIPT, true);
Services.mm.addMessageListener("Talos:ForceQuit", this);
Services.mm.addMessageListener("TalosContentProfiler:Command", this);
Services.mm.addMessageListener("TalosPowersContent:ForceCCAndGC", this);
Services.obs.addObserver(this, "xpcom-shutdown", false);
},
@ -56,6 +57,11 @@ TalosPowersService.prototype = {
this.receiveProfileCommand(message);
break;
}
case "TalosPowersContent:ForceCCAndGC": {
Cu.forceCC();
Cu.forceGC();
break;
}
}
},

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

@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var TalosPowersContent;
(function() {
TalosPowersContent = {
/**
* Synchronously force CC and GC in this process, as well as in the
* parent process.
*/
forceCCAndGC() {
var event = new CustomEvent("TalosPowersContentForceCCAndGC", {
bubbles: true,
});
document.dispatchEvent(event);
},
};
})();

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

@ -4,7 +4,7 @@
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>talos-powers@mozilla.org</em:id>
<em:version>1.0.5</em:version>
<em:version>1.0.6</em:version>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>

Двоичный файл не отображается.