fake_drivefs_launcher_client.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_COMPONENTS_DRIVEFS_FAKE_DRIVEFS_LAUNCHER_CLIENT_H_
  5. #define ASH_COMPONENTS_DRIVEFS_FAKE_DRIVEFS_LAUNCHER_CLIENT_H_
  6. #include "ash/components/drivefs/mojom/fake_drivefs_launcher.mojom.h"
  7. #include "base/component_export.h"
  8. #include "base/files/file_path.h"
  9. #include "base/no_destructor.h"
  10. #include "mojo/public/cpp/bindings/remote.h"
  11. namespace drivefs {
  12. class FakeDriveFsLauncherClient {
  13. public:
  14. COMPONENT_EXPORT(DRIVEFS)
  15. static void Init(const base::FilePath& socket_path,
  16. const base::FilePath& chroot_path);
  17. FakeDriveFsLauncherClient(const FakeDriveFsLauncherClient&) = delete;
  18. FakeDriveFsLauncherClient& operator=(const FakeDriveFsLauncherClient&) =
  19. delete;
  20. private:
  21. friend class base::NoDestructor<FakeDriveFsLauncherClient>;
  22. FakeDriveFsLauncherClient(const base::FilePath& chroot_path,
  23. const base::FilePath& socket_path);
  24. ~FakeDriveFsLauncherClient();
  25. base::FilePath MaybeMountDriveFs(
  26. const std::string& source_path,
  27. const std::vector<std::string>& mount_options);
  28. const base::FilePath chroot_path_;
  29. const base::FilePath socket_path_;
  30. mojo::Remote<mojom::FakeDriveFsLauncher> launcher_;
  31. };
  32. } // namespace drivefs
  33. #endif // ASH_COMPONENTS_DRIVEFS_FAKE_DRIVEFS_LAUNCHER_CLIENT_H_