chromium/chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/chrome_management_service.cc

// 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/browser/enterprise/connectors/device_trust/key_management/installer/management_service/chrome_management_service.h"

#include <grp.h>
#include <sys/stat.h>
#include <unistd.h>

#include <cstdint>
#include <utility>

#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
#include "base/syslog_logging.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/network/mojo_key_network_delegate.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/shared_command_constants.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/key_rotation_manager.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/metrics_utils.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/mojo_helper/mojo_helper.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/management_service/rotate_util.h"
#include "chrome/common/channel_info.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/system/invitation.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"

namespace enterprise_connectors {

namespace {

// Records an UMA metric when a failure occurs and logs a failure error message.
enterprise_connectors::Status RecordFailure(ManagementServiceError error,
                                            const std::string& log_message) {}

// Verifies group permissions for the chrome-management-service binary.
bool CheckBinaryPermissions() {}

int KeyRotationResultToExitCode(KeyRotationResult result) {}

}  // namespace

ChromeManagementService::ChromeManagementService()
    :{}

ChromeManagementService::ChromeManagementService(
    PermissionsCallback permissions_callback,
    RotationCallback rotation_callback,
    std::unique_ptr<MojoHelper> mojo_helper)
    :{}

ChromeManagementService::~ChromeManagementService() = default;

int ChromeManagementService::Run(const base::CommandLine* command_line,
                                 uint64_t pipe_name) {}

int ChromeManagementService::StartRotation(
    const base::CommandLine* command_line) {}

}  // namespace enterprise_connectors