Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions runtime/dart_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,10 @@ void InitDartVM(const uint8_t* vm_snapshot_data,
#endif

if (!bundle_path.empty()) {
auto zip_asset_store = fxl::MakeRefCounted<ZipAssetStore>(
GetUnzipperProviderForPath(std::move(bundle_path)));
zip_asset_store->GetAsBuffer(kPlatformKernelAssetKey, &platform_data);
fxl::RefPtr<blink::DirectoryAssetBundle> directory_asset_bundle =
fxl::MakeRefCounted<blink::DirectoryAssetBundle>(std::move(bundle_path));
directory_asset_bundle->GetAsBuffer(kPlatformKernelAssetKey,
&platform_data);
if (!platform_data.empty()) {
kernel_platform = Dart_ReadKernelBinary(
platform_data.data(), platform_data.size(), ReleaseFetchedBytes);
Expand Down
6 changes: 3 additions & 3 deletions runtime/dart_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

namespace blink {

// Name of the kernel blob asset within the FLX bundle.
// Name of the kernel blob asset within the asset directory.
extern const char kKernelAssetKey[];

// Name of the snapshot blob asset within the FLX bundle.
// Name of the snapshot blob asset within the asset directory.
extern const char kSnapshotAssetKey[];

// Name of the platform kernel blob asset within the FLX bundle.
// Name of the platform kernel blob asset within the asset directory.
extern const char kPlatformKernelAssetKey[];

bool IsRunningPrecompiledCode();
Expand Down
10 changes: 1 addition & 9 deletions shell/common/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,9 @@ void Engine::Init(const std::string& bundle_path) {
#error Unknown OS
#endif

std::string flx_path = bundle_path;
struct stat stat_result = {};
if (::stat(flx_path.c_str(), &stat_result) == 0) {
if (S_ISDIR(stat_result.st_mode)) {
flx_path = files::GetDirectoryName(bundle_path) + "/app.flx";
}
}

blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr,
default_isolate_snapshot_data,
default_isolate_snapshot_instr, flx_path);
default_isolate_snapshot_instr, bundle_path);
}

const std::string Engine::main_entrypoint_ = "main";
Expand Down