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_ConsoleUtils_h
8 #define mozilla_dom_ConsoleUtils_h
10 #include "mozilla/JSObjectHolder.h"
11 #include "nsISupportsImpl.h"
17 class ConsoleUtils final
{
19 NS_INLINE_DECL_REFCOUNTING(ConsoleUtils
)
27 // Main-thread only, reports a console message from a ServiceWorker.
28 static void ReportForServiceWorkerScope(const nsAString
& aScope
,
29 const nsAString
& aMessage
,
30 const nsAString
& aFilename
,
32 uint32_t aColumnNumber
, Level aLevel
);
38 static ConsoleUtils
* GetOrCreate();
40 JSObject
* GetOrCreateSandbox(JSContext
* aCx
);
42 void ReportForServiceWorkerScopeInternal(const nsAString
& aScope
,
43 const nsAString
& aMessage
,
44 const nsAString
& aFilename
,
46 uint32_t aColumnNumber
,
49 RefPtr
<JSObjectHolder
> mSandbox
;
53 } // namespace mozilla
55 #endif /* mozilla_dom_ConsoleUtils_h */