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.
5 #include "components/fuchsia_component_support/inspect.h"
7 #include <lib/sys/inspect/cpp/component.h>
9 #include "components/version_info/version_info.h"
11 namespace fuchsia_component_support {
14 const char kVersion[] = "version";
15 const char kLastChange[] = "last_change_revision";
18 void PublishVersionInfoToInspect(sys::ComponentInspector* inspector) {
19 // These values are managed by the inspector, since they won't be updated over
20 // the lifetime of the component.
21 // TODO(https://crbug.com/1077428): Add release channel.
22 inspector->root().CreateString(
23 kVersion, std::string(version_info::GetVersionNumber()), inspector);
24 inspector->root().CreateString(
25 kLastChange, std::string(version_info::GetLastChange()), inspector);
28 } // namespace fuchsia_component_support