michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsSyncStreamListener_h__ michael@0: #define nsSyncStreamListener_h__ michael@0: michael@0: #include "nsISyncStreamListener.h" michael@0: #include "nsIInputStream.h" michael@0: #include "nsIOutputStream.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: michael@0: class nsSyncStreamListener MOZ_FINAL : public nsISyncStreamListener michael@0: , public nsIInputStream michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: NS_DECL_NSISTREAMLISTENER michael@0: NS_DECL_NSISYNCSTREAMLISTENER michael@0: NS_DECL_NSIINPUTSTREAM michael@0: michael@0: nsSyncStreamListener() michael@0: : mStatus(NS_OK) michael@0: , mKeepWaiting(false) michael@0: , mDone(false) {} michael@0: michael@0: nsresult Init(); michael@0: michael@0: private: michael@0: ~nsSyncStreamListener() {} michael@0: michael@0: nsresult WaitForData(); michael@0: michael@0: nsCOMPtr mPipeIn; michael@0: nsCOMPtr mPipeOut; michael@0: nsresult mStatus; michael@0: bool mKeepWaiting; michael@0: bool mDone; michael@0: }; michael@0: michael@0: #endif // nsSyncStreamListener_h__