[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / fuchsia_component_support / config_reader.h
1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_FUCHSIA_COMPONENT_SUPPORT_CONFIG_READER_H_
6 #define COMPONENTS_FUCHSIA_COMPONENT_SUPPORT_CONFIG_READER_H_
7
8 #include "base/values.h"
9 #include "third_party/abseil-cpp/absl/types/optional.h"
10
11 namespace base {
12 class FilePath;
13 }
14
15 namespace fuchsia_component_support {
16
17 // Return a JSON dictionary read from the calling Component's config-data.
18 // All *.json files in the config-data directory are read, parsed, and merged
19 // into a single JSON dictionary value.
20 // Null is returned if no config-data exists for the Component.
21 // CHECK()s if one or more config files are malformed, or there are duplicate
22 // non-dictionary fields in different config files.
23 const absl::optional<base::Value::Dict>& LoadPackageConfig();
24
25 // Used to test the implementation of LoadPackageConfig().
26 absl::optional<base::Value::Dict> LoadConfigFromDirForTest(
27     const base::FilePath& dir);
28
29 }  // namespace fuchsia_component_support
30
31 #endif  // COMPONENTS_FUCHSIA_COMPONENT_SUPPORT_CONFIG_READER_H_