Bug 1600606 - Remove length parameters from nsITransferable instances. r=mkmelin draft
authorKhushil Mistry <khushil324@gmail.com>
Thu, 05 Dec 2019 00:33:57 +0530
changeset 82242 0683b9227f1d098773bdf9ba10c3c57ccaca868a
parent 82239 9a2171cc93933aa39ee042e7379548c8eacbd9e2
child 82243 fdb0c4f8d81cbebe3f7110e643fc613ee9a0cb56
push id9939
push userkhushil324@gmail.com
push dateWed, 04 Dec 2019 19:04:52 +0000
treeherdertry-comm-central@fdb0c4f8d81c [default view] [failures only]
reviewersmkmelin
bugs1600606
Bug 1600606 - Remove length parameters from nsITransferable instances. r=mkmelin
calendar/base/content/calendar-clipboard.js
calendar/base/content/calendar-dnd-listener.js
mail/base/content/mailCore.js
mail/base/content/msgMail3PaneWindow.js
mail/base/content/nsDragAndDrop.js
mail/components/about-support/content/aboutSupport.js
mail/components/about-support/content/export.js
mail/components/compose/content/addressingWidgetOverlay.js
mail/extensions/openpgp/content/modules/clipboard.jsm
mail/test/browser/composition/browser_blockedContent.js
mail/test/browser/content-policy/browser_generalContentPolicy.js
mail/test/browser/content-tabs/browser_aboutSupport.js
mail/test/mozmill/composition/test-blocked-content.js
mail/test/mozmill/content-policy/test-general-content-policy.js
mail/test/mozmill/content-tabs/test-about-support.js
mailnews/addrbook/content/abDragDrop.js
mailnews/addrbook/content/abMailListDialog.js
--- a/calendar/base/content/calendar-clipboard.js
+++ b/calendar/base/content/calendar-clipboard.js
@@ -110,18 +110,18 @@ function copyToClipboard(aCalendarItemAr
 
     // Create the data objects
     let icsWrapper = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
     icsWrapper.data = icsString;
 
     // Add data objects to transferable
     // Both Outlook 2000 client and Lotus Organizer use text/unicode
     // when pasting iCalendar data.
-    trans.setTransferData("text/calendar", icsWrapper, icsWrapper.data.length * 2); // double byte data
-    trans.setTransferData("text/unicode", icsWrapper, icsWrapper.data.length * 2);
+    trans.setTransferData("text/calendar", icsWrapper); // double byte data
+    trans.setTransferData("text/unicode", icsWrapper);
 
     clipboard.setData(trans, null, Ci.nsIClipboard.kGlobalClipboard);
     if (aCutMode) {
       // check for MODIFICATION_PARENT
       let useParent = response == 3;
       calendarViewController.deleteOccurrences(targetItems, useParent, true);
     }
   }
