michael@0: /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ 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 mozilla_plugins_PluginStreamChild_h michael@0: #define mozilla_plugins_PluginStreamChild_h michael@0: michael@0: #include "mozilla/plugins/PPluginStreamChild.h" michael@0: #include "mozilla/plugins/AStream.h" michael@0: michael@0: namespace mozilla { michael@0: namespace plugins { michael@0: michael@0: class PluginInstanceChild; michael@0: michael@0: class PluginStreamChild : public PPluginStreamChild, public AStream michael@0: { michael@0: friend class PluginInstanceChild; michael@0: michael@0: public: michael@0: PluginStreamChild(); michael@0: virtual ~PluginStreamChild() { } michael@0: michael@0: virtual bool IsBrowserStream() MOZ_OVERRIDE { return false; } michael@0: michael@0: virtual bool Answer__delete__(const NPReason& reason, michael@0: const bool& artificial) MOZ_OVERRIDE; michael@0: michael@0: int32_t NPN_Write(int32_t length, void* buffer); michael@0: void NPP_DestroyStream(NPError reason); michael@0: michael@0: void EnsureCorrectInstance(PluginInstanceChild* i) michael@0: { michael@0: if (i != Instance()) michael@0: NS_RUNTIMEABORT("Incorrect stream instance"); michael@0: } michael@0: void EnsureCorrectStream(NPStream* s) michael@0: { michael@0: if (s != &mStream) michael@0: NS_RUNTIMEABORT("Incorrect stream data"); michael@0: } michael@0: michael@0: private: michael@0: PluginInstanceChild* Instance(); michael@0: michael@0: NPStream mStream; michael@0: bool mClosed; michael@0: }; michael@0: michael@0: michael@0: } // namespace plugins michael@0: } // namespace mozilla michael@0: michael@0: #endif