Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
fuchsia
runtime
dart
utils
root_inspect_node.h
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
5
#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_ROOT_INSPECT_NODE_H_
6
#define FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_ROOT_INSPECT_NODE_H_
7
8
#include <lib/inspect/component/cpp/component.h>
9
#include <lib/sys/cpp/component_context.h>
10
11
#include <memory>
12
#include <mutex>
13
14
namespace
dart_utils
{
15
16
// This singleton object offers a way to create a new inspect node under the
17
// root node in a thread safe way.
18
//
19
// Usage notes:
20
// RootInspectNode::Initialize() must be invoked once in the program's
21
// main before trying to obtain a child node.
22
class
RootInspectNode
{
23
private
:
24
RootInspectNode
() =
default
;
25
~RootInspectNode
() =
default
;
26
27
public
:
28
// Initializes the underlying component inspector. Must be invoked at least
29
// once before calling CreateRootChild().
30
static
void
Initialize
(sys::ComponentContext* context);
31
32
// Creates an inspect node which is a child of the component's root inspect
33
// node with the provided |name|.
34
static
inspect::Node
CreateRootChild
(
const
std::string&
name
);
35
36
// Gets an instance to the component's inspector.
37
static
inspect::Inspector*
GetInspector
();
38
39
private
:
40
static
std::unique_ptr<inspect::ComponentInspector> inspector_;
41
static
std::mutex mutex_;
42
};
43
44
}
// namespace dart_utils
45
46
#endif
// FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_ROOT_INSPECT_NODE_H_
dart_utils::RootInspectNode
Definition
root_inspect_node.h:22
dart_utils::RootInspectNode::GetInspector
static inspect::Inspector * GetInspector()
Definition
root_inspect_node.cc:26
dart_utils::RootInspectNode::Initialize
static void Initialize(sys::ComponentContext *context)
Definition
root_inspect_node.cc:13
dart_utils::RootInspectNode::CreateRootChild
static inspect::Node CreateRootChild(const std::string &name)
Definition
root_inspect_node.cc:21
name
const char * name
Definition
fuchsia.cc:50
dart_utils
Definition
build_info.h:10
Generated on Fri Apr 26 2024 06:14:30 for Flutter Engine by
1.9.8