@@ -149,17 +149,17 @@ function pasteFromClipboard() {
   trans.addDataFlavor("text/unicode");
 
   // Get transferable from clipboard
   clipboard.getData(trans, Ci.nsIClipboard.kGlobalClipboard);
 
   // Ask transferable for the best flavor.
   let flavor = {};
   let data = {};
-  trans.getAnyTransferData(flavor, data, {});
+  trans.getAnyTransferData(flavor, data);
   data = data.value.QueryInterface(Ci.nsISupportsString).data;
   switch (flavor.value) {
     case "text/calendar":
     case "text/unicode": {
       let icsParser = Cc["@mozilla.org/calendar/ics-parser;1"].createInstance(Ci.calIIcsParser);
       try {
         icsParser.parseString(data);
       } catch (e) {
--- a/calendar/base/content/calendar-dnd-listener.js
+++ b/calendar/base/content/calendar-dnd-listener.js
@@ -215,18 +215,17 @@ calDNDBaseObserver.prototype = {
     transferable.addDataFlavor("text/x-moz-message");
     transferable.addDataFlavor("text/unicode");
     transferable.addDataFlavor("application/x-moz-file");
 
     aDragSession.getData(transferable, 0);
 
     let data = {};
     let bestFlavor = {};
-    let length = {};
-    transferable.getAnyTransferData(bestFlavor, data, length);
+    transferable.getAnyTransferData(bestFlavor, data);
 
     try {
       data = data.value.QueryInterface(Ci.nsISupportsString);
     } catch (exc) {
       // we currently only supports strings:
       return;
     }
 
@@ -544,47 +543,46 @@ function invokeEventDragSession(aItem, a
   let transfer = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable);
   transfer.init(null);
   transfer.addDataFlavor("text/calendar");
 
   let flavourProvider = {
     QueryInterface: ChromeUtils.generateQI([Ci.nsIFlavorDataProvider]),
 
     item: aItem,
-    getFlavorData: function(aInTransferable, aInFlavor, aOutData, aOutDataLen) {
+    getFlavorData: function(aInTransferable, aInFlavor, aOutData) {
       if (
         aInFlavor == "application/vnd.x-moz-cal-event" ||
         aInFlavor == "application/vnd.x-moz-cal-task"
       ) {
         aOutData.value = aItem;
-        aOutDataLen.value = 1;
       } else {
         cal.ASSERT(false, "error:" + aInFlavor);
       }
     },
   };
 
   if (cal.item.isEvent(aItem)) {
     transfer.addDataFlavor("application/vnd.x-moz-cal-event");
-    transfer.setTransferData("application/vnd.x-moz-cal-event", flavourProvider, 0);
+    transfer.setTransferData("application/vnd.x-moz-cal-event", flavourProvider);
   } else if (cal.item.isToDo(aItem)) {
     transfer.addDataFlavor("application/vnd.x-moz-cal-task");
-    transfer.setTransferData("application/vnd.x-moz-cal-task", flavourProvider, 0);
+    transfer.setTransferData("application/vnd.x-moz-cal-task", flavourProvider);
   }
 
   // Also set some normal data-types, in case we drag into another app
   let serializer = Cc["@mozilla.org/calendar/ics-serializer;1"].createInstance(
     Ci.calIIcsSerializer
   );
   serializer.addItems([aItem]);
 
   let supportsString = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
   supportsString.data = serializer.serializeToString();
-  transfer.setTransferData("text/calendar", supportsString, supportsString.data.length * 2);
-  transfer.setTransferData("text/unicode", supportsString, supportsString.data.length * 2);
+  transfer.setTransferData("text/calendar", supportsString);
+  transfer.setTransferData("text/unicode", supportsString);
 
   let action = Ci.nsIDragService.DRAGDROP_ACTION_MOVE;
   let mutArray = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
   mutArray.appendElement(transfer);
   aXULBox.sourceObject = aItem;
   try {
     cal.getDragService().invokeDragSession(aXULBox, null, null, mutArray, action);
   } catch (e) {
--- a/mail/base/content/mailCore.js
+++ b/mail/base/content/mailCore.js
@@ -903,37 +903,34 @@ function CreateAttachmentTransferData(aA
   return data;
 }
 
 function nsFlavorDataProvider() {}
 
 nsFlavorDataProvider.prototype = {
   QueryInterface: ChromeUtils.generateQI(["nsIFlavorDataProvider"]),
 
-  getFlavorData(aTransferable, aFlavor, aData, aDataLen) {
+  getFlavorData(aTransferable, aFlavor, aData) {
     // get the url for the attachment
     if (aFlavor == "application/x-moz-file-promise") {
       var urlPrimitive = {};
-      var dataSize = {};
       aTransferable.getTransferData(
         "application/x-moz-file-promise-url",
-        urlPrimitive,
-        dataSize
+        urlPrimitive
       );
 
       var srcUrlPrimitive = urlPrimitive.value.QueryInterface(
         Ci.nsISupportsString
       );
 
       // now get the destination file location from kFilePromiseDirectoryMime
       var dirPrimitive = {};
       aTransferable.getTransferData(
         "application/x-moz-file-promise-dir",
-        dirPrimitive,
-        dataSize
+        dirPrimitive
       );
       var destDirectory = dirPrimitive.value.QueryInterface(Ci.nsIFile);
 
       // now save the attachment to the specified location
       // XXX: we need more information than just the attachment url to save it,
       // fortunately, we have an array of all the current attachments so we can
       // cheat and scan through them
 
@@ -951,17 +948,16 @@ nsFlavorDataProvider.prototype = {
         var destFilePath = messenger.saveAttachmentToFolder(
           attachment.contentType,
           attachment.url,
           encodeURIComponent(name),
           attachment.uri,
           destDirectory
         );
         aData.value = destFilePath.QueryInterface(Ci.nsISupports);
-        aDataLen.value = 4;
       }
     }
   },
 };
 
 function UpdateCharsetMenu(aCharset, aNode) {
   var bundle = document.getElementById("charsetBundle");
   CharsetMenu.update(aNode, bundle.getString(aCharset.toLowerCase()));
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -1528,51 +1528,44 @@ function ThreadPaneOnDragStart(aEvent) {
   aEvent.dataTransfer.addElement(aEvent.originalTarget);
 }
 
 function messageFlavorDataProvider() {}
 
 messageFlavorDataProvider.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIFlavorDataProvider]),
 
-  getFlavorData(aTransferable, aFlavor, aData, aDataLen) {
+  getFlavorData(aTransferable, aFlavor, aData) {
     if (aFlavor !== "application/x-moz-file-promise") {
       return;
     }
     let fileUriPrimitive = {};
-    let dataSize = {};
     aTransferable.getTransferData(
       "application/x-moz-file-promise-url",
-      fileUriPrimitive,
-      dataSize
+      fileUriPrimitive
     );
 
     let fileUriStr = fileUriPrimitive.value.QueryInterface(
       Ci.nsISupportsString
     );
     let fileUri = Services.io.newURI(fileUriStr.data);
     let fileUrl = fileUri.QueryInterface(Ci.nsIURL);
     let fileName = fileUrl.fileName;
 
     let destDirPrimitive = {};
     aTransferable.getTransferData(
       "application/x-moz-file-promise-dir",
-      destDirPrimitive,
-      dataSize
+      destDirPrimitive
     );
     let destDirectory = destDirPrimitive.value.QueryInterface(Ci.nsIFile);
     let file = destDirectory.clone();
     file.append(fileName);
 
     let messageUriPrimitive = {};
-    aTransferable.getTransferData(
-      "text/x-moz-message",
-      messageUriPrimitive,
-      dataSize
-    );
+    aTransferable.getTransferData("text/x-moz-message", messageUriPrimitive);
     let messageUri = messageUriPrimitive.value.QueryInterface(
       Ci.nsISupportsString
     );
 
     messenger.saveAs(
       messageUri.data,
       true,
       null,
--- a/mail/base/content/nsDragAndDrop.js
+++ b/mail/base/content/nsDragAndDrop.js
@@ -33,30 +33,27 @@ var nsTransferable = {
    **/
   set(aTransferDataSet) {
     var trans = this.createTransferable();
     for (var i = 0; i < aTransferDataSet.dataList.length; ++i) {
       var currData = aTransferDataSet.dataList[i];
       var currFlavour = currData.flavour.contentType;
       trans.addDataFlavor(currFlavour);
       var supports = null; // nsISupports data
-      var length = 0;
       if (currData.flavour.dataIIDKey == "nsISupportsString") {
         supports = Cc["@mozilla.org/supports-string;1"].createInstance(
           Ci.nsISupportsString
         );
 
         supports.data = currData.supports;
-        length = supports.data.length;
       } else {
         // non-string data.
         supports = currData.supports;
-        length = 0; // kFlavorHasDataProvider
       }
-      trans.setTransferData(currFlavour, supports, length * 2);
+      trans.setTransferData(currFlavour, supports);
     }
     return trans;
   },
 
   /**
    * TransferData/TransferDataSet get (FlavourSet aFlavourSet,
    *                                   Function aRetrievalFunc, Boolean aAnyFlag) ;
    *
@@ -86,36 +83,35 @@ var nsTransferable = {
     // items may have been dragged) this could be >1.
     for (let i = 0; i < array.length; i++) {
       let trans = array.queryElementAt(i, Ci.nsITransferable);
       if (!trans) {
         continue;
       }
 
       var data = {};
-      var length = {};
 
       if (aAnyFlag) {
         var flavour = {};
-        trans.getAnyTransferData(flavour, data, length);
+        trans.getAnyTransferData(flavour, data);
         if (data && flavour) {
           var selectedFlavour = aFlavourSet.flavourTable[flavour.value];
           if (selectedFlavour) {
             dataArray[i] = FlavourToXfer(
               data.value,
-              length.value,
+              data.length,
               selectedFlavour
             );
           }
         }
       } else {
         var firstFlavour = aFlavourSet.flavours[0];
-        trans.getTransferData(firstFlavour, data, length);
+        trans.getTransferData(firstFlavour, data);
         if (data && firstFlavour) {
-          dataArray[i] = FlavourToXfer(data.value, length.value, firstFlavour);
+          dataArray[i] = FlavourToXfer(data.value, data.length, firstFlavour);
         }
       }
     }
     return new TransferDataSet(dataArray);
   },
 
   /**
    * nsITransferable createTransferable (void) ;
--- a/mail/components/about-support/content/aboutSupport.js
+++ b/mail/components/about-support/content/aboutSupport.js
@@ -1208,17 +1208,17 @@ function copyRawDataToClipboard(button) 
         Ci.nsISupportsString
       );
       str.data = JSON.stringify(snapshot, undefined, 2);
       let transferable = Cc[
         "@mozilla.org/widget/transferable;1"
       ].createInstance(Ci.nsITransferable);
       transferable.init(getLoadContext());
       transferable.addDataFlavor("text/unicode");
-      transferable.setTransferData("text/unicode", str, str.data.length * 2);
+      transferable.setTransferData("text/unicode", str);
       Services.clipboard.setData(
         transferable,
         null,
         Ci.nsIClipboard.kGlobalClipboard
       );
       if (AppConstants.platform == "android") {
         // Present a snackbar notification.
         var { Snackbars } = ChromeUtils.import(
@@ -1258,22 +1258,22 @@ async function copyContentsToClipboard()
   let transferable = Cc["@mozilla.org/widget/transferable;1"].createInstance(
     Ci.nsITransferable
   );
   transferable.init(getLoadContext());
 
   // Add the HTML flavor.
   transferable.addDataFlavor("text/html");
   ssHtml.data = dataHtml;
-  transferable.setTransferData("text/html", ssHtml, dataHtml.length * 2);
+  transferable.setTransferData("text/html", ssHtml);
 
   // Add the plain text flavor.
   transferable.addDataFlavor("text/unicode");
   ssText.data = dataText;
-  transferable.setTransferData("text/unicode", ssText, dataText.length * 2);
+  transferable.setTransferData("text/unicode", ssText);
 
   // Store the data into the clipboard.
   Services.clipboard.setData(
     transferable,
     null,
     Services.clipboard.kGlobalClipboard
   );
 
--- a/mail/components/about-support/content/export.js
+++ b/mail/components/about-support/content/export.js
@@ -43,22 +43,22 @@ function getClipboardTransferable() {
   let transferable = Cc["@mozilla.org/widget/transferable;1"].createInstance(
     Ci.nsITransferable
   );
   transferable.init(getLoadContext());
 
   // Add the HTML flavor.
   transferable.addDataFlavor("text/html");
   ssHtml.data = dataHtml;
-  transferable.setTransferData("text/html", ssHtml, dataHtml.length * 2);
+  transferable.setTransferData("text/html", ssHtml);
 
   // Add the plain text flavor.
   transferable.addDataFlavor("text/unicode");
   ssText.data = dataText;
-  transferable.setTransferData("text/unicode", ssText, dataText.length * 2);
+  transferable.setTransferData("text/unicode", ssText);
 
   return transferable;
 }
 
 // This function intentionally has the same name as the one in aboutSupport.js
 // so that the one here is called.
 function copyContentsToClipboard() {
   let transferable = getClipboardTransferable();
--- a/mail/components/compose/content/addressingWidgetOverlay.js
+++ b/mail/components/compose/content/addressingWidgetOverlay.js
@@ -834,27 +834,26 @@ function DropOnAddressingWidget(event) {
   );
   trans.init(getLoadContext());
   trans.addDataFlavor("text/x-moz-address");
 
   for (var i = 0; i < dragSession.numDropItems; ++i) {
     dragSession.getData(trans, i);
     var dataObj = {};
     var bestFlavor = {};
-    var len = {};
-    trans.getAnyTransferData(bestFlavor, dataObj, len);
+    trans.getAnyTransferData(bestFlavor, dataObj);
     if (dataObj) {
       dataObj = dataObj.value.QueryInterface(Ci.nsISupportsString);
     }
     if (!dataObj) {
       continue;
     }
 
     // pull the address out of the data object
-    var address = dataObj.data.substring(0, len.value);
+    var address = dataObj.data.substring(0, dataObj.length);
     if (!address) {
       continue;
     }
 
     DropRecipient(event.target, address);
   }
 }
 
--- a/mail/extensions/openpgp/content/modules/clipboard.jsm
+++ b/mail/extensions/openpgp/content/modules/clipboard.jsm
@@ -60,18 +60,17 @@ var EnigmailClipboard = {
     let cBoardContent = "";
 
     if (clipBoardType !== clipBoard.kSelectionClipboard || clipBoard.supportsSelectionClipboard()) {
       try {
         let transferable = Transferable(window);
         transferable.addDataFlavor("text/unicode");
         clipBoard.getData(transferable, clipBoardType);
         let flavour = {};
-        let length = {};
-        transferable.getAnyTransferData(flavour, data, length);
+        transferable.getAnyTransferData(flavour, data);
         cBoardContent = data.value.QueryInterface(Ci.nsISupportsString).data;
       }
       catch (ex) {}
     }
     return cBoardContent;
   },
 
   /**
--- a/mail/test/browser/composition/browser_blockedContent.js
+++ b/mail/test/browser/composition/browser_blockedContent.js
@@ -53,17 +53,17 @@ function putHTMLOnClipboard(html) {
   // Register supported data flavors
   trans.init(null);
   trans.addDataFlavor("text/html");
 
   let wapper = Cc["@mozilla.org/supports-string;1"].createInstance(
     Ci.nsISupportsString
   );
   wapper.data = html;
-  trans.setTransferData("text/html", wapper, wapper.data.length * 2);
+  trans.setTransferData("text/html", wapper);
 
   Services.clipboard.setData(trans, null, Ci.nsIClipboard.kGlobalClipboard);
 }
 
 /**
  * Test that accessing file: URLs will block when appropriate, and load
  * the content when appropriate.
  */
--- a/mail/test/browser/content-policy/browser_generalContentPolicy.js
+++ b/mail/test/browser/content-policy/browser_generalContentPolicy.js
@@ -610,17 +610,17 @@ function putHTMLOnClipboard(html) {
   // Register supported data flavors
   trans.init(null);
   trans.addDataFlavor("text/html");
 
   let wapper = Cc["@mozilla.org/supports-string;1"].createInstance(
     Ci.nsISupportsString
   );
   wapper.data = html;
-  trans.setTransferData("text/html", wapper, wapper.data.length * 2);
+  trans.setTransferData("text/html", wapper);
 
   Services.clipboard.setData(trans, null, Ci.nsIClipboard.kGlobalClipboard);
 }
 
 function subtest_insertImageIntoReplyForward(aReplyType) {
   let msgDbHdr = addToFolder(
     "Test insert image into reply or forward",
     "Stand by for image insertion ;-)",
--- a/mail/test/browser/content-tabs/browser_aboutSupport.js
+++ b/mail/test/browser/content-tabs/browser_aboutSupport.js
@@ -330,17 +330,17 @@ function check_text_in_body(aDocument, a
 add_task(function test_copy_to_clipboard_public() {
   let tab = open_about_support();
   let privateElem = find_private_element(tab);
   // To avoid destroying the current contents of the clipboard, instead of
   // actually copying to it, we just retrieve what would have been copied to it
   let transferable = tab.browser.contentWindow.getClipboardTransferable();
   for (let flavor of ["text/html", "text/unicode"]) {
     let data = {};
-    transferable.getTransferData(flavor, data, {});
+    transferable.getTransferData(flavor, data);
     let text = data.value.QueryInterface(Ci.nsISupportsString).data;
     let contentBody;
     if (flavor == "text/html") {
       let parser = new DOMParser();
       contentBody = parser.parseFromString(text, "text/html").body;
     } else {
       contentBody = text;
     }
@@ -391,17 +391,17 @@ add_task(function test_copy_to_clipboard
   mc.click(content_tab_eid(tab, "check-show-private-data"));
   wait_for_content_tab_element_display(tab, privateElem);
 
   // To avoid destroying the current contents of the clipboard, instead of
   // actually copying to it, we just retrieve what would have been copied to it
   let transferable = tab.browser.contentWindow.getClipboardTransferable();
   for (let flavor of ["text/html", "text/unicode"]) {
     let data = {};
-    transferable.getTransferData(flavor, data, {});
+    transferable.getTransferData(flavor, data);
     let text = data.value.QueryInterface(Ci.nsISupportsString).data;
     let contentBody;
     if (flavor == "text/html") {
       let parser = new DOMParser();
       contentBody = parser.parseFromString(text, "text/html").body;
     } else {
       contentBody = text;
     }
--- a/mail/test/mozmill/composition/test-blocked-content.js
+++ b/mail/test/mozmill/composition/test-blocked-content.js
@@ -55,17 +55,17 @@ function putHTMLOnClipboard(html) {
   // Register supported data flavors
   trans.init(null);
   trans.addDataFlavor("text/html");
 
   let wapper = Cc["@mozilla.org/supports-string;1"].createInstance(
     Ci.nsISupportsString
   );
   wapper.data = html;
-  trans.setTransferData("text/html", wapper, wapper.data.length * 2);
+  trans.setTransferData("text/html", wapper);
 
   Services.clipboard.setData(trans, null, Ci.nsIClipboard.kGlobalClipboard);
 }
 
 /**
  * Test that accessing file: URLs will block when appropriate, and load
  * the content when appropriate.
  */
--- a/mail/test/mozmill/content-policy/test-general-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-general-content-policy.js
@@ -609,17 +609,17 @@ function putHTMLOnClipboard(html) {
   // Register supported data flavors
   trans.init(null);
   trans.addDataFlavor("text/html");
 
   let wapper = Cc["@mozilla.org/supports-string;1"].createInstance(
     Ci.nsISupportsString
   );
   wapper.data = html;
-  trans.setTransferData("text/html", wapper, wapper.data.length * 2);
+  trans.setTransferData("text/html", wapper);
 
   Services.clipboard.setData(trans, null, Ci.nsIClipboard.kGlobalClipboard);
 }
 
 function subtest_insertImageIntoReplyForward(aReplyType) {
   let msgDbHdr = addToFolder(
     "Test insert image into reply or forward",
     "Stand by for image insertion ;-)",
--- a/mail/test/mozmill/content-tabs/test-about-support.js
+++ b/mail/test/mozmill/content-tabs/test-about-support.js
@@ -333,17 +333,17 @@ function check_text_in_body(aDocument, a
 function test_copy_to_clipboard_public() {
   let tab = open_about_support();
   let privateElem = find_private_element(tab);
   // To avoid destroying the current contents of the clipboard, instead of
   // actually copying to it, we just retrieve what would have been copied to it
   let transferable = tab.browser.contentWindow.getClipboardTransferable();
   for (let flavor of ["text/html", "text/unicode"]) {
     let data = {};
-    transferable.getTransferData(flavor, data, {});
+    transferable.getTransferData(flavor, data);
     let text = data.value.QueryInterface(Ci.nsISupportsString).data;
     let contentBody;
     if (flavor == "text/html") {
       let parser = new DOMParser();
       contentBody = parser.parseFromString(text, "text/html").body;
     } else {
       contentBody = text;
     }
@@ -381,17 +381,17 @@ function test_copy_to_clipboard_private(
   mc.click(content_tab_eid(tab, "check-show-private-data"));
   wait_for_content_tab_element_display(tab, privateElem);
 
   // To avoid destroying the current contents of the clipboard, instead of
   // actually copying to it, we just retrieve what would have been copied to it
   let transferable = tab.browser.contentWindow.getClipboardTransferable();
   for (let flavor of ["text/html", "text/unicode"]) {
     let data = {};
-    transferable.getTransferData(flavor, data, {});
+    transferable.getTransferData(flavor, data);
     let text = data.value.QueryInterface(Ci.nsISupportsString).data;
     let contentBody;
     if (flavor == "text/html") {
       let parser = new DOMParser();
       contentBody = parser.parseFromString(text, "text/html").body;
     } else {
       contentBody = text;
     }
--- a/mailnews/addrbook/content/abDragDrop.js
+++ b/mailnews/addrbook/content/abDragDrop.js
@@ -18,31 +18,29 @@ var { MailServices } = ChromeUtils.impor
 // Returns the load context for the current window
 function getLoadContext() {
   return window.docShell.QueryInterface(Ci.nsILoadContext);
 }
 
 var abFlavorDataProvider = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIFlavorDataProvider]),
 
-  getFlavorData(aTransferable, aFlavor, aData, aDataLen) {
+  getFlavorData(aTransferable, aFlavor, aData) {
     if (aFlavor == "application/x-moz-file-promise") {
       var primitive = {};
-      aTransferable.getTransferData("text/vcard", primitive, {});
+      aTransferable.getTransferData("text/vcard", primitive);
       var vCard = primitive.value.QueryInterface(Ci.nsISupportsString).data;
       aTransferable.getTransferData(
         "application/x-moz-file-promise-dest-filename",
-        primitive,
-        {}
+        primitive
       );
       var leafName = primitive.value.QueryInterface(Ci.nsISupportsString).data;
       aTransferable.getTransferData(
         "application/x-moz-file-promise-dir",
-        primitive,
-        {}
+        primitive
       );
       var localFile = primitive.value.QueryInterface(Ci.nsIFile).clone();
       localFile.append(leafName);
 
       var ofStream = Cc[
         "@mozilla.org/network/file-output-stream;1"
       ].createInstance(Ci.nsIFileOutputStream);
       ofStream.init(localFile, -1, -1, 0);
@@ -405,19 +403,18 @@ function DragAddressOverTargetControl(ev
   trans.addDataFlavor("text/x-moz-address");
 
   var canDrop = true;
 
   for (var i = 0; i < dragSession.numDropItems; ++i) {
     dragSession.getData(trans, i);
     var dataObj = {};
     var bestFlavor = {};
-    var len = {};
     try {
-      trans.getAnyTransferData(bestFlavor, dataObj, len);
+      trans.getAnyTransferData(bestFlavor, dataObj);
     } catch (ex) {
       canDrop = false;
       break;
     }
   }
   dragSession.canDrop = canDrop;
 }
 
@@ -428,33 +425,32 @@ function DropAddressOverTargetControl(ev
     Ci.nsITransferable
   );
   trans.addDataFlavor("text/x-moz-address");
 
   for (var i = 0; i < dragSession.numDropItems; ++i) {
     dragSession.getData(trans, i);
     var dataObj = {};
     var bestFlavor = {};
-    var len = {};
 
     // Ensure we catch any empty data that may have slipped through
     try {
-      trans.getAnyTransferData(bestFlavor, dataObj, len);
+      trans.getAnyTransferData(bestFlavor, dataObj);
     } catch (ex) {
       continue;
     }
 
     if (dataObj) {
       dataObj = dataObj.value.QueryInterface(Ci.nsISupportsString);
     }
     if (!dataObj) {
       continue;
     }
 
     // pull the address out of the data object
-    var address = dataObj.data.substring(0, len.value);
+    var address = dataObj.data.substring(0, dataObj.length);
     if (!address) {
       continue;
     }
 
     DropRecipient(address);
   }
 }
--- a/mailnews/addrbook/content/abMailListDialog.js
+++ b/mailnews/addrbook/content/abMailListDialog.js
@@ -488,27 +488,26 @@ function DropOnAddressListTree(event) {
   } catch (ex) {
     return;
   }
 
   for (let i = 0; i < dragSession.numDropItems; ++i) {
     dragSession.getData(trans, i);
     let dataObj = {};
     let bestFlavor = {};
-    let len = {};
-    trans.getAnyTransferData(bestFlavor, dataObj, len);
+    trans.getAnyTransferData(bestFlavor, dataObj);
     if (dataObj) {
       dataObj = dataObj.value.QueryInterface(Ci.nsISupportsString);
     }
     if (!dataObj) {
       continue;
     }
 
     // pull the URL out of the data object
-    let address = dataObj.data.substring(0, len.value);
+    let address = dataObj.data.substring(0, dataObj.length);
     if (!address) {
       continue;
     }
 
     DropListAddress(event.target, address);
   }
 }