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

Removed callback for HeadlessDartRunner #5983

Merged
merged 1 commit into from
Aug 9, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ FLUTTER_EXPORT

- Parameter entrypoint: The name of a top-level function from a Dart library.
- Parameter uri: The URI of the Dart library which contains entrypoint.
- Parameter callback: The callback to be invoked when the new Isolate is
invoked.
*/
- (void)runWithEntrypointAndCallback:(NSString*)entrypoint
libraryUri:(NSString*)uri
completion:(FlutterHeadlessDartRunnerCallback)callback;
- (void)runWithEntrypointAndLibraryUri:(NSString*)entrypoint libraryUri:(NSString*)uri;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ @implementation FlutterHeadlessDartRunner {
std::unique_ptr<shell::Shell> _shell;
}

- (void)runWithEntrypointAndCallback:(NSString*)entrypoint
libraryUri:(NSString*)uri
completion:(FlutterHeadlessDartRunnerCallback)callback {
- (void)runWithEntrypointAndLibraryUri:(NSString*)entrypoint libraryUri:(NSString*)uri {
if (_shell != nullptr || entrypoint.length == 0) {
FML_LOG(ERROR) << "This headless dart runner was already used to run some code.";
return;
Expand Down Expand Up @@ -100,8 +98,7 @@ - (void)runWithEntrypointAndCallback:(NSString*)entrypoint

// Override the default run configuration with the specified entrypoint.
_shell->GetTaskRunners().GetUITaskRunner()->PostTask(
fml::MakeCopyable([engine = _shell->GetEngine(), config = std::move(config),
callback = Block_copy(callback)]() mutable {
fml::MakeCopyable([engine = _shell->GetEngine(), config = std::move(config)]() mutable {
BOOL success = NO;
FML_LOG(INFO) << "Attempting to launch background engine configuration...";
if (!engine || !engine->Run(std::move(config))) {
Expand All @@ -110,10 +107,6 @@ - (void)runWithEntrypointAndCallback:(NSString*)entrypoint
FML_LOG(INFO) << "Background Isolate successfully started and run.";
success = YES;
}
if (callback != nil) {
callback(success);
Block_release(callback);
}
}));
}

Expand Down