diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 145a27a7348..6ef6cce1e83 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -1996,8 +1996,14 @@ nsXULDocument::CreateFromPrototype(const char* aCommand, getter_AddRefs(loadgroup)); if (NS_FAILED(rv)) return rv; - nsCOMPtr loader; - rv = nsXULDocument::CachedChromeLoader::Create(this, getter_AddRefs(loader)); + CachedChromeLoader* loader = new CachedChromeLoader(this); + if (! loader) + return NS_ERROR_OUT_OF_MEMORY; + + NS_ADDREF(loader); + nsCOMPtr anchor = do_QueryInterface(loader, &rv); + NS_RELEASE(loader); + if (NS_FAILED(rv)) return rv; rv = loadgroup->Init(loader); @@ -5559,18 +5565,6 @@ nsXULDocument::CachedChromeLoader::~CachedChromeLoader() NS_RELEASE(mDocument); } -nsresult -nsXULDocument::CachedChromeLoader::Create(nsXULDocument* aDocument, nsIStreamObserver** aResult) -{ - CachedChromeLoader* loader = new CachedChromeLoader(aDocument); - if (! loader) - return NS_ERROR_OUT_OF_MEMORY; - - *aResult = loader; - NS_ADDREF(*aResult); - return NS_OK; -} - NS_IMPL_ADDREF(nsXULDocument::CachedChromeLoader); NS_IMPL_RELEASE(nsXULDocument::CachedChromeLoader); diff --git a/content/xul/document/src/nsXULDocument.h b/content/xul/document/src/nsXULDocument.h index f4839fa11a8..107df26a9a7 100644 --- a/content/xul/document/src/nsXULDocument.h +++ b/content/xul/document/src/nsXULDocument.h @@ -752,14 +752,12 @@ protected: class CachedChromeLoader : public nsIStreamObserver { protected: - CachedChromeLoader(nsXULDocument* aDocument); - virtual ~CachedChromeLoader(); - nsXULDocument* mDocument; PRBool mLoading; public: - static nsresult Create(nsXULDocument* aDocument, nsIStreamObserver** aResult); + CachedChromeLoader(nsXULDocument* aDocument); + virtual ~CachedChromeLoader(); // nsISupports interface NS_DECL_ISUPPORTS diff --git a/rdf/content/src/nsXULDocument.cpp b/rdf/content/src/nsXULDocument.cpp index 145a27a7348..6ef6cce1e83 100644 --- a/rdf/content/src/nsXULDocument.cpp +++ b/rdf/content/src/nsXULDocument.cpp @@ -1996,8 +1996,14 @@ nsXULDocument::CreateFromPrototype(const char* aCommand, getter_AddRefs(loadgroup)); if (NS_FAILED(rv)) return rv; - nsCOMPtr loader; - rv = nsXULDocument::CachedChromeLoader::Create(this, getter_AddRefs(loader)); + CachedChromeLoader* loader = new CachedChromeLoader(this); + if (! loader) + return NS_ERROR_OUT_OF_MEMORY; + + NS_ADDREF(loader); + nsCOMPtr anchor = do_QueryInterface(loader, &rv); + NS_RELEASE(loader); + if (NS_FAILED(rv)) return rv; rv = loadgroup->Init(loader); @@ -5559,18 +5565,6 @@ nsXULDocument::CachedChromeLoader::~CachedChromeLoader() NS_RELEASE(mDocument); } -nsresult -nsXULDocument::CachedChromeLoader::Create(nsXULDocument* aDocument, nsIStreamObserver** aResult) -{ - CachedChromeLoader* loader = new CachedChromeLoader(aDocument); - if (! loader) - return NS_ERROR_OUT_OF_MEMORY; - - *aResult = loader; - NS_ADDREF(*aResult); - return NS_OK; -} - NS_IMPL_ADDREF(nsXULDocument::CachedChromeLoader); NS_IMPL_RELEASE(nsXULDocument::CachedChromeLoader); diff --git a/rdf/content/src/nsXULDocument.h b/rdf/content/src/nsXULDocument.h index f4839fa11a8..107df26a9a7 100644 --- a/rdf/content/src/nsXULDocument.h +++ b/rdf/content/src/nsXULDocument.h @@ -752,14 +752,12 @@ protected: class CachedChromeLoader : public nsIStreamObserver { protected: - CachedChromeLoader(nsXULDocument* aDocument); - virtual ~CachedChromeLoader(); - nsXULDocument* mDocument; PRBool mLoading; public: - static nsresult Create(nsXULDocument* aDocument, nsIStreamObserver** aResult); + CachedChromeLoader(nsXULDocument* aDocument); + virtual ~CachedChromeLoader(); // nsISupports interface NS_DECL_ISUPPORTS