forked from jsantell/firefox-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1029738-callwatcheractor-true-destroy.patch
52 lines (46 loc) · 1.78 KB
/
1029738-callwatcheractor-true-destroy.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 7e02d5a207716cf46e4d03b67f7442b463fee15e Mon Sep 17 00:00:00 2001
From: Jordan Santell <[email protected]>
Date: Tue, 24 Jun 2014 14:00:15 -0700
Subject: Bug 1029738 - Halt firing instrumented function calls after destruction in CallWatcherActor. r=vp
diff --git a/toolkit/devtools/server/actors/call-watcher.js b/toolkit/devtools/server/actors/call-watcher.js
index ffbac19..98999c7 100644
--- a/toolkit/devtools/server/actors/call-watcher.js
+++ b/toolkit/devtools/server/actors/call-watcher.js
@@ -313,16 +313,17 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
* to hibernation. This method is called automatically just before the
* actor is destroyed.
*/
finalize: method(function() {
if (!this._initialized) {
return;
}
this._initialized = false;
+ this._finalized = true;
this._contentObserver.stopListening();
off(this._contentObserver, "global-created", this._onGlobalCreated);
off(this._contentObserver, "global-destroyed", this._onGlobalDestroyed);
this._tracedGlobals = null;
this._tracedFunctions = null;
this._contentObserver = null;
@@ -529,16 +530,21 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
this.eraseRecording();
}
},
/**
* Invoked whenever an instrumented function is called.
*/
_onContentFunctionCall: function(...details) {
+ // If the consuming tool has finalized call-watcher, ignore the
+ // still-instrumented calls.
+ if (this._finalized) {
+ return;
+ }
let functionCall = new FunctionCallActor(this.conn, details, this._holdWeak);
this._functionCalls.push(functionCall);
this.onCall(functionCall);
}
});
/**
* The corresponding Front object for the CallWatcherActor.
--
1.8.4.2