|
1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef mozilla_plugins_PluginStreamParent_h |
|
7 #define mozilla_plugins_PluginStreamParent_h |
|
8 |
|
9 #include "mozilla/plugins/PPluginStreamParent.h" |
|
10 #include "mozilla/plugins/AStream.h" |
|
11 |
|
12 namespace mozilla { |
|
13 namespace plugins { |
|
14 |
|
15 class PluginInstanceParent; |
|
16 |
|
17 class PluginStreamParent : public PPluginStreamParent, public AStream |
|
18 { |
|
19 friend class PluginModuleParent; |
|
20 friend class PluginInstanceParent; |
|
21 |
|
22 public: |
|
23 PluginStreamParent(PluginInstanceParent* npp, const nsCString& mimeType, |
|
24 const nsCString& target, NPError* result); |
|
25 virtual ~PluginStreamParent() { } |
|
26 |
|
27 virtual bool IsBrowserStream() MOZ_OVERRIDE { return false; } |
|
28 |
|
29 virtual bool AnswerNPN_Write(const Buffer& data, int32_t* written) MOZ_OVERRIDE; |
|
30 |
|
31 virtual bool Answer__delete__(const NPError& reason, const bool& artificial) MOZ_OVERRIDE; |
|
32 |
|
33 private: |
|
34 void NPN_DestroyStream(NPReason reason); |
|
35 |
|
36 PluginInstanceParent* mInstance; |
|
37 NPStream* mStream; |
|
38 bool mClosed; |
|
39 }; |
|
40 |
|
41 } // namespace plugins |
|
42 } // namespace mozilla |
|
43 |
|
44 #endif |