default_context.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2019 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 BASE_FUCHSIA_DEFAULT_CONTEXT_H_
  5. #define BASE_FUCHSIA_DEFAULT_CONTEXT_H_
  6. #include <memory>
  7. #include "base/base_export.h"
  8. namespace sys {
  9. class ComponentContext;
  10. } // namespace sys
  11. namespace base {
  12. namespace fuchsia {
  13. // TODO(https://crbug.com/1090364): Move this to process_context.h.
  14. // Returns default sys::ComponentContext for the current process.
  15. BASE_EXPORT sys::ComponentContext* ComponentContextForCurrentProcess();
  16. } // namespace fuchsia
  17. // Replaces the default sys::ComponentContext for the current process, and
  18. // returns the previously-active one.
  19. // Use the base::TestComponentContextForProcess rather than calling this
  20. // directly.
  21. BASE_EXPORT std::unique_ptr<sys::ComponentContext>
  22. ReplaceComponentContextForCurrentProcessForTest(
  23. std::unique_ptr<sys::ComponentContext> context);
  24. } // namespace base
  25. #endif // BASE_FUCHSIA_DEFAULT_CONTEXT_H_