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 #include "mozilla/dom/MessageManagerGlobal.h"
8 #include "mozilla/IntentionalCrash.h"
9 #include "mozilla/Logging.h"
10 #include "nsContentUtils.h"
11 #include "nsJSUtils.h"
14 # include <android/log.h>
20 namespace mozilla::dom
{
22 void MessageManagerGlobal::Dump(const nsAString
& aStr
) {
23 if (!nsJSUtils::DumpEnabled()) {
27 NS_ConvertUTF16toUTF8
cStr(aStr
);
28 MOZ_LOG(nsContentUtils::DOMDumpLog(), mozilla::LogLevel::Debug
,
29 ("[MessageManager.Dump] %s", cStr
.get()));
31 __android_log_print(ANDROID_LOG_INFO
, "Gecko", "%s", cStr
.get());
34 if (IsDebuggerPresent()) {
35 OutputDebugStringW(PromiseFlatString(aStr
).get());
38 fputs(cStr
.get(), stdout
);
42 void MessageManagerGlobal::Atob(const nsAString
& aAsciiString
,
43 nsAString
& aBase64Data
, ErrorResult
& aError
) {
44 aError
= nsContentUtils::Atob(aAsciiString
, aBase64Data
);
47 void MessageManagerGlobal::Btoa(const nsAString
& aBase64Data
,
48 nsAString
& aAsciiString
, ErrorResult
& aError
) {
49 aError
= nsContentUtils::Btoa(aBase64Data
, aAsciiString
);
52 } // namespace mozilla::dom