Bug 1376531 - Fix some issues when enabling async places transactions - updating bookmarks names and pasting bookmarks. r=mak
authorMark Banner <standard8@mozilla.com>
Tue, 27 Jun 2017 12:54:16 -0700
changeset 366205 9bfbe7afcf6fe1b9fdb622fefdeb7e3234e60afa
parent 366204 60d67235b352575a4d32516c415e6c03a89315ce
child 366206 6fe1a6cf55a6eae5add2b4c521e4280eba5343be
push id32098
push usercbook@mozilla.com
push dateWed, 28 Jun 2017 11:20:51 +0000
treeherdermozilla-central@6190181ff409 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1376531
milestone56.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 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);
     }
   },