Back out 9fc0e6867256, 6947bbce9672, fb91a23bd158, a5870dd2ad7c, c3d3292fbd1e, 42f2aca1fde9 to fix Android failures on a CLOSED TREE
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 01 Jul 2011 11:20:52 -0700
changeset 72402 00bb08972e46a0a18500484d27d29a33a040d915
parent 72401 71fce8f097f507e45e7b0efc477c88ef4117ac09
child 72413 d1a0de2af8a7e6dd983f0ea50cc6c7ca38c48652
child 72491 fac8fa6cc4b521a92111053e8504be077e08c0f0
push id209
push userbzbarsky@mozilla.com
push dateTue, 05 Jul 2011 17:42:16 +0000
treeherdermozilla-aurora@cc6e30cce8af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone7.0a1
backs out9fc0e6867256dc7435ac012ad565ab788168eedb
Back out 9fc0e6867256, 6947bbce9672, fb91a23bd158, a5870dd2ad7c, c3d3292fbd1e, 42f2aca1fde9 to fix Android failures on a CLOSED TREE
client.mk
configure.in
content/base/public/nsDOMFile.h
content/base/src/nsXMLHttpRequest.cpp
content/base/test/test_XHR.html
--- a/client.mk
+++ b/client.mk
@@ -1,10 +1,8 @@
-# -*- makefile -*-
-# vim:set ts=8 sw=8 sts=8 noet:
 # ***** BEGIN LICENSE BLOCK *****
 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
 #
 # The contents of this file are subject to the Mozilla Public License Version
 # 1.1 (the "License"); you may not use this file except in compliance with
 # the License. You may obtain a copy of the License at
 # http://www.mozilla.org/MPL/
 #
@@ -20,17 +18,16 @@
 # Portions created by the Initial Developer are Copyright (C) 1998
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Stephen Lamm
 #   Benjamin Smedberg <bsmedberg@covad.net>
 #   Chase Phillips <chase@mozilla.org>
 #   Mark Mentovai <mark@moxienet.com>
-#   Joey Armstrong <joey@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -93,21 +90,24 @@ TOPSRCDIR := $(CWD)
 endif
 endif
 
 # try to find autoconf 2.13 - discard errors from 'which'
 # MacOS X 10.4 sends "no autoconf*" errors to stdout, discard those via grep
 AUTOCONF ?= $(shell which autoconf-2.13 autoconf2.13 autoconf213 2>/dev/null | grep -v '^no autoconf' | head -1)
 
 ifeq (,$(strip $(AUTOCONF)))
