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

Commit efa9b9d

Browse files
committed
[gardening] Patch flutter engine to fix flutter hhh build.
Change-Id: I38500c3f234e7fb9ccbb7fc0ddefa6fcdfbf676b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98526 Reviewed-by: Alexander Aprelev <[email protected]>
1 parent 7f09c40 commit efa9b9d

File tree

2 files changed

+92
-13
lines changed

2 files changed

+92
-13
lines changed

tools/patches/flutter-engine/75b2f9f919e5728902aff39a09223d1cc9402585.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
diff --git a/lib/io/dart_io.cc b/lib/io/dart_io.cc
2+
index 1b1866b4e..74f8bfc20 100644
3+
--- a/lib/io/dart_io.cc
4+
+++ b/lib/io/dart_io.cc
5+
@@ -12,6 +12,8 @@ using tonic::ToDart;
6+
7+
namespace blink {
8+
9+
+#define DART_CHECK_VALID(handle) if (Dart_IsError(handle)) { Dart_PropagateError(handle); }
10+
+
11+
void DartIO::InitForIsolate() {
12+
DART_CHECK_VALID(Dart_SetNativeResolver(Dart_LookupLibrary(ToDart("dart:io")),
13+
dart::bin::LookupIONative,
14+
diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc
15+
index 5145f1110..f9173d384 100644
16+
--- a/lib/ui/dart_runtime_hooks.cc
17+
+++ b/lib/ui/dart_runtime_hooks.cc
18+
@@ -56,6 +56,8 @@ namespace blink {
19+
20+
BUILTIN_NATIVE_LIST(DECLARE_FUNCTION);
21+
22+
+#define DART_CHECK_VALID(handle) if (Dart_IsError(handle)) { Dart_PropagateError(handle); }
23+
+
24+
void DartRuntimeHooks::RegisterNatives(tonic::DartLibraryNatives* natives) {
25+
natives->Register({BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)});
26+
}
27+
diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc
28+
index f6aa54c1c..723e70f51 100644
29+
--- a/lib/ui/dart_ui.cc
30+
+++ b/lib/ui/dart_ui.cc
31+
@@ -99,6 +99,8 @@ void DartUI::InitForGlobal() {
32+
}
33+
}
34+
35+
+#define DART_CHECK_VALID(handle) if (Dart_IsError(handle)) { Dart_PropagateError(handle); }
36+
+
37+
void DartUI::InitForIsolate(bool is_root_isolate) {
38+
FML_DCHECK(g_natives);
39+
auto get_native_function =
40+
diff --git a/lib/ui/plugins/callback_cache.cc b/lib/ui/plugins/callback_cache.cc
41+
index b2d4cc0d7..9979858af 100644
42+
--- a/lib/ui/plugins/callback_cache.cc
43+
+++ b/lib/ui/plugins/callback_cache.cc
44+
@@ -21,6 +21,8 @@ using tonic::ToDart;
45+
46+
namespace blink {
47+
48+
+#define DART_CHECK_VALID(handle) if (Dart_IsError(handle)) { Dart_PropagateError(handle); }
49+
+
50+
static const char* kHandleKey = "handle";
51+
static const char* kRepresentationKey = "representation";
52+
static const char* kNameKey = "name";
53+
diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc
54+
index 3a4084958..9d22b5a0c 100644
55+
--- a/lib/ui/window/platform_message_response_dart.cc
56+
+++ b/lib/ui/window/platform_message_response_dart.cc
57+
@@ -16,6 +16,8 @@ namespace blink {
58+
59+
namespace {
60+
61+
+#define DART_CHECK_VALID(handle) if (Dart_IsError(handle)) { Dart_PropagateError(handle); }
62+
+
63+
// Avoid copying the contents of messages beyond a certain size.
64+
const int kMessageCopyThreshold = 1000;
65+
66+
diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn
67+
index aed4d561d..ca6f1c3fe 100644
68+
--- a/shell/platform/BUILD.gn
69+
+++ b/shell/platform/BUILD.gn
70+
@@ -17,7 +17,7 @@ group("platform") {
71+
deps = []
72+
} else {
73+
deps = [
74+
- "linux",
75+
+# "linux",
76+
]
77+
}
78+
} else if (is_win) {
79+
diff --git a/tools/gn b/tools/gn
80+
index 7dacacf06..83bd7d9da 100755
81+
--- a/tools/gn
82+
+++ b/tools/gn
83+
@@ -134,6 +134,9 @@ def to_gn_args(args):
84+
else:
85+
gn_args['dart_runtime_mode'] = runtime_mode
86+
87+
+ gn_args['is_release'] = gn_args['dart_runtime_mode'] == 'profile'
88+
+ gn_args['is_product'] = gn_args['dart_runtime_mode'] == 'release'
89+
+
90+
if args.dart_debug:
91+
gn_args['dart_debug'] = True
92+

0 commit comments

Comments
 (0)