|
7 | 7 | #include <fcntl.h> |
8 | 8 | #include <fuchsia/mem/cpp/fidl.h> |
9 | 9 | #include <lib/async/cpp/task.h> |
| 10 | +#include <lib/inspect/cpp/inspect.h> |
10 | 11 | #include <lib/trace-engine/instrumentation.h> |
11 | 12 | #include <zircon/status.h> |
12 | 13 | #include <zircon/types.h> |
|
20 | 21 | #include "flutter/runtime/dart_vm.h" |
21 | 22 | #include "lib/sys/cpp/component_context.h" |
22 | 23 | #include "runtime/dart/utils/files.h" |
| 24 | +#include "runtime/dart/utils/root_inspect_node.h" |
23 | 25 | #include "runtime/dart/utils/vmo.h" |
24 | 26 | #include "runtime/dart/utils/vmservice_object.h" |
25 | 27 | #include "third_party/icu/source/common/unicode/udata.h" |
@@ -156,6 +158,22 @@ Runner::Runner(async::Loop* loop, sys::ComponentContext* context) |
156 | 158 | dart_utils::VMServiceObject::kPortDirName, |
157 | 159 | std::make_unique<dart_utils::VMServiceObject>()); |
158 | 160 |
|
| 161 | + inspect::Inspector* inspector = dart_utils::RootInspectNode::GetInspector(); |
| 162 | + inspector->GetRoot().CreateLazyValues( |
| 163 | + "vmservice_port", |
| 164 | + [&]() { |
| 165 | + inspect::Inspector inspector; |
| 166 | + dart_utils::VMServiceObject::LazyEntryVector out; |
| 167 | + dart_utils::VMServiceObject().GetContents(&out); |
| 168 | + std::string name = ""; |
| 169 | + if (out.size() > 0) { |
| 170 | + name = out[0].name; |
| 171 | + } |
| 172 | + inspector.GetRoot().CreateString("vm_service_port", name, &inspector); |
| 173 | + return fit::make_ok_promise(inspector); |
| 174 | + }, |
| 175 | + inspector); |
| 176 | + |
159 | 177 | SetupTraceObserver(); |
160 | 178 | #endif // !defined(DART_PRODUCT) |
161 | 179 |
|
|
0 commit comments