Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/ConsoleInstance.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_ConsoleInstance_h
8
#define mozilla_dom_ConsoleInstance_h
9
10
#include "mozilla/dom/Console.h"
11
12
13
namespace mozilla {
14
namespace dom {
15
16
class ConsoleInstance final : public nsISupports
17
                            , public nsWrapperCache
18
{
19
public:
20
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
21
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ConsoleInstance)
22
23
  explicit ConsoleInstance(JSContext* aCx,
24
                           const ConsoleInstanceOptions& aOptions);
25
26
  // WebIDL methods
27
  JSObject*
28
  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
29
30
  nsPIDOMWindowInner* GetParentObject() const
31
0
  {
32
0
    return nullptr;
33
0
  }
34
35
  void
36
  Log(JSContext* aCx, const Sequence<JS::Value>& aData);
37
38
  void
39
  Info(JSContext* aCx, const Sequence<JS::Value>& aData);
40
41
  void
42
  Warn(JSContext* aCx, const Sequence<JS::Value>& aData);
43
44
  void
45
  Error(JSContext* aCx, const Sequence<JS::Value>& aData);
46
47
  void
48
  Exception(JSContext* aCx, const Sequence<JS::Value>& aData);
49
50
  void
51
  Debug(JSContext* aCx, const Sequence<JS::Value>& aData);
52
53
  void
54
  Table(JSContext* aCx, const Sequence<JS::Value>& aData);
55
56
  void
57
  Trace(JSContext* aCx, const Sequence<JS::Value>& aData);
58
59
  void
60
  Dir(JSContext* aCx, const Sequence<JS::Value>& aData);
61
62
  void
63
  Dirxml(JSContext* aCx, const Sequence<JS::Value>& aData);
64
65
  void
66
  Group(JSContext* aCx, const Sequence<JS::Value>& aData);
67
68
  void
69
  GroupCollapsed(JSContext* aCx, const Sequence<JS::Value>& aData);
70
71
  void
72
  GroupEnd(JSContext* aCx);
73
74
  void
75
  Time(JSContext* aCx, const nsAString& aLabel);
76
77
  void
78
  TimeLog(JSContext* aCx, const nsAString& aLabel,
79
          const Sequence<JS::Value>& aData);
80
81
  void
82
  TimeEnd(JSContext* aCx, const nsAString& aLabel);
83
84
  void
85
  TimeStamp(JSContext* aCx, const JS::Handle<JS::Value> aData);
86
87
  void
88
  Profile(JSContext* aCx, const Sequence<JS::Value>& aData);
89
90
  void
91
  ProfileEnd(JSContext* aCx, const Sequence<JS::Value>& aData);
92
93
  void
94
  Assert(JSContext* aCx, bool aCondition, const Sequence<JS::Value>& aData);
95
96
  void
97
  Count(JSContext* aCx, const nsAString& aLabel);
98
99
  void
100
  CountReset(JSContext* aCx, const nsAString& aLabel);
101
102
  void
103
  Clear(JSContext* aCx);
104
105
  // For testing only.
106
  void ReportForServiceWorkerScope(const nsAString& aScope,
107
                                   const nsAString& aMessage,
108
                                   const nsAString& aFilename,
109
                                   uint32_t aLineNumber,
110
                                   uint32_t aColumnNumber,
111
                                   ConsoleLevel aLevel);
112
113
private:
114
  ~ConsoleInstance();
115
116
  RefPtr<Console> mConsole;
117
};
118
119
} // dom namespace
120
} // mozilla namespace
121
122
#endif // mozilla_dom_ConsoleInstance_h