diff options
Diffstat (limited to 'chromium/fuchsia/base/inspect.cc')
-rw-r--r-- | chromium/fuchsia/base/inspect.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/chromium/fuchsia/base/inspect.cc b/chromium/fuchsia/base/inspect.cc new file mode 100644 index 00000000000..775ae986618 --- /dev/null +++ b/chromium/fuchsia/base/inspect.cc @@ -0,0 +1,28 @@ +// 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 "fuchsia/base/inspect.h" + +#include <lib/sys/inspect/cpp/component.h> + +#include "components/version_info/version_info.h" + +namespace cr_fuchsia { + +namespace { +const char kVersion[] = "version"; +const char kLastChange[] = "last_change_revision"; +} // namespace + +void PublishVersionInfoToInspect(sys::ComponentInspector* inspector) { + // These values are managed by the inspector, since they won't be updated over + // the lifetime of the component. + // TODO(https://crbug.com/1077428): Add release channel. + inspector->root().CreateString(kVersion, version_info::GetVersionNumber(), + inspector); + inspector->root().CreateString(kLastChange, version_info::GetLastChange(), + inspector); +} + +} // namespace cr_fuchsia |