Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3 from autonome/newer-versions-support

support fx>=5
  • Loading branch information...
commit 937100933b27909ab458b78146e70bbd8d0edb1b 2 parents 9febaaf + 3fe58d0
Patrick Walton authored
Showing with 11 additions and 4 deletions.
  1. +2 −2 data/widget.js
  2. +9 −2 lib/main.js
4 data/widget.js
View
@@ -58,8 +58,8 @@ on('message', function(data) {
}
let sample = {
- alloc: data['heap-used'],
- js: data['explicit/js/gc-heap'],
+ alloc: data['heap-used'] || data['malloc/allocated'] || data['resident'],
+ js: data['explicit/js/gc-heap'] || data['js/gc-heap'] || data['js-gc-heap'],
gc: gcOccurred
};
samples.push(sample);
11 lib/main.js
View
@@ -10,7 +10,14 @@ const tabs = require('tabs');
const data = require('self').data;
const { Cc, Ci, Cu } = require('chrome');
-const MEMORY_PATHS = { 'heap-used': true, 'explicit/js/gc-heap': true };
+const MEMORY_PATHS = {
+ // Fx4 ?
+ 'heap-used': true, 'explicit/js/gc-heap': true,
+ // Fx5
+ 'malloc/allocated': true, 'js/gc-heap': true,
+ // Fx>=5
+ 'resident': true, 'js-gc-heap': true
+};
Cu.import("resource://gre/modules/Services.jsm", this);
@@ -34,7 +41,7 @@ let widgetUpdater = {
while (iter.hasMoreElements()) {
let reporter = iter.getNext().QueryInterface(Ci.nsIMemoryReporter);
if (MEMORY_PATHS[reporter.path])
- data[reporter.path] = reporter.memoryUsed;
+ data[reporter.path] = reporter.memoryUsed || reporter.amount;
}
w.postMessage(data);
Please sign in to comment.
Something went wrong with that request. Please try again.