From 27d39ad2147712f2a3773d3d6faf5df41d039043 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 1 Jul 2011 11:20:52 -0700 Subject: [PATCH] Back out 9fc0e6867256, 6947bbce9672, fb91a23bd158, a5870dd2ad7c, c3d3292fbd1e, 42f2aca1fde9 to fix Android failures on a CLOSED TREE --- client.mk | 8 +++--- configure.in | 16 +++--------- content/base/public/nsDOMFile.h | 6 +---- content/base/src/nsXMLHttpRequest.cpp | 36 +++------------------------ content/base/test/test_XHR.html | 2 -- 5 files changed, 12 insertions(+), 56 deletions(-) diff --git a/client.mk b/client.mk index fba6b4daf80..63a63cae46a 100644 --- a/client.mk +++ b/client.mk @@ -1,5 +1,3 @@ -# -*- makefile -*- -# vim:set ts=8 sw=8 sts=8 noet: # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # @@ -25,7 +23,6 @@ # Benjamin Smedberg # Chase Phillips # Mark Mentovai -# Joey Armstrong # # 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 @@ -98,11 +95,14 @@ endif 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 diff --git a/configure.in b/configure.in index 33a379ee1a2..f4828159136 100644 --- a/configure.in +++ b/configure.in @@ -982,10 +982,7 @@ 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]) @@ -7828,11 +7825,7 @@ 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 @@ -8458,10 +8451,7 @@ if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then 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 diff --git a/content/base/public/nsDOMFile.h b/content/base/public/nsDOMFile.h index ceb76b1f6b6..b90f2276f5c 100644 --- a/content/base/public/nsDOMFile.h +++ b/content/base/public/nsDOMFile.h @@ -72,10 +72,8 @@ public: 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) {} @@ -88,7 +86,6 @@ public: 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), @@ -115,7 +112,6 @@ public: protected: nsCOMPtr mFile; - nsCOMPtr mCacheToken; // start and length in PRUint64 mStart; diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index be232ea679f..6a9a32fca31 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -1616,25 +1616,8 @@ void nsXMLHttpRequest::CreateResponseBlob(nsIRequest *request) if (file) { nsCAutoString contentType; mChannel->GetContentType(contentType); - nsCOMPtr cacheToken; - if (cc) { - cc->GetCacheToken(getter_AddRefs(cacheToken)); - } - - NS_ConvertASCIItoUTF16 wideContentType(contentType); - - nsCOMPtr 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); } @@ -1905,20 +1888,9 @@ nsXMLHttpRequest::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult void *blobData = PR_Malloc(blobLen); if (blobData) { memcpy(blobData, mResponseBody.BeginReading(), blobLen); - - NS_ConvertASCIItoUTF16 wideContentType(contentType); - nsCOMPtr 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(), diff --git a/content/base/test/test_XHR.html b/content/base/test/test_XHR.html index 7c3a221a8ee..4f370b34969 100644 --- a/content/base/test/test_XHR.html +++ b/content/base/test/test_XHR.html @@ -160,8 +160,6 @@ 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();