Bug 1297133 - Bustage fix: Don't ignore return values. r=rkent a=jorgk CLOSED TREE
This commit is contained in:
Родитель
9d7361b359
Коммит
1949f5e2f5
|
@ -160,9 +160,10 @@ nsAddbookProtocolHandler::NewChannel2(nsIURI *aURI,
|
|||
rv = pipe->Init(false, false, 0, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
pipe->GetInputStream(getter_AddRefs(pipeIn));
|
||||
pipe->GetOutputStream(getter_AddRefs(pipeOut));
|
||||
|
||||
// These always succeed because the pipe is initialized above.
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(getter_AddRefs(pipeIn)));
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(getter_AddRefs(pipeOut)));
|
||||
|
||||
pipeOut->Close();
|
||||
if (aLoadInfo) {
|
||||
return NS_NewInputStreamChannelInternal(_retval,
|
||||
|
|
|
@ -1420,11 +1420,13 @@ nsresult nsMsgAsyncWriteProtocol::SetupTransportState()
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIAsyncInputStream *inputStream = nullptr;
|
||||
pipe->GetInputStream(&inputStream);
|
||||
// This always succeeds because the pipe is initialized above.
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(&inputStream));
|
||||
mInStream = dont_AddRef(static_cast<nsIInputStream *>(inputStream));
|
||||
|
||||
nsIAsyncOutputStream *outputStream = nullptr;
|
||||
pipe->GetOutputStream(&outputStream);
|
||||
// This always succeeds because the pipe is initialized above.
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(&outputStream));
|
||||
m_outputStream = dont_AddRef(static_cast<nsIOutputStream *>(outputStream));
|
||||
|
||||
mProviderThread = do_GetCurrentThread();
|
||||
|
|
|
@ -334,11 +334,11 @@ NS_IMETHODIMP nsSmtpService::NewChannel2(nsIURI *aURI,
|
|||
nsCOMPtr<nsIAsyncOutputStream> pipeOut;
|
||||
nsCOMPtr<nsIPipe> pipe = do_CreateInstance("@mozilla.org/pipe;1");
|
||||
nsresult rv = pipe->Init(false, false, 0, 0);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
pipe->GetInputStream(getter_AddRefs(pipeIn));
|
||||
pipe->GetOutputStream(getter_AddRefs(pipeOut));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// These always succeed because the pipe is initialized above.
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(getter_AddRefs(pipeIn)));
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(getter_AddRefs(pipeOut)));
|
||||
|
||||
pipeOut->Close();
|
||||
|
||||
|
|
|
@ -3028,10 +3028,11 @@ nsresult nsImapProtocol::BeginMessageDownLoad(
|
|||
// and the consumer is waiting for a whole line
|
||||
nsCOMPtr<nsIPipe> pipe = do_CreateInstance("@mozilla.org/pipe;1");
|
||||
rv = pipe->Init(false, false, 4096, PR_UINT32_MAX);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "nsIPipe->Init failed!");
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
pipe->GetInputStream(getter_AddRefs(m_channelInputStream));
|
||||
pipe->GetOutputStream(getter_AddRefs(m_channelOutputStream));
|
||||
// These always succeed because the pipe is initialized above.
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(getter_AddRefs(m_channelInputStream)));
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(getter_AddRefs(m_channelOutputStream)));
|
||||
}
|
||||
// else, if we are saving the message to disk!
|
||||
else if (m_imapMessageSink /* && m_imapAction == nsIImapUrl::nsImapSaveMessageToDisk */)
|
||||
|
|
|
@ -619,15 +619,17 @@ NS_IMETHODIMP nsStreamConverter::Init(nsIURI *aURI, nsIStreamListener * aOutList
|
|||
}
|
||||
}
|
||||
|
||||
// now we want to create a pipe which we'll use for converting the data...
|
||||
nsCOMPtr<nsIPipe> pipe = do_CreateInstance("@mozilla.org/pipe;1");
|
||||
rv = pipe->Init(true, true, 4096, 8);
|
||||
|
||||
// initialize our emitter
|
||||
if (NS_SUCCEEDED(rv) && mEmitter)
|
||||
if (mEmitter)
|
||||
{
|
||||
pipe->GetInputStream(getter_AddRefs(mInputStream));
|
||||
pipe->GetOutputStream(getter_AddRefs(mOutputStream));
|
||||
// Now we want to create a pipe which we'll use for converting the data.
|
||||
nsCOMPtr<nsIPipe> pipe = do_CreateInstance("@mozilla.org/pipe;1");
|
||||
rv = pipe->Init(true, true, 4096, 8);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// These always succeed because the pipe is initialized above.
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(getter_AddRefs(mInputStream)));
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(getter_AddRefs(mOutputStream)));
|
||||
|
||||
mEmitter->Initialize(aURI, aChannel, newType);
|
||||
mEmitter->SetPipe(mInputStream, mOutputStream);
|
||||
|
|
|
@ -2086,12 +2086,12 @@ nsresult nsNNTPProtocol::BeginArticle()
|
|||
//
|
||||
if (m_channelListener) {
|
||||
nsCOMPtr<nsIPipe> pipe = do_CreateInstance("@mozilla.org/pipe;1");
|
||||
mozilla::DebugOnly<nsresult> rv = pipe->Init(false, false, 4096, PR_UINT32_MAX);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create pipe");
|
||||
// TODO: return on failure?
|
||||
nsresult rv = pipe->Init(false, false, 4096, PR_UINT32_MAX);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
pipe->GetInputStream(getter_AddRefs(mDisplayInputStream));
|
||||
pipe->GetOutputStream(getter_AddRefs(mDisplayOutputStream));
|
||||
// These always succeed because the pipe is initialized above.
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(getter_AddRefs(mDisplayInputStream)));
|
||||
MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(getter_AddRefs(mDisplayOutputStream)));
|
||||
}
|
||||
|
||||
m_nextState = NNTP_READ_ARTICLE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче