Bug 1376531 - Fix some issues when enabling async places transactions - updating bookmarks names and pasting bookmarks. r?mak draft
authorMark Banner <standard8@mozilla.com>
Tue, 27 Jun 2017 12:54:16 -0700
changeset 600716 064b2c44c2f42a219ca1a372b10e8282787ccc6d
parent 600616 f4e52135d9bdc6ce98bb37b450021445aed894ce
child 635081 58fc4d0577977143104dde1671058660785a8ea3
push id65857
push userbmo:standard8@mozilla.com
push dateTue, 27 Jun 2017 19:54:27 +0000
reviewersmak
bugs1376531
milestone56.0a1
Bug 1376531 - Fix some issues when enabling async places transactions - updating bookmarks names and pasting bookmarks. r?mak MozReview-Commit-ID: 4sqbSMtMkDD
browser/components/places/PlacesUIUtils.jsm
browser/components/places/content/controller.js
browser/components/places/content/editBookmarkOverlay.js
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -598,17 +598,17 @@ this.PlacesUIUtils = {
 
     if (aData.type == PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR) {
       return PlacesTransactions.NewSeparator({ parentGuid: aNewParentGuid,
                                                index: aIndex });
     }
 
     let title = aData.type != PlacesUtils.TYPE_UNICODE ? aData.title
                                                        : aData.uri;
-    return PlacesTransactions.NewBookmark({ uri: NetUtil.newURI(aData.uri),
+    return PlacesTransactions.NewBookmark({ url: Services.io.newURI(aData.uri),
                                             title,
                                             parentGuid: aNewParentGuid,
                                             index: aIndex });
   },
 
   /**
    * Shows the bookmark dialog corresponding to the specified info.
    *
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -1263,18 +1263,18 @@ PlacesController.prototype = {
     } catch (ex) {
       // No supported data exists or nodes unwrap failed, just bail out.
       return;
     }
 
     let itemsToSelect = [];
     if (PlacesUIUtils.useAsyncTransactions) {
       if (ip.isTag) {
-        let uris = items.filter(item => "uri" in item).map(item => NetUtil.newURI(item.uri));
-        await PlacesTransactions.Tag({ uris, tag: ip.tagName }).transact();
+        let urls = items.filter(item => "uri" in item).map(item => Services.io.newURI(item.uri));
+        await PlacesTransactions.Tag({ urls, tag: ip.tagName }).transact();
       } else {
         await PlacesTransactions.batch(async function() {
           let insertionIndex = ip.index;
           let parent = await ip.promiseGuid();
 
           for (let item of items) {
             let doCopy = action == "copy";
 
--- a/browser/components/places/content/editBookmarkOverlay.js
+++ b/browser/components/places/content/editBookmarkOverlay.js
@@ -614,17 +614,17 @@ var gEditItemOverlay = {
     } else {
       this._mayUpdateFirstEditField("namePicker");
       if (!PlacesUIUtils.useAsyncTransactions) {
         let txn = new PlacesEditItemTitleTransaction(this._paneInfo.itemId,
                                                      newTitle);
         PlacesUtils.transactionManager.doTransaction(txn);
         return;
       }
-      (async function() {
+      (async () => {
         let guid = this._paneInfo.isTag
                     ? (await PlacesUtils.promiseItemGuid(this._paneInfo.itemId))
                     : this._paneInfo.itemGuid;
         PlacesTransactions.EditTitle({ guid, title: newTitle })
                           .transact().catch(Components.utils.reportError);
       })().catch(Components.utils.reportError);
     }
   },