Flutter Engine
The Flutter Engine
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Properties
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Related Functions
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
y
Enumerator
b
c
d
e
f
g
h
k
l
m
n
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
shell
platform
fuchsia
dart_runner
main.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
5
#include <lib/async-loop/cpp/loop.h>
6
#include <lib/async-loop/default.h>
7
#include <lib/inspect/component/cpp/component.h>
8
#include <lib/trace-provider/provider.h>
9
#include <lib/trace/event.h>
10
11
#include "
dart_runner.h
"
12
#include "flutter/fml/logging.h"
13
#include "flutter/fml/platform/fuchsia/log_interest_listener.h"
14
#include "flutter/fml/platform/fuchsia/log_state.h"
15
#include "flutter/fml/trace_event.h"
16
#include "
logging.h
"
17
#include "
platform/utils.h
"
18
#include "
runtime/dart/utils/build_info.h
"
19
#include "
runtime/dart/utils/files.h
"
20
#include "
runtime/dart/utils/root_inspect_node.h
"
21
#include "
runtime/dart/utils/tempfs.h
"
22
#include "third_party/dart/runtime/include/dart_api.h"
23
24
#if !defined(DART_PRODUCT)
25
// Register native symbol information for the Dart VM's profiler.
26
static
void
RegisterProfilerSymbols
(
const
char
* symbols_path,
27
const
char
* dso_name) {
28
std::string*
symbols
=
new
std::string();
29
if
(
dart_utils::ReadFileToString
(symbols_path,
symbols
)) {
30
Dart_AddSymbols
(dso_name,
symbols
->data(),
symbols
->size());
31
}
else
{
32
FML_LOG
(
ERROR
) <<
"Failed to load "
<< symbols_path;
33
FML_CHECK
(
false
);
34
}
35
}
36
#endif
// !defined(DART_PRODUCT)
37
38
int
main
(
int
argc,
const
char
**
argv
) {
39
async::Loop loop(&kAsyncLoopConfigAttachToCurrentThread);
40
41
// Setup logging.
42
fml::LogState::Default
().
SetTags
({
LOG_TAG
});
43
fml::LogInterestListener
listener(
fml::LogState::Default
().TakeClientEnd(),
44
loop.dispatcher());
45
listener.
AsyncWaitForInterestChanged
();
46
47
// Create our component context which is served later.
48
auto
context =
sys::ComponentContext::Create
();
49
dart_utils::RootInspectNode::Initialize
(context.get());
50
auto
build_info =
dart_utils::RootInspectNode::CreateRootChild
(
"build_info"
);
51
dart_utils::BuildInfo::Dump
(build_info);
52
53
dart::SetDartVmNode
(std::make_unique<inspect::Node>(
54
dart_utils::RootInspectNode::CreateRootChild
(
"vm"
)));
55
56
std::unique_ptr<trace::TraceProviderWithFdio> provider;
57
{
58
bool
already_started;
59
// Use CreateSynchronously to prevent loss of early events.
60
trace::TraceProviderWithFdio::CreateSynchronously(
61
loop.dispatcher(),
"dart_runner"
, &provider, &already_started);
62
}
63
64
#if !defined(DART_PRODUCT)
65
#if defined(AOT_RUNTIME)
66
RegisterProfilerSymbols
(
"pkg/data/dart_aot_runner.dartprofilersymbols"
,
""
);
67
#else
68
RegisterProfilerSymbols
(
"pkg/data/dart_jit_runner.dartprofilersymbols"
,
""
);
69
#endif
// defined(AOT_RUNTIME)
70
#endif
// !defined(DART_PRODUCT)
71
72
dart_runner::DartRunner
runner(context.get());
73
74
// Wait to serve until we have finished all of our setup.
75
context->outgoing()->ServeFromStartupInfo();
76
77
loop.Run();
78
return
0;
79
}
Create
static sk_sp< Effect > Create()
Definition:
RefCntTest.cpp:117
build_info.h
dart_runner::DartRunner
Definition:
dart_runner.h:17
dart_utils::BuildInfo::Dump
static void Dump(inspect::Node &node)
Definition:
build_info_in.cc:25
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
fml::LogInterestListener
Definition:
log_interest_listener.h:18
fml::LogInterestListener::AsyncWaitForInterestChanged
void AsyncWaitForInterestChanged()
Definition:
log_interest_listener.cc:16
fml::LogState::SetTags
void SetTags(const std::initializer_list< std::string > &tags)
Definition:
log_state.cc:56
fml::LogState::Default
static LogState & Default()
Definition:
log_state.cc:61
Dart_AddSymbols
DART_EXPORT void Dart_AddSymbols(const char *dso_name, void *buffer, intptr_t buffer_size)
dart_runner.h
main
int main(int argc, char **argv)
Definition:
main.cc:407
files.h
FML_LOG
#define FML_LOG(severity)
Definition:
logging.h:82
FML_CHECK
#define FML_CHECK(condition)
Definition:
logging.h:85
argv
char ** argv
Definition:
library.h:9
dart_profiler_symbols.symbols
list symbols
Definition:
dart_profiler_symbols.py:62
dart_utils::ReadFileToString
bool ReadFileToString(const std::string &path, std::string *result)
Definition:
files.cc:56
dart::SetDartVmNode
void SetDartVmNode(std::unique_ptr< inspect::Node > node)
root_inspect_node.h
utils.h
LOG_TAG
#define LOG_TAG
Definition:
logging.h:11
RegisterProfilerSymbols
static void RegisterProfilerSymbols(const char *symbols_path, const char *dso_name)
Definition:
main.cc:26
tempfs.h
logging.h
ERROR
#define ERROR(message)
Definition:
elf_loader.cc:260
Generated on Sun Jun 23 2024 21:54:56 for Flutter Engine by
1.9.4