Bug 1604953 - Remove xpidl [array] use in nsIActivity. r=mkmelin
authorBen Campbell <benc@thunderbird.net>
Thu, 19 Dec 2019 16:02:33 +1300
changeset 37788 89fbfe35a1f5d2d1aba9b5768752209f8ddc87aa
parent 37787 d96b359f3c446b0a4c27b05d05581fb69d9f5331
child 37789 164933b1df705b2545d414840282b2506bf78918
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
reviewersmkmelin
bugs1604953
Bug 1604953 - Remove xpidl [array] use in nsIActivity. r=mkmelin
mail/components/activity/Activity.jsm
mail/components/activity/modules/autosync.jsm
mail/components/activity/modules/glodaIndexer.jsm
mail/components/activity/nsIActivity.idl
--- a/mail/components/activity/Activity.jsm
+++ b/mail/components/activity/Activity.jsm
@@ -42,21 +42,18 @@ Activity.prototype = {
       }
     }
   },
 
   addSubject(aSubject) {
     this._subjects.push(aSubject);
   },
 
-  getSubjects(aCount) {
-    let list = this._subjects.slice();
-
-    aCount.value = list.length;
-    return list;
+  getSubjects() {
+    return this._subjects.slice();
   },
 };
 
 function ActivityProcess() {
   Activity.call(this);
   this.bindingName = "activity-process-richlistitem";
   this.groupingStyle = Ci.nsIActivity.GROUPING_STYLE_BYCONTEXT;
 }
--- a/mail/components/activity/modules/autosync.jsm
+++ b/mail/components/activity/modules/autosync.jsm
@@ -137,17 +137,17 @@ var autosyncModule = {
         "autosyncContextDisplayText",
         [folder.server.prettyName]
       );
       event.contextObj = process.contextObj;
       event.iconClass = "syncMail";
 
       // transfer all subjects.
       // same as above, not mandatory
-      let subjects = process.getSubjects({});
+      let subjects = process.getSubjects();
       for (let subject of subjects) {
         event.addSubject(subject);
       }
 
       return event;
     } catch (e) {
       this.log.error("createSyncMailEvent: " + e);
       throw e;
--- a/mail/components/activity/modules/glodaIndexer.jsm
+++ b/mail/components/activity/modules/glodaIndexer.jsm
@@ -223,17 +223,17 @@ var glodaIndexerActivity = {
         this.currentJob.startTime,
         endTime
       );
       event.contextType = this.currentJob.contextType;
       event.contextObj = this.currentJob.contextObj;
       event.iconClass = "indexMail";
 
       // Transfer subjects.
-      let subjects = this.currentJob.process.getSubjects({});
+      let subjects = this.currentJob.process.getSubjects();
       for (let subject of subjects) {
         event.addSubject(subject);
       }
 
       this.activityMgr.addActivity(event);
     }
 
     this.currentJob = null;
--- a/mail/components/activity/nsIActivity.idl
+++ b/mail/components/activity/nsIActivity.idl
@@ -176,18 +176,17 @@ interface nsIActivity : nsISupports {
    */
   void addSubject(in nsIVariant aSubject);
 
   /**
    * Retrieves all subjects associated with this activity.
    *
    * @return The list of subject objects associated by the activity.
    */
-  void getSubjects(out unsigned long length, [retval, array,
-                   size_is(length)] out nsIVariant aSubjects);
+  Array<nsIVariant> getSubjects();
 
   /*
    * Background:
    *  A context is a generic concept that is used to group the processes and
    *  warnings having similar properties such as same imap server, same smtp
    *  server etc.
    *  A context is uniquely identified by its "type" and "object" attributes.
    *  Each activity that has the same context type and object are considered