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

Commit b7be27f

Browse files
committed
Merge branch 'flutter:master' into add_virtual_method
2 parents 374db4e + ccaae8d commit b7be27f

File tree

522 files changed

+10492
-3946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

522 files changed

+10492
-3946
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ task:
5050
mkdir -p bin/cache/pkg/
5151
cp -r $ENGINE_PATH/src/out/host_debug_unopt/gen/dart-pkg/sky_engine bin/cache/pkg/
5252
bin/flutter update-packages --local-engine=host_debug_unopt
53-
bin/flutter analyze --dartdocs --flutter-repo --local-engine=host_debug_unopt
53+
bin/flutter analyze --flutter-repo --local-engine=host_debug_unopt
5454
test_framework_script: |
5555
cd $FRAMEWORK_PATH/flutter/packages/flutter
5656
../../bin/flutter test --local-engine=host_debug_unopt --null-assertions --sound-null-safety

BUILD.gn

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ group("flutter") {
5252

5353
# Flutter SDK artifacts should only be built when either doing host builds, or
5454
# for cross-compiled desktop targets.
55-
build_engine_artifacts =
56-
current_toolchain == host_toolchain || (is_linux && !is_chromeos)
55+
build_engine_artifacts = current_toolchain == host_toolchain ||
56+
(is_linux && !is_chromeos) || is_mac
5757

5858
# If enbaled, compile the SDK / snapshot.
5959
if (!is_fuchsia) {
@@ -103,6 +103,7 @@ group("flutter") {
103103
"//flutter/flow:flow_unittests",
104104
"//flutter/fml:fml_unittests",
105105
"//flutter/lib/ui:ui_unittests",
106+
"//flutter/runtime:no_dart_plugin_registrant_unittests",
106107
"//flutter/runtime:runtime_unittests",
107108
"//flutter/shell/common:shell_unittests",
108109
"//flutter/shell/platform/embedder:embedder_proctable_unittests",

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The Flutter engine follows Google style for the languages it uses:
2323
- **Note**: The Linux embedding generally follows idiomatic GObject-based C style.
2424
Use of C++ is discouraged in that embedding to avoid creating hybrid code that
2525
feels unfamiliar to either developers used to working with GObject or C++ developers.
26-
E.g., do not use STL collections or std::string. Exceptions:
26+
For example, do not use STL collections or std::string. Exceptions:
2727
- C-style casts are forbidden; use C++ casts.
2828
- Use `nullptr` rather than `NULL`.
2929
- Avoid `#define`; for internal constants use `static constexpr` instead.

DEPS

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,25 @@ vars = {
2727
'skia_git': 'https://skia.googlesource.com',
2828
# OCMock is for testing only so there is no google clone
2929
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
30-
'skia_revision': '988b7043e54cf725c864584bfda4d11bd103b473',
30+
'skia_revision': 'adadb95a9f1ef21ccc5264c7d0bdc83b56cf91e9',
3131

3232
# When updating the Dart revision, ensure that all entries that are
3333
# dependencies of Dart are also updated to match the entries in the
3434
# Dart SDK's DEPS file for that revision of Dart. The DEPS file for
3535
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
3636
# You can use //tools/dart/create_updated_flutter_deps.py to produce
3737
# updated revision list of existing dependencies.
38-
'dart_revision': '5fb4fb907f884627d0b22f4e573b3242957bba3b',
38+
'dart_revision': 'b8f4018535fa792891e2add3a475f35e3ec156ab',
3939

4040
# WARNING: DO NOT EDIT MANUALLY
4141
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
4242
'dart_boringssl_gen_rev': '7322fc15cc065d8d2957fccce6b62a509dc4d641',
4343
'dart_boringssl_rev': '1607f54fed72c6589d560254626909a64124f091',
4444
'dart_clock_rev': 'a494269254ba978e7ef8f192c5f7fec3fc05b9d3',
4545
'dart_collection_rev': '9967dcd3d7645db6de48d5abfab3018bb0c84236',
46-
'dart_dart_style_tag': '2cf810073e0cc7e7ea05d3de51830e6fa6d62924',
4746
'dart_http_throttle_tag': '1.0.2',
4847
'dart_intl_tag': '0.17.0-nullsafety',
49-
'dart_linter_tag': '1.2.1',
48+
'dart_linter_tag': '1.4.0',
5049
'dart_protobuf_rev': '0d03fd588df69e9863e2a2efc0059dee8f18d5b2',
5150
'dart_pub_rev': '0e657414a472e74ca5dd76ae0db50cc060251dec',
5251
'dart_resource_rev': '6b79867d0becf5395e5819a75720963b8298e9a7',
@@ -97,7 +96,7 @@ allowed_hosts = [
9796
]
9897

9998
deps = {
100-
'src': 'https://github.com/flutter/buildroot.git' + '@' + '33358ba597f875f6646522fd4ea86c1b31404d77',
99+
'src': 'https://github.com/flutter/buildroot.git' + '@' + '45ce223bc8d8ca88e2eb2f38eb0cf799e39edd06',
101100

102101
# Fuchsia compatibility
103102
#
@@ -155,7 +154,7 @@ deps = {
155154
Var('dart_git') + '/args.git@d8fea36c10ef96797be02e3d132d572445cd86f4',
156155

157156
'src/third_party/dart/third_party/pkg/async':
158-
Var('dart_git') + '/async.git@376d418b1b535030fbe3369938d2ffdbb0340a77',
157+
Var('dart_git') + '/async.git@cde00b89bd3c19e877b21de2c02282d4d311d0a5',
159158

160159
'src/third_party/dart/third_party/pkg/bazel_worker':
161160
Var('dart_git') + '/bazel_worker.git@0885637b037979afbf5bcd05fd748b309fd669c0',
@@ -188,7 +187,7 @@ deps = {
188187
Var('dart_git') + '/dart2js_info.git@e0acfeb5affdf94c53067e68bd836adf589628fd',
189188

190189
'src/third_party/dart/third_party/pkg/dartdoc':
191-
Var('dart_git') + '/dartdoc.git@e2d010ed74059be942a78ced5f35f1b8d667ed16',
190+
Var('dart_git') + '/dartdoc.git@505f163f7cb48e917503e4a23fbff1227e08b263',
192191

193192
'src/third_party/dart/third_party/pkg/ffi':
194193
Var('dart_git') + '/ffi.git@f3346299c55669cc0db48afae85b8110088bf8da',
@@ -206,13 +205,13 @@ deps = {
206205
Var('dart_git') + '/html.git@00cd3c22dac0e68e6ed9e7e4945101aedb1b3109',
207206

208207
'src/third_party/dart/third_party/pkg/http':
209-
Var('dart_git') + '/http.git@615380db687d0649057ed8dba9d933d7d5f5051b',
208+
Var('dart_git') + '/http.git@abb2bb182fbd7f03aafd1f889b902d7b3bdb8769',
210209

211210
'src/third_party/dart/third_party/pkg/http_multi_server':
212-
Var('dart_git') + '/http_multi_server.git@6bf4b6e5d4d890e6d54559b858ff229d79711171',
211+
Var('dart_git') + '/http_multi_server.git@de1b312164c24a1690b46c6e97bd47eff40c4649',
213212

214213
'src/third_party/dart/third_party/pkg/http_parser':
215-
Var('dart_git') + '/http_parser.git@5dd4d16693242049dfb43b5efa429fedbf932e98',
214+
Var('dart_git') + '/http_parser.git@7720bfd42a0c096734c5213478fdce92c62f0293',
216215

217216
'src/third_party/dart/third_party/pkg/http_retry':
218217
Var('dart_git') + '/http_retry.git@845771af7bb5ab38ab740ce4a31f3b0c7680302b',
@@ -224,7 +223,7 @@ deps = {
224223
Var('dart_git') + '/intl.git' + '@' + Var('dart_intl_tag'),
225224

226225
'src/third_party/dart/third_party/pkg/json_rpc_2':
227-
Var('dart_git') + '/json_rpc_2.git@b8dfe403fd8528fd14399dee3a6527b55802dd4d',
226+
Var('dart_git') + '/json_rpc_2.git@5ec32a2e0e99dedcef5b3237f93167cd22c2da50',
228227

229228
'src/third_party/dart/third_party/pkg/linter':
230229
Var('dart_git') + '/linter.git' + '@' + Var('dart_linter_tag'),
@@ -244,9 +243,6 @@ deps = {
244243
'src/third_party/dart/third_party/pkg/mockito':
245244
Var('dart_git') + '/mockito.git@d39ac507483b9891165e422ec98d9fb480037c8b',
246245

247-
'src/third_party/dart/third_party/pkg/mustache':
248-
Var('dart_git') + '/external/github.com/xxgreg/mustache@664737ecad027e6b96d0d1e627257efa0e46fcb1',
249-
250246
'src/third_party/dart/third_party/pkg/oauth2':
251247
Var('dart_git') + '/oauth2.git@7cd3284049fe5badbec9f2bea2afc41d14c01057',
252248

@@ -272,7 +268,7 @@ deps = {
272268
Var('dart_git') + '/resource.git' + '@' + Var('dart_resource_rev'),
273269

274270
'src/third_party/dart/third_party/pkg/shelf':
275-
Var('dart_git') + '/shelf.git@00e50adfb776602c25942a99d89f8704cc20db9c',
271+
Var('dart_git') + '/shelf.git@4b9294e29eb308709444a5c0b890fa8ccd69fae4',
276272

277273
'src/third_party/dart/third_party/pkg/shelf_packages_handler':
278274
Var('dart_git') + '/shelf_packages_handler.git@78302e67c035047e6348e692b0c1182131f0fe35',
@@ -311,7 +307,7 @@ deps = {
311307
Var('dart_git') + '/term_glyph.git@6a0f9b6fb645ba75e7a00a4e20072678327a0347',
312308

313309
'src/third_party/dart/third_party/pkg/test':
314-
Var('dart_git') + '/test.git@e673623f45d75ccec750d35271b0b4d1423e9fac',
310+
Var('dart_git') + '/test.git@433f1d8726f9c1484007588470b17830a5e97a12',
315311

316312
'src/third_party/dart/third_party/pkg/test_reflective_loader':
317313
Var('dart_git') + '/test_reflective_loader.git@54e930a11c372683792e22bddad79197728c91ce',
@@ -326,13 +322,13 @@ deps = {
326322
Var('dart_git') + '/watcher.git' + '@' + Var('dart_watcher_rev'),
327323

328324
'src/third_party/dart/third_party/pkg/web_socket_channel':
329-
Var('dart_git') + '/web_socket_channel.git@d3e100de8feb0283a04732366bb591ebd2282d7d',
325+
Var('dart_git') + '/web_socket_channel.git@6448ce532445a8a458fa191d9346df071ae0acad',
330326

331327
'src/third_party/dart/third_party/pkg/yaml':
332328
Var('dart_git') + '/yaml.git@b4c4411631bda556ce9a45af1ab0eecaf9f3ac53',
333329

334330
'src/third_party/dart/third_party/pkg_tested/dart_style':
335-
Var('dart_git') + '/dart_style.git' + '@' + Var('dart_dart_style_tag'),
331+
Var('dart_git') + '/dart_style.git@f17c23e0eea9a870601c19d904e2a9c1a7c81470',
336332

337333
'src/third_party/dart/third_party/pkg_tested/package_config':
338334
Var('dart_git') + '/package_config.git@a84c0d45401f215fbe9384df923a38f4022a3c45',
@@ -345,6 +341,9 @@ deps = {
345341
'src/third_party/colorama/src':
346342
Var('chromium_git') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8',
347343

344+
'src/third_party/expat':
345+
Var('flutter_git') + '/third_party/expat' + '@' + '1441fc5252746e53b285d15be7e65e4cd74d97eb',
346+
348347
'src/third_party/freetype2':
349348
Var('flutter_git') + '/third_party/freetype2' + '@' + '1f03c1b2d7f2ae832a4fbe9d12bd96c3c15bbece',
350349

@@ -361,7 +360,7 @@ deps = {
361360
Var('fuchsia_git') + '/third_party/libjpeg-turbo' + '@' + '0fb821f3b2e570b2783a94ccd9a2fb1f4916ae9f',
362361

363362
'src/third_party/libpng':
364-
Var('flutter_git') + '/third_party/libpng' + '@' + 'f46faec244dbda5f1d2a5bc370cf83125d6ffab1',
363+
Var('flutter_git') + '/third_party/libpng' + '@' + 'afda123a503bdc41df13f86316cf5f83bc204761',
365364

366365
'src/third_party/libwebp':
367366
Var('chromium_git') + '/webm/libwebp.git' + '@' + '0.6.0',
@@ -501,7 +500,7 @@ deps = {
501500
'packages': [
502501
{
503502
'package': 'fuchsia/third_party/clang/mac-amd64',
504-
'version': 'GUX2BsVIcrK9YuAZuavDsApm-5Mzaur2heo7DRsH8rQC'
503+
'version': 'bf4GDBSQEjRrv9-8G-pOt4fZqohuxEKEr4F6Gic7JRsC'
505504
}
506505
],
507506
'condition': 'host_os == "mac"',
@@ -512,7 +511,7 @@ deps = {
512511
'packages': [
513512
{
514513
'package': 'fuchsia/third_party/clang/linux-amd64',
515-
'version': 'TEHg3vhDG4veysl3QZ0KqkSv00Emiai-CTZXMTFJfqQC'
514+
'version': 'zRvL_ACCGLlvQyyLi6bT_5kSLvVhxlGr3sepp98wsqAC'
516515
}
517516
],
518517
'condition': 'host_os == "linux"',
@@ -538,7 +537,7 @@ deps = {
538537
'packages': [
539538
{
540539
'package': 'fuchsia/sdk/core/mac-amd64',
541-
'version': 'VFHTytszrSkNokXL1Rc9L7k-_cOwezdPKdXrxSzbnEgC'
540+
'version': 'uQgs5ZmFqGbZ6sZiLo5xCug5EzVsRqfvxYNOD2dE9jYC'
542541
}
543542
],
544543
'condition': 'host_os == "mac"',
@@ -548,7 +547,7 @@ deps = {
548547
'packages': [
549548
{
550549
'package': 'fuchsia/sdk/core/linux-amd64',
551-
'version': 'kafCPE8Hde3ZVlWxogcQWVvMhIfbWhXmUryNPd2chjcC'
550+
'version': '4numS0K6TAgTzLt_Y7F8xzrU2jhmR651iTLmjQaoN9oC'
552551
}
553552
],
554553
'condition': 'host_os == "linux"',

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ Information on how to get started can be found at our
3333

3434
[Build status]: https://cirrus-ci.com/github/flutter/engine
3535

36+

assets/asset_manager.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,16 @@ std::unique_ptr<fml::Mapping> AssetManager::GetAsMapping(
7777

7878
// |AssetResolver|
7979
std::vector<std::unique_ptr<fml::Mapping>> AssetManager::GetAsMappings(
80-
const std::string& asset_pattern) const {
80+
const std::string& asset_pattern,
81+
const std::optional<std::string>& subdir) const {
8182
std::vector<std::unique_ptr<fml::Mapping>> mappings;
8283
if (asset_pattern.size() == 0) {
8384
return mappings;
8485
}
8586
TRACE_EVENT1("flutter", "AssetManager::GetAsMappings", "pattern",
8687
asset_pattern.c_str());
8788
for (const auto& resolver : resolvers_) {
88-
auto resolver_mappings = resolver->GetAsMappings(asset_pattern);
89+
auto resolver_mappings = resolver->GetAsMappings(asset_pattern, subdir);
8990
mappings.insert(mappings.end(),
9091
std::make_move_iterator(resolver_mappings.begin()),
9192
std::make_move_iterator(resolver_mappings.end()));

assets/asset_manager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <memory>
1010
#include <string>
1111

12+
#include <optional>
1213
#include "flutter/assets/asset_resolver.h"
1314
#include "flutter/fml/macros.h"
1415
#include "flutter/fml/memory/ref_counted.h"
@@ -70,7 +71,8 @@ class AssetManager final : public AssetResolver {
7071

7172
// |AssetResolver|
7273
std::vector<std::unique_ptr<fml::Mapping>> GetAsMappings(
73-
const std::string& asset_pattern) const override;
74+
const std::string& asset_pattern,
75+
const std::optional<std::string>& subdir) const override;
7476

7577
private:
7678
std::deque<std::unique_ptr<AssetResolver>> resolvers_;

assets/asset_resolver.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <string>
99
#include <vector>
1010

11+
#include <optional>
1112
#include "flutter/fml/macros.h"
1213
#include "flutter/fml/mapping.h"
1314

@@ -59,10 +60,24 @@ class AssetResolver {
5960
[[nodiscard]] virtual std::unique_ptr<fml::Mapping> GetAsMapping(
6061
const std::string& asset_name) const = 0;
6162

62-
// Same as GetAsMapping() but returns mappings for all files who's name
63-
// matches |pattern|. Returns empty vector if no matching assets are found
63+
//--------------------------------------------------------------------------
64+
/// @brief Same as GetAsMapping() but returns mappings for all files
65+
/// who's name matches a given pattern. Returns empty vector
66+
/// if no matching assets are found.
67+
///
68+
/// @param[in] asset_pattern The pattern to match file names against.
69+
///
70+
/// @param[in] subdir Optional subdirectory in which to search for files.
71+
/// If supplied this function does a flat search within the
72+
/// subdirectory instead of a recursive search through the entire
73+
/// assets directory.
74+
///
75+
/// @return Returns a vector of mappings of files which match the search
76+
/// parameters.
77+
///
6478
[[nodiscard]] virtual std::vector<std::unique_ptr<fml::Mapping>>
65-
GetAsMappings(const std::string& asset_pattern) const {
79+
GetAsMappings(const std::string& asset_pattern,
80+
const std::optional<std::string>& subdir) const {
6681
return {};
6782
};
6883

assets/directory_asset_bundle.cc

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "flutter/fml/eintr_wrapper.h"
1111
#include "flutter/fml/file.h"
1212
#include "flutter/fml/mapping.h"
13+
#include "flutter/fml/trace_event.h"
1314

1415
namespace flutter {
1516

@@ -60,7 +61,8 @@ std::unique_ptr<fml::Mapping> DirectoryAssetBundle::GetAsMapping(
6061
}
6162

6263
std::vector<std::unique_ptr<fml::Mapping>> DirectoryAssetBundle::GetAsMappings(
63-
const std::string& asset_pattern) const {
64+
const std::string& asset_pattern,
65+
const std::optional<std::string>& subdir) const {
6466
std::vector<std::unique_ptr<fml::Mapping>> mappings;
6567
if (!is_valid_) {
6668
FML_DLOG(WARNING) << "Asset bundle was not valid.";
@@ -70,9 +72,19 @@ std::vector<std::unique_ptr<fml::Mapping>> DirectoryAssetBundle::GetAsMappings(
7072
std::regex asset_regex(asset_pattern);
7173
fml::FileVisitor visitor = [&](const fml::UniqueFD& directory,
7274
const std::string& filename) {
75+
TRACE_EVENT0("flutter", "DirectoryAssetBundle::GetAsMappings FileVisitor");
76+
7377
if (std::regex_match(filename, asset_regex)) {
74-
auto mapping = std::make_unique<fml::FileMapping>(fml::OpenFile(
75-
directory, filename.c_str(), false, fml::FilePermission::kRead));
78+
TRACE_EVENT0("flutter", "Matched File");
79+
80+
fml::UniqueFD fd = fml::OpenFile(directory, filename.c_str(), false,
81+
fml::FilePermission::kRead);
82+
83+
if (fml::IsDirectory(fd)) {
84+
return true;
85+
}
86+
87+
auto mapping = std::make_unique<fml::FileMapping>(fd);
7688

7789
if (mapping && mapping->IsValid()) {
7890
mappings.push_back(std::move(mapping));
@@ -82,7 +94,18 @@ std::vector<std::unique_ptr<fml::Mapping>> DirectoryAssetBundle::GetAsMappings(
8294
}
8395
return true;
8496
};
85-
fml::VisitFilesRecursively(descriptor_, visitor);
97+
if (!subdir) {
98+
fml::VisitFilesRecursively(descriptor_, visitor);
99+
} else {
100+
fml::UniqueFD subdir_fd =
101+
fml::OpenFileReadOnly(descriptor_, subdir.value().c_str());
102+
if (!fml::IsDirectory(subdir_fd)) {
103+
FML_LOG(ERROR) << "Subdirectory path " << subdir.value()
104+
<< " is not a directory";
105+
return mappings;
106+
}
107+
fml::VisitFiles(subdir_fd, visitor);
108+
}
86109

87110
return mappings;
88111
}

assets/directory_asset_bundle.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_
66
#define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_
77

8+
#include <optional>
89
#include "flutter/assets/asset_resolver.h"
910
#include "flutter/fml/macros.h"
1011
#include "flutter/fml/memory/ref_counted.h"
@@ -39,7 +40,8 @@ class DirectoryAssetBundle : public AssetResolver {
3940

4041
// |AssetResolver|
4142
std::vector<std::unique_ptr<fml::Mapping>> GetAsMappings(
42-
const std::string& asset_pattern) const override;
43+
const std::string& asset_pattern,
44+
const std::optional<std::string>& subdir) const override;
4345

4446
FML_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle);
4547
};

0 commit comments

Comments
 (0)