From 36de5ef33afa5910eef0e298a0da5cd3ed9ee870 Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Tue, 17 Mar 2009 11:08:59 +0000 Subject: [PATCH] Backed out changeset 55d159b75f41 from bug 482659. --- content/base/src/nsFrameLoader.cpp | 2 +- content/html/document/test/Makefile.in | 1 - .../html/document/test/test_bug482659.html | 128 ------------------ layout/reftests/bugs/482659-1-ref.html | 4 - layout/reftests/bugs/482659-1a.html | 16 --- layout/reftests/bugs/482659-1b.html | 16 --- layout/reftests/bugs/482659-1c.html | 25 ---- layout/reftests/bugs/482659-1d.html | 25 ---- layout/reftests/bugs/reftest.list | 4 - netwerk/build/nsNetCID.h | 10 -- netwerk/build/nsNetModule.cpp | 6 - .../about/src/nsAboutProtocolHandler.cpp | 98 +------------- .../about/src/nsAboutProtocolHandler.h | 33 ----- netwerk/test/unit/test_aboutblank.js | 29 ---- 14 files changed, 4 insertions(+), 393 deletions(-) delete mode 100644 content/html/document/test/test_bug482659.html delete mode 100644 layout/reftests/bugs/482659-1-ref.html delete mode 100644 layout/reftests/bugs/482659-1a.html delete mode 100644 layout/reftests/bugs/482659-1b.html delete mode 100644 layout/reftests/bugs/482659-1c.html delete mode 100644 layout/reftests/bugs/482659-1d.html delete mode 100644 netwerk/test/unit/test_aboutblank.js diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index ebd8a2f71e6..3e074973a9b 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -159,7 +159,7 @@ nsFrameLoader::LoadFrame() // If the URI was malformed, try to recover by loading about:blank. if (rv == NS_ERROR_MALFORMED_URI) { rv = NS_NewURI(getter_AddRefs(uri), NS_LITERAL_STRING("about:blank"), - charset, base_uri); + charset); } NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/html/document/test/Makefile.in b/content/html/document/test/Makefile.in index f83d203b274..6170ca830a9 100644 --- a/content/html/document/test/Makefile.in +++ b/content/html/document/test/Makefile.in @@ -89,7 +89,6 @@ _TEST_FILES = test_bug1682.html \ bug448564-iframe-3.html \ bug448564-echo.sjs \ bug448564-submit.js \ - test_bug482659.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/html/document/test/test_bug482659.html b/content/html/document/test/test_bug482659.html deleted file mode 100644 index 15b30cb801d..00000000000 --- a/content/html/document/test/test_bug482659.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - Test for Bug 482659 - - - - - -Mozilla Bug 482659 -

- - - - -

- -
-
-
- - - - - - - Test for Bug 482659 - - - - - -Mozilla Bug 482659 -

- - - - -

