Bug 1394101 - Part 2 Add missing generator function declare in Data Manager. r=IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sat, 23 Sep 2017 12:55:33 +0200
changeset 31430 b8b1280b35a3831b86f9ec14e5fb449c1e1e49b3
parent 31429 1f21d91b6b924a0326a34aee81fa67d0bd45278a
child 31431 5d4cbfdbc82944a96809505b226a25c57be3d8d5
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs1394101
Bug 1394101 - Part 2 Add missing generator function declare in Data Manager. r=IanN a=IanN
suite/common/dataman/dataman.js
--- a/suite/common/dataman/dataman.js
+++ b/suite/common/dataman/dataman.js
@@ -266,17 +266,17 @@ var gDomains = {
       this.tree.view.selection.select(0);
 
     let loaderInstance;
 
     function nextStep() {
       loaderInstance.next();
     }
 
-    function loader() {
+    function* loader() {
       // Add domains for all cookies we find.
       gDataman.debugMsg("Add cookies to domain list: " + Date.now()/1000);
       gDomains.ignoreUpdate = true;
       gCookies.loadList();
       for (let cookie of gCookies.cookies)
         gDomains.addDomainOrFlag(cookie.rawHost, "hasCookies");
       gDomains.ignoreUpdate = false;
       gDomains.search(gDomains.searchfield.value);
@@ -345,16 +345,17 @@ var gDomains = {
           Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
       yield setTimeout(nextStep, 0);
 
       gDataman.debugMsg("Domain list built: " + Date.now()/1000);
       gDomains.listLoadCompleted = true;
       gDomains.loadView();
       yield undefined;
     }
+
     loaderInstance = loader();
     setTimeout(nextStep, 0);
   },
 
   shutdown: function domain_shutdown() {
     gDataman.timer.cancel();
     gTabs.shutdown();
     this.tree.view = null;
@@ -362,17 +363,18 @@ var gDomains = {
 
   loadView: function domain_loadView() {
     // Load the view set in the dataman object.
     gDataman.debugMsg("Load View: " + gDataman.viewToLoad.join(", "));
     let loaderInstance;
     function nextStep() {
       loaderInstance.next();
     }
-    function loader() {
+
+    function* loader() {
       if (gDataman.viewToLoad.length) {
         if (gDataman.viewToLoad[0] == "" && gDataman.viewToLoad.length > 1) {
           let sType = gDataman.viewToLoad[1].substr(0,1).toUpperCase() +
                       gDataman.viewToLoad[1].substr(1);
           gDataman.debugMsg("Select a specific data type: " + sType);
           gDomains.selectfield.value = sType;
           gDomains.selectType(sType);
           yield setTimeout(nextStep, 0);
@@ -455,16 +457,17 @@ var gDomains = {
         }
       }
       yield setTimeout(nextStep, 0);
 
       // Send a notification that we have finished.
       Services.obs.notifyObservers(window, "dataman-loaded", null);
       yield undefined;
     }
+
     loaderInstance = loader();
     setTimeout(nextStep, 0);
   },
 
   _getObjID: function domain__getObjID(aIdx) {
     return gDomains.displayedDomains[aIdx].title;
   },