2018-01-04 21:19:43 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_ConsoleInstance_h
|
|
|
|
#define mozilla_dom_ConsoleInstance_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/Console.h"
|
|
|
|
|
2022-05-09 23:41:06 +03:00
|
|
|
namespace mozilla::dom {
|
2018-01-04 21:19:43 +03:00
|
|
|
|
|
|
|
class ConsoleInstance final : public nsISupports, public nsWrapperCache {
|
|
|
|
public:
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2022-09-07 14:22:51 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ConsoleInstance)
|
2018-01-04 21:19:43 +03:00
|
|
|
|
2018-02-22 10:49:51 +03:00
|
|
|
explicit ConsoleInstance(JSContext* aCx,
|
|
|
|
const ConsoleInstanceOptions& aOptions);
|
2018-01-04 21:19:43 +03:00
|
|
|
|
|
|
|
// WebIDL methods
|
|
|
|
JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
|
|
|
|
nsPIDOMWindowInner* GetParentObject() const { return nullptr; }
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Log(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Info(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Warn(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Error(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Exception(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Debug(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Table(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Trace(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Dir(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Dirxml(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Group(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void GroupCollapsed(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void GroupEnd(JSContext* aCx);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Time(JSContext* aCx, const nsAString& aLabel);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-05-15 14:00:49 +03:00
|
|
|
void TimeLog(JSContext* aCx, const nsAString& aLabel,
|
|
|
|
const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void TimeEnd(JSContext* aCx, const nsAString& aLabel);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void TimeStamp(JSContext* aCx, const JS::Handle<JS::Value> aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Profile(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void ProfileEnd(JSContext* aCx, const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Assert(JSContext* aCx, bool aCondition,
|
|
|
|
const Sequence<JS::Value>& aData);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Count(JSContext* aCx, const nsAString& aLabel);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-05-22 12:34:41 +03:00
|
|
|
void CountReset(JSContext* aCx, const nsAString& aLabel);
|
|
|
|
|
2019-03-19 07:33:32 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2018-01-04 21:19:43 +03:00
|
|
|
void Clear(JSContext* aCx);
|
|
|
|
|
2018-01-11 00:06:37 +03:00
|
|
|
// For testing only.
|
|
|
|
void ReportForServiceWorkerScope(const nsAString& aScope,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
const nsAString& aFilename,
|
2018-01-11 00:06:38 +03:00
|
|
|
uint32_t aLineNumber, uint32_t aColumnNumber,
|
|
|
|
ConsoleLevel aLevel);
|
2018-01-11 00:06:37 +03:00
|
|
|
|
2018-01-04 21:19:43 +03:00
|
|
|
private:
|
|
|
|
~ConsoleInstance();
|
|
|
|
|
|
|
|
RefPtr<Console> mConsole;
|
|
|
|
};
|
|
|
|
|
2022-05-09 23:41:06 +03:00
|
|
|
} // namespace mozilla::dom
|
2018-01-04 21:19:43 +03:00
|
|
|
|
|
|
|
#endif // mozilla_dom_ConsoleInstance_h
|