Backed out changeset 379bb5e39311 (bug 1850606) to unblock deployment of new bugbug...
[gecko.git] / dom / console / ConsoleInstance.h
blob6afed56b5790880c22d23380317b071f83db2d83
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/. */
7 #ifndef mozilla_dom_ConsoleInstance_h
8 #define mozilla_dom_ConsoleInstance_h
10 #include "mozilla/dom/Console.h"
12 namespace mozilla::dom {
14 class ConsoleInstance final : public nsISupports, public nsWrapperCache {
15 public:
16 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
17 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ConsoleInstance)
19 explicit ConsoleInstance(JSContext* aCx,
20 const ConsoleInstanceOptions& aOptions);
22 // WebIDL methods
23 JSObject* WrapObject(JSContext* aCx,
24 JS::Handle<JSObject*> aGivenProto) override;
26 nsPIDOMWindowInner* GetParentObject() const { return nullptr; }
28 MOZ_CAN_RUN_SCRIPT
29 void Log(JSContext* aCx, const Sequence<JS::Value>& aData);
31 MOZ_CAN_RUN_SCRIPT
32 void Info(JSContext* aCx, const Sequence<JS::Value>& aData);
34 MOZ_CAN_RUN_SCRIPT
35 void Warn(JSContext* aCx, const Sequence<JS::Value>& aData);
37 MOZ_CAN_RUN_SCRIPT
38 void Error(JSContext* aCx, const Sequence<JS::Value>& aData);
40 MOZ_CAN_RUN_SCRIPT
41 void Exception(JSContext* aCx, const Sequence<JS::Value>& aData);
43 MOZ_CAN_RUN_SCRIPT
44 void Debug(JSContext* aCx, const Sequence<JS::Value>& aData);
46 MOZ_CAN_RUN_SCRIPT
47 void Table(JSContext* aCx, const Sequence<JS::Value>& aData);
49 MOZ_CAN_RUN_SCRIPT
50 void Trace(JSContext* aCx, const Sequence<JS::Value>& aData);
52 MOZ_CAN_RUN_SCRIPT
53 void Dir(JSContext* aCx, const Sequence<JS::Value>& aData);
55 MOZ_CAN_RUN_SCRIPT
56 void Dirxml(JSContext* aCx, const Sequence<JS::Value>& aData);
58 MOZ_CAN_RUN_SCRIPT
59 void Group(JSContext* aCx, const Sequence<JS::Value>& aData);
61 MOZ_CAN_RUN_SCRIPT
62 void GroupCollapsed(JSContext* aCx, const Sequence<JS::Value>& aData);
64 MOZ_CAN_RUN_SCRIPT
65 void GroupEnd(JSContext* aCx);
67 MOZ_CAN_RUN_SCRIPT
68 void Time(JSContext* aCx, const nsAString& aLabel);
70 MOZ_CAN_RUN_SCRIPT
71 void TimeLog(JSContext* aCx, const nsAString& aLabel,
72 const Sequence<JS::Value>& aData);
74 MOZ_CAN_RUN_SCRIPT
75 void TimeEnd(JSContext* aCx, const nsAString& aLabel);
77 MOZ_CAN_RUN_SCRIPT
78 void TimeStamp(JSContext* aCx, const JS::Handle<JS::Value> aData);
80 MOZ_CAN_RUN_SCRIPT
81 void Profile(JSContext* aCx, const Sequence<JS::Value>& aData);
83 MOZ_CAN_RUN_SCRIPT
84 void ProfileEnd(JSContext* aCx, const Sequence<JS::Value>& aData);
86 MOZ_CAN_RUN_SCRIPT
87 void Assert(JSContext* aCx, bool aCondition,
88 const Sequence<JS::Value>& aData);
90 MOZ_CAN_RUN_SCRIPT
91 void Count(JSContext* aCx, const nsAString& aLabel);
93 MOZ_CAN_RUN_SCRIPT
94 void CountReset(JSContext* aCx, const nsAString& aLabel);
96 MOZ_CAN_RUN_SCRIPT
97 void Clear(JSContext* aCx);
99 // For testing only.
100 void ReportForServiceWorkerScope(const nsAString& aScope,
101 const nsAString& aMessage,
102 const nsAString& aFilename,
103 uint32_t aLineNumber, uint32_t aColumnNumber,
104 ConsoleLevel aLevel);
106 private:
107 ~ConsoleInstance();
109 RefPtr<Console> mConsole;
112 } // namespace mozilla::dom
114 #endif // mozilla_dom_ConsoleInstance_h