Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7c89b41

Browse files
renyoustuartmorgan-garbreng
authored
Flutter 1.21 candidate.10 (#20480)
* Add virtual destructors to ByteStream* (#20417) * Fix broken symbols on Fuchsia embedder (#20459) See: b/163653659 Co-authored-by: stuartmorgan <stuartmorgan@google.com> Co-authored-by: David Worsham <dworsham@google.com>
1 parent 235e389 commit 7c89b41

3 files changed

Lines changed: 125 additions & 109 deletions

File tree

shell/platform/common/cpp/client_wrapper/byte_buffer_streams.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class ByteBufferStreamReader : public ByteStreamReader {
2323
explicit ByteBufferStreamReader(const uint8_t* bytes, size_t size)
2424
: bytes_(bytes), size_(size) {}
2525

26+
virtual ~ByteBufferStreamReader() = default;
27+
2628
// |ByteStreamReader|
2729
uint8_t ReadByte() override {
2830
if (location_ >= size_) {
@@ -69,6 +71,8 @@ class ByteBufferStreamWriter : public ByteStreamWriter {
6971
assert(buffer);
7072
}
7173

74+
virtual ~ByteBufferStreamWriter() = default;
75+
7276
// |ByteStreamWriter|
7377
void WriteByte(uint8_t byte) { bytes_->push_back(byte); }
7478

shell/platform/common/cpp/client_wrapper/include/flutter/byte_streams.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ namespace flutter {
1212
// An interface for a class that reads from a byte stream.
1313
class ByteStreamReader {
1414
public:
15+
explicit ByteStreamReader() = default;
16+
virtual ~ByteStreamReader() = default;
17+
1518
// Reads and returns the next byte from the stream.
1619
virtual uint8_t ReadByte() = 0;
1720

@@ -48,6 +51,9 @@ class ByteStreamReader {
4851
// An interface for a class that writes to a byte stream.
4952
class ByteStreamWriter {
5053
public:
54+
explicit ByteStreamWriter() = default;
55+
virtual ~ByteStreamWriter() = default;
56+
5157
// Writes |byte| to the stream.
5258
virtual void WriteByte(uint8_t byte) = 0;
5359

shell/platform/fuchsia/flutter/BUILD.gn

Lines changed: 115 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -21,98 +21,120 @@ shell_gpu_configuration("fuchsia_legacy_gpu_configuration") {
2121
enable_metal = false
2222
}
2323

24-
source_set("flutter_runner_sources") {
25-
sources = [
26-
"accessibility_bridge.cc",
27-
"accessibility_bridge.h",
28-
"component.cc",
29-
"component.h",
30-
"compositor_context.cc",
31-
"compositor_context.h",
32-
"engine.cc",
33-
"engine.h",
34-
"flutter_runner_product_configuration.cc",
35-
"flutter_runner_product_configuration.h",
36-
"fuchsia_intl.cc",
37-
"fuchsia_intl.h",
38-
"isolate_configurator.cc",
39-
"isolate_configurator.h",
40-
"logging.h",
41-
"loop.cc",
42-
"loop.h",
43-
"platform_view.cc",
44-
"platform_view.h",
45-
"runner.cc",
46-
"runner.h",
47-
"session_connection.cc",
48-
"session_connection.h",
49-
"surface.cc",
50-
"surface.h",
51-
"task_observers.cc",
52-
"task_observers.h",
53-
"task_runner_adapter.cc",
54-
"task_runner_adapter.h",
55-
"thread.cc",
56-
"thread.h",
57-
"unique_fdio_ns.h",
58-
"vsync_recorder.cc",
59-
"vsync_recorder.h",
60-
"vsync_waiter.cc",
61-
"vsync_waiter.h",
62-
"vulkan_surface.cc",
63-
"vulkan_surface.h",
64-
"vulkan_surface_pool.cc",
65-
"vulkan_surface_pool.h",
66-
"vulkan_surface_producer.cc",
67-
"vulkan_surface_producer.h",
68-
]
24+
template("runner_sources") {
25+
assert(defined(invoker.product), "runner_sources must define product")
6926

70-
# The use of these dependencies is temporary and will be moved behind the
71-
# embedder API.
72-
flutter_public_deps = [
73-
"//flutter/flow:flow_fuchsia_legacy",
74-
"//flutter/lib/ui:ui_fuchsia_legacy",
75-
"//flutter/runtime:runtime_fuchsia_legacy",
76-
"//flutter/shell/common:common_fuchsia_legacy",
77-
]
78-
flutter_deps = [
79-
":fuchsia_legacy_gpu_configuration",
80-
"//flutter/assets",
81-
"//flutter/common",
82-
"//flutter/fml",
83-
"//flutter/vulkan",
84-
]
27+
extra_defines = []
28+
if (invoker.product) {
29+
extra_defines += [ "DART_PRODUCT" ]
30+
}
8531

86-
public_deps = [
87-
"$fuchsia_sdk_root/pkg:scenic_cpp",
88-
"$fuchsia_sdk_root/pkg:sys_cpp",
89-
"//flutter/shell/platform/fuchsia/runtime/dart/utils",
90-
] + flutter_public_deps
32+
source_set(target_name) {
33+
sources = [
34+
"accessibility_bridge.cc",
35+
"accessibility_bridge.h",
36+
"component.cc",
37+
"component.h",
38+
"compositor_context.cc",
39+
"compositor_context.h",
40+
"engine.cc",
41+
"engine.h",
42+
"flutter_runner_product_configuration.cc",
43+
"flutter_runner_product_configuration.h",
44+
"fuchsia_intl.cc",
45+
"fuchsia_intl.h",
46+
"isolate_configurator.cc",
47+
"isolate_configurator.h",
48+
"logging.h",
49+
"loop.cc",
50+
"loop.h",
51+
"platform_view.cc",
52+
"platform_view.h",
53+
"runner.cc",
54+
"runner.h",
55+
"session_connection.cc",
56+
"session_connection.h",
57+
"surface.cc",
58+
"surface.h",
59+
"task_observers.cc",
60+
"task_observers.h",
61+
"task_runner_adapter.cc",
62+
"task_runner_adapter.h",
63+
"thread.cc",
64+
"thread.h",
65+
"unique_fdio_ns.h",
66+
"vsync_recorder.cc",
67+
"vsync_recorder.h",
68+
"vsync_waiter.cc",
69+
"vsync_waiter.h",
70+
"vulkan_surface.cc",
71+
"vulkan_surface.h",
72+
"vulkan_surface_pool.cc",
73+
"vulkan_surface_pool.h",
74+
"vulkan_surface_producer.cc",
75+
"vulkan_surface_producer.h",
76+
]
9177

92-
deps = [
93-
"$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics",
94-
"$fuchsia_sdk_root/fidl:fuchsia.fonts",
95-
"$fuchsia_sdk_root/fidl:fuchsia.images",
96-
"$fuchsia_sdk_root/fidl:fuchsia.intl",
97-
"$fuchsia_sdk_root/fidl:fuchsia.io",
98-
"$fuchsia_sdk_root/fidl:fuchsia.sys",
99-
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
100-
"$fuchsia_sdk_root/fidl:fuchsia.ui.scenic",
101-
"$fuchsia_sdk_root/pkg:async-cpp",
102-
"$fuchsia_sdk_root/pkg:async-default",
103-
"$fuchsia_sdk_root/pkg:async-loop",
104-
"$fuchsia_sdk_root/pkg:async-loop-cpp",
105-
"$fuchsia_sdk_root/pkg:fdio",
106-
"$fuchsia_sdk_root/pkg:fidl_cpp",
107-
"$fuchsia_sdk_root/pkg:syslog",
108-
"$fuchsia_sdk_root/pkg:trace",
109-
"$fuchsia_sdk_root/pkg:trace-engine",
110-
"$fuchsia_sdk_root/pkg:trace-provider-so",
111-
"$fuchsia_sdk_root/pkg:vfs_cpp",
112-
"$fuchsia_sdk_root/pkg:zx",
113-
"//flutter/shell/platform/fuchsia/dart-pkg/fuchsia",
114-
"//flutter/shell/platform/fuchsia/dart-pkg/zircon",
115-
] + flutter_deps
78+
defines = extra_defines
79+
if (flutter_runtime_mode == "profile") {
80+
defines += [ "FLUTTER_PROFILE" ]
81+
}
82+
83+
# The use of these dependencies is temporary and will be moved behind the
84+
# embedder API.
85+
flutter_public_deps = [
86+
"//flutter/flow:flow_fuchsia_legacy",
87+
"//flutter/lib/ui:ui_fuchsia_legacy",
88+
"//flutter/runtime:runtime_fuchsia_legacy",
89+
"//flutter/shell/common:common_fuchsia_legacy",
90+
]
91+
flutter_deps = [
92+
":fuchsia_legacy_gpu_configuration",
93+
"//flutter/assets",
94+
"//flutter/common",
95+
"//flutter/fml",
96+
"//flutter/vulkan",
97+
]
98+
99+
public_deps = [
100+
"$fuchsia_sdk_root/pkg:scenic_cpp",
101+
"$fuchsia_sdk_root/pkg:sys_cpp",
102+
"//flutter/shell/platform/fuchsia/runtime/dart/utils",
103+
] + flutter_public_deps
104+
105+
deps = [
106+
"$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics",
107+
"$fuchsia_sdk_root/fidl:fuchsia.fonts",
108+
"$fuchsia_sdk_root/fidl:fuchsia.images",
109+
"$fuchsia_sdk_root/fidl:fuchsia.intl",
110+
"$fuchsia_sdk_root/fidl:fuchsia.io",
111+
"$fuchsia_sdk_root/fidl:fuchsia.sys",
112+
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
113+
"$fuchsia_sdk_root/fidl:fuchsia.ui.scenic",
114+
"$fuchsia_sdk_root/pkg:async-cpp",
115+
"$fuchsia_sdk_root/pkg:async-default",
116+
"$fuchsia_sdk_root/pkg:async-loop",
117+
"$fuchsia_sdk_root/pkg:async-loop-cpp",
118+
"$fuchsia_sdk_root/pkg:fdio",
119+
"$fuchsia_sdk_root/pkg:fidl_cpp",
120+
"$fuchsia_sdk_root/pkg:syslog",
121+
"$fuchsia_sdk_root/pkg:trace",
122+
"$fuchsia_sdk_root/pkg:trace-engine",
123+
"$fuchsia_sdk_root/pkg:trace-provider-so",
124+
"$fuchsia_sdk_root/pkg:vfs_cpp",
125+
"$fuchsia_sdk_root/pkg:zx",
126+
"//flutter/shell/platform/fuchsia/dart-pkg/fuchsia",
127+
"//flutter/shell/platform/fuchsia/dart-pkg/zircon",
128+
] + flutter_deps
129+
}
130+
}
131+
132+
runner_sources("flutter_runner_sources") {
133+
product = false
134+
}
135+
136+
runner_sources("flutter_runner_sources_product") {
137+
product = true
116138
}
117139

118140
# Things that explicitly being excluded:
@@ -142,20 +164,18 @@ template("flutter_runner") {
142164
invoker_output_name = invoker.output_name
143165
extra_deps = invoker.extra_deps
144166

145-
extra_defines = []
146-
if (defined(invoker.extra_defines)) {
147-
extra_defines += invoker.extra_defines
167+
product_suffix = ""
168+
if (invoker.product) {
169+
product_suffix = "_product"
148170
}
149171

150172
executable(target_name) {
151173
output_name = invoker_output_name
152174

153-
defines = extra_defines
154-
155175
sources = [ "main.cc" ]
156176

157177
deps = [
158-
":flutter_runner_sources",
178+
":flutter_runner_sources${product_suffix}",
159179
"$fuchsia_sdk_root/pkg:async-loop-cpp",
160180
"$fuchsia_sdk_root/pkg:trace",
161181
"$fuchsia_sdk_root/pkg:trace-provider-so",
@@ -177,11 +197,6 @@ flutter_runner("jit") {
177197
output_name = "flutter_jit_runner"
178198
product = false
179199

180-
extra_defines = []
181-
if (flutter_runtime_mode == "profile") {
182-
extra_defines += [ "FLUTTER_PROFILE" ]
183-
}
184-
185200
extra_deps = [
186201
"//third_party/dart/runtime:libdart_jit",
187202
"//third_party/dart/runtime/platform:libdart_platform_jit",
@@ -192,8 +207,6 @@ flutter_runner("jit_product") {
192207
output_name = "flutter_jit_product_runner"
193208
product = true
194209

195-
extra_defines = [ "DART_PRODUCT" ]
196-
197210
extra_deps = [
198211
"//third_party/dart/runtime:libdart_jit_product",
199212
"//third_party/dart/runtime/platform:libdart_platform_jit_product",
@@ -204,11 +217,6 @@ flutter_runner("aot") {
204217
output_name = "flutter_aot_runner"
205218
product = false
206219

207-
extra_defines = []
208-
if (flutter_runtime_mode == "profile") {
209-
extra_defines += [ "FLUTTER_PROFILE" ]
210-
}
211-
212220
extra_deps = [
213221
"//third_party/dart/runtime:libdart_precompiled_runtime",
214222
"//third_party/dart/runtime/platform:libdart_platform_precompiled_runtime",
@@ -219,8 +227,6 @@ flutter_runner("aot_product") {
219227
output_name = "flutter_aot_product_runner"
220228
product = true
221229

222-
extra_defines = [ "DART_PRODUCT" ]
223-
224230
extra_deps = [
225231
"//third_party/dart/runtime:libdart_precompiled_runtime_product",
226232
"//third_party/dart/runtime/platform:libdart_platform_precompiled_runtime_product",

0 commit comments

Comments
 (0)