Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/plugins/ipc/StreamNotifyParent.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
2
/* vim: set sw=2 ts=2 et : */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_plugins_StreamNotifyParent_h
8
#define mozilla_plugins_StreamNotifyParent_h
9
10
#include "mozilla/plugins/PStreamNotifyParent.h"
11
12
namespace mozilla {
13
namespace plugins {
14
15
class StreamNotifyParent : public PStreamNotifyParent
16
{
17
  friend class PluginInstanceParent;
18
19
  StreamNotifyParent()
20
    : mDestructionFlag(nullptr)
21
0
  { }
22
0
  ~StreamNotifyParent() {
23
0
    if (mDestructionFlag)
24
0
      *mDestructionFlag = true;
25
0
  }
26
27
public:
28
  // If we are destroyed within the call to NPN_GetURLNotify, notify the caller
29
  // so that we aren't destroyed again. see bug 536437.
30
0
  void SetDestructionFlag(bool* flag) {
31
0
    mDestructionFlag = flag;
32
0
  }
33
0
  void ClearDestructionFlag() {
34
0
    mDestructionFlag = nullptr;
35
0
  }
36
37
  virtual void ActorDestroy(ActorDestroyReason aWhy) override;
38
39
private:
40
  mozilla::ipc::IPCResult RecvRedirectNotifyResponse(const bool& allow) override;
41
42
  bool* mDestructionFlag;
43
};
44
45
} // namespace plugins
46
} // namespace mozilla
47
48
#endif