Bug 1032121 - Remove content handler leftover code in ActivitiesService.jsm. r=fabrice, a=sledru
authorFabrice Desré <fabrice@mozilla.com>
Mon, 30 Jun 2014 16:37:11 -0700
changeset 229189 f365749d72c9887111077fd1fb09b9953b69fff7
parent 229188 c6f9f039615333de397220f867dbc5f0cb39f6af
child 229190 d0bb536942e27651a83d43cf2b251d39107815fe
push id6
push userryanvm@gmail.com
push dateMon, 12 Jan 2015 22:04:06 +0000
treeherdermozilla-b2g37_v2_2@895c8fc7b734 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice, sledru
bugs1032121
milestone32.0a2
Bug 1032121 - Remove content handler leftover code in ActivitiesService.jsm. r=fabrice, a=sledru
dom/activities/src/ActivitiesService.jsm
--- a/dom/activities/src/ActivitiesService.jsm
+++ b/dom/activities/src/ActivitiesService.jsm
@@ -377,64 +377,34 @@ let Activities = {
         this.trySendAndCleanup(msg.id, "Activity:FireError", msg);
         break;
 
       case "Activities:Register":
         let self = this;
         this.db.add(msg,
           function onSuccess(aEvent) {
             mm.sendAsyncMessage("Activities:Register:OK", null);
-            let res = [];
-            msg.forEach(function(aActivity) {
-              self.updateContentTypeList(aActivity, res);
-            });
           },
           function onError(aEvent) {
             msg.error = "REGISTER_ERROR";
             mm.sendAsyncMessage("Activities:Register:KO", msg);
           });
         break;
       case "Activities:Unregister":
         this.db.remove(msg);
-        let res = [];
-        msg.forEach(function(aActivity) {
-          this.updateContentTypeList(aActivity, res);
-        }, this);
         break;
       case "child-process-shutdown":
         for (let id in this.callers) {
           if (this.callers[id].childMM == mm) {
             this.trySendAndCleanup(id, "Activity:FireError", {
               "id": id,
               "error": "ActivityCanceled"
             });
             break;
           }
         }
         break;
     }
-  },
-
-  updateContentTypeList: function updateContentTypeList(aActivity, aResult) {
-    // Bail out if this is not a "view" activity.
-    if (aActivity.name != "view") {
-      return;
-    }
+  }
 
-    let types = aActivity.description.filters.type;
-    if (typeof types == "string") {
-      types = [types];
-    }
-
-    // Check that this is a real content type and sanitize it.
-    types.forEach(function(aContentType) {
-      let hadCharset = { };
-      let charset = { };
-      let contentType =
-        NetUtil.parseContentType(aContentType, charset, hadCharset);
-      if (contentType) {
-        aResult.push(contentType);
-      }
-    });
-  }
 }
 
 Activities.init();