-AUTOCONF=$(error Could not find autoconf 2.13)
+AUTOCONF=$(error Couldn't find autoconf 2.13)
 endif
 
 MKDIR := mkdir
 SH := /bin/sh
+ifndef MAKE
+MAKE := gmake
+endif
 PERL ?= perl
 PYTHON ?= python
 
 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
 ifdef CONFIG_GUESS_SCRIPT
   CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
 endif
 
--- a/configure.in
+++ b/configure.in
@@ -977,20 +977,17 @@ fi
 
 if test -z "$COMPILE_ENVIRONMENT"; then
     NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
 fi
 AC_SUBST(NSINSTALL_BIN)
 
 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
-MOZ_PATH_PROGS(UNZIP, unzip)
-if test -z "$UNZIP" -o "$UNZIP" = ":"; then
-    AC_MSG_ERROR([unzip not found in \$PATH])
-fi
+MOZ_PATH_PROG(UNZIP, unzip, :)
 MOZ_PATH_PROGS(ZIP, zip)
 if test -z "$ZIP" -o "$ZIP" = ":"; then
     AC_MSG_ERROR([zip not found in \$PATH])
 fi
 MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
 MOZ_PATH_PROG(XARGS, xargs)
 if test -z "$XARGS" -o "$XARGS" = ":"; then
     AC_MSG_ERROR([xargs not found in \$PATH .])
@@ -7823,21 +7820,17 @@ dnl Omnijar packaging is compatible with
 dnl In unpackaged builds, omnijar looks for files as if
 dnl things were flat packaged. After packaging, all files
 dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
 dnl is set to flat since putting files into jars is only
 dnl done during packaging with omnijar.
 if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
     MOZ_OMNIJAR=1
     AC_DEFINE(MOZ_OMNIJAR)
-    if test "$OS_ARCH" = "WINNT"; then
-        MOZ_CHROME_FILE_FORMAT=flat
-    else
-        MOZ_CHROME_FILE_FORMAT=symlink
-    fi
+    MOZ_CHROME_FILE_FORMAT=flat
 elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
     AC_DEFINE(MOZ_CHROME_FILE_FORMAT_JAR)
 fi
 
 AC_SUBST(MOZ_OMNIJAR)
 
 dnl ========================================================
 dnl = Define default location for MOZILLA_FIVE_HOME
@@ -8453,20 +8446,17 @@ if test -z "${GLIB_CFLAGS}" -o -z "${GLI
     if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then
         PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
     else
         AM_PATH_GLIB(${GLIB_VERSION})
     fi
 fi
 fi
 
-if test -z "${GLIB_GMODULE_LIBS}" \
-   -a -n "${GLIB_CONFIG}"\
-    -a "${GLIB_CONFIG}" != no\
-; then
+if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
     GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
 fi
 
 AC_SUBST(LIBIDL_CFLAGS)
 AC_SUBST(LIBIDL_LIBS)
 AC_SUBST(STATIC_LIBIDL)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
--- a/content/base/public/nsDOMFile.h
+++ b/content/base/public/nsDOMFile.h
@@ -67,33 +67,30 @@ class nsDOMFile : public nsIDOMFile,
                   public nsIJSNativeInitializer
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMBLOB
   NS_DECL_NSIDOMFILE
   NS_DECL_NSIXHRSENDABLE
 
-  nsDOMFile(nsIFile *aFile, const nsAString& aContentType,
-            nsISupports *aCacheToken = nsnull)
+  nsDOMFile(nsIFile *aFile, const nsAString& aContentType)
     : mFile(aFile),
-      mCacheToken(aCacheToken),
       mContentType(aContentType),
       mIsFullFile(true)
   {}
 
   nsDOMFile(nsIFile *aFile)
     : mFile(aFile),
       mIsFullFile(true)
   {}
 
   nsDOMFile(const nsDOMFile* aOther, PRUint64 aStart, PRUint64 aLength,
             const nsAString& aContentType)
     : mFile(aOther->mFile),
-      mCacheToken(aOther->mCacheToken),
       mStart(aOther->mIsFullFile ? aStart :
                                    (aOther->mStart + aStart)),
       mLength(aLength),
       mContentType(aContentType),
       mIsFullFile(false)
   {
     NS_ASSERTION(mFile, "must have file");
     // Ensure non-null mContentType
@@ -110,17 +107,16 @@ public:
                         jsval* aArgv);
 
   // DOMClassInfo constructor (for File("foo"))
   static nsresult
   NewFile(nsISupports* *aNewObject);
 
 protected:
   nsCOMPtr<nsIFile> mFile;
-  nsCOMPtr<nsISupports> mCacheToken;
 
   // start and length in 
   PRUint64 mStart;
   PRUint64 mLength;
 
   nsString mContentType;
   
   bool mIsFullFile;
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -1611,35 +1611,18 @@ void nsXMLHttpRequest::CreateResponseBlo
     nsCOMPtr<nsIFileChannel> fc = do_QueryInterface(request);
     if (fc) {
       fc->GetFile(getter_AddRefs(file));
     }
   }
   if (file) {
     nsCAutoString contentType;
     mChannel->GetContentType(contentType);
-    nsCOMPtr<nsISupports> cacheToken;
-    if (cc) {
-      cc->GetCacheToken(getter_AddRefs(cacheToken));
-    }
-
-    NS_ConvertASCIItoUTF16 wideContentType(contentType);
-
-    nsCOMPtr<nsIDOMBlob> blob =
-      new nsDOMFile(file, wideContentType, cacheToken);
-
-    // XXXkhuey this is a complete hack ... but we need to get 6 out the door
-    // The response blob here should not be a File object, it should only
-    // be a Blob.  Unfortunately, because nsDOMFile has grown through
-    // accretion over the years and is in dangerous need of a refactoring,
-    // slicing it is the easiest way to get there ...
-    PRUint64 size = 0;
-    blob->GetSize(&size);
-    blob->MozSlice(0, size, wideContentType, 2, getter_AddRefs(mResponseBlob));
-    
+    mResponseBlob = new nsDOMFile(file,
+                                  NS_ConvertASCIItoUTF16(contentType));
     mResponseBody.Truncate();
     mResponseBodyUnicode.SetIsVoid(PR_TRUE);
   }
 }
 
 /* void onDataAvailable (in nsIRequest request, in nsISupports ctxt, in nsIInputStream inStr, in unsigned long sourceOffset, in unsigned long count); */
 NS_IMETHODIMP
 nsXMLHttpRequest::OnDataAvailable(nsIRequest *request, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
@@ -1900,30 +1883,19 @@ nsXMLHttpRequest::OnStopRequest(nsIReque
       nsCAutoString contentType;
       mChannel->GetContentType(contentType);
       // XXX We should change mResponseBody to be a raw malloc'ed buffer
       //     to avoid copying the data.
       PRUint32 blobLen = mResponseBody.Length();
       void *blobData = PR_Malloc(blobLen);
       if (blobData) {
         memcpy(blobData, mResponseBody.BeginReading(), blobLen);
-
-        NS_ConvertASCIItoUTF16 wideContentType(contentType);
-        nsCOMPtr<nsIDOMBlob> blob =
+        mResponseBlob =
           new nsDOMMemoryFile(blobData, blobLen, EmptyString(),
-                              wideContentType);
-
-        // XXXkhuey this is a complete hack ... but we need to get 6 out the door
-        // The response blob here should not be a File object, it should only
-        // be a Blob.  Unfortunately, because nsDOMFile has grown through
-        // accretion over the years and is in dangerous need of a refactoring,
-        // slicing it is the easiest way to get there ...
-        blob->MozSlice(0, blobLen, wideContentType,
-                       2, getter_AddRefs(mResponseBlob));
-
+                              NS_ConvertASCIItoUTF16(contentType));
         mResponseBody.Truncate();
       }
       NS_ASSERTION(mResponseBodyUnicode.IsVoid(),
                    "mResponseBodyUnicode should be empty");
     }
   }
 
   channel->SetNotificationCallbacks(nsnull);
--- a/content/base/test/test_XHR.html
+++ b/content/base/test/test_XHR.html
@@ -155,18 +155,16 @@ xhr = new XMLHttpRequest();
 xhr.open("GET", 'file_XHR_pass2.txt', false); 
 xhr.responseType = 'blob';
 xhr.send(null);
 is(xhr.status, 200, "wrong status");
 checkResponseTextAccessThrows(xhr);
 checkResponseXMLAccessThrows(xhr);
 b = xhr.response;
 ok(b, "should have a non-null blob");
-ok(b instanceof Blob, "should be a Blob");
-ok(!(b instanceof File), "should not be a File");
 is(b.size, "hello pass\n".length, "wrong blob size");
 
 var fr = new FileReader();
 fr.onload = function() {
   ok(fr.result, "hello pass\n", "wrong values");
   checkOnloadCount();
 };
 fr.readAsBinaryString(b);