-
Notifications
You must be signed in to change notification settings - Fork 6k
Support loading flutter assets from dynamic patch #7308
Conversation
This replicates similar logic found in ApkAssetProvider that locates assets by their short name in a sudbirectory inside of an archive file, instead of only at the root of archive.
@@ -253,7 +253,7 @@ static void RunBundleAndSnapshotFromLibrary(JNIEnv* env, | |||
const auto file_ext_index = bundlepath.rfind("."); | |||
if (bundlepath.substr(file_ext_index) == ".zip") { | |||
asset_manager->PushBack( | |||
std::make_unique<blink::ZipAssetStore>(bundlepath)); | |||
std::make_unique<blink::ZipAssetStore>(bundlepath, "flutter_assets")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the new codestd::make_unique<blink::ZipAssetStore>(bundlepath, "flutter_assets"));
equivalent to std::make_unique<blink::ZipAssetStore>("flutter_assets/" + bundlepath));
in the old code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not equivalent because bundlepath is the path to the archive file, and directory is the path inside of the archive (just like in ApkAssetProvider).
assets/zip_asset_store.cc
Outdated
|
||
std::stringstream file_name; | ||
file_name << directory_.c_str() << "/" << asset_name; | ||
auto found = stat_cache_.find(file_name.str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think auto found = stat_cache_.find(directory_ + "/" + asset_name);
might be cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
flutter/engine@1bd9d41...995e324 git log 1bd9d41..995e324 --no-merges --oneline 995e324 Roll src/third_party/skia f3e6b90461e4..aec8c7e280cb (1 commits) (flutter/engine#7326) 6f763fb Minor refactoring of dynamic patching code. (flutter/engine#7325) 868dc04 Support loading flutter assets from dynamic patch (flutter/engine#7308) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
flutter/engine@1bd9d41...995e324 git log 1bd9d41..995e324 --no-merges --oneline 995e324 Roll src/third_party/skia f3e6b90461e4..aec8c7e280cb (1 commits) (flutter/engine#7326) 6f763fb Minor refactoring of dynamic patching code. (flutter/engine#7325) 868dc04 Support loading flutter assets from dynamic patch (flutter/engine#7308) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
This replicates similar logic found in ApkAssetProvider that locates assets by their short name in a sudbirectory inside of an archive file, instead of only at the root of archive.