Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
root_inspect_node.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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
6
7#include <lib/async/default.h>
8
9namespace dart_utils {
10
11std::unique_ptr<inspect::ComponentInspector> RootInspectNode::inspector_;
12std::mutex RootInspectNode::mutex_;
13
14void RootInspectNode::Initialize(sys::ComponentContext* context) {
15 std::lock_guard<std::mutex> lock(mutex_);
16 if (!inspector_) {
17 inspector_ = std::make_unique<inspect::ComponentInspector>(
18 async_get_default_dispatcher(), inspect::PublishOptions{});
19 }
20}
21
22inspect::Node RootInspectNode::CreateRootChild(const std::string& name) {
23 std::lock_guard<std::mutex> lock(mutex_);
24 return inspector_->inspector().GetRoot().CreateChild(name);
25}
26
27inspect::Inspector* RootInspectNode::GetInspector() {
28 return &inspector_->inspector();
29}
30
31} // namespace dart_utils
static inspect::Inspector * GetInspector()
static void Initialize(sys::ComponentContext *context)
static inspect::Node CreateRootChild(const std::string &name)
const char * name
Definition fuchsia.cc:50