1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsSyncStreamListener_h__
6 #define nsSyncStreamListener_h__
8 #include "nsISyncStreamListener.h"
9 #include "nsIInputStream.h"
10 #include "nsIOutputStream.h"
12 #include "mozilla/Attributes.h"
14 //-----------------------------------------------------------------------------
16 class nsSyncStreamListener final
: public nsISyncStreamListener
,
17 public nsIInputStream
{
20 NS_DECL_NSIREQUESTOBSERVER
21 NS_DECL_NSISTREAMLISTENER
22 NS_DECL_NSISYNCSTREAMLISTENER
23 NS_DECL_NSIINPUTSTREAM
27 friend nsresult
NS_NewSyncStreamListener(nsIStreamListener
** result
,
28 nsIInputStream
** stream
);
29 nsSyncStreamListener();
30 ~nsSyncStreamListener() = default;
34 nsresult
WaitForData();
36 nsCOMPtr
<nsIInputStream
> mPipeIn
;
37 nsCOMPtr
<nsIOutputStream
> mPipeOut
;
38 nsresult mStatus
{NS_OK
};
39 bool mKeepWaiting
{false};
43 #endif // nsSyncStreamListener_h__