Bug 1376531 - Fix some issues when enabling async places transactions - updating bookmarks names and pasting bookmarks. r?mak
MozReview-Commit-ID: 4sqbSMtMkDD
--- 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);
}
},