From a498c3e1e1eb8150e41a4cabfcd327c2da408752 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Thu, 9 Aug 2018 09:21:07 -0700 Subject: [PATCH] Removed callback for HeadlessDartRunner --- .../ios/framework/Headers/FlutterHeadlessDartRunner.h | 6 +----- .../ios/framework/Source/FlutterHeadlessDartRunner.mm | 11 ++--------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h b/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h index 646a5164c43d9..f6f37248364ed 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h @@ -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 diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index 470c5909af23e..8db85fd3b5664 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -47,9 +47,7 @@ @implementation FlutterHeadlessDartRunner { std::unique_ptr _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; @@ -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))) { @@ -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); - } })); }