Bug 1290599 - Choose either close or onClosed as transport closing event r?jryans draft
authorJarda Snajdr <jsnajdr@gmail.com>
Tue, 09 Aug 2016 10:49:18 +0200
changeset 398537 f77ff532e208e775df54d38b596ff58761acf578
parent 398536 d5a2407a9535f246dd2dc321555c9c1037088e45
child 527691 4f1c49b6d059db75538282cd85e2c4e1d129cd0d
push id25563
push userbmo:jsnajdr@gmail.com
push dateTue, 09 Aug 2016 09:41:28 +0000
reviewersjryans
bugs1290599
milestone51.0a1
Bug 1290599 - Choose either close or onClosed as transport closing event r?jryans Although "close" would be an event name more consistent with usual event naming (like in DOM APIs), I'm choosing "onClosed" here, because it's more in-line with what debugger transports use (onPacket, onBulkPacket), it's a minimal change (only LocalDebuggerTransport is affected) and no update to RDP inspector is needed. MozReview-Commit-ID: B0YnBOOBSNI
devtools/shared/transport/transport.js
--- a/devtools/shared/transport/transport.js
+++ b/devtools/shared/transport/transport.js
@@ -649,17 +649,17 @@
 
       return sendDeferred.promise;
     },
 
     /**
      * Close the transport.
      */
     close: function () {
-      this.emit("close");
+      this.emit("onClosed");
 
       if (this.other) {
         // Remove the reference to the other endpoint before calling close(), to
         // avoid infinite recursion.
         let other = this.other;
         this.other = null;
         other.close();
       }