Bug 1429083 - Lazily load uuid-generator in proxy module. r=whimboo

The uuid-generator is not always used when the proxy module is imported.
This changes it to be lazily loaded so we do not always initialise it.

MozReview-Commit-ID: In0oAGDFjWy

--HG--
extra : rebase_source : d4d6c594cd1ac0872a1f34a30f3e7452a7759300
This commit is contained in:
Andreas Tolfsen 2018-01-09 15:37:57 +00:00
Родитель cc531c6af0
Коммит 591e869879
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -4,10 +4,11 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
const {utils: Cu} = Components;
Cu.import("resource://gre/modules/Log.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
const {
error,
@ -18,8 +19,8 @@ Cu.import("chrome://marionette/content/modal.js");
this.EXPORTED_SYMBOLS = ["proxy"];
const uuidgen = Cc["@mozilla.org/uuid-generator;1"]
.getService(Ci.nsIUUIDGenerator);
XPCOMUtils.defineLazyServiceGetter(
this, "uuidgen", "@mozilla.org/uuid-generator;1", "nsIUUIDGenerator");
const logger = Log.repository.getLogger("Marionette");