Bug 1347452 - Assigned item.guid using PlacesUtils.history.makeGuid() in insertBookmark(). r?mak draft
authorsellsellgo <sellsellgo@gmail.com>
Thu, 17 Aug 2017 09:50:25 +0200
changeset 648589 37bdaf258b893eda41c2b572176c6381814ba245
parent 648046 932388b8c22c9775264e543697ce918415db9e23
child 726866 180d81d593533d9062ba9f96be66b5d567e43064
push id74803
push userbmo:sellsellgo@gmail.com
push dateFri, 18 Aug 2017 00:28:54 +0000
reviewersmak
bugs1347452
milestone57.0a1
Bug 1347452 - Assigned item.guid using PlacesUtils.history.makeGuid() in insertBookmark(). r?mak MozReview-Commit-ID: LgVFlgNEzHf
toolkit/components/places/Bookmarks.jsm
--- a/toolkit/components/places/Bookmarks.jsm
+++ b/toolkit/components/places/Bookmarks.jsm
@@ -1323,17 +1323,17 @@ function updateBookmark(info, item, newP
 function insertBookmark(item, parent) {
   return PlacesUtils.withConnectionWrapper("Bookmarks.jsm: insertBookmark",
     async function(db) {
 
     // If a guid was not provided, generate one, so we won't need to fetch the
     // bookmark just after having created it.
     let hasExistingGuid = item.hasOwnProperty("guid");
     if (!hasExistingGuid)
-      item.guid = (await db.executeCached("SELECT GENERATE_GUID() AS guid"))[0].getResultByName("guid");
+      item.guid = PlacesUtils.history.makeGuid();
 
     let isTagging = parent._parentId == PlacesUtils.tagsFolderId;
 
     await db.executeTransaction(async function transaction() {
       if (item.type == Bookmarks.TYPE_BOOKMARK) {
         // Ensure a page exists in moz_places for this URL.
         // The IGNORE conflict can trigger on `guid`.
         await maybeInsertPlace(db, item.url);