Bug 1132713 - Only enable memory actor when both gecko 38+ and memory actor exists, for addon debugger. r=vp
authorJordan Santell <jsantell@gmail.com>
Fri, 13 Feb 2015 11:58:38 -0800
changeset 242745 82abcbb019d7a7961cc7b35616c62467551546f6
parent 242744 8a4280e988954694c3e37fd7ace6cf967e562014
child 242746 2439c229cacea574a5b398c8c766df447732b90b
push id682
push userjryans@gmail.com
push dateFri, 13 Feb 2015 21:27:38 +0000
reviewersvp
bugs1132713
milestone38.0a1
Bug 1132713 - Only enable memory actor when both gecko 38+ and memory actor exists, for addon debugger. r=vp From b208befbd8912652bdd892a1b2bb8d7b4ff4a895 Mon Sep 17 00:00:00 2001
browser/devtools/performance/modules/compatibility.js
--- a/browser/devtools/performance/modules/compatibility.js
+++ b/browser/devtools/performance/modules/compatibility.js
@@ -76,17 +76,21 @@ function createMockAllocations () {
  */
 function memoryActorSupported (target) {
   // This `target` property is used only in tests to test
   // instances where the memory actor is not available.
   if (target.TEST_MOCK_MEMORY_ACTOR) {
     return false;
   }
 
-  return !!target.getTrait("memoryActorAllocations");
+  // We need to test that both the root actor has `memoryActorAllocations`,
+  // which is in Gecko 38+, and also that the target has a memory actor. There
+  // are scenarios, like addon debugging, where memoryActorAllocations is available,
+  // but no memory actor (like addon debugging in Gecko 38+)
+  return !!target.getTrait("memoryActorAllocations") && target.hasActor("memory");
 }
 exports.memoryActorSupported = Task.async(memoryActorSupported);
 
 /**
  * Takes a TabTarget, and checks existence of a TimelineActor on
  * the server, or if TEST_MOCK_TIMELINE_ACTOR is to be used.
  *
  * @param {TabTarget} target