Bug 1440441 - comm-central part: Remove use of nsIDOMFormData. r=adrian17
authorJorg K <jorgk@jorgk.com>
Sun, 25 Feb 2018 23:57:42 +0100
changeset 59351 185a8711571f0cff1de6ab0861ccb75ff5374707
parent 59350 1ba58e1ca623934b65194f01d371d2c3935c5375
child 59352 c7fe8ceb6756fbf210ebb9a62c142660bfc11173
push id5942
push userrichard.marti@gmail.com
push dateTue, 27 Feb 2018 07:03:20 +0000
treeherdertry-comm-central@d58d9c002526 [default view] [failures only]
reviewersadrian17
bugs1440441
Bug 1440441 - comm-central part: Remove use of nsIDOMFormData. r=adrian17
mail/components/cloudfile/nsBox.js
--- a/mail/components/cloudfile/nsBox.js
+++ b/mail/components/cloudfile/nsBox.js
@@ -10,17 +10,17 @@
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 ChromeUtils.import("resource:///modules/cloudFileAccounts.js");
 ChromeUtils.import("resource:///modules/OAuth2.jsm");
 ChromeUtils.import("resource://gre/modules/Http.jsm");
 
-Cu.importGlobalProperties(["File", "XMLHttpRequest"]);
+Cu.importGlobalProperties(["File", "FormData", "XMLHttpRequest"]);
 
 var gServerUrl = "https://api.box.com/2.0/";
 var gUploadUrl = "https://upload.box.com/api/2.0/";
 
 var kAuthBaseUrl = "https://www.box.com/api/";
 var kAuthUrl = "oauth2/authorize";
 
 XPCOMUtils.defineLazyServiceGetter(this, "gProtocolService",
@@ -772,18 +772,17 @@ nsBoxFileUploader.prototype = {
         this.callback(this.requestObserver,
                       Ci.nsIMsgCloudFileProvider.uploadErr);
     }.bind(this);
 
     req.setRequestHeader("Authorization", "Bearer " + this.box._oauth.accessToken);
 
     // Encode the form.
     File.createFromNsIFile(this.file).then(file => {
-      let form = Cc["@mozilla.org/files/formdata;1"]
-                   .createInstance(Ci.nsIDOMFormData);
+      let form = new FormData();
       form.append("filename", file, this.file.leafName);
       form.append("parent_id", this.box._cachedFolderId);
 
       req.send(form);
     });
   },
 
   /**