Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/Comment.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
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_dom_Comment_h
8
#define mozilla_dom_Comment_h
9
10
#include "mozilla/Attributes.h"
11
#include "mozilla/dom/CharacterData.h"
12
13
namespace mozilla {
14
namespace dom {
15
16
class Comment final : public CharacterData
17
{
18
private:
19
  void Init()
20
0
  {
21
0
    MOZ_ASSERT(mNodeInfo->NodeType() == COMMENT_NODE,
22
0
               "Bad NodeType in aNodeInfo");
23
0
  }
24
25
  virtual ~Comment();
26
27
public:
28
  explicit Comment(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
29
    : CharacterData(std::move(aNodeInfo))
30
0
  {
31
0
    Init();
32
0
  }
33
34
  explicit Comment(nsNodeInfoManager* aNodeInfoManager)
35
    : CharacterData(aNodeInfoManager->GetCommentNodeInfo())
36
0
  {
37
0
    Init();
38
0
  }
39
40
  NS_IMPL_FROMNODE_HELPER(Comment, IsComment())
41
42
  // nsISupports
43
  NS_INLINE_DECL_REFCOUNTING_INHERITED(Comment, CharacterData)
44
45
  virtual already_AddRefed<CharacterData>
46
    CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
47
                  bool aCloneText) const override;
48
49
#ifdef DEBUG
50
  virtual void List(FILE* out, int32_t aIndent) const override;
51
  virtual void DumpContent(FILE* out = stdout, int32_t aIndent = 0,
52
                           bool aDumpAll = true) const override
53
  {
54
    return;
55
  }
56
#endif
57
58
  static already_AddRefed<Comment>
59
  Constructor(const GlobalObject& aGlobal, const nsAString& aData,
60
              ErrorResult& aRv);
61
62
protected:
63
  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
64
};
65
66
} // namespace dom
67
} // namespace mozilla
68
69
#endif // mozilla_dom_Comment_h