-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
862fbde
commit d961c2f
Showing
2 changed files
with
22 additions
and
17 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#import <Foundation/NSLock.h> | ||
#import <Foundation/NSURL.h> | ||
#import <Foundation/NSURLSession.h> | ||
#include <stdint.h> | ||
|
||
#if !__has_feature(objc_arc) | ||
#error "This file must be compiled with ARC enabled" | ||
#endif | ||
|
||
typedef void (^_DidFinish)(void *closure, NSURLSession *session, | ||
NSURLSessionDownloadTask *downloadTask, | ||
NSURL *location); | ||
typedef void (^_DidFinishWithLock)(NSCondition *lock, NSURLSession *session, | ||
NSURLSessionDownloadTask *downloadTask, | ||
NSURL *location); | ||
/// Create a block useable as a | ||
/// `URLSession:downloadTask:didFinishDownloadingToURL:` that can be used to | ||
/// make an async Dart callback behave synchronously. | ||
__attribute__((visibility("default"))) __attribute__((used)) | ||
_DidFinish adaptFinishWithLock(_DidFinishWithLock block); |
19 changes: 2 additions & 17 deletions
19
pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters