зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1203786 - test_memoryReporters.xul should ignore namespaces. r=njn
--HG-- extra : transplant_source : 8%B4%E0f%1A%B1%94%0Ce%15%FCopt%127g%ACK%FB
This commit is contained in:
Родитель
73389bf1f4
Коммит
21ea7df326
|
@ -39,6 +39,11 @@
|
||||||
const COUNT_CUMULATIVE = Ci.nsIMemoryReporter.UNITS_COUNT_CUMULATIVE;
|
const COUNT_CUMULATIVE = Ci.nsIMemoryReporter.UNITS_COUNT_CUMULATIVE;
|
||||||
const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE;
|
const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE;
|
||||||
|
|
||||||
|
// Use backslashes instead of forward slashes due to memory reporting's hacky
|
||||||
|
// handling of URLs.
|
||||||
|
const XUL_NS =
|
||||||
|
"http:\\\\www.mozilla.org\\keymaster\\gatekeeper\\there.is.only.xul";
|
||||||
|
|
||||||
let vsizeAmounts = [];
|
let vsizeAmounts = [];
|
||||||
let residentAmounts = [];
|
let residentAmounts = [];
|
||||||
let heapAllocatedAmounts = [];
|
let heapAllocatedAmounts = [];
|
||||||
|
@ -119,13 +124,16 @@
|
||||||
function handleReportAnonymized(aProcess, aPath, aKind, aUnits, aAmount,
|
function handleReportAnonymized(aProcess, aPath, aKind, aUnits, aAmount,
|
||||||
aDescription)
|
aDescription)
|
||||||
{
|
{
|
||||||
|
// Path might include an xmlns using http, which is safe to ignore.
|
||||||
|
let reducedPath = aPath.replace(XUL_NS, "");
|
||||||
|
|
||||||
// Shouldn't get http: or https: in any paths.
|
// Shouldn't get http: or https: in any paths.
|
||||||
if (aPath.includes('http:')) {
|
if (reducedPath.includes('http:')) {
|
||||||
present.httpWhenAnonymized = aPath;
|
present.httpWhenAnonymized = aPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// file: URLs should have their path anonymized.
|
// file: URLs should have their path anonymized.
|
||||||
if (aPath.search('file:..[^<]') !== -1) {
|
if (reducedPath.search('file:..[^<]') !== -1) {
|
||||||
present.unanonymizedFilePathWhenAnonymized = aPath;
|
present.unanonymizedFilePathWhenAnonymized = aPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -391,4 +399,3 @@
|
||||||
]]>
|
]]>
|
||||||
</script>
|
</script>
|
||||||
</window>
|
</window>
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче