blob: d96c870763f348fb6518ba2cd49dce192ad460d2 [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_STORAGE_BLOBFS_SERVICE_HEALTH_CHECK_H_
#define SRC_STORAGE_BLOBFS_SERVICE_HEALTH_CHECK_H_
#ifndef __Fuchsia__
#error Fuchsia-only Header
#endif
#include <fidl/fuchsia.update.verify/cpp/wire.h>
#include <lib/async/dispatcher.h>
#include "src/storage/blobfs/blobfs.h"
#include "src/storage/lib/vfs/cpp/service.h"
namespace blobfs {
// HealthCheckService is a service which clients can use to ask blobfs to perform basic self-checks
// of runtime behaviour (such as reading, writing files).
class HealthCheckService : public fidl::WireServer<fuchsia_update_verify::BlobfsVerifier>,
public fs::Service {
public:
// fuchsia.update.verify.BlobfsVerifier interface
void Verify(VerifyRequestView request, VerifyCompleter::Sync& completer) final;
protected:
friend fbl::internal::MakeRefCountedHelper<HealthCheckService>;
friend fbl::RefPtr<HealthCheckService>;
HealthCheckService(async_dispatcher_t* dispatcher, Blobfs& blobfs);
~HealthCheckService() override = default;
private:
Blobfs& blobfs_;
};
} // namespace blobfs
#endif // SRC_STORAGE_BLOBFS_SERVICE_HEALTH_CHECK_H_