summaryrefslogtreecommitdiffstats
path: root/ipc/chromium/src/mojo/core/ports/name.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /ipc/chromium/src/mojo/core/ports/name.cc
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--ipc/chromium/src/mojo/core/ports/name.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/ipc/chromium/src/mojo/core/ports/name.cc b/ipc/chromium/src/mojo/core/ports/name.cc
new file mode 100644
index 0000000000..17a787d933
--- /dev/null
+++ b/ipc/chromium/src/mojo/core/ports/name.cc
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/core/ports/name.h"
+#include "chrome/common/ipc_message_utils.h"
+
+namespace mojo {
+namespace core {
+namespace ports {
+
+std::ostream& operator<<(std::ostream& stream, const Name& name) {
+ std::ios::fmtflags flags(stream.flags());
+ stream << std::hex << std::uppercase << name.v1;
+ if (name.v2 != 0) {
+ stream << '.' << name.v2;
+ }
+ stream.flags(flags);
+ return stream;
+}
+
+mozilla::Logger& operator<<(mozilla::Logger& log, const Name& name) {
+ log.printf("%" PRIX64, name.v1);
+ if (name.v2 != 0) {
+ log.printf(".%" PRIX64, name.v2);
+ }
+ return log;
+}
+
+} // namespace ports
+} // namespace core
+} // namespace mojo
+
+void IPC::ParamTraits<mojo::core::ports::PortName>::Write(
+ MessageWriter* aWriter, const paramType& aParam) {
+ WriteParam(aWriter, aParam.v1);
+ WriteParam(aWriter, aParam.v2);
+}
+
+bool IPC::ParamTraits<mojo::core::ports::PortName>::Read(MessageReader* aReader,
+ paramType* aResult) {
+ return ReadParam(aReader, &aResult->v1) && ReadParam(aReader, &aResult->v2);
+}
+
+void IPC::ParamTraits<mojo::core::ports::NodeName>::Write(
+ MessageWriter* aWriter, const paramType& aParam) {
+ WriteParam(aWriter, aParam.v1);
+ WriteParam(aWriter, aParam.v2);
+}
+
+bool IPC::ParamTraits<mojo::core::ports::NodeName>::Read(MessageReader* aReader,
+ paramType* aResult) {
+ return ReadParam(aReader, &aResult->v1) && ReadParam(aReader, &aResult->v2);
+}