Commit 38108391 authored by Yusuke Sato's avatar Yusuke Sato Committed by Commit Bot

arcvm: Support loading features.json on ARCVM

This CL depends on chrome-internal:2517652 to fully work.

BUG=b:123162143
TEST=ARCVM still starts

Change-Id: I56c5608fa97e014a14c807e8a035b98f295f7d55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2041886Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Yusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739454}
parent 6a1b1ed5
...@@ -15,11 +15,14 @@ ...@@ -15,11 +15,14 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/threading/scoped_blocking_call.h" #include "base/threading/scoped_blocking_call.h"
#include "base/values.h" #include "base/values.h"
#include "components/arc/arc_util.h"
namespace arc { namespace arc {
namespace { namespace {
constexpr const base::FilePath::CharType kArcVmFeaturesJsonFile[] =
FILE_PATH_LITERAL("/etc/arcvm/features.json");
constexpr const base::FilePath::CharType kArcFeaturesJsonFile[] = constexpr const base::FilePath::CharType kArcFeaturesJsonFile[] =
FILE_PATH_LITERAL("/etc/arc/features.json"); FILE_PATH_LITERAL("/etc/arc/features.json");
...@@ -141,10 +144,12 @@ ArcFeatures& ArcFeatures::operator=(ArcFeatures&& other) = default; ...@@ -141,10 +144,12 @@ ArcFeatures& ArcFeatures::operator=(ArcFeatures&& other) = default;
void ArcFeaturesParser::GetArcFeatures( void ArcFeaturesParser::GetArcFeatures(
base::OnceCallback<void(base::Optional<ArcFeatures>)> callback) { base::OnceCallback<void(base::Optional<ArcFeatures>)> callback) {
const auto* json_file =
arc::IsArcVmEnabled() ? kArcVmFeaturesJsonFile : kArcFeaturesJsonFile;
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
FROM_HERE, FROM_HERE,
{base::ThreadPool(), base::MayBlock(), base::TaskPriority::BEST_EFFORT}, {base::ThreadPool(), base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&ReadOnFileThread, base::FilePath(kArcFeaturesJsonFile)), base::BindOnce(&ReadOnFileThread, base::FilePath(json_file)),
std::move(callback)); std::move(callback));
} }
......
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