@@ -184,18 +184,26 @@ std::unique_ptr<IsolateConfiguration> CreateIsolateConfiguration(
184
184
const auto configuration_from_blob =
185
185
[&asset_manager](const std::string& snapshot_name)
186
186
-> std::unique_ptr<IsolateConfiguration> {
187
- std::unique_ptr<fml::Mapping> blob =
188
- asset_manager.GetAsMapping (snapshot_name);
187
+ auto blob = asset_manager.GetAsMapping (snapshot_name);
188
+ auto delta = asset_manager.GetAsMapping (" kernel_delta.bin" );
189
+ if (blob && delta) {
190
+ std::vector<std::unique_ptr<fml::Mapping>> kernels;
191
+ kernels.emplace_back (std::move (blob));
192
+ kernels.emplace_back (std::move (delta));
193
+ return IsolateConfiguration::CreateForKernelList (std::move (kernels));
194
+ }
189
195
if (blob) {
190
196
return IsolateConfiguration::CreateForSnapshot (std::move (blob));
191
197
}
198
+ if (delta) {
199
+ return IsolateConfiguration::CreateForSnapshot (std::move (delta));
200
+ }
192
201
return nullptr ;
193
202
};
194
203
195
204
if (auto kernel = configuration_from_blob (" kernel_blob.bin" )) {
196
205
return kernel;
197
206
}
198
-
199
207
if (auto script = configuration_from_blob (" snapshot_blob.bin" )) {
200
208
return script;
201
209
}
@@ -209,14 +217,13 @@ static void RunBundleAndSnapshot(
209
217
jobject jcaller,
210
218
jlong shell_holder,
211
219
jstring jbundlepath,
212
- jstring /* snapshot override (unused) */ ,
220
+ jstring jsnapshotOverride ,
213
221
jstring jEntrypoint,
214
222
jboolean /* reuse runtime controller (unused) */ ,
215
223
jobject jAssetManager) {
216
224
auto asset_manager = fml::MakeRefCounted<blink::AssetManager>();
217
225
218
226
const auto bundlepath = fml::jni::JavaStringToString (env, jbundlepath);
219
-
220
227
if (bundlepath.size () > 0 ) {
221
228
// If we got a bundle path, attempt to use that as a directory asset
222
229
// bundle or a zip asset bundle.
@@ -244,8 +251,13 @@ static void RunBundleAndSnapshot(
244
251
}
245
252
}
246
253
247
- auto isolate_configuration = CreateIsolateConfiguration (*asset_manager);
254
+ const auto defaultpath = fml::jni::JavaStringToString (env, jsnapshotOverride);
255
+ if (defaultpath.size () > 0 ) {
256
+ asset_manager->PushBack (std::make_unique<blink::DirectoryAssetBundle>(
257
+ fml::OpenFile (defaultpath.c_str (), fml::OpenPermission::kRead , true )));
258
+ }
248
259
260
+ auto isolate_configuration = CreateIsolateConfiguration (*asset_manager);
249
261
if (!isolate_configuration) {
250
262
FXL_DLOG (ERROR)
251
263
<< " Isolate configuration could not be determined for engine launch." ;
0 commit comments