1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/ipc/PluginStreamChild.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_plugins_PluginStreamChild_h 1.10 +#define mozilla_plugins_PluginStreamChild_h 1.11 + 1.12 +#include "mozilla/plugins/PPluginStreamChild.h" 1.13 +#include "mozilla/plugins/AStream.h" 1.14 + 1.15 +namespace mozilla { 1.16 +namespace plugins { 1.17 + 1.18 +class PluginInstanceChild; 1.19 + 1.20 +class PluginStreamChild : public PPluginStreamChild, public AStream 1.21 +{ 1.22 + friend class PluginInstanceChild; 1.23 + 1.24 +public: 1.25 + PluginStreamChild(); 1.26 + virtual ~PluginStreamChild() { } 1.27 + 1.28 + virtual bool IsBrowserStream() MOZ_OVERRIDE { return false; } 1.29 + 1.30 + virtual bool Answer__delete__(const NPReason& reason, 1.31 + const bool& artificial) MOZ_OVERRIDE; 1.32 + 1.33 + int32_t NPN_Write(int32_t length, void* buffer); 1.34 + void NPP_DestroyStream(NPError reason); 1.35 + 1.36 + void EnsureCorrectInstance(PluginInstanceChild* i) 1.37 + { 1.38 + if (i != Instance()) 1.39 + NS_RUNTIMEABORT("Incorrect stream instance"); 1.40 + } 1.41 + void EnsureCorrectStream(NPStream* s) 1.42 + { 1.43 + if (s != &mStream) 1.44 + NS_RUNTIMEABORT("Incorrect stream data"); 1.45 + } 1.46 + 1.47 +private: 1.48 + PluginInstanceChild* Instance(); 1.49 + 1.50 + NPStream mStream; 1.51 + bool mClosed; 1.52 +}; 1.53 + 1.54 + 1.55 +} // namespace plugins 1.56 +} // namespace mozilla 1.57 + 1.58 +#endif