bug 1523104: remote: self-assign id to connection; r=ochameau
authorAndreas Tolfsen <ato@sny.no>
Thu, 07 Mar 2019 22:14:59 +0000
changeset 521133 c750fecfdf21
parent 521132 1f861b702507
child 521134 e94205832ec1
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1523104
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1523104: remote: self-assign id to connection; r=ochameau
remote/Connection.jsm
--- a/remote/Connection.jsm
+++ b/remote/Connection.jsm
@@ -5,20 +5,21 @@
 "use strict";
 
 var EXPORTED_SYMBOLS = ["Connection"];
 
 const {Log} = ChromeUtils.import("chrome://remote/content/Log.jsm");
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "log", Log.get);
+XPCOMUtils.defineLazyServiceGetter(this, "UUIDGen", "@mozilla.org/uuid-generator;1", "nsIUUIDGenerator");
 
 class Connection {
-  constructor(connID, transport) {
-    this.id = connID;
+  constructor(transport) {
+    this.id = UUIDGen.generateUUID().toString();
     this.transport = transport;
 
     this.transport.hooks = this;
     this.onmessage = () => {};
   }
 
   send(message) {
     log.trace(`<-(connection ${this.id}) ${JSON.stringify(message)}`);