From 94c4150fb90660fbf97e280a3d1a512d61a19b26 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 15 May 2012 12:03:01 +0200 Subject: [PATCH] Backed out changeset ad106d37ee43. The bug number in the changeset was wrong. --- content/base/src/nsXMLHttpRequest.cpp | 16 +- content/base/test/chrome/Makefile.in | 1 - content/base/test/chrome/test_bug682305.html | 159 ------------------ netwerk/base/public/Makefile.in | 1 - netwerk/base/public/nsStreamListenerWrapper.h | 33 ---- netwerk/base/src/Makefile.in | 1 - netwerk/base/src/nsStreamListenerWrapper.cpp | 10 -- netwerk/protocol/http/HttpBaseChannel.cpp | 31 +++- 8 files changed, 34 insertions(+), 218 deletions(-) delete mode 100644 content/base/test/chrome/test_bug682305.html delete mode 100644 netwerk/base/public/nsStreamListenerWrapper.h delete mode 100644 netwerk/base/src/nsStreamListenerWrapper.cpp diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index ec12054ee755..313cd20e2d67 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 sw=2 et tw=80: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -110,7 +109,6 @@ #include "nsIDOMFormData.h" #include "nsWrapperCacheInlines.h" -#include "nsStreamListenerWrapper.h" using namespace mozilla; using namespace mozilla::dom; @@ -3048,6 +3046,9 @@ nsXMLHttpRequest::Send(JSContext *aCx, nsIVariant* aVariant, const Nullable - - - - XMLHttpRequest send and channel implemented in JS - - - - - - -Mozilla Bug 682305 -

- -
-
-
- - diff --git a/netwerk/base/public/Makefile.in b/netwerk/base/public/Makefile.in index 7dc472791fcf..e635b51b15ce 100644 --- a/netwerk/base/public/Makefile.in +++ b/netwerk/base/public/Makefile.in @@ -165,7 +165,6 @@ EXPORTS = \ nsReadLine.h \ nsASocketHandler.h \ nsAsyncRedirectVerifyHelper.h \ - nsStreamListenerWrapper.h \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/netwerk/base/public/nsStreamListenerWrapper.h b/netwerk/base/public/nsStreamListenerWrapper.h deleted file mode 100644 index 60fa705f2c92..000000000000 --- a/netwerk/base/public/nsStreamListenerWrapper.h +++ /dev/null @@ -1,33 +0,0 @@ -/* 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/. */ - -#ifndef nsStreamListenerWrapper_h__ -#define nsStreamListenerWrapper_h__ - -#include "nsCOMPtr.h" -#include "nsIStreamListener.h" -#include "nsIRequestObserver.h" - -// Wrapper class to make replacement of nsHttpChannel's listener -// from JavaScript possible. It is workaround for bug 433711 and 682305. -class nsStreamListenerWrapper : public nsIStreamListener -{ -public: - nsStreamListenerWrapper(nsIStreamListener *listener) - : mListener(listener) - { - NS_ASSERTION(mListener, "no stream listener specified"); - } - - NS_DECL_ISUPPORTS - NS_FORWARD_NSIREQUESTOBSERVER(mListener->) - NS_FORWARD_NSISTREAMLISTENER(mListener->) - -private: - ~nsStreamListenerWrapper() {} - nsCOMPtr mListener; -}; - -#endif // nsStreamListenerWrapper_h__ - diff --git a/netwerk/base/src/Makefile.in b/netwerk/base/src/Makefile.in index f946ff526b6a..c86916c333dc 100644 --- a/netwerk/base/src/Makefile.in +++ b/netwerk/base/src/Makefile.in @@ -93,7 +93,6 @@ CPPSRCS = \ nsDNSPrefetch.cpp \ RedirectChannelRegistrar.cpp \ nsPreloadedStream.cpp \ - nsStreamListenerWrapper.cpp \ $(NULL) ifeq ($(MOZ_WIDGET_TOOLKIT),os2) diff --git a/netwerk/base/src/nsStreamListenerWrapper.cpp b/netwerk/base/src/nsStreamListenerWrapper.cpp deleted file mode 100644 index 0b2cd7b3dc7c..000000000000 --- a/netwerk/base/src/nsStreamListenerWrapper.cpp +++ /dev/null @@ -1,10 +0,0 @@ -/* 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 "nsStreamListenerWrapper.h" - -NS_IMPL_ISUPPORTS2(nsStreamListenerWrapper, - nsIStreamListener, - nsIRequestObserver) - diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 1eb793578bf4..a1007e182c26 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -53,7 +53,6 @@ #include "nsIResumableChannel.h" #include "nsIApplicationCacheChannel.h" #include "nsEscape.h" -#include "nsStreamListenerWrapper.h" #include "prnetdb.h" @@ -1428,6 +1427,36 @@ HttpBaseChannel::GetEntityID(nsACString& aEntityID) return NS_OK; } +//----------------------------------------------------------------------------- +// nsStreamListenerWrapper +//----------------------------------------------------------------------------- + +// Wrapper class to make replacement of nsHttpChannel's listener +// from JavaScript possible. It is workaround for bug 433711. +class nsStreamListenerWrapper : public nsIStreamListener +{ +public: + nsStreamListenerWrapper(nsIStreamListener *listener); + + NS_DECL_ISUPPORTS + NS_FORWARD_NSIREQUESTOBSERVER(mListener->) + NS_FORWARD_NSISTREAMLISTENER(mListener->) + +private: + ~nsStreamListenerWrapper() {} + nsCOMPtr mListener; +}; + +nsStreamListenerWrapper::nsStreamListenerWrapper(nsIStreamListener *listener) + : mListener(listener) +{ + NS_ASSERTION(mListener, "no stream listener specified"); +} + +NS_IMPL_ISUPPORTS2(nsStreamListenerWrapper, + nsIStreamListener, + nsIRequestObserver) + //----------------------------------------------------------------------------- // nsHttpChannel::nsITraceableChannel //-----------------------------------------------------------------------------