Bug 1149896 - Avoid warnings when using sendAsyncMessage on a ReadingListItem object. r=adw, a=sledru
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 08 Apr 2015 11:15:23 +1000
changeset 265491 6b53fb4054722e0ef2b51750f76f78de4a2be526
parent 265490 f30e59dc03c365cd0285efabdb73792ecf87c532
child 265492 4a8383fdd860443d6f2e39dc593fadd9ab2563f7
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, sledru
bugs1149896
milestone39.0a2
Bug 1149896 - Avoid warnings when using sendAsyncMessage on a ReadingListItem object. r=adw, a=sledru
browser/components/readinglist/ReadingList.jsm
--- a/browser/components/readinglist/ReadingList.jsm
+++ b/browser/components/readinglist/ReadingList.jsm
@@ -341,17 +341,17 @@ ReadingListImpl.prototype = {
 
     log.debug("Adding item with guid: ${guid}, url: ${url}", record);
     yield this._store.addItem(record);
     log.trace("Added item with guid: ${guid}, url: ${url}", record);
     this._invalidateIterators();
     let item = this._itemFromRecord(record);
     this._callListeners("onItemAdded", item);
     let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
-    mm.broadcastAsyncMessage("Reader:Added", item);
+    mm.broadcastAsyncMessage("Reader:Added", item.toJSON());
     return item;
   }),
 
   /**
    * Updates the properties of an item that belongs to the list.
    *
    * The passed-in item may have as few or as many properties that you want to
    * set; only the properties that are present are updated.  The item must have
@@ -422,17 +422,17 @@ ReadingListImpl.prototype = {
     item.list = null;
     item._deleted = true;
     // failing to remove the item from the map points at something bad!
     if (!this._itemsByNormalizedURL.delete(item.url)) {
       log.error("Failed to remove item from the map", item);
     }
     this._invalidateIterators();
     let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
-    mm.broadcastAsyncMessage("Reader:Removed", item);
+    mm.broadcastAsyncMessage("Reader:Removed", item.toJSON());
     this._callListeners("onItemDeleted", item);
   }),
 
   /**
    * Finds the first item that matches the given options.
    *
    * @param optsList See Options Objects.
    * @return The first matching item, or null if there are no matching items.