Bug 1551779 part 5. Stop using [array] for getTagsForURI. r=mak
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 16 May 2019 14:03:54 +0000
changeset 474095 5db31f792bf4ee2c800edfc88d69e7d825ab3e44
parent 474094 87a537f8e5a89204a95ec7395e9024688e16dfae
child 474096 fb8cc6cad30a0f94d5858cc35b20ce77acc605d2
push id36022
push userncsoregi@mozilla.com
push dateThu, 16 May 2019 21:55:16 +0000
treeherdermozilla-central@96802be91766 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1551779
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551779 part 5. Stop using [array] for getTagsForURI. r=mak Differential Revision: https://phabricator.services.mozilla.com/D31242
services/sync/tps/extensions/tps/resource/modules/bookmarks.jsm
toolkit/components/places/PlacesSyncUtils.jsm
toolkit/components/places/TaggingService.jsm
toolkit/components/places/nsITaggingService.idl
--- a/services/sync/tps/extensions/tps/resource/modules/bookmarks.jsm
+++ b/services/sync/tps/extensions/tps/resource/modules/bookmarks.jsm
@@ -506,17 +506,17 @@ Bookmark.prototype = {
           this.props.keyword + ", actual: " + keyword +
           " for " + this.toString());
         return null;
       }
     }
     if (this.props.tags != null) {
       try {
         let URI = Services.io.newURI(this.props.uri);
-        let tags = PlacesUtils.tagging.getTagsForURI(URI, {});
+        let tags = PlacesUtils.tagging.getTagsForURI(URI);
         tags.sort();
         this.props.tags.sort();
         if (JSON.stringify(tags) != JSON.stringify(this.props.tags)) {
           Logger.logPotentialError("Wrong tags - expected: " +
             JSON.stringify(this.props.tags) + ", actual: " +
             JSON.stringify(tags) + " for " + this.toString());
           return null;
         }
--- a/toolkit/components/places/PlacesSyncUtils.jsm
+++ b/toolkit/components/places/PlacesSyncUtils.jsm
@@ -1914,17 +1914,17 @@ function syncBookmarkToPlacesBookmark(in
 var fetchBookmarkItem = async function(db, bookmarkItem) {
   let item = await placesBookmarkToSyncBookmark(db, bookmarkItem);
 
   if (!item.title) {
     item.title = "";
   }
 
   item.tags = PlacesUtils.tagging.getTagsForURI(
-    PlacesUtils.toURI(bookmarkItem.url), {});
+    PlacesUtils.toURI(bookmarkItem.url));
 
   let keywordEntry = await PlacesUtils.keywords.fetch({
     url: bookmarkItem.url,
   });
   if (keywordEntry) {
     item.keyword = keywordEntry.keyword;
   }
 
--- a/toolkit/components/places/TaggingService.jsm
+++ b/toolkit/components/places/TaggingService.jsm
@@ -228,17 +228,17 @@ TaggingService.prototype = {
           // There is a tagged item.
           PlacesUtils.bookmarks.removeItem(itemId, aSource);
         }
       }
     }
   },
 
   // nsITaggingService
-  getTagsForURI: function TS_getTagsForURI(aURI, aCount) {
+  getTagsForURI: function TS_getTagsForURI(aURI) {
     if (!aURI) {
       throw Components.Exception("Invalid uri", Cr.NS_ERROR_INVALID_ARG);
     }
 
     let tags = [];
     let db = PlacesUtils.history.DBConnection;
     let stmt = db.createStatement(
       `SELECT t.id AS folderId
@@ -259,19 +259,16 @@ TaggingService.prototype = {
     } finally {
       stmt.finalize();
     }
 
     // sort the tag list
     tags.sort(function(a, b) {
         return a.toLowerCase().localeCompare(b.toLowerCase());
       });
-    if (aCount) {
-      aCount.value = tags.length;
-    }
     return tags;
   },
 
   __tagFolders: null,
   get _tagFolders() {
     if (!this.__tagFolders) {
       this.__tagFolders = [];
 
--- a/toolkit/components/places/nsITaggingService.idl
+++ b/toolkit/components/places/nsITaggingService.idl
@@ -50,19 +50,17 @@ interface nsITaggingService : nsISupport
 
   /**
    * Retrieves all tags set for the given URL.
    *
    * @param aURI
    *        a URL.
    * @returns array of tags (sorted by name).
    */
-  void getTagsForURI(in nsIURI aURI,
-                     [optional] out unsigned long length,
-                     [retval, array, size_is(length)] out wstring aTags);
+  Array<AString> getTagsForURI(in nsIURI aURI);
 
 };
 
 %{C++
 
 #define TAGGING_SERVICE_CID "@mozilla.org/browser/tagging-service;1"
 
 %}