Backout 194d8f675d2d & 251a18603db4 (bug 811615) for xpcshell and mochitest failures
authorEd Morley <emorley@mozilla.com>
Tue, 11 Dec 2012 13:09:38 +0000
changeset 121216 88fd42043056864232a7e1d67ee3f6757de7076d
parent 121215 2ea2ccfd704eefa79d76be459580b9ca96132039
child 121217 e594a31444eedc02a217bd7f6a63b1b849016584
push idunknown
push userunknown
push dateunknown
bugs811615
milestone20.0a1
backs out194d8f675d2de1dce80eebb6cafaa60916eff429
Backout 194d8f675d2d & 251a18603db4 (bug 811615) for xpcshell and mochitest failures
content/base/public/nsDOMFile.h
content/base/src/nsDOMBlobBuilder.cpp
content/base/src/nsDOMBlobBuilder.h
content/base/src/nsDOMFile.cpp
dom/base/ObjectWrapper.jsm
dom/base/nsDOMClassInfo.cpp
dom/webidl/File.webidl
dom/webidl/WebIDL.mk
dom/workers/File.cpp
js/xpconnect/loader/Makefile.in
js/xpconnect/loader/mozJSComponentLoader.cpp
--- a/content/base/public/nsDOMFile.h
+++ b/content/base/public/nsDOMFile.h
@@ -195,17 +195,18 @@ public:
   : nsDOMFileBase(aContentType, aStart, aLength)
   { }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMFileCC, nsIDOMFile)
 };
 
