未验证 提交 ca572216 编写于 作者: J Jason Simmons 提交者: GitHub

Load kernel files from the script URI in the isolate create callback (#4828)

Fixes https://github.com/flutter/flutter/issues/15731
上级 5e83371a
......@@ -336,8 +336,13 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
}
// Entry script path (file:// is stripped).
entry_path = std::string(script_uri + strlen(kFileUriPrefix));
if (!running_from_source) {
// Attempt to copy the snapshot from the asset bundle.
if (StringEndsWith(entry_path, ".dill")) {
// Load the kernel from the script URI.
if (!files::ReadFileToVector(entry_path, &kernel_data)) {
FXL_LOG(ERROR) << "Failed to load kernel";
}
} else if (!running_from_source) {
// Attempt to copy the snapshot or kernel from the asset bundle.
const std::string& bundle_path = entry_path;
struct stat stat_result = {};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册