michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et tw=80 : */ 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 RtspChannelParent_h michael@0: #define RtspChannelParent_h michael@0: michael@0: #include "mozilla/net/PRtspChannelParent.h" michael@0: #include "mozilla/net/NeckoParent.h" michael@0: #include "nsBaseChannel.h" michael@0: #include "nsIParentChannel.h" michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: // Note: RtspChannel doesn't transport streams as normal channel does. michael@0: // (See RtspChannelChild.h for detail). michael@0: // The reason for the existence of RtspChannelParent is to support HTTP->RTSP michael@0: // redirection. michael@0: // When redirection happens, two instances of RtspChannelParent will be created: michael@0: // - One will be created when HTTP creates the new channel for redirects, and michael@0: // will be registered as an nsIChannel. michael@0: // - The other will be created via IPDL by RtspChannelChild, and will be michael@0: // registered as an nsIParentChannel. michael@0: class RtspChannelParent : public PRtspChannelParent michael@0: , public nsBaseChannel michael@0: , public nsIParentChannel michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIPARENTCHANNEL michael@0: michael@0: RtspChannelParent(nsIURI *aUri); michael@0: ~RtspChannelParent(); michael@0: michael@0: // nsBaseChannel::nsIChannel michael@0: NS_IMETHOD GetContentType(nsACString & aContentType) MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD AsyncOpen(nsIStreamListener *listener, michael@0: nsISupports *aContext) MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel::nsIStreamListener::nsIRequestObserver michael@0: NS_IMETHOD OnStartRequest(nsIRequest *aRequest, michael@0: nsISupports *aContext) MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD OnStopRequest(nsIRequest *aRequest, michael@0: nsISupports *aContext, michael@0: nsresult aStatusCode) MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel::nsIStreamListener michael@0: NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, michael@0: nsISupports *aContext, michael@0: nsIInputStream *aInputStream, michael@0: uint64_t aOffset, michael@0: uint32_t aCount) MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel::nsIChannel::nsIRequest michael@0: NS_IMETHOD Cancel(nsresult status) MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD Suspend() MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD Resume() MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel michael@0: NS_IMETHOD OpenContentStream(bool aAsync, michael@0: nsIInputStream **aStream, michael@0: nsIChannel **aChannel) MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // RtspChannelParent michael@0: bool Init(const RtspChannelConnectArgs& aArgs); michael@0: michael@0: protected: michael@0: // Used to connect redirected-to channel in parent with just created michael@0: // ChildChannel. Used during HTTP->RTSP redirection. michael@0: bool ConnectChannel(const uint32_t& channelId); michael@0: michael@0: private: michael@0: bool mIPCClosed; michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; michael@0: }; michael@0: michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: michael@0: #endif // RtspChannelParent_h