Bug 1394580 - 7. Follow-up to unpack fields in function signature; r=me
authorJim Chen <nchen@mozilla.com>
Wed, 06 Sep 2017 14:26:18 -0400
changeset 379369 ef59984ad7b0
parent 379368 3067ce95b439
child 379370 5c18cf6c6ebd
push id32453
push userarchaeopteryx@coole-files.de
push date2017-09-07 10:39 +0000
treeherdermozilla-central@37b95547f0d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1394580
milestone57.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 1394580 - 7. Follow-up to unpack fields in function signature; r=me Unpack fields from the parameter object in the function signature itself. r=me for trivial patch. MozReview-Commit-ID: BeMPOlLgNcQ
mobile/android/components/geckoview/GeckoViewStartup.js
--- a/mobile/android/components/geckoview/GeckoViewStartup.js
+++ b/mobile/android/components/geckoview/GeckoViewStartup.js
@@ -12,60 +12,59 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 function GeckoViewStartup() {
 }
 
 GeckoViewStartup.prototype = {
   classID: Components.ID("{8e993c34-fdd6-432c-967e-f995d888777f}"),
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
-  addLazyGetter: function(aOptions) {
-    let {name, script, service, module, observers, ppmm, mm} = aOptions;
+  addLazyGetter: function({name, script, service, module,
+                           observers, ppmm, mm, init, once}) {
     if (script) {
       XPCOMUtils.defineLazyScriptGetter(this, name, script);
     } else if (module) {
       XPCOMUtils.defineLazyGetter(this, name, _ => {
         let sandbox = {};
         Cu.import(module, sandbox);
-        if (aOptions.init) {
-          aOptions.init.call(this, sandbox[name]);
+        if (init) {
+          init.call(this, sandbox[name]);
         }
         return sandbox[name];
       });
     } else if (service) {
       XPCOMUtils.defineLazyGetter(this, name, _ =>
         Cc[service].getService(Ci.nsISupports).wrappedJSObject);
     }
 
     if (observers) {
       let observer = (subject, topic, data) => {
         Services.obs.removeObserver(observer, topic);
-        if (!aOptions.once) {
+        if (!once) {
           Services.obs.addObserver(this[name], topic);
         }
         this[name].observe(subject, topic, data); // Explicitly notify new observer
       };
       observers.forEach(topic => Services.obs.addObserver(observer, topic));
     }
 
     if (ppmm || mm) {
       let target = ppmm ? Services.ppmm : Services.mm;
       let listener = msg => {
         target.removeMessageListener(msg.name, listener);
-        if (!aOptions.once) {
+        if (!once) {
           target.addMessageListener(msg.name, this[name]);
         }
         this[name].receiveMessage(msg);
       };
       (ppmm || mm).forEach(msg => target.addMessageListener(msg, listener));
     }
   },
 
-  addLazyEventListener: function(aOptions) {
-    let {name, target, events, options} = aOptions;
+  addLazyEventListener: function({name, target, events, options}) {
     let listener = event => {
       if (!options || !options.once) {
         target.removeEventListener(event.type, listener, options);
         target.addEventListener(event.type, this[name], options);
       }
       this[name].handleEvent(event);
     };
     events.forEach(event => target.addEventListener(event, listener, options));