-class nsDOMFileFile : public nsDOMFile
+class nsDOMFileFile : public nsDOMFile,
+                      public nsIJSNativeInitializer
 {
 public:
   // Create as a file
   nsDOMFileFile(nsIFile *aFile)
     : nsDOMFile(EmptyString(), EmptyString(), UINT64_MAX, UINT64_MAX),
       mFile(aFile), mWholeFile(true), mStoredFile(false)
   {
     NS_ASSERTION(mFile, "must have file");
@@ -283,24 +284,37 @@ public:
     : nsDOMFile(EmptyString(), EmptyString(), UINT64_MAX, UINT64_MAX),
       mWholeFile(true), mStoredFile(false)
   {
     // Lazily get the content type and size
     mContentType.SetIsVoid(true);
     mName.SetIsVoid(true);
   }
 
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // nsIJSNativeInitializer
+  NS_IMETHOD Initialize(nsISupports* aOwner,
+                        JSContext* aCx,
+                        JSObject* aObj,
+                        uint32_t aArgc,
+                        jsval* aArgv);
+
   // Overrides
   NS_IMETHOD GetSize(uint64_t* aSize);
   NS_IMETHOD GetType(nsAString& aType);
   NS_IMETHOD GetLastModifiedDate(JSContext* cx, JS::Value* aLastModifiedDate);
   NS_IMETHOD GetMozLastModifiedDate(uint64_t* aLastModifiedDate);
   NS_IMETHOD GetMozFullPathInternal(nsAString& aFullPath);
   NS_IMETHOD GetInternalStream(nsIInputStream**);
 
+  // DOMClassInfo constructor (for File("foo"))
+  static nsresult
+  NewFile(nsISupports* *aNewObject);
+
 protected:
   // Create slice
   nsDOMFileFile(const nsDOMFileFile* aOther, uint64_t aStart, uint64_t aLength,
                 const nsAString& aContentType)
     : nsDOMFile(aContentType, aOther->mStart + aStart, aLength),
       mFile(aOther->mFile), mWholeFile(false),
       mStoredFile(aOther->mStoredFile)
   {
--- a/content/base/src/nsDOMBlobBuilder.cpp
+++ b/content/base/src/nsDOMBlobBuilder.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDOMBlobBuilder.h"
 #include "jsfriendapi.h"
 #include "mozilla/dom/BlobBinding.h"
-#include "mozilla/dom/FileBinding.h"
 #include "nsAutoPtr.h"
 #include "nsDOMClassInfoID.h"
 #include "nsIMultiplexInputStream.h"
 #include "nsStringStream.h"
 #include "nsTArray.h"
 #include "nsJSUtils.h"
 #include "nsContentUtils.h"
 #include "nsIScriptError.h"
@@ -167,27 +166,24 @@ GetXPConnectNative(JSContext* aCx, JSObj
 
 NS_IMETHODIMP
 nsDOMMultipartFile::Initialize(nsISupports* aOwner,
                                JSContext* aCx,
                                JSObject* aObj,
                                uint32_t aArgc,
                                jsval* aArgv)
 {
-  if (!mIsFile) {
-    return InitBlob(aCx, aArgc, aArgv, GetXPConnectNative);
-  }
-  return InitFile(aCx, aArgc, aArgv);
+  return InitInternal(aCx, aArgc, aArgv, GetXPConnectNative);
 }
 
 nsresult
-nsDOMMultipartFile::InitBlob(JSContext* aCx,
-                             uint32_t aArgc,
-                             jsval* aArgv,
-                             UnwrapFuncPtr aUnwrapFunc)
+nsDOMMultipartFile::InitInternal(JSContext* aCx,
+                                 uint32_t aArgc,
+                                 jsval* aArgv,
+                                 UnwrapFuncPtr aUnwrapFunc)
 {
   bool nativeEOL = false;
   if (aArgc > 1) {
     if (NS_IsMainThread()) {
       BlobPropertyBag d;
       if (!d.Init(aCx, nullptr, aArgv[1])) {
         return NS_ERROR_TYPE_ERR;
       }
@@ -260,106 +256,16 @@ nsDOMMultipartFile::InitBlob(JSContext* 
 
     mBlobs = blobSet.GetBlobs();
   }
 
   return NS_OK;
 }
 
 nsresult
-nsDOMMultipartFile::InitFile(JSContext* aCx,
-                             uint32_t aArgc,
-                             jsval* aArgv)
-{
-  nsresult rv;
-
-  NS_ASSERTION(!mImmutable, "Something went wrong ...");
-  NS_ENSURE_TRUE(!mImmutable, NS_ERROR_UNEXPECTED);
-
-  if (!nsContentUtils::IsCallerChrome()) {
-    return NS_ERROR_DOM_SECURITY_ERR; // Real short trip
-  }
-
-  NS_ENSURE_TRUE(aArgc > 0, NS_ERROR_UNEXPECTED);
-
-  bool nativeEOL = false;
-  if (aArgc > 1) {
-    FilePropertyBag d;
-    if (!d.Init(aCx, nullptr, aArgv[1])) {
-      return NS_ERROR_TYPE_ERR;
-    }
-    mName = d.name;
-    mContentType = d.type;
-    nativeEOL = d.endings == EndingTypesValues::Native;
-  }
-
-  // We expect to get a path to represent as a File object,
-  // an nsIFile, or an nsIDOMFile.
-  nsCOMPtr<nsIFile> file;
-  nsCOMPtr<nsIDOMFile> domFile;
-  if (!aArgv[0].isString()) {
-    // Lets see if it's an nsIFile
-    if (!aArgv[0].isObject()) {
-      return NS_ERROR_UNEXPECTED; // We're not interested
-    }
-
-    JSObject* obj = &aArgv[0].toObject();
-
-    nsISupports* supports =
-      nsContentUtils::XPConnect()->GetNativeOfWrapper(aCx, obj);
-    if (!supports) {
-      return NS_ERROR_UNEXPECTED;
-    }
-
-    domFile = do_QueryInterface(supports);
-    file = do_QueryInterface(supports);
-    if (!domFile && !file) {
-      return NS_ERROR_UNEXPECTED;
-    }
-  } else {
-    // It's a string
-    JSString* str = JS_ValueToString(aCx, aArgv[0]);
-    NS_ENSURE_TRUE(str, NS_ERROR_XPC_BAD_CONVERT_JS);
-
-    nsDependentJSString xpcomStr;
-    if (!xpcomStr.init(aCx, str)) {
-      return NS_ERROR_XPC_BAD_CONVERT_JS;
-    }
-
-    rv = NS_NewLocalFile(xpcomStr, false, getter_AddRefs(file));
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  if (file) {
-    bool exists;
-    rv = file->Exists(&exists);
-    NS_ENSURE_SUCCESS(rv, rv);
-    NS_ENSURE_TRUE(exists, NS_ERROR_FILE_NOT_FOUND);
-
-    bool isDir;
-    rv = file->IsDirectory(&isDir);
-    NS_ENSURE_SUCCESS(rv, rv);
-    NS_ENSURE_FALSE(isDir, NS_ERROR_FILE_IS_DIRECTORY);
-
-    domFile = new nsDOMFileFile(file);
-  }
-  
-  // XXXkhuey this is terrible
-  if (mContentType.IsEmpty()) {
-    domFile->GetType(mContentType);
-  }
-
-  BlobSet blobSet;
-  blobSet.AppendBlob(domFile);
-  mBlobs = blobSet.GetBlobs();
-
-  return NS_OK;
-}
-
-nsresult
 BlobSet::AppendVoidPtr(const void* aData, uint32_t aLength)
 {
   NS_ENSURE_ARG_POINTER(aData);
 
   uint64_t offset = mDataLen;
 
   if (!ExpandBufferSize(aLength))
     return NS_ERROR_OUT_OF_MEMORY;
--- a/content/base/src/nsDOMBlobBuilder.h
+++ b/content/base/src/nsDOMBlobBuilder.h
@@ -49,47 +49,34 @@ public:
   // nsIJSNativeInitializer
   NS_IMETHOD Initialize(nsISupports* aOwner,
                         JSContext* aCx,
                         JSObject* aObj,
                         uint32_t aArgc,
                         jsval* aArgv);
 
   typedef nsIDOMBlob* (*UnwrapFuncPtr)(JSContext*, JSObject*);
-  nsresult InitBlob(JSContext* aCx,
-                    uint32_t aArgc,
-                    jsval* aArgv,
-                    UnwrapFuncPtr aUnwrapFunc);
-  nsresult InitFile(JSContext* aCx,
-                    uint32_t aArgc,
-                    jsval* aArgv);
+  nsresult InitInternal(JSContext* aCx,
+                        uint32_t aArgc,
+                        jsval* aArgv,
+                        UnwrapFuncPtr aUnwrapFunc);
 
   already_AddRefed<nsIDOMBlob>
   CreateSlice(uint64_t aStart, uint64_t aLength, const nsAString& aContentType);
 
   NS_IMETHOD GetSize(uint64_t*);
   NS_IMETHOD GetInternalStream(nsIInputStream**);
 
   static nsresult
   NewFile(const nsAString& aName, nsISupports* *aNewObject);
 
   // DOMClassInfo constructor (for Blob([b1, "foo"], { type: "image/png" }))
   static nsresult
   NewBlob(nsISupports* *aNewObject);
 
-  // DOMClassInfo constructor (for File([b1, "foo"], { type: "image/png",
-  //                                                   name: "foo.png" }))
-  inline static nsresult
-  NewFile(nsISupports* *aNewObject)
-  {
-    // Initialization will set the filename, so we can pass in an empty string
-    // for now.
-    return NewFile(EmptyString(), aNewObject);
-  }
-
   virtual const nsTArray<nsCOMPtr<nsIDOMBlob> >*
   GetSubBlobs() const { return &mBlobs; }
 
 protected:
   nsTArray<nsCOMPtr<nsIDOMBlob> > mBlobs;
 };
 
 class BlobSet {
--- a/content/base/src/nsDOMFile.cpp
+++ b/content/base/src/nsDOMFile.cpp
@@ -463,24 +463,35 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMFileCC)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMFileCC)
 
 ////////////////////////////////////////////////////////////////////////////
 // nsDOMFileFile implementation
 
+NS_IMPL_ISUPPORTS_INHERITED1(nsDOMFileFile, nsDOMFile,
+                             nsIJSNativeInitializer)
+
 already_AddRefed<nsIDOMBlob>
 nsDOMFileFile::CreateSlice(uint64_t aStart, uint64_t aLength,
                            const nsAString& aContentType)
 {
   nsCOMPtr<nsIDOMBlob> t = new nsDOMFileFile(this, aStart, aLength, aContentType);
   return t.forget();
 }
 
+/* static */ nsresult
+nsDOMFileFile::NewFile(nsISupports* *aNewObject)
+{
+  nsCOMPtr<nsISupports> file = do_QueryObject(new nsDOMFileFile());
+  file.forget(aNewObject);
+  return NS_OK;
+}
+
 NS_IMETHODIMP
 nsDOMFileFile::GetMozFullPathInternal(nsAString &aFilename)
 {
   NS_ASSERTION(mIsFile, "Should only be called on files");
   return mFile->GetPath(aFilename);
 }
 
 NS_IMETHODIMP
@@ -575,16 +586,81 @@ NS_IMETHODIMP
 nsDOMFileFile::GetInternalStream(nsIInputStream **aStream)
 {
   return mWholeFile ?
     NS_NewLocalFileInputStream(aStream, mFile, -1, -1, sFileStreamFlags) :
     NS_NewPartialLocalFileInputStream(aStream, mFile, mStart, mLength,
                                       -1, -1, sFileStreamFlags);
 }
 
+NS_IMETHODIMP
+nsDOMFileFile::Initialize(nsISupports* aOwner,
+                          JSContext* aCx,
+                          JSObject* aObj,
+                          uint32_t aArgc,
+                          JS::Value* aArgv)
+{
+  nsresult rv;
+
+  NS_ASSERTION(!mImmutable, "Something went wrong ...");
+  NS_ENSURE_TRUE(!mImmutable, NS_ERROR_UNEXPECTED);
+
+  if (!nsContentUtils::IsCallerChrome()) {
+    return NS_ERROR_DOM_SECURITY_ERR; // Real short trip
+  }
+
+  NS_ENSURE_TRUE(aArgc > 0, NS_ERROR_UNEXPECTED);
+
+  // We expect to get a path to represent as a File object,
+  // or an nsIFile
+  nsCOMPtr<nsIFile> file;
+  if (!aArgv[0].isString()) {
+    // Lets see if it's an nsIFile
+    if (!aArgv[0].isObject()) {
+      return NS_ERROR_UNEXPECTED; // We're not interested
+    }
+
+    JSObject* obj = &aArgv[0].toObject();
+
+    // Is it an nsIFile
+    file = do_QueryInterface(
+      nsContentUtils::XPConnect()->
+        GetNativeOfWrapper(aCx, obj));
+    if (!file)
+      return NS_ERROR_UNEXPECTED;
+  } else {
+    // It's a string
+    JSString* str = JS_ValueToString(aCx, aArgv[0]);
+    NS_ENSURE_TRUE(str, NS_ERROR_XPC_BAD_CONVERT_JS);
+
+    nsDependentJSString xpcomStr;
+    if (!xpcomStr.init(aCx, str)) {
+      return NS_ERROR_XPC_BAD_CONVERT_JS;
+    }
+
+    rv = NS_NewLocalFile(xpcomStr, false, getter_AddRefs(file));
+    NS_ENSURE_SUCCESS(rv, rv);
+  }
+
+  bool exists;
+  rv = file->Exists(&exists);
+  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_TRUE(exists, NS_ERROR_FILE_NOT_FOUND);
+
+  bool isDir;
+  rv = file->IsDirectory(&isDir);
+  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_FALSE(isDir, NS_ERROR_FILE_IS_DIRECTORY);
+
+  mFile = file;
+  file->GetLeafName(mName);
+
+  return NS_OK;
+}
+
 ////////////////////////////////////////////////////////////////////////////
 // nsDOMMemoryFile implementation
 
 already_AddRefed<nsIDOMBlob>
 nsDOMMemoryFile::CreateSlice(uint64_t aStart, uint64_t aLength,
                              const nsAString& aContentType)
 {
   nsCOMPtr<nsIDOMBlob> t =
--- a/dom/base/ObjectWrapper.jsm
+++ b/dom/base/ObjectWrapper.jsm
@@ -8,63 +8,74 @@ const Cu = Components.utils;
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 this.EXPORTED_SYMBOLS = ["ObjectWrapper"];
 
 // Makes sure that we expose correctly chrome JS objects to content.
 
 this.ObjectWrapper = {
-  getObjectKind: function objWrapper_getObjectKind(aObject) {
+  getObjectKind: function objWrapper_getobjectkind(aObject) {
     if (!aObject) {
       return "null";
     }
 
     if (Array.isArray(aObject)) {
       return "array";
-    } else if (aObject instanceof Ci.nsIDOMFile) {
-      return "file";
-    } else if (aObject instanceof Ci.nsIDOMBlob) {
+    } else if (aObject.mozSlice && (typeof aObject.mozSlice == "function")) {
       return "blob";
     } else if (typeof aObject == "object") {
       return "object";
     } else {
       return "primitive";
     }
   },
 
   wrap: function objWrapper_wrap(aObject, aCtxt) {
+    if (!aObject) {
+      return null;
+    }
+
     // First check wich kind of object we have.
     let kind = this.getObjectKind(aObject);
-    if (kind == "null") {
-      return null;
-    } else if (kind == "array") {
+    if (kind == "array") {
       let res = Cu.createArrayIn(aCtxt);
       aObject.forEach(function(aObj) {
         res.push(this.wrap(aObj, aCtxt));
       }, this);
       return res;
-    } else if (kind == "file") {
-      return new aCtxt.File(aObject,
-                            { name: aObject.name,
-                              type: aObject.type });
     } else if (kind == "blob") {
       return new aCtxt.Blob([aObject]);
     } else if (kind == "primitive") {
       return aObject;
     }
 
-    // Fall-through, we now have a dictionnary object.
+    //  Fall-through, we now have a dictionnary object.
     let res = Cu.createObjectIn(aCtxt);
     let propList = { };
     for (let prop in aObject) {
+      let value;
+      let objProp = aObject[prop];
+      let propKind = this.getObjectKind(objProp);
+      if (propKind == "array") {
+        value = Cu.createArrayIn(aCtxt);
+        objProp.forEach(function(aObj) {
+          value.push(this.wrap(aObj, aCtxt));
+        }, this);
+      } else if (propKind == "blob") {
+        value = new aCtxt.Blob([objProp]);
+      } else if (propKind == "object") {
+        value = this.wrap(objProp, aCtxt);
+      } else {
+        value = objProp;
+      }
       propList[prop] = {
         enumerable: true,
         configurable: true,
         writable: true,
-        value: this.wrap(aObject[prop], aCtxt)
+        value: value
       }
     }
     Object.defineProperties(res, propList);
     Cu.makeObjectPropsNormal(res);
     return res;
   }
 }
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1752,17 +1752,17 @@ struct nsConstructorFuncMapData
   { eDOMClassInfo_##_class##_id, _func },
 
 #define NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(_class)   \
   { eDOMClassInfo_##_class##_id, NS_DOM##_class##Ctor },
 
 static const nsConstructorFuncMapData kConstructorFuncMap[] =
 {
   NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Blob, nsDOMMultipartFile::NewBlob)
-  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(File, nsDOMMultipartFile::NewFile)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(File, nsDOMFileFile::NewFile)
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(Event)
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(UIEvent)
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MouseEvent)
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(WheelEvent)
 #ifdef MOZ_B2G_RIL
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozWifiStatusChangeEvent)
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozWifiConnectionInfoEvent)
 #endif
deleted file mode 100644
--- a/dom/webidl/File.webidl
+++ /dev/null
@@ -1,9 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-dictionary FilePropertyBag : BlobPropertyBag {
-  DOMString name = "";
-};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -28,17 +28,16 @@ webidl_files = \
   DOMSettableTokenList.webidl \
   DOMStringMap.webidl \
   DOMTokenList.webidl \
   DynamicsCompressorNode.webidl \
   Element.webidl \
   EventHandler.webidl \
   EventListener.webidl \
   EventTarget.webidl \
-  File.webidl \
   FileHandle.webidl \
   FileList.webidl \
   FileReaderSync.webidl \
   Function.webidl \
   GainNode.webidl \
   HTMLCollection.webidl \
   HTMLElement.webidl \
   HTMLOptionsCollection.webidl \
--- a/dom/workers/File.cpp
+++ b/dom/workers/File.cpp
@@ -83,17 +83,18 @@ private:
   {
     return GetPrivate(aObj);
   }
 
   static JSBool
   Construct(JSContext* aCx, unsigned aArgc, jsval* aVp)
   {
     nsRefPtr<nsDOMMultipartFile> file = new nsDOMMultipartFile();
-    nsresult rv = file->InitBlob(aCx, aArgc, JS_ARGV(aCx, aVp), Unwrap);
+    nsresult rv = file->InitInternal(aCx, aArgc, JS_ARGV(aCx, aVp),
+                                     Unwrap);
     if (NS_FAILED(rv)) {
       ThrowDOMExceptionForNSResult(aCx, rv);
       return false;
     }
 
     JSObject* obj = file::CreateBlob(aCx, file);
     if (!obj) {
       return false;
--- a/js/xpconnect/loader/Makefile.in
+++ b/js/xpconnect/loader/Makefile.in
@@ -8,21 +8,18 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= jsloader
 LIBRARY_NAME	= jsloader_s
 FORCE_STATIC_LIB = 1
 LIBXUL_LIBRARY = 1
-LOCAL_INCLUDES += \
-  -I$(srcdir)/../src \
-  -I$(srcdir)/../wrappers \
-  -I$(topsrcdir)/content/base/src \
-  $(NULL)
+LOCAL_INCLUDES += -I$(srcdir)/../src \
+                  -I$(srcdir)/../wrappers
 
 CPPSRCS		= mozJSComponentLoader.cpp mozJSSubScriptLoader.cpp mozJSLoaderUtils.cpp
 
 EXTRA_JS_MODULES = XPCOMUtils.jsm ISO8601DateUtils.jsm
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += \
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -38,17 +38,17 @@
 #include "nsIObserverService.h"
 #include "nsIXPCScriptable.h"
 #include "nsString.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIURI.h"
 #include "nsIFileURL.h"
 #include "nsIJARURI.h"
 #include "nsNetUtil.h"
-#include "nsDOMBlobBuilder.h"
+#include "nsDOMFile.h"
 #include "jsprf.h"
 #include "nsJSPrincipals.h"
 // For reporting errors with the console service
 #include "nsIScriptError.h"
 #include "nsIConsoleService.h"
 #include "nsIStorageStream.h"
 #include "nsIStringStream.h"
 #if defined(XP_WIN)
@@ -240,17 +240,17 @@ File(JSContext *cx, unsigned argc, jsval
     nsresult rv;
 
     if (!argc) {
         XPCThrower::Throw(NS_ERROR_UNEXPECTED, cx);
         return false;
     }
 
     nsCOMPtr<nsISupports> native;
-    rv = nsDOMMultipartFile::NewFile(getter_AddRefs(native));
+    rv = nsDOMFileFile::NewFile(getter_AddRefs(native));
     if (NS_FAILED(rv)) {
         XPCThrower::Throw(rv, cx);
         return false;
     }
 
     nsCOMPtr<nsIJSNativeInitializer> initializer = do_QueryInterface(native);
     NS_ASSERTION(initializer, "what?");