From ba09080b75a63ad132a1bc2e1cebafd58ae4b1ed Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Tue, 29 Jun 1999 21:48:35 +0000 Subject: [PATCH] NECKO - nsWebShell: we were getting a unichar string back from GetBuffer(); changed it to ToNewCString(). nsDocLoader: trying to get a regular url to load. git-svn-id: svn://10.0.0.236/trunk@37478 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 3 ++- mozilla/uriloader/base/nsDocLoader.cpp | 10 +++------- mozilla/webshell/src/nsDocLoader.cpp | 10 +++------- mozilla/webshell/src/nsWebShell.cpp | 3 ++- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 1e479960505..6f90cffc07a 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1755,8 +1755,9 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec, if (NS_FAILED(rv)) return rv; nsIURI *uri = nsnull; - const char *uriSpec = aUrlSpec.GetBuffer(); + char *uriSpec = aUrlSpec.ToNewCString(); rv = service->NewURI(uriSpec, nsnull, &uri); + nsCRT::free(uriSpec); if (NS_FAILED(rv)) return rv; rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url); diff --git a/mozilla/uriloader/base/nsDocLoader.cpp b/mozilla/uriloader/base/nsDocLoader.cpp index 5be8783e059..fb348c938a3 100644 --- a/mozilla/uriloader/base/nsDocLoader.cpp +++ b/mozilla/uriloader/base/nsDocLoader.cpp @@ -1495,11 +1495,7 @@ nsresult nsDocumentBindInfo::Bind(const nsString& aURLSpec, * the nsISupports pointer so the backend can have access to the front * end nsIContentViewerContainer for refreshing urls. */ -#ifndef NECKO rv = m_DocLoader->CreateURL(&url, nsnull, aURLSpec, m_Container); -#else - rv = NS_ERROR_NULL_POINTER; -#endif // NECKO if (NS_FAILED(rv)) { return rv; } @@ -1532,7 +1528,7 @@ nsresult nsDocumentBindInfo::Bind(const nsString& aURLSpec, */ #ifdef NECKO // m_DocLoader->SetDocumentChannel(channel); - NS_ASSERTION(0, "help"); + //NS_ASSERTION(0, "help"); #else m_DocLoader->SetDocumentUrl(url); #endif @@ -1787,8 +1783,9 @@ nsDocumentBindInfo::OnStartBinding(nsIURI* aURL, const char *aContentType) nsCOMPtr aURL; rv = channel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(rv)) return rv; - char* aContentType; + char* aContentType = nsnull; channel->GetContentType(&aContentType); + aContentType = "text/html"; #endif // NECKO #if defined(DEBUG) @@ -1804,7 +1801,6 @@ nsDocumentBindInfo::OnStartBinding(nsIURI* aURL, const char *aContentType) this, spec, aContentType)); #ifdef NECKO nsCRT::free(spec); - nsCRT::free(aContentType); #endif // NECKO #endif /* DEBUG */ diff --git a/mozilla/webshell/src/nsDocLoader.cpp b/mozilla/webshell/src/nsDocLoader.cpp index 5be8783e059..fb348c938a3 100644 --- a/mozilla/webshell/src/nsDocLoader.cpp +++ b/mozilla/webshell/src/nsDocLoader.cpp @@ -1495,11 +1495,7 @@ nsresult nsDocumentBindInfo::Bind(const nsString& aURLSpec, * the nsISupports pointer so the backend can have access to the front * end nsIContentViewerContainer for refreshing urls. */ -#ifndef NECKO rv = m_DocLoader->CreateURL(&url, nsnull, aURLSpec, m_Container); -#else - rv = NS_ERROR_NULL_POINTER; -#endif // NECKO if (NS_FAILED(rv)) { return rv; } @@ -1532,7 +1528,7 @@ nsresult nsDocumentBindInfo::Bind(const nsString& aURLSpec, */ #ifdef NECKO // m_DocLoader->SetDocumentChannel(channel); - NS_ASSERTION(0, "help"); + //NS_ASSERTION(0, "help"); #else m_DocLoader->SetDocumentUrl(url); #endif @@ -1787,8 +1783,9 @@ nsDocumentBindInfo::OnStartBinding(nsIURI* aURL, const char *aContentType) nsCOMPtr aURL; rv = channel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(rv)) return rv; - char* aContentType; + char* aContentType = nsnull; channel->GetContentType(&aContentType); + aContentType = "text/html"; #endif // NECKO #if defined(DEBUG) @@ -1804,7 +1801,6 @@ nsDocumentBindInfo::OnStartBinding(nsIURI* aURL, const char *aContentType) this, spec, aContentType)); #ifdef NECKO nsCRT::free(spec); - nsCRT::free(aContentType); #endif // NECKO #endif /* DEBUG */ diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 1e479960505..6f90cffc07a 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -1755,8 +1755,9 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec, if (NS_FAILED(rv)) return rv; nsIURI *uri = nsnull; - const char *uriSpec = aUrlSpec.GetBuffer(); + char *uriSpec = aUrlSpec.ToNewCString(); rv = service->NewURI(uriSpec, nsnull, &uri); + nsCRT::free(uriSpec); if (NS_FAILED(rv)) return rv; rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);