diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
index 4e34d08c9d0..39c41c66276 100644
--- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
@@ -29,7 +29,7 @@
#include "nsIHTMLContent.h"
#include "nsIHTMLContentContainer.h"
#include "nsIURL.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
#include "nsNetUtil.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
@@ -144,7 +144,7 @@ static PRLogModuleInfo* gSinkLogModuleInfo;
class SinkContext;
class HTMLContentSink : public nsIHTMLContentSink,
- public nsIUnicharStreamLoaderObserver,
+ public nsIStreamLoaderObserver,
public nsITimerCallback,
public nsICSSLoaderObserver,
public nsIDocumentObserver
@@ -161,7 +161,7 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
// nsIContentSink
NS_IMETHOD WillBuildModel(void);
@@ -2116,7 +2116,7 @@ HTMLContentSink::~HTMLContentSink()
NS_IMPL_ISUPPORTS6(HTMLContentSink,
nsIHTMLContentSink,
nsIContentSink,
- nsIUnicharStreamLoaderObserver,
+ nsIStreamLoaderObserver,
nsITimerCallback,
nsICSSLoaderObserver,
nsIDocumentObserver)
@@ -4038,10 +4038,11 @@ HTMLContentSink::EvaluateScript(nsString& aScript,
}
NS_IMETHODIMP
-HTMLContentSink::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+HTMLContentSink::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* aContext,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
nsresult rv = NS_OK;
nsString aData(string, stringLen);
@@ -4203,10 +4204,10 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
return rv;
nsCOMPtr loadGroup;
- nsIUnicharStreamLoader* loader;
+ nsIStreamLoader* loader;
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
- rv = NS_NewUnicharStreamLoader(&loader, url, this, loadGroup);
+ rv = NS_NewStreamLoader(&loader, url, this, nsnull, loadGroup);
NS_RELEASE(url);
if (NS_OK == rv) {
rv = NS_ERROR_HTMLPARSER_BLOCK;
diff --git a/mozilla/content/html/style/src/nsCSSLoader.cpp b/mozilla/content/html/style/src/nsCSSLoader.cpp
index 68dd1d5de00..44cd814c31a 100644
--- a/mozilla/content/html/style/src/nsCSSLoader.cpp
+++ b/mozilla/content/html/style/src/nsCSSLoader.cpp
@@ -30,7 +30,7 @@
#include "nsIStyleSheetLinkingElement.h"
#include "nsIDocument.h"
#include "nsINameSpaceManager.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
#include "nsIUnicharInputStream.h"
#include "nsHashtable.h"
@@ -153,7 +153,7 @@ public:
nsISupports* mSupports;
};
-class SheetLoadData : public nsIUnicharStreamLoaderObserver
+class SheetLoadData : public nsIStreamLoaderObserver
{
public:
virtual ~SheetLoadData(void);
@@ -170,7 +170,7 @@ public:
nsICSSLoaderObserver* aObserver);
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
CSSLoaderImpl* mLoader;
nsIURI* mURL;
@@ -197,7 +197,7 @@ public:
nsICSSLoaderObserver* mObserver;
};
-NS_IMPL_ISUPPORTS1(SheetLoadData, nsIUnicharStreamLoaderObserver);
+NS_IMPL_ISUPPORTS1(SheetLoadData, nsIStreamLoaderObserver);
MOZ_DECL_CTOR_COUNTER(PendingSheetData);
@@ -287,7 +287,7 @@ public:
nsresult ParseSheet(nsIUnicharInputStream* aIn, SheetLoadData* aLoadData,
PRBool& aCompleted, nsICSSStyleSheet*& aSheet);
- void DidLoadStyle(nsIUnicharStreamLoader* aLoader,
+ void DidLoadStyle(nsIStreamLoader* aLoader,
nsString& aStyleData,
SheetLoadData* aLoadData,
nsresult aStatus);
@@ -599,10 +599,11 @@ CSSLoaderImpl::RecycleParser(nsICSSParser* aParser)
}
NS_IMETHODIMP
-SheetLoadData::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+SheetLoadData::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* context,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
nsString aStyleData(string, stringLen);
mLoader->DidLoadStyle(aLoader, aStyleData, this, aStatus);
@@ -791,7 +792,7 @@ CSSLoaderImpl::ParseSheet(nsIUnicharInputStream* aIn,
}
void
-CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
+CSSLoaderImpl::DidLoadStyle(nsIStreamLoader* aLoader,
nsString& aStyleData,
SheetLoadData* aLoadData,
nsresult aStatus)
@@ -1105,7 +1106,7 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
}
}
else if (mDocument || aData->mIsAgent) { // we're still live, start an async load
- nsIUnicharStreamLoader* loader;
+ nsIStreamLoader* loader;
nsIURI* urlClone;
result = aKey.mURL->Clone(&urlClone); // dont give key URL to netlib, it gets munged
if (NS_SUCCEEDED(result)) {
@@ -1115,7 +1116,7 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
nsCOMPtr loadGroup;
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
- result = NS_NewUnicharStreamLoader(&loader, urlClone, aData, loadGroup);
+ result = NS_NewStreamLoader(&loader, urlClone, aData, nsnull, loadGroup);
#ifdef NS_DEBUG
mSyncCallback = PR_FALSE;
#endif
diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
index 7a49096d7f7..5875069f1db 100644
--- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp
+++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
@@ -266,7 +266,7 @@ NS_INTERFACE_MAP_BEGIN(nsXMLContentSink)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
#endif
- NS_INTERFACE_MAP_ENTRY(nsIUnicharStreamLoaderObserver)
+ NS_INTERFACE_MAP_ENTRY(nsIStreamLoaderObserver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXMLContentSink)
NS_INTERFACE_MAP_END
@@ -1737,10 +1737,11 @@ IsJavaScriptLanguage(const nsString& aName, const char* *aVersion)
}
NS_IMETHODIMP
-nsXMLContentSink::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+nsXMLContentSink::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* context,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
nsresult rv = NS_OK;
nsString aData(string, stringLen);
@@ -1835,11 +1836,11 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
if (NS_FAILED(rv))
return rv;
- nsIUnicharStreamLoader* loader;
+ nsIStreamLoader* loader;
nsCOMPtr loadGroup;
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
- rv = NS_NewUnicharStreamLoader(&loader, url, this, loadGroup);
+ rv = NS_NewStreamLoader(&loader, url, this, nsnull, loadGroup);
NS_RELEASE(url);
if (NS_OK == rv) {
rv = NS_ERROR_HTMLPARSER_BLOCK;
diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.h b/mozilla/content/xml/document/src/nsXMLContentSink.h
index 7f2836d128b..97d408142cf 100644
--- a/mozilla/content/xml/document/src/nsXMLContentSink.h
+++ b/mozilla/content/xml/document/src/nsXMLContentSink.h
@@ -32,7 +32,7 @@
#include "nsITransformMediator.h"
#endif
#include "nsIUnicharInputStream.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
#include "nsISupportsArray.h"
class nsIDocument;
@@ -62,7 +62,7 @@ class nsXMLContentSink : public nsIXMLContentSink,
public nsIObserver,
public nsSupportsWeakReference,
#endif
- public nsIUnicharStreamLoaderObserver
+ public nsIStreamLoaderObserver
{
public:
nsXMLContentSink();
@@ -74,7 +74,7 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
// nsIContentSink
NS_IMETHOD WillBuildModel(void);
diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp
index ad4ab633c9f..6a3fd623b9c 100644
--- a/mozilla/content/xul/document/src/nsXULDocument.cpp
+++ b/mozilla/content/xul/document/src/nsXULDocument.cpp
@@ -573,8 +573,8 @@ nsXULDocument::QueryInterface(REFNSIID iid, void** result)
else if (iid.Equals(NS_GET_IID(nsISupportsWeakReference))) {
*result = NS_STATIC_CAST(nsISupportsWeakReference*, this);
}
- else if (iid.Equals(NS_GET_IID(nsIUnicharStreamLoaderObserver))) {
- *result = NS_STATIC_CAST(nsIUnicharStreamLoaderObserver*, this);
+ else if (iid.Equals(NS_GET_IID(nsIStreamLoaderObserver))) {
+ *result = NS_STATIC_CAST(nsIStreamLoaderObserver*, this);
}
else {
*result = nsnull;
@@ -4859,8 +4859,8 @@ nsXULDocument::LoadScript(nsXULPrototypeScript* aScriptProto, PRBool* aBlock)
nsCOMPtr group = do_QueryReferent(mDocumentLoadGroup);
// N.B., the loader will be released in OnUnicharStreamComplete
- nsIUnicharStreamLoader* loader;
- rv = NS_NewUnicharStreamLoader(&loader, aScriptProto->mSrcURI, this, group);
+ nsIStreamLoader* loader;
+ rv = NS_NewStreamLoader(&loader, aScriptProto->mSrcURI, this, nsnull, group);
if (NS_FAILED(rv)) return rv;
aScriptProto->mSrcLoading = PR_TRUE;
@@ -4874,10 +4874,11 @@ nsXULDocument::LoadScript(nsXULPrototypeScript* aScriptProto, PRBool* aBlock)
NS_IMETHODIMP
-nsXULDocument::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+nsXULDocument::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* context,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
// This is the completion routine that will be called when a
// transcluded script completes. Compile and execute the script
@@ -4900,7 +4901,8 @@ nsXULDocument::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
scriptProto->mSrcLoading = PR_FALSE;
if (NS_SUCCEEDED(aStatus)) {
- rv = scriptProto->Compile(string, stringLen,
+ nsString stringStr(string, stringLen);
+ rv = scriptProto->Compile(stringStr.GetUnicode(), stringLen,
scriptProto->mSrcURI, 1,
this, mMasterPrototype);
aStatus = rv;
diff --git a/mozilla/content/xul/document/src/nsXULDocument.h b/mozilla/content/xul/document/src/nsXULDocument.h
index 298c90b21b5..2cdbf130c82 100644
--- a/mozilla/content/xul/document/src/nsXULDocument.h
+++ b/mozilla/content/xul/document/src/nsXULDocument.h
@@ -59,7 +59,7 @@
#include "nsVoidArray.h"
#include "nsWeakPtr.h"
#include "nsWeakReference.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
class nsIAtom;
class nsIElementFactory;
@@ -67,7 +67,6 @@ class nsILoadGroup;
class nsIRDFResource;
class nsIRDFService;
class nsITimer;
-class nsIUnicharStreamLoader;
class nsIXULContentUtils;
class nsIXULPrototypeCache;
#if 0 // XXXbe save me, scc (need NSCAP_FORWARD_DECL(nsXULPrototypeScript))
@@ -91,7 +90,7 @@ class nsXULDocument : public nsIDocument,
public nsIJSScriptObject,
public nsIScriptObjectOwner,
public nsIHTMLContentContainer,
- public nsIUnicharStreamLoaderObserver,
+ public nsIStreamLoaderObserver,
public nsSupportsWeakReference
{
public:
@@ -100,7 +99,7 @@ public:
// nsISupports interface
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
// nsIDocument interface
virtual nsIArena* GetArena();
diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
index 4e34d08c9d0..39c41c66276 100644
--- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
@@ -29,7 +29,7 @@
#include "nsIHTMLContent.h"
#include "nsIHTMLContentContainer.h"
#include "nsIURL.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
#include "nsNetUtil.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
@@ -144,7 +144,7 @@ static PRLogModuleInfo* gSinkLogModuleInfo;
class SinkContext;
class HTMLContentSink : public nsIHTMLContentSink,
- public nsIUnicharStreamLoaderObserver,
+ public nsIStreamLoaderObserver,
public nsITimerCallback,
public nsICSSLoaderObserver,
public nsIDocumentObserver
@@ -161,7 +161,7 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
// nsIContentSink
NS_IMETHOD WillBuildModel(void);
@@ -2116,7 +2116,7 @@ HTMLContentSink::~HTMLContentSink()
NS_IMPL_ISUPPORTS6(HTMLContentSink,
nsIHTMLContentSink,
nsIContentSink,
- nsIUnicharStreamLoaderObserver,
+ nsIStreamLoaderObserver,
nsITimerCallback,
nsICSSLoaderObserver,
nsIDocumentObserver)
@@ -4038,10 +4038,11 @@ HTMLContentSink::EvaluateScript(nsString& aScript,
}
NS_IMETHODIMP
-HTMLContentSink::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+HTMLContentSink::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* aContext,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
nsresult rv = NS_OK;
nsString aData(string, stringLen);
@@ -4203,10 +4204,10 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
return rv;
nsCOMPtr loadGroup;
- nsIUnicharStreamLoader* loader;
+ nsIStreamLoader* loader;
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
- rv = NS_NewUnicharStreamLoader(&loader, url, this, loadGroup);
+ rv = NS_NewStreamLoader(&loader, url, this, nsnull, loadGroup);
NS_RELEASE(url);
if (NS_OK == rv) {
rv = NS_ERROR_HTMLPARSER_BLOCK;
diff --git a/mozilla/layout/html/style/src/nsCSSLoader.cpp b/mozilla/layout/html/style/src/nsCSSLoader.cpp
index 68dd1d5de00..44cd814c31a 100644
--- a/mozilla/layout/html/style/src/nsCSSLoader.cpp
+++ b/mozilla/layout/html/style/src/nsCSSLoader.cpp
@@ -30,7 +30,7 @@
#include "nsIStyleSheetLinkingElement.h"
#include "nsIDocument.h"
#include "nsINameSpaceManager.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
#include "nsIUnicharInputStream.h"
#include "nsHashtable.h"
@@ -153,7 +153,7 @@ public:
nsISupports* mSupports;
};
-class SheetLoadData : public nsIUnicharStreamLoaderObserver
+class SheetLoadData : public nsIStreamLoaderObserver
{
public:
virtual ~SheetLoadData(void);
@@ -170,7 +170,7 @@ public:
nsICSSLoaderObserver* aObserver);
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
CSSLoaderImpl* mLoader;
nsIURI* mURL;
@@ -197,7 +197,7 @@ public:
nsICSSLoaderObserver* mObserver;
};
-NS_IMPL_ISUPPORTS1(SheetLoadData, nsIUnicharStreamLoaderObserver);
+NS_IMPL_ISUPPORTS1(SheetLoadData, nsIStreamLoaderObserver);
MOZ_DECL_CTOR_COUNTER(PendingSheetData);
@@ -287,7 +287,7 @@ public:
nsresult ParseSheet(nsIUnicharInputStream* aIn, SheetLoadData* aLoadData,
PRBool& aCompleted, nsICSSStyleSheet*& aSheet);
- void DidLoadStyle(nsIUnicharStreamLoader* aLoader,
+ void DidLoadStyle(nsIStreamLoader* aLoader,
nsString& aStyleData,
SheetLoadData* aLoadData,
nsresult aStatus);
@@ -599,10 +599,11 @@ CSSLoaderImpl::RecycleParser(nsICSSParser* aParser)
}
NS_IMETHODIMP
-SheetLoadData::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+SheetLoadData::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* context,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
nsString aStyleData(string, stringLen);
mLoader->DidLoadStyle(aLoader, aStyleData, this, aStatus);
@@ -791,7 +792,7 @@ CSSLoaderImpl::ParseSheet(nsIUnicharInputStream* aIn,
}
void
-CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
+CSSLoaderImpl::DidLoadStyle(nsIStreamLoader* aLoader,
nsString& aStyleData,
SheetLoadData* aLoadData,
nsresult aStatus)
@@ -1105,7 +1106,7 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
}
}
else if (mDocument || aData->mIsAgent) { // we're still live, start an async load
- nsIUnicharStreamLoader* loader;
+ nsIStreamLoader* loader;
nsIURI* urlClone;
result = aKey.mURL->Clone(&urlClone); // dont give key URL to netlib, it gets munged
if (NS_SUCCEEDED(result)) {
@@ -1115,7 +1116,7 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
nsCOMPtr loadGroup;
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
- result = NS_NewUnicharStreamLoader(&loader, urlClone, aData, loadGroup);
+ result = NS_NewStreamLoader(&loader, urlClone, aData, nsnull, loadGroup);
#ifdef NS_DEBUG
mSyncCallback = PR_FALSE;
#endif
diff --git a/mozilla/layout/style/nsCSSLoader.cpp b/mozilla/layout/style/nsCSSLoader.cpp
index 68dd1d5de00..44cd814c31a 100644
--- a/mozilla/layout/style/nsCSSLoader.cpp
+++ b/mozilla/layout/style/nsCSSLoader.cpp
@@ -30,7 +30,7 @@
#include "nsIStyleSheetLinkingElement.h"
#include "nsIDocument.h"
#include "nsINameSpaceManager.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
#include "nsIUnicharInputStream.h"
#include "nsHashtable.h"
@@ -153,7 +153,7 @@ public:
nsISupports* mSupports;
};
-class SheetLoadData : public nsIUnicharStreamLoaderObserver
+class SheetLoadData : public nsIStreamLoaderObserver
{
public:
virtual ~SheetLoadData(void);
@@ -170,7 +170,7 @@ public:
nsICSSLoaderObserver* aObserver);
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
CSSLoaderImpl* mLoader;
nsIURI* mURL;
@@ -197,7 +197,7 @@ public:
nsICSSLoaderObserver* mObserver;
};
-NS_IMPL_ISUPPORTS1(SheetLoadData, nsIUnicharStreamLoaderObserver);
+NS_IMPL_ISUPPORTS1(SheetLoadData, nsIStreamLoaderObserver);
MOZ_DECL_CTOR_COUNTER(PendingSheetData);
@@ -287,7 +287,7 @@ public:
nsresult ParseSheet(nsIUnicharInputStream* aIn, SheetLoadData* aLoadData,
PRBool& aCompleted, nsICSSStyleSheet*& aSheet);
- void DidLoadStyle(nsIUnicharStreamLoader* aLoader,
+ void DidLoadStyle(nsIStreamLoader* aLoader,
nsString& aStyleData,
SheetLoadData* aLoadData,
nsresult aStatus);
@@ -599,10 +599,11 @@ CSSLoaderImpl::RecycleParser(nsICSSParser* aParser)
}
NS_IMETHODIMP
-SheetLoadData::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+SheetLoadData::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* context,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
nsString aStyleData(string, stringLen);
mLoader->DidLoadStyle(aLoader, aStyleData, this, aStatus);
@@ -791,7 +792,7 @@ CSSLoaderImpl::ParseSheet(nsIUnicharInputStream* aIn,
}
void
-CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
+CSSLoaderImpl::DidLoadStyle(nsIStreamLoader* aLoader,
nsString& aStyleData,
SheetLoadData* aLoadData,
nsresult aStatus)
@@ -1105,7 +1106,7 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
}
}
else if (mDocument || aData->mIsAgent) { // we're still live, start an async load
- nsIUnicharStreamLoader* loader;
+ nsIStreamLoader* loader;
nsIURI* urlClone;
result = aKey.mURL->Clone(&urlClone); // dont give key URL to netlib, it gets munged
if (NS_SUCCEEDED(result)) {
@@ -1115,7 +1116,7 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
nsCOMPtr loadGroup;
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
- result = NS_NewUnicharStreamLoader(&loader, urlClone, aData, loadGroup);
+ result = NS_NewStreamLoader(&loader, urlClone, aData, nsnull, loadGroup);
#ifdef NS_DEBUG
mSyncCallback = PR_FALSE;
#endif
diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
index 7a49096d7f7..5875069f1db 100644
--- a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
+++ b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
@@ -266,7 +266,7 @@ NS_INTERFACE_MAP_BEGIN(nsXMLContentSink)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
#endif
- NS_INTERFACE_MAP_ENTRY(nsIUnicharStreamLoaderObserver)
+ NS_INTERFACE_MAP_ENTRY(nsIStreamLoaderObserver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXMLContentSink)
NS_INTERFACE_MAP_END
@@ -1737,10 +1737,11 @@ IsJavaScriptLanguage(const nsString& aName, const char* *aVersion)
}
NS_IMETHODIMP
-nsXMLContentSink::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+nsXMLContentSink::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* context,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
nsresult rv = NS_OK;
nsString aData(string, stringLen);
@@ -1835,11 +1836,11 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
if (NS_FAILED(rv))
return rv;
- nsIUnicharStreamLoader* loader;
+ nsIStreamLoader* loader;
nsCOMPtr loadGroup;
mDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
- rv = NS_NewUnicharStreamLoader(&loader, url, this, loadGroup);
+ rv = NS_NewStreamLoader(&loader, url, this, nsnull, loadGroup);
NS_RELEASE(url);
if (NS_OK == rv) {
rv = NS_ERROR_HTMLPARSER_BLOCK;
diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.h b/mozilla/layout/xml/document/src/nsXMLContentSink.h
index 7f2836d128b..97d408142cf 100644
--- a/mozilla/layout/xml/document/src/nsXMLContentSink.h
+++ b/mozilla/layout/xml/document/src/nsXMLContentSink.h
@@ -32,7 +32,7 @@
#include "nsITransformMediator.h"
#endif
#include "nsIUnicharInputStream.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
#include "nsISupportsArray.h"
class nsIDocument;
@@ -62,7 +62,7 @@ class nsXMLContentSink : public nsIXMLContentSink,
public nsIObserver,
public nsSupportsWeakReference,
#endif
- public nsIUnicharStreamLoaderObserver
+ public nsIStreamLoaderObserver
{
public:
nsXMLContentSink();
@@ -74,7 +74,7 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
// nsIContentSink
NS_IMETHOD WillBuildModel(void);
diff --git a/mozilla/netwerk/base/public/Makefile.in b/mozilla/netwerk/base/public/Makefile.in
index 8007232d8f9..d6221a3419d 100644
--- a/mozilla/netwerk/base/public/Makefile.in
+++ b/mozilla/netwerk/base/public/Makefile.in
@@ -49,7 +49,7 @@ XPIDLSRCS = \
nsISocketTransportService.idl \
nsIStatusCodeEventSink.idl \
nsIFileSystem.idl \
- nsIUnicharStreamLoader.idl \
+ nsIStreamLoader.idl \
nsINetPrompt.idl \
nsISocketTransport.idl \
$(NULL)
diff --git a/mozilla/netwerk/base/public/makefile.win b/mozilla/netwerk/base/public/makefile.win
index 73c45ba07be..22494da37dd 100644
--- a/mozilla/netwerk/base/public/makefile.win
+++ b/mozilla/netwerk/base/public/makefile.win
@@ -50,7 +50,7 @@ XPIDLSRCS = \
.\nsIFileTransportService.idl \
.\nsIStatusCodeEventSink.idl \
.\nsIFileSystem.idl \
- .\nsIUnicharStreamLoader.idl \
+ .\nsIStreamLoader.idl \
.\nsINetPrompt.idl \
.\nsISocketTransport.idl \
$(NULL)
diff --git a/mozilla/netwerk/base/public/nsIStreamLoader.idl b/mozilla/netwerk/base/public/nsIStreamLoader.idl
new file mode 100644
index 00000000000..b64aa32a28e
--- /dev/null
+++ b/mozilla/netwerk/base/public/nsIStreamLoader.idl
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape 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/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All
+ * Rights Reserved.
+ *
+ * Contributor(s):
+ */
+
+#include "nsISupports.idl"
+#include "nsIChannel.idl"
+
+interface nsIURI;
+interface nsILoadGroup;
+interface nsIStreamObserver;
+interface nsIStreamLoader;
+interface nsIInterfaceRequestor;
+
+[scriptable, uuid(359F7990-D4E9-11d3-A1A5-0050041CAF44)]
+interface nsIStreamLoaderObserver : nsISupports
+{
+ void onStreamComplete(in nsIStreamLoader loader,
+ in nsISupports ctxt,
+ in nsresult status,
+ in unsigned long resultLength,
+ [size_is(resultLength)] in string result);
+};
+
+[scriptable, uuid(31d37360-8e5a-11d3-93ad-00104ba0fd40)]
+interface nsIStreamLoader : nsISupports
+{
+ void init(in nsIURI uri,
+ in nsIStreamLoaderObserver completionObserver,
+ in nsISupports ctxt,
+ in nsILoadGroup loadGroup,
+ in nsIInterfaceRequestor notificationCallbacks,
+ in nsLoadFlags loadAttributes,
+ in unsigned long bufferSegmentSize,
+ in unsigned long bufferMaxSize);
+
+ /**
+ * Gets the number of bytes read so far.
+ */
+ readonly attribute unsigned long numBytesRead;
+};
+
+%{C++
+
+#define NS_STREAMLOADER_CID \
+{ /* 5BA6D920-D4E9-11d3-A1A5-0050041CAF44 */ \
+ 0x5ba6d920, 0xd4e9, 0x11d3, { 0xa1, 0xa5, 0x0, 0x50, 0x4, 0x1c, 0xaf, 0x44 } \
+}
+
+%}
diff --git a/mozilla/netwerk/base/public/nsNetUtil.h b/mozilla/netwerk/base/public/nsNetUtil.h
index c66daa2ee75..e04933b9160 100644
--- a/mozilla/netwerk/base/public/nsNetUtil.h
+++ b/mozilla/netwerk/base/public/nsNetUtil.h
@@ -36,7 +36,7 @@
#include "nsIAllocator.h"
#include "nsCOMPtr.h"
#include "nsIHTTPProtocolHandler.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
inline nsresult
NS_NewURI(nsIURI* *result, const char* spec, nsIURI* baseURI = nsnull)
@@ -86,6 +86,12 @@ NS_OpenURI(nsIChannel* *result, nsIURI* uri, nsILoadGroup *aGroup,
return rv;
}
+// Use this function with CAUTION. And do not use it on
+// the UI thread. It creates a stream that blocks when
+// you Read() from it and blocking the UI thread is
+// illegal. If you don't want to implement a full
+// blown asyncrhonous consumer (via nsIStreamListener)
+// look at nsIStreamLoader instead.
inline nsresult
NS_OpenURI(nsIInputStream* *result, nsIURI* uri)
{
@@ -229,24 +235,25 @@ NS_NewLoadGroup(nsIStreamObserver* obs, nsILoadGroup* *result)
inline nsresult
-NS_NewUnicharStreamLoader(nsIUnicharStreamLoader* *result,
- nsIURI* uri,
- nsIUnicharStreamLoaderObserver* observer,
- nsILoadGroup* loadGroup = nsnull,
- nsIInterfaceRequestor* notificationCallbacks = nsnull,
- nsLoadFlags loadAttributes = nsIChannel::LOAD_NORMAL,
- PRUint32 bufferSegmentSize = 0,
- PRUint32 bufferMaxSize = 0)
+NS_NewStreamLoader(nsIStreamLoader* *result,
+ nsIURI* uri,
+ nsIStreamLoaderObserver* observer,
+ nsISupports* context = nsnull,
+ nsILoadGroup* loadGroup = nsnull,
+ nsIInterfaceRequestor* notificationCallbacks = nsnull,
+ nsLoadFlags loadAttributes = nsIChannel::LOAD_NORMAL,
+ PRUint32 bufferSegmentSize = 0,
+ PRUint32 bufferMaxSize = 0)
{
nsresult rv;
- nsCOMPtr loader;
- static NS_DEFINE_CID(kUnicharStreamLoaderCID, NS_UNICHARSTREAMLOADER_CID);
- rv = nsComponentManager::CreateInstance(kUnicharStreamLoaderCID,
+ nsCOMPtr loader;
+ static NS_DEFINE_CID(kStreamLoaderCID, NS_STREAMLOADER_CID);
+ rv = nsComponentManager::CreateInstance(kStreamLoaderCID,
nsnull,
- NS_GET_IID(nsIUnicharStreamLoader),
+ NS_GET_IID(nsIStreamLoader),
getter_AddRefs(loader));
if (NS_FAILED(rv)) return rv;
- rv = loader->Init(uri, observer, loadGroup, notificationCallbacks, loadAttributes,
+ rv = loader->Init(uri, observer, context, loadGroup, notificationCallbacks, loadAttributes,
bufferSegmentSize, bufferMaxSize);
if (NS_FAILED(rv)) return rv;
*result = loader;
diff --git a/mozilla/netwerk/base/src/Makefile.in b/mozilla/netwerk/base/src/Makefile.in
index d24a3005812..d8ebb9ce477 100644
--- a/mozilla/netwerk/base/src/Makefile.in
+++ b/mozilla/netwerk/base/src/Makefile.in
@@ -45,7 +45,7 @@ CPPSRCS = \
nsLoadGroup.cpp \
nsInputStreamChannel.cpp \
nsDirectoryIndexStream.cpp \
- nsUnicharStreamLoader.cpp \
+ nsStreamLoader.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a
diff --git a/mozilla/netwerk/base/src/makefile.win b/mozilla/netwerk/base/src/makefile.win
index bec646f4188..043d2c79553 100644
--- a/mozilla/netwerk/base/src/makefile.win
+++ b/mozilla/netwerk/base/src/makefile.win
@@ -43,7 +43,7 @@ CPP_OBJS = \
.\$(OBJDIR)\nsLoadGroup.obj \
.\$(OBJDIR)\nsInputStreamChannel.obj \
.\$(OBJDIR)\nsDirectoryIndexStream.obj \
- .\$(OBJDIR)\nsUnicharStreamLoader.obj \
+ .\$(OBJDIR)\nsStreamLoader.obj \
$(NULL)
INCS = $(INCS) \
diff --git a/mozilla/netwerk/base/src/nsStreamLoader.cpp b/mozilla/netwerk/base/src/nsStreamLoader.cpp
new file mode 100644
index 00000000000..61ffd4fde8b
--- /dev/null
+++ b/mozilla/netwerk/base/src/nsStreamLoader.cpp
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape 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/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All
+ * Rights Reserved.
+ *
+ * Contributor(s):
+ */
+
+#include "nsStreamLoader.h"
+#include "nsIInputStream.h"
+#include "nsIURL.h"
+#include "nsNetUtil.h"
+#include "nsIChannel.h"
+#include "nsIServiceManager.h"
+#include "nsIIOService.h"
+
+static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
+
+NS_IMETHODIMP
+nsStreamLoader::Init(nsIURI* aURL,
+ nsIStreamLoaderObserver* observer,
+ nsISupports* context,
+ nsILoadGroup* aGroup,
+ nsIInterfaceRequestor* notificationCallbacks,
+ nsLoadFlags loadAttributes,
+ PRUint32 bufferSegmentSize,
+ PRUint32 bufferMaxSize)
+{
+ nsresult rv = NS_OK;
+ mObserver = observer;
+ mContext = context;
+
+ NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
+ if (NS_FAILED(rv)) return rv;
+
+ nsCOMPtr channel;
+ rv = serv->NewChannelFromURI("load", aURL, aGroup, notificationCallbacks,
+ loadAttributes, nsnull,
+ bufferSegmentSize, bufferMaxSize, getter_AddRefs(channel));
+ if (NS_FAILED(rv)) return rv;
+
+ rv = channel->AsyncRead(0, -1, nsnull, this);
+
+ if (NS_FAILED(rv) && mObserver) {
+ nsresult rv2 = mObserver->OnStreamComplete(this, mContext, rv,
+ mData.Length(),
+ mData.GetBuffer());
+ if (NS_FAILED(rv2))
+ rv = rv2; // take the user's error instead
+ }
+
+ return rv;
+}
+
+NS_METHOD
+nsStreamLoader::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
+{
+ if (aOuter) return NS_ERROR_NO_AGGREGATION;
+
+ nsStreamLoader* it = new nsStreamLoader();
+ if (it == nsnull)
+ return NS_ERROR_OUT_OF_MEMORY;
+ NS_ADDREF(it);
+ nsresult rv = it->QueryInterface(aIID, aResult);
+ NS_RELEASE(it);
+ return rv;
+}
+
+NS_IMPL_ISUPPORTS3(nsStreamLoader, nsIStreamLoader,
+ nsIStreamObserver, nsIStreamListener)
+
+NS_IMETHODIMP
+nsStreamLoader::GetNumBytesRead(PRUint32* aNumBytes)
+{
+ if (!mData.IsEmpty()) {
+ *aNumBytes = mData.Length();
+ }
+ else {
+ *aNumBytes = 0;
+ }
+
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsStreamLoader::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
+{
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsStreamLoader::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
+ nsresult status, const PRUnichar *errorMsg)
+{
+ nsresult rv = mObserver->OnStreamComplete(this, mContext, status,
+ mData.Length(),
+ mData.GetBuffer());
+ return rv;
+}
+
+#define BUF_SIZE 1024
+
+NS_IMETHODIMP
+nsStreamLoader::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
+ nsIInputStream *inStr,
+ PRUint32 sourceOffset, PRUint32 count)
+{
+ nsresult rv = NS_OK;
+ char buffer[BUF_SIZE];
+ PRUint32 len, lenRead;
+
+ inStr->Available(&len);
+
+ while (len > 0) {
+ if (len < BUF_SIZE) {
+ lenRead = len;
+ }
+ else {
+ lenRead = BUF_SIZE;
+ }
+
+ rv = inStr->Read(buffer, lenRead, &lenRead);
+ if (NS_FAILED(rv) || lenRead == 0) {
+ return rv;
+ }
+
+ mData.Append(buffer, lenRead);
+ len -= lenRead;
+ }
+
+ return rv;
+}
diff --git a/mozilla/netwerk/base/src/nsStreamLoader.h b/mozilla/netwerk/base/src/nsStreamLoader.h
new file mode 100644
index 00000000000..450b8651bfa
--- /dev/null
+++ b/mozilla/netwerk/base/src/nsStreamLoader.h
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape 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/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All
+ * Rights Reserved.
+ *
+ * Contributor(s):
+ */
+
+#ifndef nsStreamLoader_h__
+#define nsStreamLoader_h__
+
+#include "nsIStreamLoader.h"
+#include "nsIStreamListener.h"
+#include "nsCOMPtr.h"
+#include "nsString.h"
+
+class nsStreamLoader : public nsIStreamLoader,
+ public nsIStreamListener
+{
+public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSISTREAMLOADER
+ NS_DECL_NSISTREAMOBSERVER
+ NS_DECL_NSISTREAMLISTENER
+
+ nsStreamLoader() { NS_INIT_REFCNT();} ;
+ virtual ~nsStreamLoader() {};
+
+ static NS_METHOD
+ Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
+
+protected:
+ nsCOMPtr mObserver;
+ nsCOMPtr mContext; // the observer's context
+ nsCString mData;
+/// nsCOMPtr mLoadGroup;
+};
+
+#endif // nsStreamLoader_h__
diff --git a/mozilla/netwerk/build/nsNetModule.cpp b/mozilla/netwerk/build/nsNetModule.cpp
index cbcdcf3339c..b02c98a3920 100644
--- a/mozilla/netwerk/build/nsNetModule.cpp
+++ b/mozilla/netwerk/build/nsNetModule.cpp
@@ -35,7 +35,7 @@
#include "nsDnsService.h"
#include "nsLoadGroup.h"
#include "nsInputStreamChannel.h"
-#include "nsUnicharStreamLoader.h"
+#include "nsStreamLoader.h"
#include "nsAsyncStreamListener.h"
#include "nsSyncStreamListener.h"
#include "nsFileStreams.h"
@@ -81,9 +81,9 @@ static nsModuleComponentInfo gNetModuleInfo[] = {
"component://netscape/network/input-stream-channel",
nsInputStreamChannel::Create },
{ "Unichar Stream Loader",
- NS_UNICHARSTREAMLOADER_CID,
- "component://netscape/network/unichar-stream-loader",
- nsUnicharStreamLoader::Create },
+ NS_STREAMLOADER_CID,
+ "component://netscape/network/stream-loader",
+ nsStreamLoader::Create },
{ "Async Stream Observer",
NS_ASYNCSTREAMOBSERVER_CID,
"component://netscape/network/async-stream-observer",
diff --git a/mozilla/rdf/content/src/nsXULDocument.cpp b/mozilla/rdf/content/src/nsXULDocument.cpp
index ad4ab633c9f..6a3fd623b9c 100644
--- a/mozilla/rdf/content/src/nsXULDocument.cpp
+++ b/mozilla/rdf/content/src/nsXULDocument.cpp
@@ -573,8 +573,8 @@ nsXULDocument::QueryInterface(REFNSIID iid, void** result)
else if (iid.Equals(NS_GET_IID(nsISupportsWeakReference))) {
*result = NS_STATIC_CAST(nsISupportsWeakReference*, this);
}
- else if (iid.Equals(NS_GET_IID(nsIUnicharStreamLoaderObserver))) {
- *result = NS_STATIC_CAST(nsIUnicharStreamLoaderObserver*, this);
+ else if (iid.Equals(NS_GET_IID(nsIStreamLoaderObserver))) {
+ *result = NS_STATIC_CAST(nsIStreamLoaderObserver*, this);
}
else {
*result = nsnull;
@@ -4859,8 +4859,8 @@ nsXULDocument::LoadScript(nsXULPrototypeScript* aScriptProto, PRBool* aBlock)
nsCOMPtr group = do_QueryReferent(mDocumentLoadGroup);
// N.B., the loader will be released in OnUnicharStreamComplete
- nsIUnicharStreamLoader* loader;
- rv = NS_NewUnicharStreamLoader(&loader, aScriptProto->mSrcURI, this, group);
+ nsIStreamLoader* loader;
+ rv = NS_NewStreamLoader(&loader, aScriptProto->mSrcURI, this, nsnull, group);
if (NS_FAILED(rv)) return rv;
aScriptProto->mSrcLoading = PR_TRUE;
@@ -4874,10 +4874,11 @@ nsXULDocument::LoadScript(nsXULPrototypeScript* aScriptProto, PRBool* aBlock)
NS_IMETHODIMP
-nsXULDocument::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
- nsresult aStatus,
- PRUint32 stringLen,
- const PRUnichar* string)
+nsXULDocument::OnStreamComplete(nsIStreamLoader* aLoader,
+ nsISupports* context,
+ nsresult aStatus,
+ PRUint32 stringLen,
+ const char* string)
{
// This is the completion routine that will be called when a
// transcluded script completes. Compile and execute the script
@@ -4900,7 +4901,8 @@ nsXULDocument::OnUnicharStreamComplete(nsIUnicharStreamLoader* aLoader,
scriptProto->mSrcLoading = PR_FALSE;
if (NS_SUCCEEDED(aStatus)) {
- rv = scriptProto->Compile(string, stringLen,
+ nsString stringStr(string, stringLen);
+ rv = scriptProto->Compile(stringStr.GetUnicode(), stringLen,
scriptProto->mSrcURI, 1,
this, mMasterPrototype);
aStatus = rv;
diff --git a/mozilla/rdf/content/src/nsXULDocument.h b/mozilla/rdf/content/src/nsXULDocument.h
index 298c90b21b5..2cdbf130c82 100644
--- a/mozilla/rdf/content/src/nsXULDocument.h
+++ b/mozilla/rdf/content/src/nsXULDocument.h
@@ -59,7 +59,7 @@
#include "nsVoidArray.h"
#include "nsWeakPtr.h"
#include "nsWeakReference.h"
-#include "nsIUnicharStreamLoader.h"
+#include "nsIStreamLoader.h"
class nsIAtom;
class nsIElementFactory;
@@ -67,7 +67,6 @@ class nsILoadGroup;
class nsIRDFResource;
class nsIRDFService;
class nsITimer;
-class nsIUnicharStreamLoader;
class nsIXULContentUtils;
class nsIXULPrototypeCache;
#if 0 // XXXbe save me, scc (need NSCAP_FORWARD_DECL(nsXULPrototypeScript))
@@ -91,7 +90,7 @@ class nsXULDocument : public nsIDocument,
public nsIJSScriptObject,
public nsIScriptObjectOwner,
public nsIHTMLContentContainer,
- public nsIUnicharStreamLoaderObserver,
+ public nsIStreamLoaderObserver,
public nsSupportsWeakReference
{
public:
@@ -100,7 +99,7 @@ public:
// nsISupports interface
NS_DECL_ISUPPORTS
- NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
+ NS_DECL_NSISTREAMLOADEROBSERVER
// nsIDocument interface
virtual nsIArena* GetArena();
diff --git a/mozilla/xpcom/base/IIDS.h b/mozilla/xpcom/base/IIDS.h
index a28a7b11ee5..6f0f816ae9b 100644
--- a/mozilla/xpcom/base/IIDS.h
+++ b/mozilla/xpcom/base/IIDS.h
@@ -842,12 +842,6 @@ nsFrameUtil_CID = { /* a6cf90d7-15b3-11d2-932e-00805f8add32 */
0x11d2,
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}
};
-nsIUnicharStreamLoader = { /* a6cf90d8-15b3-11d2-932e-00805f8add32 */
- 0xa6cf90d8,
- 0x15b3,
- 0x11d2,
- {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}
- };
nsIScriptNameSetRegistry = { /* a6cf90d9-15b3-11d2-932e-00805f8add32 */
0xa6cf90d9,
0x15b3,