- -
-
-
- - diff --git a/layout/reftests/bugs/482659-1-ref.html b/layout/reftests/bugs/482659-1-ref.html deleted file mode 100644 index 70e76fb7b87..00000000000 --- a/layout/reftests/bugs/482659-1-ref.html +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/layout/reftests/bugs/482659-1a.html b/layout/reftests/bugs/482659-1a.html deleted file mode 100644 index f767f4df8ea..00000000000 --- a/layout/reftests/bugs/482659-1a.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/layout/reftests/bugs/482659-1b.html b/layout/reftests/bugs/482659-1b.html deleted file mode 100644 index 2fd28565e5e..00000000000 --- a/layout/reftests/bugs/482659-1b.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/layout/reftests/bugs/482659-1c.html b/layout/reftests/bugs/482659-1c.html deleted file mode 100644 index c41ded81496..00000000000 --- a/layout/reftests/bugs/482659-1c.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - diff --git a/layout/reftests/bugs/482659-1d.html b/layout/reftests/bugs/482659-1d.html deleted file mode 100644 index 2f951e795c8..00000000000 --- a/layout/reftests/bugs/482659-1d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 61b3123e200..6fac915cc5a 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1107,7 +1107,3 @@ fails == 461512-1.html 461512-1-ref.html # Bug 461512 == 480880-2c.html about:blank == 482592-1a.xhtml 482592-1-ref.html == 482592-1b.xhtml 482592-1-ref.html -== 482659-1a.html 482659-1-ref.html -== 482659-1b.html 482659-1-ref.html -== 482659-1c.html 482659-1-ref.html -== 482659-1d.html 482659-1-ref.html diff --git a/netwerk/build/nsNetCID.h b/netwerk/build/nsNetCID.h index 86e5ea8810a..ee844787ebb 100644 --- a/netwerk/build/nsNetCID.h +++ b/netwerk/build/nsNetCID.h @@ -123,16 +123,6 @@ { 0xa7, 0x85, 0x85, 0xc3, 0x94, 0x01, 0x25, 0x03 } \ } -// component inheriting from the nested simple URI component and also -// carrying along its base URI -#define NS_NESTEDABOUTURI_CID \ -{ /* 2f277c00-0eaf-4ddb-b936-41326ba48aae */ \ - 0x2f277c00, \ - 0x0eaf, \ - 0x4ddb, \ - { 0xb9, 0x36, 0x41, 0x32, 0x6b, 0xa4, 0x8a, 0xae } \ -} - // component implementing nsIStandardURL, nsIURI, nsIURL, nsISerializable, // and nsIClassInfo. #define NS_STANDARDURL_CLASSNAME \ diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index 9eb36b5e177..6c573c6d6b7 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -60,7 +60,6 @@ #include "nsMimeTypes.h" #include "nsNetStrings.h" #include "nsDNSPrefetch.h" -#include "nsAboutProtocolHandler.h" #include "nsNetCID.h" @@ -180,7 +179,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsCookieService, nsCookieService::GetSi #include "nsAboutBlank.h" NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutProtocolHandler) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeAboutProtocolHandler) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsNestedAboutURI) #ifdef NECKO_PROTOCOL_about // about @@ -1016,10 +1014,6 @@ static const nsModuleComponentInfo gNetModuleInfo[] = { NS_ABOUT_MODULE_CONTRACTID_PREFIX "blank", nsAboutBlank::Create }, - { "Nested about: URI", - NS_NESTEDABOUTURI_CID, - nsnull, - nsNestedAboutURIConstructor }, #ifdef NECKO_PROTOCOL_about #ifdef NS_BUILD_REFCNT_LOGGING { "about:bloat", diff --git a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp index 80cce9e79b7..594fc9a90ee 100644 --- a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp +++ b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp @@ -49,13 +49,9 @@ #include "nsAboutProtocolUtils.h" #include "nsNetError.h" #include "nsNetUtil.h" -#include "nsIObjectInputStream.h" -#include "nsIObjectOutputStream.h" -#include "nsAutoPtr.h" -#include "nsIWritablePropertyBag2.h" +#include "nsSimpleNestedURI.h" static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID); -static NS_DEFINE_CID(kNestedAboutURICID, NS_NESTEDABOUTURI_CID); //////////////////////////////////////////////////////////////////////////////// @@ -135,7 +131,7 @@ nsAboutProtocolHandler::NewURI(const nsACString &aSpec, rv = NS_NewURI(getter_AddRefs(inner), spec); NS_ENSURE_SUCCESS(rv, rv); - nsSimpleNestedURI* outer = new nsNestedAboutURI(inner, aBaseURI); + nsSimpleNestedURI* outer = new nsSimpleNestedURI(inner); NS_ENSURE_TRUE(outer, NS_ERROR_OUT_OF_MEMORY); // Take a ref to it in the COMPtr we plan to return @@ -162,22 +158,7 @@ nsAboutProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result) nsresult rv = NS_GetAboutModule(uri, getter_AddRefs(aboutMod)); if (NS_SUCCEEDED(rv)) { // The standard return case: - rv = aboutMod->NewChannel(uri, result); - if (NS_SUCCEEDED(rv)) { - nsRefPtr aboutURI; - rv = uri->QueryInterface(kNestedAboutURICID, - getter_AddRefs(aboutURI)); - if (NS_SUCCEEDED(rv) && aboutURI->GetBaseURI()) { - nsCOMPtr writableBag = - do_QueryInterface(*result); - if (writableBag) { - writableBag-> - SetPropertyAsInterface(NS_LITERAL_STRING("baseURI"), - aboutURI->GetBaseURI()); - } - } - } - return rv; + return aboutMod->NewChannel(uri, result); } // mumble... @@ -264,76 +245,3 @@ nsSafeAboutProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool * *_retval = PR_FALSE; return NS_OK; } - -//////////////////////////////////////////////////////////// -// nsNestedAboutURI implementation -NS_INTERFACE_MAP_BEGIN(nsNestedAboutURI) - if (aIID.Equals(kNestedAboutURICID)) - foundInterface = static_cast(this); - else -NS_INTERFACE_MAP_END_INHERITING(nsSimpleNestedURI) - -// nsISerializable -NS_IMETHODIMP -nsNestedAboutURI::Read(nsIObjectInputStream* aStream) -{ - nsresult rv = nsSimpleNestedURI::Read(aStream); - if (NS_FAILED(rv)) return rv; - - PRBool haveBase; - rv = aStream->ReadBoolean(&haveBase); - if (NS_FAILED(rv)) return rv; - - if (haveBase) { - rv = aStream->ReadObject(PR_TRUE, getter_AddRefs(mBaseURI)); - if (NS_FAILED(rv)) return rv; - } - - return NS_OK; -} - -NS_IMETHODIMP -nsNestedAboutURI::Write(nsIObjectOutputStream* aStream) -{ - nsresult rv = nsSimpleNestedURI::Write(aStream); - if (NS_FAILED(rv)) return rv; - - rv = aStream->WriteBoolean(mBaseURI != nsnull); - if (NS_FAILED(rv)) return rv; - - if (mBaseURI) { - rv = aStream->WriteObject(mBaseURI, PR_TRUE); - if (NS_FAILED(rv)) return rv; - } - - return NS_OK; -} - -// nsSimpleURI -/* virtual */ nsSimpleURI* -nsNestedAboutURI::StartClone() -{ - // Sadly, we can't make use of nsSimpleNestedURI::StartClone here. - NS_ENSURE_TRUE(mInnerURI, nsnull); - - nsCOMPtr innerClone; - nsresult rv = mInnerURI->Clone(getter_AddRefs(innerClone)); - if (NS_FAILED(rv)) { - return nsnull; - } - - nsNestedAboutURI* url = new nsNestedAboutURI(innerClone, mBaseURI); - if (url) { - url->SetMutable(PR_FALSE); - } - - return url; -} - -// nsIClassInfo -NS_IMETHODIMP -nsNestedAboutURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) -{ - *aClassIDNoAlloc = kNestedAboutURICID; - return NS_OK; -} diff --git a/netwerk/protocol/about/src/nsAboutProtocolHandler.h b/netwerk/protocol/about/src/nsAboutProtocolHandler.h index b560f5bc48b..ca1a3f8a2e8 100644 --- a/netwerk/protocol/about/src/nsAboutProtocolHandler.h +++ b/netwerk/protocol/about/src/nsAboutProtocolHandler.h @@ -39,7 +39,6 @@ #define nsAboutProtocolHandler_h___ #include "nsIProtocolHandler.h" -#include "nsSimpleNestedURI.h" class nsCString; class nsIAboutModule; @@ -73,36 +72,4 @@ private: }; -// Class to allow us to propagate the base URI to about:blank correctly -class nsNestedAboutURI : public nsSimpleNestedURI { -public: - nsNestedAboutURI(nsIURI* aInnerURI, nsIURI* aBaseURI) - : nsSimpleNestedURI(aInnerURI) - , mBaseURI(aBaseURI) - {} - - // For use only from deserialization - nsNestedAboutURI() : nsSimpleNestedURI() {} - - virtual ~nsNestedAboutURI() {} - - // Override QI so we can QI to our CID as needed - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - - // Override StartClone(), the nsISerializable methods, and - // GetClassIDNoAlloc; this last is needed to make our nsISerializable impl - // work right. - virtual nsSimpleURI* StartClone(); - NS_IMETHOD Read(nsIObjectInputStream* aStream); - NS_IMETHOD Write(nsIObjectOutputStream* aStream); - NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc); - - nsIURI* GetBaseURI() const { - return mBaseURI; - } - -protected: - nsCOMPtr mBaseURI; -}; - #endif /* nsAboutProtocolHandler_h___ */ diff --git a/netwerk/test/unit/test_aboutblank.js b/netwerk/test/unit/test_aboutblank.js deleted file mode 100644 index 9ade3a4841b..00000000000 --- a/netwerk/test/unit/test_aboutblank.js +++ /dev/null @@ -1,29 +0,0 @@ -function run_test() { - var ioServ = Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService); - - var base = ioServ.newURI("http://www.example.com", null, null); - - var about1 = ioServ.newURI("about:blank", null, null); - var about2 = ioServ.newURI("about:blank", null, base); - - var chan1 = ioServ.newChannelFromURI(about1) - .QueryInterface(Components.interfaces.nsIPropertyBag2); - var chan2 = ioServ.newChannelFromURI(about2) - .QueryInterface(Components.interfaces.nsIPropertyBag2); - - var haveProp = false; - var propVal = null; - try { - propVal = chan1.getPropertyAsInterface("baseURI", - Components.interfaces.nsIURI); - haveProp = true; - } catch (e if e.result == Components.results.NS_ERROR_NOT_AVAILABLE) { - // Property shouldn't be there. - } - do_check_eq(propVal, null); - do_check_eq(haveProp, false); - do_check_eq(chan2.getPropertyAsInterface("baseURI", - Components.interfaces.nsIURI), - base); -}