inspect.cc 1010 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/fuchsia_component_support/inspect.h"
  5. #include <lib/sys/inspect/cpp/component.h>
  6. #include "components/version_info/version_info.h"
  7. namespace fuchsia_component_support {
  8. namespace {
  9. const char kVersion[] = "version";
  10. const char kLastChange[] = "last_change_revision";
  11. } // namespace
  12. void PublishVersionInfoToInspect(sys::ComponentInspector* inspector) {
  13. // These values are managed by the inspector, since they won't be updated over
  14. // the lifetime of the component.
  15. // TODO(https://crbug.com/1077428): Add release channel.
  16. inspector->root().CreateString(kVersion, version_info::GetVersionNumber(),
  17. inspector);
  18. inspector->root().CreateString(kLastChange, version_info::GetLastChange(),
  19. inspector);
  20. }
  21. } // namespace fuchsia_component_support