blob: 3c2aee1bc2a99b2b695cedfd2f68d2cdd68076fc [file] [log] [blame]
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/updater/ipc/ipc_names.h"
#include <optional>
#include "chrome/updater/linux/ipc_constants.h"
#include "chrome/updater/updater_scope.h"
#include "mojo/public/cpp/platform/named_platform_channel.h"
namespace updater {
mojo::NamedPlatformChannel::ServerName GetUpdateServiceInternalServerName(
UpdaterScope scope) {
return GetActiveDutyInternalSocketPath(scope).AsUTF8Unsafe();
}
mojo::NamedPlatformChannel::ServerName GetUpdateServiceServerName(
UpdaterScope scope) {
std::optional<base::FilePath> socket = GetActiveDutySocketPath(scope);
CHECK(socket);
return socket->AsUTF8Unsafe();
}
} // namespace updater