Bug 1511692 - suppress warning for NS_BASE_STREAM_CLOSED from base streams Available() call. r=baku
authorJorg K <jorgk@jorgk.com>
Tue, 04 Dec 2018 00:48:00 +0200
changeset 508555 e77b8931ae7a436fc3706f02511bd07c432f141d
parent 508554 a5e9c1404b37e7587a16dc6aa9d3b06081ce88bf
child 508557 0a65dda20ade2c24bf42fb22bfd7169b320b732e
child 508597 84c1e131a7fa6ff30388ecf0a08d51479fe2c5a5
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1511692
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1511692 - suppress warning for NS_BASE_STREAM_CLOSED from base streams Available() call. r=baku
xpcom/io/NonBlockingAsyncInputStream.cpp
--- a/xpcom/io/NonBlockingAsyncInputStream.cpp
+++ b/xpcom/io/NonBlockingAsyncInputStream.cpp
@@ -163,17 +163,18 @@ NonBlockingAsyncInputStream::Close() {
   return NS_OK;
 }
 
 // nsIInputStream interface
 
 NS_IMETHODIMP
 NonBlockingAsyncInputStream::Available(uint64_t* aLength) {
   nsresult rv = mInputStream->Available(aLength);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
+  // Don't issue warnings for legal condition NS_BASE_STREAM_CLOSED.
+  if (rv == NS_BASE_STREAM_CLOSED || NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // Nothing more to read. Let's close the stream now.
   if (*aLength == 0) {
     mInputStream->Close();
     mClosed = true;
     return NS_BASE_STREAM_CLOSED;