startup.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2020 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 CHROMEOS_STARTUP_STARTUP_H_
  5. #define CHROMEOS_STARTUP_STARTUP_H_
  6. #include <string>
  7. #include "base/component_export.h"
  8. #include "base/files/scoped_file.h"
  9. #include "chromeos/crosapi/mojom/crosapi.mojom.h"
  10. #include "third_party/abseil-cpp/absl/types/optional.h"
  11. namespace chromeos {
  12. // Reads the startup data. The FD to be read for the startup data should be
  13. // specified via the kCrosStartupDataFD command line flag. This function
  14. // consumes the FD, so this must not be called twice in a process.
  15. COMPONENT_EXPORT(CHROMEOS_STARTUP)
  16. absl::optional<std::string> ReadStartupData();
  17. // Reads the post-login data. The FD to be read for the startup data should be
  18. // specified via the kCrosPostLoginDataFD command line flag. This function
  19. // consumes the FD, so this must not be called twice in a process.
  20. COMPONENT_EXPORT(CHROMEOS_STARTUP)
  21. absl::optional<std::string> ReadPostLoginData();
  22. // Creates a memory backed file containing the serialized |params|,
  23. // and returns its FD.
  24. COMPONENT_EXPORT(CHROMEOS_STARTUP)
  25. base::ScopedFD CreateMemFDFromBrowserInitParams(
  26. const crosapi::mojom::BrowserInitParamsPtr& data);
  27. } // namespace chromeos
  28. #endif // CHROMEOS_STARTUP_STARTUP_H_