Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/plugins/BrowserStreamParent.h
Line
Count
Source (jump to first uncovered line)
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_BrowserStreamParent_h
7
#define mozilla_plugins_BrowserStreamParent_h
8
9
#include "mozilla/plugins/PBrowserStreamParent.h"
10
#include "mozilla/plugins/AStream.h"
11
#include "nsNPAPIPluginStreamListener.h"
12
#include "nsPluginStreamListenerPeer.h"
13
14
namespace mozilla {
15
namespace plugins {
16
17
class PluginInstanceParent;
18
19
class BrowserStreamParent : public PBrowserStreamParent, public AStream
20
{
21
  friend class PluginModuleParent;
22
  friend class PluginInstanceParent;
23
24
public:
25
  BrowserStreamParent(PluginInstanceParent* npp,
26
                      NPStream* stream);
27
  virtual ~BrowserStreamParent();
28
29
0
  virtual bool IsBrowserStream() override { return true; }
30
31
  virtual void ActorDestroy(ActorDestroyReason aWhy) override;
32
33
  virtual mozilla::ipc::IPCResult RecvStreamDestroyed() override;
34
35
  int32_t WriteReady();
36
  int32_t Write(int32_t offset, int32_t len, void* buffer);
37
38
  void NPP_DestroyStream(NPReason reason);
39
40
  void SetAlive()
41
0
  {
42
0
    if (mState == INITIALIZING) {
43
0
      mState = ALIVE;
44
0
    }
45
0
  }
46
47
private:
48
  using PBrowserStreamParent::SendNPP_DestroyStream;
49
50
  PluginInstanceParent* mNPP;
51
  NPStream* mStream;
52
  nsCOMPtr<nsISupports> mStreamPeer;
53
  RefPtr<nsNPAPIPluginStreamListener> mStreamListener;
54
55
  enum {
56
    INITIALIZING,
57
    DEFERRING_DESTROY,
58
    ALIVE,
59
    DYING,
60
    DELETING
61
  } mState;
62
};
63
64
} // namespace plugins
65
} // namespace mozilla
66
67
#endif