Commit 70879ba6 authored by Sharon Yang's avatar Sharon Yang Committed by Commit Bot

[fuchsia] Remove default_context.h/cc

To finish the default_context migration, remove the old default_context
files.

Test: CQ
Bug: 1090364
Change-Id: I415b793572ed6d9042a7fded0ae258f83446ad04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303781Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799703}
parent 4a991b97
// Copyright 2019 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/default_context.h"
#include <lib/sys/cpp/component_context.h>
#include "base/fuchsia/file_utils.h"
#include "base/no_destructor.h"
namespace base {
namespace {
std::unique_ptr<sys::ComponentContext>* ProcessComponentContextPtr() {
static base::NoDestructor<std::unique_ptr<sys::ComponentContext>> value(
std::make_unique<sys::ComponentContext>(
sys::ServiceDirectory::CreateFromNamespace()));
return value.get();
}
} // namespace
namespace fuchsia {
sys::ComponentContext* ComponentContextForCurrentProcess() {
return ProcessComponentContextPtr()->get();
}
} // namespace fuchsia
std::unique_ptr<sys::ComponentContext>
ReplaceComponentContextForCurrentProcessForTest(
std::unique_ptr<sys::ComponentContext> context) {
std::swap(*ProcessComponentContextPtr(), context);
return context;
}
} // namespace base
// Copyright 2019 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.
#ifndef BASE_FUCHSIA_DEFAULT_CONTEXT_H_
#define BASE_FUCHSIA_DEFAULT_CONTEXT_H_
#include <memory>
#include "base/base_export.h"
namespace sys {
class ComponentContext;
} // namespace sys
namespace base {
namespace fuchsia {
// TODO(https://crbug.com/1090364): Remove this file when external dependencies
// have been migrated to process_context.
// Returns default sys::ComponentContext for the current process.
BASE_EXPORT sys::ComponentContext* ComponentContextForCurrentProcess();
} // namespace fuchsia
// Replaces the default sys::ComponentContext for the current process, and
// returns the previously-active one.
// Use the base::TestComponentContextForProcess rather than calling this
// directly.
BASE_EXPORT std::unique_ptr<sys::ComponentContext>
ReplaceComponentContextForCurrentProcessForTest(
std::unique_ptr<sys::ComponentContext> context);
} // namespace base
#endif // BASE_FUCHSIA_DEFAULT_CONTEXT_H_
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <utility> #include <utility>
#include "base/check.h" #include "base/check.h"
#include "base/fuchsia/default_context.h"
#include "base/fuchsia/fuchsia_logging.h" #include "base/fuchsia/fuchsia_logging.h"
#include "base/fuchsia/process_context.h" #include "base/fuchsia/process_context.h"
#include "base/notreached.h" #include "base/notreached.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment