зеркало из https://github.com/mozilla/gecko-dev.git
Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=dbaron, rs=scc
This commit is contained in:
Родитель
71afc6ad07
Коммит
06f4e59853
|
@ -198,7 +198,7 @@ nsFingerChannel::Open(nsIInputStream **_retval)
|
|||
do_GetService(kSocketTransportServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = socketService->CreateTransport(mHost, mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
rv = socketService->CreateTransport(mHost.get(), mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
BUFFER_MAX_SIZE, getter_AddRefs(mTransport));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
@ -221,7 +221,7 @@ nsFingerChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports *ctxt)
|
|||
do_GetService(kSocketTransportServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = socketService->CreateTransport(mHost, mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
rv = socketService->CreateTransport(mHost.get(), mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
BUFFER_MAX_SIZE, getter_AddRefs(mTransport));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ nsJARURI::FormatSpec(const char* entryPath, char* *result)
|
|||
spec += NS_JAR_DELIMITER;
|
||||
spec += entryPath;
|
||||
|
||||
*result = nsCRT::strdup(spec);
|
||||
*result = ToNewCString(spec);
|
||||
return *result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ nsJARURI::SetSpec(const char * aSpec)
|
|||
jarPath.Cut(pos, jarPath.Length());
|
||||
jarPath.Cut(0, endPos);
|
||||
|
||||
rv = serv->NewURI(jarPath, nsnull, getter_AddRefs(mJARFile));
|
||||
rv = serv->NewURI(jarPath.get(), nsnull, getter_AddRefs(mJARFile));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCAutoString entry(aSpec);
|
||||
|
@ -155,7 +155,7 @@ nsJARURI::SetSpec(const char * aSpec)
|
|||
while (entry.CharAt(0) == '/')
|
||||
entry.Cut(0,1); // Strip any additional leading slashes from entry path
|
||||
|
||||
rv = serv->ResolveRelativePath(entry, nsnull, &mJAREntry);
|
||||
rv = serv->ResolveRelativePath(entry.get(), nsnull, &mJAREntry);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -341,9 +341,7 @@ nsFileTransport::Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult)
|
|||
NS_IMETHODIMP
|
||||
nsFileTransport::GetName(PRUnichar* *result)
|
||||
{
|
||||
nsAutoString name;
|
||||
name.AppendWithConversion(mStreamName);
|
||||
*result = ToNewUnicode(name);
|
||||
*result = ToNewUnicode(mStreamName);
|
||||
return *result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -847,11 +845,9 @@ nsFileTransport::Process(void)
|
|||
saveListener = 0;
|
||||
}
|
||||
if (mProgressSink) {
|
||||
nsAutoString fileName;
|
||||
fileName.AssignWithConversion(mStreamName);
|
||||
mProgressSink->OnStatus(this, saveContext,
|
||||
NS_NET_STATUS_READ_FROM,
|
||||
fileName.get());
|
||||
NS_ConvertASCIItoUCS2(mStreamName).get());
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1015,10 +1011,9 @@ nsFileTransport::Process(void)
|
|||
mProvider = 0;
|
||||
}
|
||||
if (mProgressSink) {
|
||||
nsAutoString fileName; fileName.AssignWithConversion(mStreamName);
|
||||
nsresult rv = mProgressSink->OnStatus(this, mContext,
|
||||
NS_NET_STATUS_WROTE_TO,
|
||||
fileName.get());
|
||||
NS_ConvertASCIItoUCS2(mStreamName).get());
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unexpected OnStatus failure");
|
||||
}
|
||||
mContext = 0;
|
||||
|
|
|
@ -1205,7 +1205,7 @@ nsStdURL::GetFile(nsIFile * *aFile)
|
|||
path.Cut(0, 1);
|
||||
#endif
|
||||
nsCOMPtr<nsILocalFile> localFile;
|
||||
rv = NS_NewLocalFile(path, PR_FALSE, getter_AddRefs(localFile));
|
||||
rv = NS_NewLocalFile(path.get(), PR_FALSE, getter_AddRefs(localFile));
|
||||
|
||||
mFile = localFile;
|
||||
*aFile = mFile;
|
||||
|
|
|
@ -211,7 +211,7 @@ NS_IMETHODIMP nsMIMEInfoImpl::SetFileExtensions( const char* aExtensions )
|
|||
PRInt32 breakLocation = -1;
|
||||
while ( (breakLocation= extList.FindCharInSet( ",",0 ) )!= -1)
|
||||
{
|
||||
nsCString ext( extList, breakLocation );
|
||||
nsCString ext( extList.get(), breakLocation );
|
||||
mExtensions.AppendCString( ext );
|
||||
extList.Cut(0, breakLocation+1 );
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ void nsMIMEInfoImpl::SetRememberPrefForMimeType(const char * prefName)
|
|||
|
||||
// always escape the pref b4 storing it in case someone enters some funky characters for a mime type...
|
||||
nsXPIDLCString escapedPrefString;
|
||||
*((char **)getter_Copies(escapedPrefString)) = nsEscape(prefValue, url_XAlphas);
|
||||
escapedPrefString.Adopt(nsEscape(prefValue.get(), url_XAlphas));
|
||||
prefBranch->SetCharPref(prefName, escapedPrefString);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,6 +232,6 @@ NS_IMETHODIMP nsMIMEService::GetTypeFromFile( nsIFile* aFile, char **aContentTyp
|
|||
// Windows, unix and mac when no type match occured.
|
||||
|
||||
|
||||
return GetTypeFromExtension( fileExt, aContentType );
|
||||
return GetTypeFromExtension( fileExt.get(), aContentType );
|
||||
}
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ nsXMLMIMEDataSource::Serialize() {
|
|||
PRUint32 bytesWritten;
|
||||
PRBool more;
|
||||
|
||||
rv = stream->Write( buffer , buffer.Length(), &bytesWritten );
|
||||
rv = stream->Write( buffer.get() , buffer.Length(), &bytesWritten );
|
||||
|
||||
while ( NS_SUCCEEDED( enumerator->HasMoreElements(& more ) )&& more )
|
||||
{
|
||||
|
@ -403,7 +403,7 @@ nsXMLMIMEDataSource::Serialize() {
|
|||
|
||||
buffer+="/>\r";
|
||||
|
||||
rv = stream->Write( buffer , buffer.Length(), &bytesWritten );
|
||||
rv = stream->Write( buffer.get() , buffer.Length(), &bytesWritten );
|
||||
|
||||
if ( NS_FAILED( rv ) )
|
||||
return rv;
|
||||
|
@ -655,29 +655,29 @@ static nsresult AddAttribute( nsIMIMEInfo* inElement, nsCString& inAttribute, ns
|
|||
nsresult rv = NS_OK;
|
||||
if ( inAttribute == nsDependentCString(kMIMEType) )
|
||||
{
|
||||
rv = inElement->SetMIMEType( inValue );
|
||||
rv = inElement->SetMIMEType( inValue.get() );
|
||||
}
|
||||
else if ( inAttribute == nsDependentCString(kDescription) )
|
||||
{
|
||||
PRUnichar* unicode;
|
||||
convertUTF8ToUnicode( inValue, &unicode );
|
||||
convertUTF8ToUnicode( inValue.get(), &unicode );
|
||||
rv =inElement->SetDescription( unicode );
|
||||
nsTextFormatter::smprintf_free(unicode);
|
||||
}
|
||||
else if ( inAttribute == nsDependentCString(kExtensions) )
|
||||
{
|
||||
rv = inElement->SetFileExtensions( inValue );
|
||||
rv = inElement->SetFileExtensions( inValue.get() );
|
||||
}
|
||||
else if ( inAttribute == nsDependentCString(kMacType) )
|
||||
{
|
||||
PRUint32 value;
|
||||
sscanf ( inValue, "%x", &value);
|
||||
sscanf ( inValue.get(), "%x", &value);
|
||||
rv = inElement->SetMacType( value );
|
||||
}
|
||||
else if ( inAttribute == nsDependentCString(kMacCreator) )
|
||||
{
|
||||
PRUint32 value;
|
||||
sscanf ( inValue, "%x", &value);
|
||||
sscanf ( inValue.get(), "%x", &value);
|
||||
rv = inElement->SetMacCreator( value );
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
char time[128];
|
||||
PR_FormatTimeUSEnglish(time, 128, "%Y-%m-%d-%H%M%S.txt", &expTime);
|
||||
dumpFileName += time;
|
||||
rv = file->Append((const char*)dumpFileName);
|
||||
rv = file->Append(dumpFileName.get());
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
char* nativePath;
|
||||
|
|
|
@ -121,7 +121,7 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
"<head>\n<title>Information about the Cache Service</title>\n</head>\n"
|
||||
"<body>\n<div>\n");
|
||||
|
||||
outputStream->Write(mBuffer, mBuffer.Length(), &bytesWritten);
|
||||
outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
|
||||
|
||||
rv = ParseURI(aURI, mDeviceID);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -135,7 +135,7 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
|
|||
mBuffer.Append("</pre>\n");
|
||||
}
|
||||
mBuffer.Append("</div>\n</body>\n</html>\n");
|
||||
outputStream->Write(mBuffer, mBuffer.Length(), &bytesWritten);
|
||||
outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
|
||||
|
||||
nsCOMPtr<nsIInputStream> inStr;
|
||||
PRUint32 size;
|
||||
|
@ -215,7 +215,7 @@ nsAboutCache::VisitDevice(const char *deviceID,
|
|||
mBuffer.Append("<hr />\n<pre>\n");
|
||||
}
|
||||
|
||||
mStream->Write(mBuffer, mBuffer.Length(), &bytesWritten);
|
||||
mStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -300,7 +300,7 @@ nsAboutCache::VisitEntry(const char *deviceID,
|
|||
// Entry is done...
|
||||
mBuffer.Append("\n\n");
|
||||
|
||||
mStream->Write(mBuffer, mBuffer.Length(), &bytesWritten);
|
||||
mStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
|
||||
|
||||
*visitNext = PR_TRUE;
|
||||
return NS_OK;
|
||||
|
|
|
@ -104,7 +104,7 @@ nsAboutCacheEntry::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor,
|
|||
"<style type=\"text/css\">\npre {\n margin: 0;\n}\n"
|
||||
"td:first-child {\n text-align: right;\n vertical-align: top;\n"
|
||||
" line-height: 0.8em;\n}\n</style>\n</head>\n<body>\n");
|
||||
outputStream->Write(buffer, buffer.Length(), &n);
|
||||
outputStream->Write(buffer.get(), buffer.Length(), &n);
|
||||
|
||||
if (NS_SUCCEEDED(status))
|
||||
rv = WriteCacheEntryDescription(outputStream, descriptor);
|
||||
|
@ -113,7 +113,7 @@ nsAboutCacheEntry::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor,
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
buffer.Assign("</body>\n</html>\n");
|
||||
outputStream->Write(buffer, buffer.Length(), &n);
|
||||
outputStream->Write(buffer.get(), buffer.Length(), &n);
|
||||
|
||||
nsCOMPtr<nsIInputStream> inStr;
|
||||
PRUint32 size;
|
||||
|
@ -327,7 +327,7 @@ nsAboutCacheEntry::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
|
|||
do_GetService(NS_CACHESERVICE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = serv->CreateSession(clientID,
|
||||
rv = serv->CreateSession(clientID.get(),
|
||||
nsICache::STORE_ANYWHERE,
|
||||
streamBased,
|
||||
getter_AddRefs(mCacheSession));
|
||||
|
@ -339,7 +339,7 @@ nsAboutCacheEntry::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
|
|||
mListener = listener;
|
||||
mListenerContext = context;
|
||||
|
||||
return mCacheSession->AsyncOpenCacheEntry(key, nsICache::ACCESS_READ, this);
|
||||
return mCacheSession->AsyncOpenCacheEntry(key.get(), nsICache::ACCESS_READ, this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -486,7 +486,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
|
|||
|
||||
buffer.Append("</table>\n");
|
||||
|
||||
outputStream->Write(buffer, buffer.Length(), &n);
|
||||
outputStream->Write(buffer.get(), buffer.Length(), &n);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -497,7 +497,7 @@ nsAboutCacheEntry::WriteCacheEntryUnavailable(nsIOutputStream *outputStream,
|
|||
PRUint32 n;
|
||||
nsCAutoString buffer;
|
||||
buffer.Assign("The cache entry you selected is no longer available.");
|
||||
outputStream->Write(buffer, buffer.Length(), &n);
|
||||
outputStream->Write(buffer.get(), buffer.Length(), &n);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ nsFingerChannel::Open(nsIInputStream **_retval)
|
|||
do_GetService(kSocketTransportServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = socketService->CreateTransport(mHost, mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
rv = socketService->CreateTransport(mHost.get(), mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
BUFFER_MAX_SIZE, getter_AddRefs(mTransport));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
@ -221,7 +221,7 @@ nsFingerChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports *ctxt)
|
|||
do_GetService(kSocketTransportServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = socketService->CreateTransport(mHost, mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
rv = socketService->CreateTransport(mHost.get(), mPort, mProxyInfo, BUFFER_SEG_SIZE,
|
||||
BUFFER_MAX_SIZE, getter_AddRefs(mTransport));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ nsFTPChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt)
|
|||
nsCAutoString cacheKey;
|
||||
GenerateCacheKey(cacheKey);
|
||||
|
||||
return mCacheSession->AsyncOpenCacheEntry(cacheKey, accessRequested, this);
|
||||
return mCacheSession->AsyncOpenCacheEntry(cacheKey.get(), accessRequested, this);
|
||||
}
|
||||
|
||||
return SetupState();
|
||||
|
|
|
@ -505,7 +505,7 @@ nsFtpState::OnDataAvailable(nsIRequest *request,
|
|||
if (!mControlReadContinue)
|
||||
{
|
||||
if (mFTPEventSink)
|
||||
mFTPEventSink->OnFTPControlLog(PR_TRUE, mResponseMsg);
|
||||
mFTPEventSink->OnFTPControlLog(PR_TRUE, mResponseMsg.get());
|
||||
|
||||
return Process();
|
||||
}
|
||||
|
@ -1228,7 +1228,7 @@ nsFtpState::SetContentType()
|
|||
SetDirMIMEType(fromStr);
|
||||
|
||||
nsCAutoString contentType;contentType.AssignWithConversion(fromStr);
|
||||
return mChannel->SetContentType(contentType);
|
||||
return mChannel->SetContentType(contentType.get());
|
||||
}
|
||||
|
||||
return mChannel->SetContentType("application/http-index-format");
|
||||
|
@ -1250,7 +1250,7 @@ nsFtpState::S_list() {
|
|||
if(mCacheEntry) {
|
||||
nsCAutoString serverType;
|
||||
serverType.AppendInt(mServerType);
|
||||
(void) mCacheEntry->SetMetaDataElement("servertype", serverType);
|
||||
(void) mCacheEntry->SetMetaDataElement("servertype", serverType.get());
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIStreamListener> converter;
|
||||
|
@ -1933,12 +1933,10 @@ nsFtpState::StopProcessing() {
|
|||
{
|
||||
// check to see if the control status is bad.
|
||||
// web shell wont throw an alert. we better:
|
||||
nsAutoString text;
|
||||
text.AssignWithConversion(mResponseMsg);
|
||||
|
||||
NS_ASSERTION(mPrompter, "no prompter!");
|
||||
if (mPrompter)
|
||||
(void) mPrompter->Alert(nsnull, text.get());
|
||||
(void) mPrompter->Alert(nsnull, NS_ConvertASCIItoUCS2(mResponseMsg).get());
|
||||
}
|
||||
|
||||
nsresult broadcastErrorCode = mControlStatus;
|
||||
|
|
|
@ -183,7 +183,7 @@ nsHttpChannel::Init(nsIURI *uri,
|
|||
hostLine.Append(':');
|
||||
hostLine.AppendInt(port);
|
||||
}
|
||||
rv = mRequestHead.SetHeader(nsHttp::Host, hostLine);
|
||||
rv = mRequestHead.SetHeader(nsHttp::Host, hostLine.get());
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = nsHttpHandler::get()->
|
||||
|
@ -695,11 +695,11 @@ nsHttpChannel::OpenCacheEntry(PRBool *delayed)
|
|||
// we'll try to synchronously open the cache entry... however, it may be
|
||||
// in use and not yet validated, in which case we'll try asynchronously
|
||||
// opening the cache entry.
|
||||
rv = session->OpenCacheEntry(cacheKey, accessRequested, PR_FALSE,
|
||||
rv = session->OpenCacheEntry(cacheKey.get(), accessRequested, PR_FALSE,
|
||||
getter_AddRefs(mCacheEntry));
|
||||
if (rv == NS_ERROR_CACHE_WAIT_FOR_VALIDATION) {
|
||||
// access to the cache entry has been denied
|
||||
rv = session->AsyncOpenCacheEntry(cacheKey, accessRequested, this);
|
||||
rv = session->AsyncOpenCacheEntry(cacheKey.get(), accessRequested, this);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
// we'll have to wait for the cache entry
|
||||
*delayed = PR_TRUE;
|
||||
|
@ -1270,9 +1270,9 @@ nsHttpChannel::ProcessAuthentication(PRUint32 httpStatus)
|
|||
|
||||
// set the authentication credentials
|
||||
if (proxyAuth)
|
||||
mRequestHead.SetHeader(nsHttp::Proxy_Authorization, creds);
|
||||
mRequestHead.SetHeader(nsHttp::Proxy_Authorization, creds.get());
|
||||
else
|
||||
mRequestHead.SetHeader(nsHttp::Authorization, creds);
|
||||
mRequestHead.SetHeader(nsHttp::Authorization, creds.get());
|
||||
|
||||
// kill off the current transaction
|
||||
mTransaction->Cancel(NS_BINDING_REDIRECTED);
|
||||
|
@ -1458,7 +1458,7 @@ nsHttpChannel::GetAuthenticator(const char *scheme, nsIHttpAuthenticator **auth)
|
|||
contractid.Append(scheme);
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIHttpAuthenticator> serv = do_GetService(contractid, &rv);
|
||||
nsCOMPtr<nsIHttpAuthenticator> serv = do_GetService(contractid.get(), &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
*auth = serv;
|
||||
|
@ -2074,7 +2074,7 @@ nsHttpChannel::SetReferrer(nsIURI *referrer, PRUint32 referrerType)
|
|||
PRUint32 prehostLoc = PRUint32(ref.Find(prehost, PR_TRUE));
|
||||
ref.Cut(prehostLoc, nsCharTraits<char>::length(prehost) + 1); // + 1 for @
|
||||
}
|
||||
mRequestHead.SetHeader(nsHttp::Referer, ref);
|
||||
mRequestHead.SetHeader(nsHttp::Referer, ref.get());
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -333,7 +333,7 @@ nsHttpHandler::IsAcceptableEncoding(const char *enc)
|
|||
if (!PL_strncasecmp(enc, "x-", 2))
|
||||
enc += 2;
|
||||
|
||||
return PL_strcasestr(mAcceptEncodings, enc) != nsnull;
|
||||
return PL_strcasestr(mAcceptEncodings.get(), enc) != nsnull;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -89,7 +89,7 @@ nsJARURI::FormatSpec(const char* entryPath, char* *result)
|
|||
spec += NS_JAR_DELIMITER;
|
||||
spec += entryPath;
|
||||
|
||||
*result = nsCRT::strdup(spec);
|
||||
*result = ToNewCString(spec);
|
||||
return *result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ nsJARURI::SetSpec(const char * aSpec)
|
|||
jarPath.Cut(pos, jarPath.Length());
|
||||
jarPath.Cut(0, endPos);
|
||||
|
||||
rv = serv->NewURI(jarPath, nsnull, getter_AddRefs(mJARFile));
|
||||
rv = serv->NewURI(jarPath.get(), nsnull, getter_AddRefs(mJARFile));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCAutoString entry(aSpec);
|
||||
|
@ -155,7 +155,7 @@ nsJARURI::SetSpec(const char * aSpec)
|
|||
while (entry.CharAt(0) == '/')
|
||||
entry.Cut(0,1); // Strip any additional leading slashes from entry path
|
||||
|
||||
rv = serv->ResolveRelativePath(entry, nsnull, &mJAREntry);
|
||||
rv = serv->ResolveRelativePath(entry.get(), nsnull, &mJAREntry);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -276,10 +276,10 @@ nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char* aDataStr) {
|
|||
|
||||
if (gTextToSubURI) {
|
||||
PRUnichar *result = nsnull;
|
||||
if (NS_SUCCEEDED(rv = gTextToSubURI->UnEscapeAndConvert(mEncoding.get(), filename,
|
||||
if (NS_SUCCEEDED(rv = gTextToSubURI->UnEscapeAndConvert(mEncoding.get(), filename.get(),
|
||||
&result)) && (result)) {
|
||||
if (nsCRT::strlen(result) > 0) {
|
||||
aIdx->SetLocation(filename);
|
||||
aIdx->SetLocation(filename.get());
|
||||
if (!mHasDescription)
|
||||
aIdx->SetDescription(result);
|
||||
success = PR_TRUE;
|
||||
|
@ -295,7 +295,7 @@ nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char* aDataStr) {
|
|||
// just fallback to unescape'ing in-place
|
||||
// XXX - this shouldn't be using UTF8, should it?
|
||||
// when can we fail to get the service, anyway? - bbaetz
|
||||
aIdx->SetLocation(filename);
|
||||
aIdx->SetLocation(filename.get());
|
||||
if (!mHasDescription) {
|
||||
aIdx->SetDescription(NS_ConvertUTF8toUCS2(value).get());
|
||||
}
|
||||
|
|
|
@ -714,7 +714,7 @@ nsMultiMixedConv::SendStart(nsIChannel *aChannel) {
|
|||
// Set up the new part channel...
|
||||
mPartChannel = newChannel;
|
||||
|
||||
rv = mPartChannel->SetContentType(mContentType);
|
||||
rv = mPartChannel->SetContentType(mContentType.get());
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
mPartChannel->SetContentLength(mContentLength);
|
||||
|
@ -871,7 +871,7 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr,
|
|||
// it's header observers.
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
|
||||
if (httpChannel) {
|
||||
rv = httpChannel->SetResponseHeader(headerStr, headerVal);
|
||||
rv = httpChannel->SetResponseHeader(headerStr.get(), headerVal.get());
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
} else if (headerStr.EqualsIgnoreCase("content-range") ||
|
||||
|
|
|
@ -418,7 +418,7 @@ nsresult nsUnknownDecoder::FireListenerNotifications(nsIRequest* request,
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Set the new content type on the channel...
|
||||
rv = channel->SetContentType(mContentType);
|
||||
rv = channel->SetContentType(mContentType.get());
|
||||
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Unable to set content type on channel!");
|
||||
if (NS_FAILED(rv))
|
||||
|
|
|
@ -188,7 +188,7 @@ writeFile(int cycles)
|
|||
for (x=0; x<32; x++) {
|
||||
nsCAutoString filename; filename.Assign(TMPDIR "foo" DIRSEP);
|
||||
filename.AppendInt(x);
|
||||
PR_MakeDir(filename, 0755);
|
||||
PR_MakeDir(filename.get(), 0755);
|
||||
}
|
||||
|
||||
// create "cache" files
|
||||
|
@ -201,7 +201,7 @@ writeFile(int cycles)
|
|||
PRIntervalTime i1, i2, i3;
|
||||
i1 = PR_IntervalNow();
|
||||
|
||||
fd = PR_OpenFile(filename, PR_WRONLY|PR_TRUNCATE, 0644);
|
||||
fd = PR_OpenFile(filename.get(), PR_WRONLY|PR_TRUNCATE, 0644);
|
||||
if (!fd)
|
||||
printf("bad filename? %s\n", filename.get());
|
||||
|
||||
|
@ -218,7 +218,7 @@ writeFile(int cycles)
|
|||
|
||||
/*
|
||||
printf(" - writing %s [topen=%d twrite=%d]\n",
|
||||
(const char *) filename,
|
||||
filename.get(),
|
||||
PR_IntervalToMilliseconds(i2 - i1),
|
||||
PR_IntervalToMilliseconds(i3 - i2));
|
||||
*/
|
||||
|
@ -244,7 +244,7 @@ readFile(int cycles)
|
|||
filename.Append(DIRSEP);
|
||||
filename.AppendInt( x );
|
||||
|
||||
fd = PR_OpenFile(filename, PR_RDONLY, 0);
|
||||
fd = PR_OpenFile(filename.get(), PR_RDONLY, 0);
|
||||
|
||||
PRInt32 size = PR_Available(fd);
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ public:
|
|||
nsCAutoString str(name);
|
||||
nsMemory::Free(name);
|
||||
str.Append(".bak");
|
||||
rv = file->SetLeafName(str);
|
||||
rv = file->SetLeafName(str.get());
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = NS_NewLocalFileOutputStream(getter_AddRefs(mOut),
|
||||
file,
|
||||
|
@ -255,7 +255,7 @@ TestAsyncWrite(const char* fileName, PRUint32 offset, PRInt32 length)
|
|||
outFile.Append(".out");
|
||||
nsITransport* fileTrans;
|
||||
nsCOMPtr<nsILocalFile> file;
|
||||
rv = NS_NewLocalFile(outFile, PR_FALSE, getter_AddRefs(file));
|
||||
rv = NS_NewLocalFile(outFile.get(), PR_FALSE, getter_AddRefs(file));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = fts->CreateTransport(file,
|
||||
PR_CREATE_FILE | PR_WRONLY | PR_TRUNCATE,
|
||||
|
@ -266,7 +266,7 @@ TestAsyncWrite(const char* fileName, PRUint32 offset, PRInt32 length)
|
|||
if (listener == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(listener);
|
||||
rv = listener->Init(outFile);
|
||||
rv = listener->Init(outFile.get());
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
MyProgressEventSink* progressSink = new MyProgressEventSink();
|
||||
|
|
|
@ -211,7 +211,7 @@ NS_IMETHODIMP nsMIMEInfoImpl::SetFileExtensions( const char* aExtensions )
|
|||
PRInt32 breakLocation = -1;
|
||||
while ( (breakLocation= extList.FindCharInSet( ",",0 ) )!= -1)
|
||||
{
|
||||
nsCString ext( extList, breakLocation );
|
||||
nsCString ext( extList.get(), breakLocation );
|
||||
mExtensions.AppendCString( ext );
|
||||
extList.Cut(0, breakLocation+1 );
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ void nsMIMEInfoImpl::SetRememberPrefForMimeType(const char * prefName)
|
|||
|
||||
// always escape the pref b4 storing it in case someone enters some funky characters for a mime type...
|
||||
nsXPIDLCString escapedPrefString;
|
||||
*((char **)getter_Copies(escapedPrefString)) = nsEscape(prefValue, url_XAlphas);
|
||||
escapedPrefString.Adopt(nsEscape(prefValue.get(), url_XAlphas));
|
||||
prefBranch->SetCharPref(prefName, escapedPrefString);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче