From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/base/fuchsia/process_context.cc | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 chromium/base/fuchsia/process_context.cc (limited to 'chromium/base/fuchsia/process_context.cc') diff --git a/chromium/base/fuchsia/process_context.cc b/chromium/base/fuchsia/process_context.cc new file mode 100644 index 00000000000..02dfa43be75 --- /dev/null +++ b/chromium/base/fuchsia/process_context.cc @@ -0,0 +1,41 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/fuchsia/process_context.h" + +#include +#include +#include + +#include "base/fuchsia/process_context.h" +#include "base/no_destructor.h" + +namespace base { + +namespace { +std::unique_ptr* ProcessComponentContextPtr() { + static base::NoDestructor> value( + std::make_unique( + sys::ServiceDirectory::CreateFromNamespace())); + return value.get(); +} +} // namespace + +sys::ComponentInspector* ComponentInspectorForProcess() { + static base::NoDestructor value( + ComponentContextForProcess()); + return value.get(); +} + +sys::ComponentContext* ComponentContextForProcess() { + return ProcessComponentContextPtr()->get(); +} + +std::unique_ptr ReplaceComponentContextForProcessForTest( + std::unique_ptr context) { + std::swap(*ProcessComponentContextPtr(), context); + return context; +} + +} // namespace base -- cgit v1.2.1