зеркало из https://github.com/mozilla/gecko-dev.git
fixing code that relied on implicit string construction
This commit is contained in:
Родитель
aae8dfd4db
Коммит
3f0620d231
|
@ -184,8 +184,7 @@ nsEvaluateStringProxy::BringUpConsole()
|
|||
|
||||
// Next, find out whether there's a console already open.
|
||||
nsCOMPtr<nsIDOMWindow> console;
|
||||
nsAutoString windowType = NS_LITERAL_STRING("global:console");
|
||||
rv = windowMediator->GetMostRecentWindow(windowType.GetUnicode(),
|
||||
rv = windowMediator->GetMostRecentWindow(NS_LITERAL_STRING("global:console"),
|
||||
getter_AddRefs(console));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ nsSimpleURI::SetScheme(const char* scheme)
|
|||
NS_IMETHODIMP
|
||||
nsSimpleURI::GetPrePath(char* *result)
|
||||
{
|
||||
nsCAutoString prePath = mScheme;
|
||||
nsCAutoString prePath(mScheme);
|
||||
prePath += ":";
|
||||
*result = prePath.ToNewCString();
|
||||
return *result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
|
|
|
@ -96,7 +96,7 @@ nsMIMEInfoImpl::FirstExtension(char **_retval) {
|
|||
|
||||
NS_IMETHODIMP nsMIMEInfoImpl::AppendExtension(const char *aExtension)
|
||||
{
|
||||
mExtensions.AppendCString( aExtension );
|
||||
mExtensions.AppendCString( nsCString(aExtension) );
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ nsXMLMIMEDataSource::AddMapping(const char* mimeType,
|
|||
nsMIMEInfoImpl* anInfo = new nsMIMEInfoImpl(mimeType);
|
||||
if (!anInfo) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
anInfo->mExtensions.AppendCString(extension);
|
||||
anInfo->mExtensions.AppendCString(nsCString(extension));
|
||||
anInfo->mDescription.AssignWithConversion(description);
|
||||
anInfo->mURI = dataURI;
|
||||
|
||||
|
@ -233,7 +233,7 @@ nsXMLMIMEDataSource::AppendExtension(const char* mimeType, const char* extension
|
|||
nsMIMEInfoImpl* info = (nsMIMEInfoImpl*)mInfoObjects->Get(&key);
|
||||
if (!info) return NS_ERROR_FAILURE;
|
||||
|
||||
info->mExtensions.AppendCString(extension);
|
||||
info->mExtensions.AppendCString(nsCString(extension));
|
||||
|
||||
// Add another file extension mapping.
|
||||
key = extension;
|
||||
|
@ -255,7 +255,7 @@ nsXMLMIMEDataSource::RemoveExtension(const char* aExtension) {
|
|||
|
||||
// Next remove the root MIME mapping from the array and hash
|
||||
// IFF this was the only file extension mapping left.
|
||||
PRBool removed = info->mExtensions.RemoveCString(aExtension);
|
||||
PRBool removed = info->mExtensions.RemoveCString(nsCString(aExtension));
|
||||
NS_ASSERTION(removed, "mapping problem");
|
||||
|
||||
if (info->GetExtCount() == 0) {
|
||||
|
|
|
@ -38,7 +38,7 @@ nsAboutBlank::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
nsISupports* s;
|
||||
rv = NS_NewCStringInputStream(&s, kBlankPage);
|
||||
rv = NS_NewCStringInputStream(&s, nsCString(kBlankPage));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsIInputStream* in;
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
|
||||
nsCOMPtr<nsISupports> s;
|
||||
const char* msg = "Bloat statistics cleared.";
|
||||
rv = NS_NewCStringInputStream(getter_AddRefs(s), msg);
|
||||
rv = NS_NewCStringInputStream(getter_AddRefs(s), nsCString(msg));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
size = nsCRT::strlen(msg);
|
||||
|
@ -88,7 +88,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
|
||||
nsCOMPtr<nsISupports> s;
|
||||
const char* msg = "Memory leaks dumped.";
|
||||
rv = NS_NewCStringInputStream(getter_AddRefs(s), msg);
|
||||
rv = NS_NewCStringInputStream(getter_AddRefs(s), nsCString(msg));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
size = nsCRT::strlen(msg);
|
||||
|
|
|
@ -1066,7 +1066,7 @@ nsHTTPChannel::CheckCache()
|
|||
if (header) {
|
||||
PRInt32 offset;
|
||||
|
||||
nsCAutoString cacheControlHeader = (const char*)header;
|
||||
nsCAutoString cacheControlHeader(NS_STATIC_CAST(const char*, header));
|
||||
offset = cacheControlHeader.Find("must-revalidate", PR_TRUE);
|
||||
if (offset != kNotFound)
|
||||
mustRevalidate = PR_TRUE;
|
||||
|
@ -1258,7 +1258,7 @@ nsHTTPChannel::CacheReceivedResponse(nsIStreamListener *aListener,
|
|||
if (header) {
|
||||
PRInt32 offset;
|
||||
|
||||
nsCAutoString cacheControlHeader = (const char*)header;
|
||||
nsCAutoString cacheControlHeader(NS_STATIC_CAST(const char*, header));
|
||||
offset = cacheControlHeader.Find("no-store", PR_TRUE);
|
||||
if (offset != kNotFound)
|
||||
return NS_OK;
|
||||
|
@ -1271,7 +1271,7 @@ nsHTTPChannel::CacheReceivedResponse(nsIStreamListener *aListener,
|
|||
if (header) {
|
||||
PRInt32 offset;
|
||||
|
||||
nsCAutoString pragmaHeader = (const char*)header;
|
||||
nsCAutoString pragmaHeader(NS_STATIC_CAST(const char*, header));
|
||||
offset = pragmaHeader.Find("no-cache", PR_TRUE);
|
||||
if (offset != kNotFound)
|
||||
return NS_OK;
|
||||
|
@ -1775,7 +1775,7 @@ nsresult nsHTTPChannel::ResponseCompleted(nsIStreamListener *aListener,
|
|||
if (header) {
|
||||
PRInt32 offset;
|
||||
|
||||
nsCAutoString cacheControlHeader = (const char*)header;
|
||||
nsCAutoString cacheControlHeader(NS_STATIC_CAST(const char*, header));
|
||||
offset = cacheControlHeader.Find("no-store", PR_TRUE);
|
||||
if (offset != kNotFound) {
|
||||
if (mCacheEntry)
|
||||
|
@ -1792,7 +1792,7 @@ nsresult nsHTTPChannel::ResponseCompleted(nsIStreamListener *aListener,
|
|||
if (header) {
|
||||
PRInt32 offset;
|
||||
|
||||
nsCAutoString pragmaHeader = (const char*)header;
|
||||
nsCAutoString pragmaHeader(NS_STATIC_CAST(const char*, header));
|
||||
offset = pragmaHeader.Find("no-cache", PR_TRUE);
|
||||
if (offset != kNotFound) {
|
||||
if (mCacheEntry)
|
||||
|
|
|
@ -314,7 +314,7 @@ nsHTTPHandler::NewPostDataStream(PRBool isFile,
|
|||
}
|
||||
else {
|
||||
nsCOMPtr<nsISupports> in;
|
||||
rv = NS_NewCStringInputStream(getter_AddRefs(in), data);
|
||||
rv = NS_NewCStringInputStream(getter_AddRefs(in), nsCString(data));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = in->QueryInterface(NS_GET_IID(nsIInputStream),(void**)result);
|
||||
|
|
|
@ -96,7 +96,7 @@ nsMIMEInfoImpl::FirstExtension(char **_retval) {
|
|||
|
||||
NS_IMETHODIMP nsMIMEInfoImpl::AppendExtension(const char *aExtension)
|
||||
{
|
||||
mExtensions.AppendCString( aExtension );
|
||||
mExtensions.AppendCString( nsCString(aExtension) );
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче