Skip to content
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
4 changes: 4 additions & 0 deletions pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.3-wip

* Remove some unnecessary native code.

## 2.0.2

* Upgrade to `package:objective_c` 4.1.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion pkgs/cupertino_http/ffigen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ headers:
- '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOperation.h'
- '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSError.h'
- '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSDictionary.h'
- 'darwin/cupertino_http/Sources/cupertino_http/utils.h'
preamble: |
// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types
Expand Down
30 changes: 8 additions & 22 deletions pkgs/cupertino_http/lib/src/cupertino_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -919,29 +919,15 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
}

if (onFinishedDownloading != null) {
final asyncFinishDownloading =
// ignore: lines_longer_than_80_chars
ncb.ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL
.listener((nsCondition, nsSession, nsTask, nsUrl) {
try {
onFinishedDownloading(
URLSession._(nsSession,
isBackground: isBackground, hasDelegate: true),
URLSessionDownloadTask._(nsTask),
nsurlToUri(nsUrl));
} finally {
nsCondition.unlock();
}
ncb.NSURLSessionDownloadDelegate
.URLSession_downloadTask_didFinishDownloadingToURL_
.implementAsBlocking(protoBuilder, (nsSession, nsTask, nsUrl) {
onFinishedDownloading(
URLSession._(nsSession,
isBackground: isBackground, hasDelegate: true),
URLSessionDownloadTask._(nsTask),
nsurlToUri(nsUrl));
});

final downloadDelegate = objc.getProtocol('NSURLSessionDownloadDelegate');
final didFinishDownloadingToURL = objc
.registerName('URLSession:downloadTask:didFinishDownloadingToURL:');
final signature = objc.getProtocolMethodSignature(
downloadDelegate, didFinishDownloadingToURL,
isRequired: true, isInstanceMethod: true)!;
protoBuilder.implementMethod(didFinishDownloadingToURL, signature,
linkedLibs.adaptFinishWithLock(asyncFinishDownloading));
}

if (onWebSocketTaskOpened != null) {
Expand Down
Loading
Loading