Bug 1394101 - Part 2 Add missing generator function declare in Data Manager. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sat, 23 Sep 2017 12:25:28 +0200
changeset 29034 264f1743605c0f94e0a25811d1ce2cef9bf1f1b8
parent 29033 56a768de610ba6e4d2660c575fa811a79b051f68
child 29035 d2b98c955e08bcd938971ab2950ebef8307df156
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1394101
Bug 1394101 - Part 2 Add missing generator function declare in Data Manager. r=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;
   },