diff --git a/pkgs/cupertino_http/CHANGELOG.md b/pkgs/cupertino_http/CHANGELOG.md index 7d7c1db68d..24d6f7a5b3 100644 --- a/pkgs/cupertino_http/CHANGELOG.md +++ b/pkgs/cupertino_http/CHANGELOG.md @@ -1,6 +1,11 @@ -## 2.0.3-wip +## 2.1.0-wip * Remove some unnecessary native code. +* Upgrade to `package:objective_c` 7.0. +* Upgrade to `package:ffigen` 18.0. +* Fix a [bug](https://github.com/dart-lang/http/issues/1702) where + `package:cupertino_http` did not work with `package:firebase_performance` + enabled. ## 2.0.2 diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m index d978b7321e..7ad2e44763 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m @@ -1,5 +1,6 @@ #include #import +#import #import #import #import @@ -16,1046 +17,877 @@ #error "This file must be compiled with ARC enabled" #endif +typedef struct { + int64_t version; + void* (*newWaiter)(void); + void (*awaitWaiter)(void*); + void* (*currentIsolate)(void); + void (*enterIsolate)(void*); + void (*exitIsolate)(void); + int64_t (*getMainPortId)(void); + bool (*getCurrentThreadOwnsIsolate)(int64_t); +} DOBJC_Context; + id objc_retainBlock(id); -typedef void (^_ListenerTrampoline)(); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(_ListenerTrampoline block) NS_RETURNS_RETAINED { +#define BLOCKING_BLOCK_IMPL(ctx, BLOCK_SIG, INVOKE_DIRECT, INVOKE_LISTENER) \ + assert(ctx->version >= 1); \ + void* targetIsolate = ctx->currentIsolate(); \ + int64_t targetPort = ctx->getMainPortId == NULL ? 0 : ctx->getMainPortId(); \ + return BLOCK_SIG { \ + void* currentIsolate = ctx->currentIsolate(); \ + bool mayEnterIsolate = \ + currentIsolate == NULL && \ + ctx->getCurrentThreadOwnsIsolate != NULL && \ + ctx->getCurrentThreadOwnsIsolate(targetPort); \ + if (currentIsolate == targetIsolate || mayEnterIsolate) { \ + if (mayEnterIsolate) { \ + ctx->enterIsolate(targetIsolate); \ + } \ + INVOKE_DIRECT; \ + if (mayEnterIsolate) { \ + ctx->exitIsolate(); \ + } \ + } else { \ + void* waiter = ctx->newWaiter(); \ + INVOKE_LISTENER; \ + ctx->awaitWaiter(waiter); \ + } \ + }; + + +typedef void (^ListenerTrampoline)(); +__attribute__((visibility("default"))) __attribute__((used)) +ListenerTrampoline _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(ListenerTrampoline block) NS_RETURNS_RETAINED { return ^void() { objc_retainBlock(block); block(); }; } -typedef void (^_BlockingTrampoline)(void * waiter); +typedef void (^BlockingTrampoline)(void * waiter); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( - _BlockingTrampoline block, _BlockingTrampoline listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void() { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter); - awaitWaiter(waiter); - } - }; +ListenerTrampoline _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( + BlockingTrampoline block, BlockingTrampoline listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(), { + objc_retainBlock(block); + block(nil); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter); + }); } -typedef void (^_ListenerTrampoline1)(id arg0); +typedef void (^ListenerTrampoline_1)(id arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline1 _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { +ListenerTrampoline_1 _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(ListenerTrampoline_1 block) NS_RETURNS_RETAINED { return ^void(id arg0) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0)); }; } -typedef void (^_BlockingTrampoline1)(void * waiter, id arg0); +typedef void (^BlockingTrampoline_1)(void * waiter, id arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline1 _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( - _BlockingTrampoline1 block, _BlockingTrampoline1 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_1 _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + BlockingTrampoline_1 block, BlockingTrampoline_1 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0), { + objc_retainBlock(block); + block(nil, (__bridge id)(__bridge_retained void*)(arg0)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0)); + }); +} + +typedef BOOL (^ProtocolTrampoline)(void * sel); +__attribute__((visibility("default"))) __attribute__((used)) +BOOL _NativeCupertinoHttp_protocolTrampoline_e3qsqz(id target, void * sel) { + return ((ProtocolTrampoline)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); } -typedef void (^_ListenerTrampoline2)(void * arg0, id arg1); +typedef id (^ProtocolTrampoline_1)(void * sel); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline2 _NativeCupertinoHttp_wrapListenerBlock_18v1jvf(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { +id _NativeCupertinoHttp_protocolTrampoline_1mbt9g9(id target, void * sel) { + return ((ProtocolTrampoline_1)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); +} + +typedef void (^ListenerTrampoline_2)(void * arg0, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) +ListenerTrampoline_2 _NativeCupertinoHttp_wrapListenerBlock_18v1jvf(ListenerTrampoline_2 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^_BlockingTrampoline2)(void * waiter, void * arg0, id arg1); +typedef void (^BlockingTrampoline_2)(void * waiter, void * arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline2 _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( - _BlockingTrampoline2 block, _BlockingTrampoline2 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_2 _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( + BlockingTrampoline_2 block, BlockingTrampoline_2 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + }); } -typedef void (^_ListenerTrampoline3)(id arg0, id arg1, BOOL * arg2); +typedef void (^ProtocolTrampoline_2)(void * sel, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline3 _NativeCupertinoHttp_wrapListenerBlock_1o83rbn(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { - return ^void(id arg0, id arg1, BOOL * arg2) { - objc_retainBlock(block); - block((__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), arg2); - }; +void _NativeCupertinoHttp_protocolTrampoline_18v1jvf(id target, void * sel, id arg1) { + return ((ProtocolTrampoline_2)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef void (^_BlockingTrampoline3)(void * waiter, id arg0, id arg1, BOOL * arg2); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline3 _NativeCupertinoHttp_wrapBlockingBlock_1o83rbn( - _BlockingTrampoline3 block, _BlockingTrampoline3 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, id arg1, BOOL * arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), arg2); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), arg2); - awaitWaiter(waiter); - } - }; +typedef id (^ProtocolTrampoline_3)(void * sel, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) +id _NativeCupertinoHttp_protocolTrampoline_xr62hr(id target, void * sel, id arg1) { + return ((ProtocolTrampoline_3)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); +} + +Protocol* _NativeCupertinoHttp_NSProgressReporting(void) { return @protocol(NSProgressReporting); } + +Protocol* _NativeCupertinoHttp_NSURLSessionTaskDelegate(void) { return @protocol(NSURLSessionTaskDelegate); } + +typedef unsigned long (^ProtocolTrampoline_4)(void * sel, NSFastEnumerationState * arg1, id * arg2, unsigned long arg3); +__attribute__((visibility("default"))) __attribute__((used)) +unsigned long _NativeCupertinoHttp_protocolTrampoline_17ap02x(id target, void * sel, NSFastEnumerationState * arg1, id * arg2, unsigned long arg3) { + return ((ProtocolTrampoline_4)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } -typedef void (^_ListenerTrampoline4)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); +typedef void (^ListenerTrampoline_3)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline4 _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { +ListenerTrampoline_3 _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(ListenerTrampoline_3 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^_BlockingTrampoline4)(void * waiter, struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); +typedef void (^BlockingTrampoline_3)(void * waiter, struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline4 _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( - _BlockingTrampoline4 block, _BlockingTrampoline4 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, arg1); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, arg1); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_3 _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( + BlockingTrampoline_3 block, BlockingTrampoline_3 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1), { + objc_retainBlock(block); + block(nil, arg0, arg1); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, arg1); + }); } -typedef void (^_ListenerTrampoline5)(struct __CFRunLoopTimer * arg0); +typedef void (^ListenerTrampoline_4)(struct __CFRunLoopTimer * arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline5 _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(_ListenerTrampoline5 block) NS_RETURNS_RETAINED { +ListenerTrampoline_4 _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(ListenerTrampoline_4 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopTimer * arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_BlockingTrampoline5)(void * waiter, struct __CFRunLoopTimer * arg0); +typedef void (^BlockingTrampoline_4)(void * waiter, struct __CFRunLoopTimer * arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline5 _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol( - _BlockingTrampoline5 block, _BlockingTrampoline5 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(struct __CFRunLoopTimer * arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_4 _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol( + BlockingTrampoline_4 block, BlockingTrampoline_4 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(struct __CFRunLoopTimer * arg0), { + objc_retainBlock(block); + block(nil, arg0); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0); + }); } -typedef void (^_ListenerTrampoline6)(size_t arg0); +typedef void (^ListenerTrampoline_5)(size_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline6 _NativeCupertinoHttp_wrapListenerBlock_6enxqz(_ListenerTrampoline6 block) NS_RETURNS_RETAINED { +ListenerTrampoline_5 _NativeCupertinoHttp_wrapListenerBlock_6enxqz(ListenerTrampoline_5 block) NS_RETURNS_RETAINED { return ^void(size_t arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_BlockingTrampoline6)(void * waiter, size_t arg0); +typedef void (^BlockingTrampoline_5)(void * waiter, size_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline6 _NativeCupertinoHttp_wrapBlockingBlock_6enxqz( - _BlockingTrampoline6 block, _BlockingTrampoline6 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(size_t arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_5 _NativeCupertinoHttp_wrapBlockingBlock_6enxqz( + BlockingTrampoline_5 block, BlockingTrampoline_5 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(size_t arg0), { + objc_retainBlock(block); + block(nil, arg0); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0); + }); } -typedef void (^_ListenerTrampoline7)(id arg0, int arg1); +typedef void (^ListenerTrampoline_6)(id arg0, int arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline7 _NativeCupertinoHttp_wrapListenerBlock_18kzm6a(_ListenerTrampoline7 block) NS_RETURNS_RETAINED { +ListenerTrampoline_6 _NativeCupertinoHttp_wrapListenerBlock_18kzm6a(ListenerTrampoline_6 block) NS_RETURNS_RETAINED { return ^void(id arg0, int arg1) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), arg1); }; } -typedef void (^_BlockingTrampoline7)(void * waiter, id arg0, int arg1); +typedef void (^BlockingTrampoline_6)(void * waiter, id arg0, int arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline7 _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( - _BlockingTrampoline7 block, _BlockingTrampoline7 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, int arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), arg1); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), arg1); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_6 _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( + BlockingTrampoline_6 block, BlockingTrampoline_6 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, int arg1), { + objc_retainBlock(block); + block(nil, (__bridge id)(__bridge_retained void*)(arg0), arg1); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), arg1); + }); } -typedef void (^_ListenerTrampoline8)(int arg0); +typedef void (^ListenerTrampoline_7)(int arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline8 _NativeCupertinoHttp_wrapListenerBlock_9o8504(_ListenerTrampoline8 block) NS_RETURNS_RETAINED { +ListenerTrampoline_7 _NativeCupertinoHttp_wrapListenerBlock_9o8504(ListenerTrampoline_7 block) NS_RETURNS_RETAINED { return ^void(int arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_BlockingTrampoline8)(void * waiter, int arg0); +typedef void (^BlockingTrampoline_7)(void * waiter, int arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline8 _NativeCupertinoHttp_wrapBlockingBlock_9o8504( - _BlockingTrampoline8 block, _BlockingTrampoline8 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(int arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_7 _NativeCupertinoHttp_wrapBlockingBlock_9o8504( + BlockingTrampoline_7 block, BlockingTrampoline_7 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(int arg0), { + objc_retainBlock(block); + block(nil, arg0); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0); + }); } -typedef void (^_ListenerTrampoline9)(BOOL arg0, id arg1, int arg2); +typedef void (^ListenerTrampoline_8)(BOOL arg0, id arg1, int arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline9 _NativeCupertinoHttp_wrapListenerBlock_og5b6y(_ListenerTrampoline9 block) NS_RETURNS_RETAINED { +ListenerTrampoline_8 _NativeCupertinoHttp_wrapListenerBlock_og5b6y(ListenerTrampoline_8 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0, id arg1, int arg2) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), arg2); }; } -typedef void (^_BlockingTrampoline9)(void * waiter, BOOL arg0, id arg1, int arg2); +typedef void (^BlockingTrampoline_8)(void * waiter, BOOL arg0, id arg1, int arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline9 _NativeCupertinoHttp_wrapBlockingBlock_og5b6y( - _BlockingTrampoline9 block, _BlockingTrampoline9 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(BOOL arg0, id arg1, int arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), arg2); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), arg2); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_8 _NativeCupertinoHttp_wrapBlockingBlock_og5b6y( + BlockingTrampoline_8 block, BlockingTrampoline_8 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(BOOL arg0, id arg1, int arg2), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), arg2); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), arg2); + }); } -typedef void (^_ListenerTrampoline10)(struct __SecTrust * arg0, SecTrustResultType arg1); +typedef void (^ListenerTrampoline_9)(struct __SecTrust * arg0, SecTrustResultType arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline10 _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(_ListenerTrampoline10 block) NS_RETURNS_RETAINED { +ListenerTrampoline_9 _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(ListenerTrampoline_9 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, SecTrustResultType arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^_BlockingTrampoline10)(void * waiter, struct __SecTrust * arg0, SecTrustResultType arg1); +typedef void (^BlockingTrampoline_9)(void * waiter, struct __SecTrust * arg0, SecTrustResultType arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline10 _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt( - _BlockingTrampoline10 block, _BlockingTrampoline10 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(struct __SecTrust * arg0, SecTrustResultType arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, arg1); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, arg1); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_9 _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt( + BlockingTrampoline_9 block, BlockingTrampoline_9 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(struct __SecTrust * arg0, SecTrustResultType arg1), { + objc_retainBlock(block); + block(nil, arg0, arg1); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, arg1); + }); } -typedef void (^_ListenerTrampoline11)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); +typedef void (^ListenerTrampoline_10)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline11 _NativeCupertinoHttp_wrapListenerBlock_k73ff5(_ListenerTrampoline11 block) NS_RETURNS_RETAINED { +ListenerTrampoline_10 _NativeCupertinoHttp_wrapListenerBlock_k73ff5(ListenerTrampoline_10 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2) { objc_retainBlock(block); block(arg0, arg1, arg2); }; } -typedef void (^_BlockingTrampoline11)(void * waiter, struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); +typedef void (^BlockingTrampoline_10)(void * waiter, struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline11 _NativeCupertinoHttp_wrapBlockingBlock_k73ff5( - _BlockingTrampoline11 block, _BlockingTrampoline11 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, arg1, arg2); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, arg1, arg2); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_10 _NativeCupertinoHttp_wrapBlockingBlock_k73ff5( + BlockingTrampoline_10 block, BlockingTrampoline_10 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2), { + objc_retainBlock(block); + block(nil, arg0, arg1, arg2); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, arg1, arg2); + }); } -typedef void (^_ListenerTrampoline12)(uint16_t arg0); +typedef void (^ListenerTrampoline_11)(uint16_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline12 _NativeCupertinoHttp_wrapListenerBlock_15f11yh(_ListenerTrampoline12 block) NS_RETURNS_RETAINED { +ListenerTrampoline_11 _NativeCupertinoHttp_wrapListenerBlock_15f11yh(ListenerTrampoline_11 block) NS_RETURNS_RETAINED { return ^void(uint16_t arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_BlockingTrampoline12)(void * waiter, uint16_t arg0); +typedef void (^BlockingTrampoline_11)(void * waiter, uint16_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline12 _NativeCupertinoHttp_wrapBlockingBlock_15f11yh( - _BlockingTrampoline12 block, _BlockingTrampoline12 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(uint16_t arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_11 _NativeCupertinoHttp_wrapBlockingBlock_15f11yh( + BlockingTrampoline_11 block, BlockingTrampoline_11 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(uint16_t arg0), { + objc_retainBlock(block); + block(nil, arg0); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0); + }); } -typedef void (^_ListenerTrampoline13)(id arg0, id arg1); +typedef void (^ListenerTrampoline_12)(id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline13 _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(_ListenerTrampoline13 block) NS_RETURNS_RETAINED { +ListenerTrampoline_12 _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(ListenerTrampoline_12 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^_BlockingTrampoline13)(void * waiter, id arg0, id arg1); +typedef void (^BlockingTrampoline_12)(void * waiter, id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline13 _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( - _BlockingTrampoline13 block, _BlockingTrampoline13 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, id arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_12 _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( + BlockingTrampoline_12 block, BlockingTrampoline_12 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1), { + objc_retainBlock(block); + block(nil, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1)); + }); } -typedef void (^_ListenerTrampoline14)(id arg0, id arg1, id arg2); +typedef void (^ListenerTrampoline_13)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline14 _NativeCupertinoHttp_wrapListenerBlock_18qun1e(_ListenerTrampoline14 block) NS_RETURNS_RETAINED { +ListenerTrampoline_13 _NativeCupertinoHttp_wrapListenerBlock_18qun1e(ListenerTrampoline_13 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), objc_retainBlock(arg2)); }; } -typedef void (^_BlockingTrampoline14)(void * waiter, id arg0, id arg1, id arg2); +typedef void (^BlockingTrampoline_13)(void * waiter, id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline14 _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( - _BlockingTrampoline14 block, _BlockingTrampoline14 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, id arg1, id arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), objc_retainBlock(arg2)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), objc_retainBlock(arg2)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_13 _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( + BlockingTrampoline_13 block, BlockingTrampoline_13 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1, id arg2), { + objc_retainBlock(block); + block(nil, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), objc_retainBlock(arg2)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), objc_retainBlock(arg2)); + }); } -typedef void (^_ListenerTrampoline15)(id arg0, id arg1); +typedef void (^ListenerTrampoline_14)(id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline15 _NativeCupertinoHttp_wrapListenerBlock_o762yo(_ListenerTrampoline15 block) NS_RETURNS_RETAINED { +ListenerTrampoline_14 _NativeCupertinoHttp_wrapListenerBlock_o762yo(ListenerTrampoline_14 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), objc_retainBlock(arg1)); }; } -typedef void (^_BlockingTrampoline15)(void * waiter, id arg0, id arg1); +typedef void (^BlockingTrampoline_14)(void * waiter, id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline15 _NativeCupertinoHttp_wrapBlockingBlock_o762yo( - _BlockingTrampoline15 block, _BlockingTrampoline15 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, id arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), objc_retainBlock(arg1)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), objc_retainBlock(arg1)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_14 _NativeCupertinoHttp_wrapBlockingBlock_o762yo( + BlockingTrampoline_14 block, BlockingTrampoline_14 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1), { + objc_retainBlock(block); + block(nil, (__bridge id)(__bridge_retained void*)(arg0), objc_retainBlock(arg1)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), objc_retainBlock(arg1)); + }); } -typedef void (^_ListenerTrampoline16)(BOOL arg0); +typedef void (^ListenerTrampoline_15)(BOOL arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline16 _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(_ListenerTrampoline16 block) NS_RETURNS_RETAINED { +ListenerTrampoline_15 _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(ListenerTrampoline_15 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_BlockingTrampoline16)(void * waiter, BOOL arg0); +typedef void (^BlockingTrampoline_15)(void * waiter, BOOL arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline16 _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9( - _BlockingTrampoline16 block, _BlockingTrampoline16 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(BOOL arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_15 _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9( + BlockingTrampoline_15 block, BlockingTrampoline_15 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(BOOL arg0), { + objc_retainBlock(block); + block(nil, arg0); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0); + }); } -typedef void (^_ListenerTrampoline17)(id arg0, id arg1, id arg2); +typedef void (^ListenerTrampoline_16)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline17 _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(_ListenerTrampoline17 block) NS_RETURNS_RETAINED { +ListenerTrampoline_16 _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(ListenerTrampoline_16 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); }; } -typedef void (^_BlockingTrampoline17)(void * waiter, id arg0, id arg1, id arg2); +typedef void (^BlockingTrampoline_16)(void * waiter, id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline17 _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( - _BlockingTrampoline17 block, _BlockingTrampoline17 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, id arg1, id arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_16 _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( + BlockingTrampoline_16 block, BlockingTrampoline_16 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1, id arg2), { + objc_retainBlock(block); + block(nil, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); + }); } -typedef void (^_ListenerTrampoline18)(NSURLSessionResponseDisposition arg0); +Protocol* _NativeCupertinoHttp_NSURLSessionDelegate(void) { return @protocol(NSURLSessionDelegate); } + +typedef void (^ListenerTrampoline_17)(NSURLSessionResponseDisposition arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline18 _NativeCupertinoHttp_wrapListenerBlock_16sve1d(_ListenerTrampoline18 block) NS_RETURNS_RETAINED { +ListenerTrampoline_17 _NativeCupertinoHttp_wrapListenerBlock_16sve1d(ListenerTrampoline_17 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionResponseDisposition arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_BlockingTrampoline18)(void * waiter, NSURLSessionResponseDisposition arg0); +typedef void (^BlockingTrampoline_17)(void * waiter, NSURLSessionResponseDisposition arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline18 _NativeCupertinoHttp_wrapBlockingBlock_16sve1d( - _BlockingTrampoline18 block, _BlockingTrampoline18 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(NSURLSessionResponseDisposition arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0); - awaitWaiter(waiter); - } +ListenerTrampoline_17 _NativeCupertinoHttp_wrapBlockingBlock_16sve1d( + BlockingTrampoline_17 block, BlockingTrampoline_17 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(NSURLSessionResponseDisposition arg0), { + objc_retainBlock(block); + block(nil, arg0); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0); + }); +} + +typedef void (^ListenerTrampoline_18)(NSURLSessionDelayedRequestDisposition arg0, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) +ListenerTrampoline_18 _NativeCupertinoHttp_wrapListenerBlock_1otpo83(ListenerTrampoline_18 block) NS_RETURNS_RETAINED { + return ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1) { + objc_retainBlock(block); + block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^_ListenerTrampoline19)(void * arg0, id arg1, id arg2, id arg3, id arg4); +typedef void (^BlockingTrampoline_18)(void * waiter, NSURLSessionDelayedRequestDisposition arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline19 _NativeCupertinoHttp_wrapListenerBlock_xx612k(_ListenerTrampoline19 block) NS_RETURNS_RETAINED { +ListenerTrampoline_18 _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( + BlockingTrampoline_18 block, BlockingTrampoline_18 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + }); +} + +typedef void (^ListenerTrampoline_19)(void * arg0, id arg1, id arg2, id arg3, id arg4); +__attribute__((visibility("default"))) __attribute__((used)) +ListenerTrampoline_19 _NativeCupertinoHttp_wrapListenerBlock_xx612k(ListenerTrampoline_19 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), objc_retainBlock(arg4)); }; } -typedef void (^_BlockingTrampoline19)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4); +typedef void (^BlockingTrampoline_19)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline19 _NativeCupertinoHttp_wrapBlockingBlock_xx612k( - _BlockingTrampoline19 block, _BlockingTrampoline19 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), objc_retainBlock(arg4)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), objc_retainBlock(arg4)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_19 _NativeCupertinoHttp_wrapBlockingBlock_xx612k( + BlockingTrampoline_19 block, BlockingTrampoline_19 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3, id arg4), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), objc_retainBlock(arg4)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), objc_retainBlock(arg4)); + }); +} + +typedef void (^ProtocolTrampoline_5)(void * sel, id arg1, id arg2, id arg3, id arg4); +__attribute__((visibility("default"))) __attribute__((used)) +void _NativeCupertinoHttp_protocolTrampoline_xx612k(id target, void * sel, id arg1, id arg2, id arg3, id arg4) { + return ((ProtocolTrampoline_5)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } -typedef void (^_ListenerTrampoline20)(void * arg0, id arg1, id arg2, id arg3); +typedef void (^ListenerTrampoline_20)(void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline20 _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(_ListenerTrampoline20 block) NS_RETURNS_RETAINED { +ListenerTrampoline_20 _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(ListenerTrampoline_20 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3)); }; } -typedef void (^_BlockingTrampoline20)(void * waiter, void * arg0, id arg1, id arg2, id arg3); +typedef void (^BlockingTrampoline_20)(void * waiter, void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline20 _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( - _BlockingTrampoline20 block, _BlockingTrampoline20 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, id arg3) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_20 _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + BlockingTrampoline_20 block, BlockingTrampoline_20 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3)); + }); } -typedef void (^_ListenerTrampoline21)(void * arg0, id arg1, id arg2); +typedef void (^ProtocolTrampoline_6)(void * sel, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline21 _NativeCupertinoHttp_wrapListenerBlock_fjrv01(_ListenerTrampoline21 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1, id arg2) { - objc_retainBlock(block); - block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); - }; +void _NativeCupertinoHttp_protocolTrampoline_1tz5yf(id target, void * sel, id arg1, id arg2, id arg3) { + return ((ProtocolTrampoline_6)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } -typedef void (^_BlockingTrampoline21)(void * waiter, void * arg0, id arg1, id arg2); +typedef void (^ListenerTrampoline_21)(void * arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline21 _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( - _BlockingTrampoline21 block, _BlockingTrampoline21 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; +ListenerTrampoline_21 _NativeCupertinoHttp_wrapListenerBlock_fjrv01(ListenerTrampoline_21 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); - awaitWaiter(waiter); - } + objc_retainBlock(block); + block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); }; } -typedef void (^_ListenerTrampoline22)(NSURLSessionDelayedRequestDisposition arg0, id arg1); +typedef void (^BlockingTrampoline_21)(void * waiter, void * arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline22 _NativeCupertinoHttp_wrapListenerBlock_1otpo83(_ListenerTrampoline22 block) NS_RETURNS_RETAINED { - return ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1) { +ListenerTrampoline_21 _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( + BlockingTrampoline_21 block, BlockingTrampoline_21 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2), { objc_retainBlock(block); - block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); - }; + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); + }); } -typedef void (^_BlockingTrampoline22)(void * waiter, NSURLSessionDelayedRequestDisposition arg0, id arg1); +typedef void (^ProtocolTrampoline_7)(void * sel, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline22 _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( - _BlockingTrampoline22 block, _BlockingTrampoline22 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); - awaitWaiter(waiter); - } - }; +void _NativeCupertinoHttp_protocolTrampoline_fjrv01(id target, void * sel, id arg1, id arg2) { + return ((ProtocolTrampoline_7)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); } -typedef void (^_ListenerTrampoline23)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); +typedef void (^ListenerTrampoline_22)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline23 _NativeCupertinoHttp_wrapListenerBlock_l2g8ke(_ListenerTrampoline23 block) NS_RETURNS_RETAINED { +ListenerTrampoline_22 _NativeCupertinoHttp_wrapListenerBlock_l2g8ke(ListenerTrampoline_22 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), (__bridge id)(__bridge_retained void*)(arg4), objc_retainBlock(arg5)); }; } -typedef void (^_BlockingTrampoline23)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); +typedef void (^BlockingTrampoline_22)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline23 _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( - _BlockingTrampoline23 block, _BlockingTrampoline23 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), (__bridge id)(__bridge_retained void*)(arg4), objc_retainBlock(arg5)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), (__bridge id)(__bridge_retained void*)(arg4), objc_retainBlock(arg5)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_22 _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( + BlockingTrampoline_22 block, BlockingTrampoline_22 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), (__bridge id)(__bridge_retained void*)(arg4), objc_retainBlock(arg5)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), (__bridge id)(__bridge_retained void*)(arg4), objc_retainBlock(arg5)); + }); } -typedef void (^_ListenerTrampoline24)(NSURLSessionAuthChallengeDisposition arg0, id arg1); +typedef void (^ProtocolTrampoline_8)(void * sel, id arg1, id arg2, id arg3, id arg4, id arg5); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline24 _NativeCupertinoHttp_wrapListenerBlock_n8yd09(_ListenerTrampoline24 block) NS_RETURNS_RETAINED { +void _NativeCupertinoHttp_protocolTrampoline_l2g8ke(id target, void * sel, id arg1, id arg2, id arg3, id arg4, id arg5) { + return ((ProtocolTrampoline_8)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4, arg5); +} + +typedef void (^ListenerTrampoline_23)(NSURLSessionAuthChallengeDisposition arg0, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) +ListenerTrampoline_23 _NativeCupertinoHttp_wrapListenerBlock_n8yd09(ListenerTrampoline_23 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^_BlockingTrampoline24)(void * waiter, NSURLSessionAuthChallengeDisposition arg0, id arg1); +typedef void (^BlockingTrampoline_23)(void * waiter, NSURLSessionAuthChallengeDisposition arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline24 _NativeCupertinoHttp_wrapBlockingBlock_n8yd09( - _BlockingTrampoline24 block, _BlockingTrampoline24 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_23 _NativeCupertinoHttp_wrapBlockingBlock_n8yd09( + BlockingTrampoline_23 block, BlockingTrampoline_23 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + }); } -typedef void (^_ListenerTrampoline25)(void * arg0, id arg1, id arg2, id arg3); +typedef void (^ListenerTrampoline_24)(void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline25 _NativeCupertinoHttp_wrapListenerBlock_bklti2(_ListenerTrampoline25 block) NS_RETURNS_RETAINED { +ListenerTrampoline_24 _NativeCupertinoHttp_wrapListenerBlock_bklti2(ListenerTrampoline_24 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), objc_retainBlock(arg3)); }; } -typedef void (^_BlockingTrampoline25)(void * waiter, void * arg0, id arg1, id arg2, id arg3); +typedef void (^BlockingTrampoline_24)(void * waiter, void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline25 _NativeCupertinoHttp_wrapBlockingBlock_bklti2( - _BlockingTrampoline25 block, _BlockingTrampoline25 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, id arg3) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), objc_retainBlock(arg3)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), objc_retainBlock(arg3)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_24 _NativeCupertinoHttp_wrapBlockingBlock_bklti2( + BlockingTrampoline_24 block, BlockingTrampoline_24 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), objc_retainBlock(arg3)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), objc_retainBlock(arg3)); + }); } -typedef void (^_ListenerTrampoline26)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); +typedef void (^ProtocolTrampoline_9)(void * sel, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline26 _NativeCupertinoHttp_wrapListenerBlock_jyim80(_ListenerTrampoline26 block) NS_RETURNS_RETAINED { +void _NativeCupertinoHttp_protocolTrampoline_bklti2(id target, void * sel, id arg1, id arg2, id arg3) { + return ((ProtocolTrampoline_9)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); +} + +typedef void (^ListenerTrampoline_25)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); +__attribute__((visibility("default"))) __attribute__((used)) +ListenerTrampoline_25 _NativeCupertinoHttp_wrapListenerBlock_jyim80(ListenerTrampoline_25 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, objc_retainBlock(arg4)); }; } -typedef void (^_BlockingTrampoline26)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, id arg4); +typedef void (^BlockingTrampoline_25)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline26 _NativeCupertinoHttp_wrapBlockingBlock_jyim80( - _BlockingTrampoline26 block, _BlockingTrampoline26 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, objc_retainBlock(arg4)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, objc_retainBlock(arg4)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_25 _NativeCupertinoHttp_wrapBlockingBlock_jyim80( + BlockingTrampoline_25 block, BlockingTrampoline_25 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, objc_retainBlock(arg4)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, objc_retainBlock(arg4)); + }); +} + +typedef void (^ProtocolTrampoline_10)(void * sel, id arg1, id arg2, int64_t arg3, id arg4); +__attribute__((visibility("default"))) __attribute__((used)) +void _NativeCupertinoHttp_protocolTrampoline_jyim80(id target, void * sel, id arg1, id arg2, int64_t arg3, id arg4) { + return ((ProtocolTrampoline_10)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } -typedef void (^_ListenerTrampoline27)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +typedef void (^ListenerTrampoline_26)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline27 _NativeCupertinoHttp_wrapListenerBlock_h68abb(_ListenerTrampoline27 block) NS_RETURNS_RETAINED { +ListenerTrampoline_26 _NativeCupertinoHttp_wrapListenerBlock_h68abb(ListenerTrampoline_26 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4, arg5); }; } -typedef void (^_BlockingTrampoline27)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +typedef void (^BlockingTrampoline_26)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline27 _NativeCupertinoHttp_wrapBlockingBlock_h68abb( - _BlockingTrampoline27 block, _BlockingTrampoline27 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4, arg5); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4, arg5); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_26 _NativeCupertinoHttp_wrapBlockingBlock_h68abb( + BlockingTrampoline_26 block, BlockingTrampoline_26 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4, arg5); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4, arg5); + }); +} + +typedef void (^ProtocolTrampoline_11)(void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +__attribute__((visibility("default"))) __attribute__((used)) +void _NativeCupertinoHttp_protocolTrampoline_h68abb(id target, void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { + return ((ProtocolTrampoline_11)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4, arg5); } Protocol* _NativeCupertinoHttp_NSURLSessionDataDelegate(void) { return @protocol(NSURLSessionDataDelegate); } -typedef void (^_ListenerTrampoline28)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); +typedef void (^ListenerTrampoline_27)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline28 _NativeCupertinoHttp_wrapListenerBlock_ly2579(_ListenerTrampoline28 block) NS_RETURNS_RETAINED { +ListenerTrampoline_27 _NativeCupertinoHttp_wrapListenerBlock_ly2579(ListenerTrampoline_27 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4); }; } -typedef void (^_BlockingTrampoline28)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); +typedef void (^BlockingTrampoline_27)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline28 _NativeCupertinoHttp_wrapBlockingBlock_ly2579( - _BlockingTrampoline28 block, _BlockingTrampoline28 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_27 _NativeCupertinoHttp_wrapBlockingBlock_ly2579( + BlockingTrampoline_27 block, BlockingTrampoline_27 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4); + }); +} + +typedef void (^ProtocolTrampoline_12)(void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4); +__attribute__((visibility("default"))) __attribute__((used)) +void _NativeCupertinoHttp_protocolTrampoline_ly2579(id target, void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4) { + return ((ProtocolTrampoline_12)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } Protocol* _NativeCupertinoHttp_NSURLSessionDownloadDelegate(void) { return @protocol(NSURLSessionDownloadDelegate); } -typedef void (^_ListenerTrampoline29)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); +typedef void (^ListenerTrampoline_28)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline29 _NativeCupertinoHttp_wrapListenerBlock_1lx650f(_ListenerTrampoline29 block) NS_RETURNS_RETAINED { +ListenerTrampoline_28 _NativeCupertinoHttp_wrapListenerBlock_1lx650f(ListenerTrampoline_28 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, (__bridge id)(__bridge_retained void*)(arg4)); }; } -typedef void (^_BlockingTrampoline29)(void * waiter, void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); +typedef void (^BlockingTrampoline_28)(void * waiter, void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline29 _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( - _BlockingTrampoline29 block, _BlockingTrampoline29 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, (__bridge id)(__bridge_retained void*)(arg4)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, (__bridge id)(__bridge_retained void*)(arg4)); - awaitWaiter(waiter); - } - }; +ListenerTrampoline_28 _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( + BlockingTrampoline_28 block, BlockingTrampoline_28 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4), { + objc_retainBlock(block); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, (__bridge id)(__bridge_retained void*)(arg4)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, (__bridge id)(__bridge_retained void*)(arg4)); + }); } -Protocol* _NativeCupertinoHttp_NSURLSessionWebSocketDelegate(void) { return @protocol(NSURLSessionWebSocketDelegate); } - -typedef void (^_ListenerTrampoline30)(id arg0, unsigned long arg1, BOOL * arg2); +typedef void (^ProtocolTrampoline_13)(void * sel, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline30 _NativeCupertinoHttp_wrapListenerBlock_1p9ui4q(_ListenerTrampoline30 block) NS_RETURNS_RETAINED { - return ^void(id arg0, unsigned long arg1, BOOL * arg2) { - objc_retainBlock(block); - block((__bridge id)(__bridge_retained void*)(arg0), arg1, arg2); - }; +void _NativeCupertinoHttp_protocolTrampoline_1lx650f(id target, void * sel, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { + return ((ProtocolTrampoline_13)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } -typedef void (^_BlockingTrampoline30)(void * waiter, id arg0, unsigned long arg1, BOOL * arg2); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline30 _NativeCupertinoHttp_wrapBlockingBlock_1p9ui4q( - _BlockingTrampoline30 block, _BlockingTrampoline30 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, unsigned long arg1, BOOL * arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), arg1, arg2); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), arg1, arg2); - awaitWaiter(waiter); - } - }; -} +Protocol* _NativeCupertinoHttp_NSURLSessionWebSocketDelegate(void) { return @protocol(NSURLSessionWebSocketDelegate); } -typedef void (^_ListenerTrampoline31)(id arg0, id arg1, id arg2); +typedef void (^ListenerTrampoline_29)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline31 _NativeCupertinoHttp_wrapListenerBlock_1b3bb6a(_ListenerTrampoline31 block) NS_RETURNS_RETAINED { +ListenerTrampoline_29 _NativeCupertinoHttp_wrapListenerBlock_1b3bb6a(ListenerTrampoline_29 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block(objc_retainBlock(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); }; } -typedef void (^_BlockingTrampoline31)(void * waiter, id arg0, id arg1, id arg2); +typedef void (^BlockingTrampoline_29)(void * waiter, id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline31 _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( - _BlockingTrampoline31 block, _BlockingTrampoline31 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, id arg1, id arg2) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, objc_retainBlock(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, objc_retainBlock(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); - awaitWaiter(waiter); - } - }; -} - -typedef void (^_ListenerTrampoline32)(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline32 _NativeCupertinoHttp_wrapListenerBlock_lmc3p5(_ListenerTrampoline32 block) NS_RETURNS_RETAINED { - return ^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3) { +ListenerTrampoline_29 _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( + BlockingTrampoline_29 block, BlockingTrampoline_29 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1, id arg2), { objc_retainBlock(block); - block((__bridge id)(__bridge_retained void*)(arg0), arg1, arg2, arg3); - }; -} - -typedef void (^_BlockingTrampoline32)(void * waiter, id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline32 _NativeCupertinoHttp_wrapBlockingBlock_lmc3p5( - _BlockingTrampoline32 block, _BlockingTrampoline32 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), arg1, arg2, arg3); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), arg1, arg2, arg3); - awaitWaiter(waiter); - } - }; + block(nil, objc_retainBlock(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, objc_retainBlock(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); + }); } -typedef void (^_ListenerTrampoline33)(id arg0, BOOL * arg1); +typedef id (^ProtocolTrampoline_14)(void * sel, id arg1, id arg2, id * arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline33 _NativeCupertinoHttp_wrapListenerBlock_t8l8el(_ListenerTrampoline33 block) NS_RETURNS_RETAINED { - return ^void(id arg0, BOOL * arg1) { - objc_retainBlock(block); - block((__bridge id)(__bridge_retained void*)(arg0), arg1); - }; +id _NativeCupertinoHttp_protocolTrampoline_10z9f5k(id target, void * sel, id arg1, id arg2, id * arg3) { + return ((ProtocolTrampoline_14)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } -typedef void (^_BlockingTrampoline33)(void * waiter, id arg0, BOOL * arg1); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline33 _NativeCupertinoHttp_wrapBlockingBlock_t8l8el( - _BlockingTrampoline33 block, _BlockingTrampoline33 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(id arg0, BOOL * arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0), arg1); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0), arg1); - awaitWaiter(waiter); - } - }; +typedef NSItemProviderRepresentationVisibility (^ProtocolTrampoline_15)(void * sel, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) +NSItemProviderRepresentationVisibility _NativeCupertinoHttp_protocolTrampoline_1ldqghh(id target, void * sel, id arg1) { + return ((ProtocolTrampoline_15)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef void (^_ListenerTrampoline34)(unsigned short * arg0, unsigned long arg1); +typedef id (^ProtocolTrampoline_16)(void * sel, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline34 _NativeCupertinoHttp_wrapListenerBlock_vhbh5h(_ListenerTrampoline34 block) NS_RETURNS_RETAINED { - return ^void(unsigned short * arg0, unsigned long arg1) { - objc_retainBlock(block); - block(arg0, arg1); - }; +id _NativeCupertinoHttp_protocolTrampoline_1q0i84(id target, void * sel, id arg1, id arg2) { + return ((ProtocolTrampoline_16)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); } -typedef void (^_BlockingTrampoline34)(void * waiter, unsigned short * arg0, unsigned long arg1); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline34 _NativeCupertinoHttp_wrapBlockingBlock_vhbh5h( - _BlockingTrampoline34 block, _BlockingTrampoline34 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(unsigned short * arg0, unsigned long arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, arg1); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, arg1); - awaitWaiter(waiter); - } - }; -} +Protocol* _NativeCupertinoHttp_NSLocking(void) { return @protocol(NSLocking); } -typedef void (^_ListenerTrampoline35)(void * arg0, unsigned long arg1); +typedef void (^ListenerTrampoline_30)(void * arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline35 _NativeCupertinoHttp_wrapListenerBlock_zuf90e(_ListenerTrampoline35 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, unsigned long arg1) { +ListenerTrampoline_30 _NativeCupertinoHttp_wrapListenerBlock_ovsamd(ListenerTrampoline_30 block) NS_RETURNS_RETAINED { + return ^void(void * arg0) { objc_retainBlock(block); - block(arg0, arg1); - }; -} - -typedef void (^_BlockingTrampoline35)(void * waiter, void * arg0, unsigned long arg1); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline35 _NativeCupertinoHttp_wrapBlockingBlock_zuf90e( - _BlockingTrampoline35 block, _BlockingTrampoline35 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0, unsigned long arg1) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0, arg1); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, arg1); - awaitWaiter(waiter); - } + block(arg0); }; } -typedef void (^_ListenerTrampoline36)(void * arg0); +typedef void (^BlockingTrampoline_30)(void * waiter, void * arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline36 _NativeCupertinoHttp_wrapListenerBlock_ovsamd(_ListenerTrampoline36 block) NS_RETURNS_RETAINED { - return ^void(void * arg0) { +ListenerTrampoline_30 _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( + BlockingTrampoline_30 block, BlockingTrampoline_30 listenerBlock, + DOBJC_Context* ctx) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0), { objc_retainBlock(block); - block(arg0); - }; + block(nil, arg0); + }, { + objc_retainBlock(listenerBlock); + listenerBlock(waiter, arg0); + }); } -typedef void (^_BlockingTrampoline36)(void * waiter, void * arg0); +typedef void (^ProtocolTrampoline_17)(void * sel); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline36 _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( - _BlockingTrampoline36 block, _BlockingTrampoline36 listenerBlock, - void* (*newWaiter)(), void (*awaitWaiter)(void*)) NS_RETURNS_RETAINED { - NSThread *targetThread = [NSThread currentThread]; - return ^void(void * arg0) { - if ([NSThread currentThread] == targetThread) { - objc_retainBlock(block); - block(nil, arg0); - } else { - void* waiter = newWaiter(); - objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0); - awaitWaiter(waiter); - } - }; +void _NativeCupertinoHttp_protocolTrampoline_ovsamd(id target, void * sel) { + return ((ProtocolTrampoline_17)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); } +#undef BLOCKING_BLOCK_IMPL diff --git a/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart b/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart index e316e80bb3..6796b3595b 100644 --- a/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart @@ -121,7 +121,11 @@ void testProperties(URLSessionConfiguration config) { config.multipathServiceType, NSURLSessionMultipathServiceType .NSURLSessionMultipathServiceTypeNone); - }); + }, + skip: Platform.isMacOS + ? 'NSURLSessionConfiguration.multipathServiceType is not ' + 'supported on macOS' + : false); test('networkServiceType', () { expect(config.networkServiceType, NSURLRequestNetworkServiceType.NSURLNetworkServiceTypeDefault); diff --git a/pkgs/cupertino_http/example/integration_test/utils_test.dart b/pkgs/cupertino_http/example/integration_test/utils_test.dart index 80c2c1caad..bb104eef18 100644 --- a/pkgs/cupertino_http/example/integration_test/utils_test.dart +++ b/pkgs/cupertino_http/example/integration_test/utils_test.dart @@ -12,20 +12,20 @@ void main() { group('stringNSDictionaryToMap', () { test('empty input', () { - final d = objc.NSMutableDictionary.new1(); + final d = objc.NSMutableDictionary(); expect(stringNSDictionaryToMap(d), {}); }); test('single string input', () { - final d = objc.NSMutableDictionary.new1() + final d = objc.NSMutableDictionary() ..setObject_forKey_('value'.toNSString(), 'key'.toNSString()); expect(stringNSDictionaryToMap(d), {'key': 'value'}); }); test('multiple string input', () { - final d = objc.NSMutableDictionary.new1() + final d = objc.NSMutableDictionary() ..setObject_forKey_('value1'.toNSString(), 'key1'.toNSString()) ..setObject_forKey_('value2'.toNSString(), 'key2'.toNSString()) ..setObject_forKey_('value3'.toNSString(), 'key3'.toNSString()); @@ -34,14 +34,14 @@ void main() { }); test('non-string value', () { - final d = objc.NSMutableDictionary.new1() + final d = objc.NSMutableDictionary() ..setObject_forKey_( objc.NSNumberCreation.numberWithInteger_(5), 'key'.toNSString()); expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError); }); test('non-string key', () { - final d = objc.NSMutableDictionary.new1() + final d = objc.NSMutableDictionary() ..setObject_forKey_( 'value'.toNSString(), objc.NSNumberCreation.numberWithInteger_(5)); expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError); @@ -57,17 +57,17 @@ void main() { test('single string input', () { final array = stringIterableToNSArray(['apple']); expect(array.count, 1); - expect( - objc.NSString.castFrom(array.objectAtIndex_(0)).toString(), 'apple'); + expect(objc.NSString.castFrom(array.objectAtIndex_(0)).toDartString(), + 'apple'); }); test('multiple string input', () { final array = stringIterableToNSArray(['apple', 'banana']); expect(array.count, 2); - expect( - objc.NSString.castFrom(array.objectAtIndex_(0)).toString(), 'apple'); - expect( - objc.NSString.castFrom(array.objectAtIndex_(1)).toString(), 'banana'); + expect(objc.NSString.castFrom(array.objectAtIndex_(0)).toDartString(), + 'apple'); + expect(objc.NSString.castFrom(array.objectAtIndex_(1)).toDartString(), + 'banana'); }); }); } diff --git a/pkgs/cupertino_http/example/ios/Podfile.lock b/pkgs/cupertino_http/example/ios/Podfile.lock index 7201c0f962..3778c20a2b 100644 --- a/pkgs/cupertino_http/example/ios/Podfile.lock +++ b/pkgs/cupertino_http/example/ios/Podfile.lock @@ -25,11 +25,11 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/objective_c/ios" SPEC CHECKSUMS: - cupertino_http: 947a233f40cfea55167a49f2facc18434ea117ba + cupertino_http: 94ac07f5ff090b8effa6c5e2c47871d48ab7c86c Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 - objective_c: 77e887b5ba1827970907e10e832eec1683f3431d + integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e + objective_c: 89e720c30d716b036faf9c9684022048eee1eee2 PODFILE CHECKSUM: d2243213672c3c48aae53c36642ba411a6be7309 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index b302ff3aec..38f75b0cf9 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -31,7 +31,7 @@ dev_dependencies: http_profile: ^0.1.0 integration_test: sdk: flutter - objective_c: ^4.0.0 + objective_c: ^7.0.0 test: ^1.21.1 web_socket_conformance_tests: path: ../../web_socket_conformance_tests/ diff --git a/pkgs/cupertino_http/lib/src/cupertino_api.dart b/pkgs/cupertino_http/lib/src/cupertino_api.dart index 2fced66721..9586279874 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_api.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_api.dart @@ -27,7 +27,6 @@ library; import 'dart:async'; -import 'dart:isolate'; import 'package:objective_c/objective_c.dart' as objc; @@ -337,7 +336,7 @@ class URLResponse extends _ObjectHolder { /// The MIME type of the response. /// /// See [NSURLResponse.MIMEType](https://developer.apple.com/documentation/foundation/nsurlresponse/1411613-mimetype) - String? get mimeType => _nsObject.MIMEType?.toString(); + String? get mimeType => _nsObject.MIMEType?.toDartString(); @override String toString() => '[URLResponse ' @@ -411,7 +410,7 @@ class URLSessionWebSocketMessage /// Will be `null` if the [URLSessionWebSocketMessage] is a data message. /// /// See [NSURLSessionWebSocketMessage.string](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessage/3181194-string) - String? get string => _nsObject.string?.toString(); + String? get string => _nsObject.string?.toDartString(); /// The type of the WebSocket message. /// @@ -516,7 +515,7 @@ class URLSessionTask extends _ObjectHolder { /// The user-assigned description for the task. /// /// See [NSURLSessionTask.taskDescription](https://developer.apple.com/documentation/foundation/nsurlsessiontask/1409798-taskdescription) - String get taskDescription => _nsObject.taskDescription.toString(); + String get taskDescription => _nsObject.taskDescription?.toDartString() ?? ''; /// The user-assigned description for the task. /// @@ -702,7 +701,7 @@ class URLRequest extends _ObjectHolder { /// NOTE: The documentation for `NSURLRequest.HTTPMethod` says that the /// property is nullable but, in practice, assigning it to null will produce /// an error. - String get httpMethod => _nsObject.HTTPMethod!.toString(); + String get httpMethod => _nsObject.HTTPMethod!.toDartString(); /// The timeout interval during the connection attempt. /// @@ -802,32 +801,8 @@ class URLSession extends _ObjectHolder { // Indicates if the session is a background session. Copied from the // [URLSessionConfiguration._isBackground] associated with this [URLSession]. final bool _isBackground; - final bool _hasDelegate; - // Pending Dart-implemented protocols/blocks do not keep the isolate alive. - // So we create a `ReceivePort` to keep the isolate alive. - // When a new task is created in a `URLSession` with a delegate installed - // (`_hasDelegate`), `_taskCount` is incremented. When a task completes, - // `_taskCount` is decremented. When `_taskCount` is 0 then the `ReceivePort` - // is closed. - static var _taskCount = 0; - static ReceivePort? _port; - - static void _incrementTaskCount() { - _port ??= ReceivePort(); - ++_taskCount; - } - static void _decrementTaskCount() { - assert(_taskCount > 0); - assert(_port != null); - --_taskCount; - if (_taskCount == 0) { - _port?.close(); - _port = null; - } - } - - static objc.ObjCObjectBase delegate( + static ncb.NSURLSessionDelegate delegate( bool isBackground, { URLRequest? Function(URLSession session, URLSessionTask task, HTTPURLResponse response, URLRequest newRequest)? @@ -850,17 +825,13 @@ class URLSession extends _ObjectHolder { }) { final protoBuilder = objc.ObjCProtocolBuilder(); - ncb.NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(protoBuilder, (nsSession, nsTask, nsError) { - _decrementTaskCount(); - if (onComplete != null) { - onComplete( - URLSession._(nsSession, - isBackground: isBackground, hasDelegate: true), - URLSessionTask._(nsTask), - nsError); - } - }); + if (onComplete != null) { + ncb.NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(protoBuilder, (nsSession, nsTask, nsError) { + onComplete(URLSession._(nsSession, isBackground: isBackground), + URLSessionTask._(nsTask), nsError); + }); + } if (onRedirect != null) { ncb @@ -878,8 +849,7 @@ class URLSession extends _ObjectHolder { final response = URLResponse._exactURLResponseType(nsResponse) as HTTPURLResponse; redirectRequest = onRedirect( - URLSession._(nsSession, - isBackground: isBackground, hasDelegate: true), + URLSession._(nsSession, isBackground: isBackground), URLSessionTask._(nsTask), response, request); @@ -899,8 +869,7 @@ class URLSession extends _ObjectHolder { (nsSession, nsDataTask, nsResponse, nsCompletionHandler) { final exactResponse = URLResponse._exactURLResponseType(nsResponse); final disposition = onResponse( - URLSession._(nsSession, - isBackground: isBackground, hasDelegate: true), + URLSession._(nsSession, isBackground: isBackground), URLSessionTask._(nsDataTask), exactResponse); nsCompletionHandler.call(disposition); @@ -910,11 +879,8 @@ class URLSession extends _ObjectHolder { if (onData != null) { ncb.NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ .implementAsListener(protoBuilder, (nsSession, nsDataTask, nsData) { - onData( - URLSession._(nsSession, - isBackground: isBackground, hasDelegate: true), - URLSessionTask._(nsDataTask), - nsData); + onData(URLSession._(nsSession, isBackground: isBackground), + URLSessionTask._(nsDataTask), nsData); }); } @@ -923,8 +889,7 @@ class URLSession extends _ObjectHolder { .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsBlocking(protoBuilder, (nsSession, nsTask, nsUrl) { onFinishedDownloading( - URLSession._(nsSession, - isBackground: isBackground, hasDelegate: true), + URLSession._(nsSession, isBackground: isBackground), URLSessionDownloadTask._(nsTask), nsurlToUri(nsUrl)); }); @@ -935,10 +900,9 @@ class URLSession extends _ObjectHolder { .URLSession_webSocketTask_didOpenWithProtocol_ .implementAsListener(protoBuilder, (nsSession, nsTask, nsProtocol) { onWebSocketTaskOpened( - URLSession._(nsSession, - isBackground: isBackground, hasDelegate: true), + URLSession._(nsSession, isBackground: isBackground), URLSessionWebSocketTask._(nsTask), - nsProtocol?.toString()); + nsProtocol?.toDartString()); }); } @@ -948,30 +912,26 @@ class URLSession extends _ObjectHolder { .implementAsListener(protoBuilder, (nsSession, nsTask, closeCode, reason) { onWebSocketTaskClosed( - URLSession._(nsSession, - isBackground: isBackground, hasDelegate: true), + URLSession._(nsSession, isBackground: isBackground), URLSessionWebSocketTask._(nsTask), closeCode, reason); }); } - return protoBuilder.build(); + return ncb.NSURLSessionDelegate.castFrom(protoBuilder.build()); } URLSession._( super.c, { required bool isBackground, - required bool hasDelegate, - }) : _isBackground = isBackground, - _hasDelegate = hasDelegate; + }) : _isBackground = isBackground; /// A client with reasonable default behavior. /// /// See [NSURLSession.sharedSession](https://developer.apple.com/documentation/foundation/nsurlsession/1409000-sharedsession) factory URLSession.sharedSession() => - URLSession._(ncb.NSURLSession.getSharedSession(), - isBackground: false, hasDelegate: false); + URLSession._(ncb.NSURLSession.getSharedSession(), isBackground: false); /// A client with a given configuration. /// @@ -1036,7 +996,7 @@ class URLSession extends _ObjectHolder { // Avoid the complexity of simultaneous or out-of-order delegate callbacks // by only allowing callbacks to execute sequentially. // See https://developer.apple.com/forums/thread/47252 - final queue = ncb.NSOperationQueue.new1() + final queue = ncb.NSOperationQueue() ..maxConcurrentOperationCount = 1 ..name = 'cupertino_http.NSURLSessionDelegateQueue'.toNSString(); @@ -1063,13 +1023,11 @@ class URLSession extends _ObjectHolder { onWebSocketTaskClosed: onWebSocketTaskClosed), queue), isBackground: config._isBackground, - hasDelegate: true, ); } else { return URLSession._( ncb.NSURLSession.sessionWithConfiguration_(config._nsObject), - isBackground: config._isBackground, - hasDelegate: false); + isBackground: config._isBackground); } } @@ -1083,21 +1041,16 @@ class URLSession extends _ObjectHolder { /// A description of the session that may be useful for debugging. /// /// See [NSURLSession.sessionDescription](https://developer.apple.com/documentation/foundation/nsurlsession/1408277-sessiondescription) - String? get sessionDescription => _nsObject.sessionDescription?.toString(); + String? get sessionDescription => + _nsObject.sessionDescription?.toDartString(); set sessionDescription(String? value) => _nsObject.sessionDescription = value?.toNSString(); /// Create a [URLSessionTask] that accesses a server URL. /// /// See [NSURLSession dataTaskWithRequest:](https://developer.apple.com/documentation/foundation/nsurlsession/1410592-datataskwithrequest) - URLSessionTask dataTaskWithRequest(URLRequest request) { - final task = - URLSessionTask._(_nsObject.dataTaskWithRequest_(request._nsObject)); - if (_hasDelegate) { - _incrementTaskCount(); - } - return task; - } + URLSessionTask dataTaskWithRequest(URLRequest request) => + URLSessionTask._(_nsObject.dataTaskWithRequest_(request._nsObject)); /// Creates a [URLSessionTask] that accesses a server URL and calls /// [completion] when done. @@ -1116,7 +1069,6 @@ class URLSession extends _ObjectHolder { final completer = ncb.ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.listener( (data, response, error) { - _decrementTaskCount(); completion( data, response == null ? null : URLResponse._exactURLResponseType(response), @@ -1129,7 +1081,6 @@ class URLSession extends _ObjectHolder { completer, ); - _incrementTaskCount(); return URLSessionTask._(task); } @@ -1140,14 +1091,9 @@ class URLSession extends _ObjectHolder { /// receive notifications when the data has completed downloaded. /// /// See [NSURLSession downloadTaskWithRequest:](https://developer.apple.com/documentation/foundation/nsurlsession/1411481-downloadtaskwithrequest) - URLSessionDownloadTask downloadTaskWithRequest(URLRequest request) { - final task = URLSessionDownloadTask._( - _nsObject.downloadTaskWithRequest_(request._nsObject)); - if (_hasDelegate) { - _incrementTaskCount(); - } - return task; - } + URLSessionDownloadTask downloadTaskWithRequest(URLRequest request) => + URLSessionDownloadTask._( + _nsObject.downloadTaskWithRequest_(request._nsObject)); /// Creates a [URLSessionWebSocketTask] that represents a connection to a /// WebSocket endpoint. @@ -1161,12 +1107,8 @@ class URLSession extends _ObjectHolder { throw UnsupportedError( 'WebSocket tasks are not supported in background sessions'); } - final task = URLSessionWebSocketTask._( + return URLSessionWebSocketTask._( _nsObject.webSocketTaskWithRequest_(request._nsObject)); - if (_hasDelegate) { - _incrementTaskCount(); - } - return task; } /// Creates a [URLSessionWebSocketTask] that represents a connection to a @@ -1188,9 +1130,6 @@ class URLSession extends _ObjectHolder { _nsObject.webSocketTaskWithURL_protocols_( uriToNSURL(uri), stringIterableToNSArray(protocols))); } - if (_hasDelegate) { - _incrementTaskCount(); - } return task; } diff --git a/pkgs/cupertino_http/lib/src/cupertino_client.dart b/pkgs/cupertino_http/lib/src/cupertino_client.dart index 041f7f584c..7618fe53bc 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_client.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_client.dart @@ -169,7 +169,7 @@ class CupertinoClient extends BaseClient { final taskTracker = _tracker(task); if (error != null) { final exception = ClientException( - error.localizedDescription.toString(), taskTracker.request.url); + error.localizedDescription.toDartString(), taskTracker.request.url); if (taskTracker.profile != null && taskTracker.profile!.requestData.endTime == null) { // Error occurred during the request. diff --git a/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart b/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart index 124e6c5ba2..c7868e0efe 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart @@ -162,18 +162,19 @@ class CupertinoWebSocket implements WebSocket { /// [CloseReceived] event. void _closeConnectionWithError(Object e) { if (e is objc.NSError) { - if (e.domain.toString() == 'NSPOSIXErrorDomain' && e.code == 57) { + final domain = e.domain.toDartString(); + if (domain == 'NSPOSIXErrorDomain' && e.code == 57) { // Socket is not connected. // onWebSocketTaskClosed/onComplete will be invoked and may indicate a // close code. return; } - var (int code, String? reason) = switch ([e.domain.toString(), e.code]) { + var (int code, String? reason) = switch ([domain, e.code]) { ['NSPOSIXErrorDomain', 100] => ( 1002, - e.localizedDescription.toString() + e.localizedDescription.toDartString() ), - _ => (1006, e.localizedDescription.toString()) + _ => (1006, e.localizedDescription.toDartString()) }; _task.cancel(); _connectionClosed(code, reason.codeUnits.toNSData()); diff --git a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart index 264574264a..68a0dc5175 100644 --- a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart +++ b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart @@ -168,18 +168,18 @@ class NativeCupertinoHttp { late final _setrlimit = _setrlimitPtr.asFunction)>(); - int wait1( + int wait$1( ffi.Pointer arg0, ) { - return _wait1( + return _wait$1( arg0, ); } - late final _wait1Ptr = + late final _wait$1Ptr = _lookup)>>('wait'); - late final _wait1 = - _wait1Ptr.asFunction)>(); + late final _wait$1 = + _wait$1Ptr.asFunction)>(); int waitpid( int arg0, @@ -829,14 +829,14 @@ class NativeCupertinoHttp { void exit( int arg0, ) { - return _exit1( + return _exit$1( arg0, ); } late final _exitPtr = _lookup>('exit'); - late final _exit1 = _exitPtr.asFunction(); + late final _exit$1 = _exitPtr.asFunction(); ffi.Pointer getenv( ffi.Pointer arg0, @@ -2917,25 +2917,17 @@ class NativeCupertinoHttp { late final __Block_object_dispose = __Block_object_disposePtr .asFunction, int)>(); - late final ffi.Pointer>> - __NSConcreteGlobalBlock = - _lookup>>('_NSConcreteGlobalBlock'); + late final ffi.Pointer> __NSConcreteGlobalBlock = + _lookup>('_NSConcreteGlobalBlock'); ffi.Pointer> get _NSConcreteGlobalBlock => - __NSConcreteGlobalBlock.value; + __NSConcreteGlobalBlock; - set _NSConcreteGlobalBlock(ffi.Pointer> value) => - __NSConcreteGlobalBlock.value = value; - - late final ffi.Pointer>> - __NSConcreteStackBlock = - _lookup>>('_NSConcreteStackBlock'); + late final ffi.Pointer> __NSConcreteStackBlock = + _lookup>('_NSConcreteStackBlock'); ffi.Pointer> get _NSConcreteStackBlock => - __NSConcreteStackBlock.value; - - set _NSConcreteStackBlock(ffi.Pointer> value) => - __NSConcreteStackBlock.value = value; + __NSConcreteStackBlock; void Debugger() { return _Debugger(); @@ -4844,7 +4836,7 @@ class NativeCupertinoHttp { int __toupper( int arg0, ) { - return ___toupper1( + return ___toupper$1( arg0, ); } @@ -4852,12 +4844,12 @@ class NativeCupertinoHttp { late final ___toupperPtr = _lookup< ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( '__toupper'); - late final ___toupper1 = ___toupperPtr.asFunction(); + late final ___toupper$1 = ___toupperPtr.asFunction(); int __tolower( int arg0, ) { - return ___tolower1( + return ___tolower$1( arg0, ); } @@ -4865,7 +4857,7 @@ class NativeCupertinoHttp { late final ___tolowerPtr = _lookup< ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( '__tolower'); - late final ___tolower1 = ___tolowerPtr.asFunction(); + late final ___tolower$1 = ___tolowerPtr.asFunction(); ffi.Pointer __error() { return ___error(); @@ -6667,7 +6659,7 @@ class NativeCupertinoHttp { int setjmp( ffi.Pointer arg0, ) { - return _setjmp1( + return _setjmp$1( arg0, ); } @@ -6675,14 +6667,14 @@ class NativeCupertinoHttp { late final _setjmpPtr = _lookup)>>( 'setjmp'); - late final _setjmp1 = + late final _setjmp$1 = _setjmpPtr.asFunction)>(); void longjmp( ffi.Pointer arg0, int arg1, ) { - return _longjmp1( + return _longjmp$1( arg0, arg1, ); @@ -6691,7 +6683,7 @@ class NativeCupertinoHttp { late final _longjmpPtr = _lookup< ffi.NativeFunction, ffi.Int)>>( 'longjmp'); - late final _longjmp1 = + late final _longjmp$1 = _longjmpPtr.asFunction, int)>(); int _setjmp( @@ -6764,21 +6756,15 @@ class NativeCupertinoHttp { _lookup>('longjmperror'); late final _longjmperror = _longjmperrorPtr.asFunction(); - late final ffi.Pointer>> _sys_signame = - _lookup>>('sys_signame'); - - ffi.Pointer> get sys_signame => _sys_signame.value; + late final ffi.Pointer> _sys_signame = + _lookup>('sys_signame'); - set sys_signame(ffi.Pointer> value) => - _sys_signame.value = value; + ffi.Pointer> get sys_signame => _sys_signame; - late final ffi.Pointer>> _sys_siglist = - _lookup>>('sys_siglist'); + late final ffi.Pointer> _sys_siglist = + _lookup>('sys_siglist'); - ffi.Pointer> get sys_siglist => _sys_siglist.value; - - set sys_siglist(ffi.Pointer> value) => - _sys_siglist.value = value; + ffi.Pointer> get sys_siglist => _sys_siglist; int raise( int arg0, @@ -6876,23 +6862,23 @@ class NativeCupertinoHttp { late final _pthread_sigmask = _pthread_sigmaskPtr.asFunction< int Function(int, ffi.Pointer, ffi.Pointer)>(); - int sigaction1( + int sigaction$1( int arg0, ffi.Pointer arg1, ffi.Pointer arg2, ) { - return _sigaction1( + return _sigaction$1( arg0, arg1, arg2, ); } - late final _sigaction1Ptr = _lookup< + late final _sigaction$1Ptr = _lookup< ffi.NativeFunction< ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Pointer)>>('sigaction'); - late final _sigaction1 = _sigaction1Ptr.asFunction< + late final _sigaction$1 = _sigaction$1Ptr.asFunction< int Function(int, ffi.Pointer, ffi.Pointer)>(); int sigaddset( @@ -7176,23 +7162,23 @@ class NativeCupertinoHttp { _lookup>('sigsetmask'); late final _sigsetmask = _sigsetmaskPtr.asFunction(); - int sigvec1( + int sigvec$1( int arg0, ffi.Pointer arg1, ffi.Pointer arg2, ) { - return _sigvec1( + return _sigvec$1( arg0, arg1, arg2, ); } - late final _sigvec1Ptr = _lookup< + late final _sigvec$1Ptr = _lookup< ffi.NativeFunction< ffi.Int Function( ffi.Int, ffi.Pointer, ffi.Pointer)>>('sigvec'); - late final _sigvec1 = _sigvec1Ptr.asFunction< + late final _sigvec$1 = _sigvec$1Ptr.asFunction< int Function(int, ffi.Pointer, ffi.Pointer)>(); int renameat( @@ -13772,7 +13758,7 @@ class NativeCupertinoHttp { CFStringRef theString, int encoding, ) { - return _CFStringGetPascalStringPtr1( + return _CFStringGetPascalStringPtr$1( theString, encoding, ); @@ -13782,14 +13768,14 @@ class NativeCupertinoHttp { ffi.NativeFunction< ConstStringPtr Function( CFStringRef, CFStringEncoding)>>('CFStringGetPascalStringPtr'); - late final _CFStringGetPascalStringPtr1 = _CFStringGetPascalStringPtrPtr + late final _CFStringGetPascalStringPtr$1 = _CFStringGetPascalStringPtrPtr .asFunction(); ffi.Pointer CFStringGetCStringPtr( CFStringRef theString, int encoding, ) { - return _CFStringGetCStringPtr1( + return _CFStringGetCStringPtr$1( theString, encoding, ); @@ -13799,13 +13785,13 @@ class NativeCupertinoHttp { ffi.NativeFunction< ffi.Pointer Function( CFStringRef, CFStringEncoding)>>('CFStringGetCStringPtr'); - late final _CFStringGetCStringPtr1 = _CFStringGetCStringPtrPtr.asFunction< + late final _CFStringGetCStringPtr$1 = _CFStringGetCStringPtrPtr.asFunction< ffi.Pointer Function(CFStringRef, int)>(); ffi.Pointer CFStringGetCharactersPtr( CFStringRef theString, ) { - return _CFStringGetCharactersPtr1( + return _CFStringGetCharactersPtr$1( theString, ); } @@ -13813,7 +13799,7 @@ class NativeCupertinoHttp { late final _CFStringGetCharactersPtrPtr = _lookup Function(CFStringRef)>>( 'CFStringGetCharactersPtr'); - late final _CFStringGetCharactersPtr1 = _CFStringGetCharactersPtrPtr + late final _CFStringGetCharactersPtr$1 = _CFStringGetCharactersPtrPtr .asFunction Function(CFStringRef)>(); int CFStringGetBytes( @@ -17775,12 +17761,12 @@ class NativeCupertinoHttp { CFURLRef CFURLCreateCopyAppendingPathExtension( CFAllocatorRef allocator, CFURLRef url, - CFStringRef extension1, + CFStringRef extension$, ) { return _CFURLCreateCopyAppendingPathExtension( allocator, url, - extension1, + extension$, ); } @@ -21724,13 +21710,13 @@ class NativeCupertinoHttp { _lookup>('setreuid'); late final _setreuid = _setreuidPtr.asFunction(); - void sync1() { - return _sync1(); + void sync$() { + return _sync$(); } - late final _sync1Ptr = + late final _sync$Ptr = _lookup>('sync'); - late final _sync1 = _sync1Ptr.asFunction(); + late final _sync$ = _sync$Ptr.asFunction(); int truncate( ffi.Pointer arg0, @@ -23365,19 +23351,19 @@ class NativeCupertinoHttp { late final _openat_authenticated_np = _openat_authenticated_npPtr .asFunction, int, int)>(); - int flock1( + int flock$1( int arg0, int arg1, ) { - return _flock1( + return _flock$1( arg0, arg1, ); } - late final _flock1Ptr = + late final _flock$1Ptr = _lookup>('flock'); - late final _flock1 = _flock1Ptr.asFunction(); + late final _flock$1 = _flock$1Ptr.asFunction(); filesec_t filesec_init() { return _filesec_init(); @@ -40671,20 +40657,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40696,20 +40677,31 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Bool Function(ffi.Pointer, ffi.Pointer)>() +external bool _NativeCupertinoHttp_protocolTrampoline_e3qsqz( + ffi.Pointer target, + ffi.Pointer arg0, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>() +external ffi.Pointer + _NativeCupertinoHttp_protocolTrampoline_1mbt9g9( + ffi.Pointer target, + ffi.Pointer arg0, ); @ffi.Native< @@ -40721,45 +40713,48 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1o83rbn( - ffi.Pointer block, + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_18v1jvf( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_1o83rbn( - ffi.Pointer block, - ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>() +external instancetype _NativeCupertinoHttp_protocolTrampoline_xr62hr( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +@ffi.Native< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>() +external int _NativeCupertinoHttp_protocolTrampoline_17ap02x( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + int arg3, ); @ffi.Native< @@ -40771,20 +40766,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40796,20 +40786,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40821,20 +40806,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_6enxqz( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40846,20 +40826,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40871,20 +40846,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_9o8504( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40896,20 +40866,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_og5b6y( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40921,20 +40886,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40946,20 +40906,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_k73ff5( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40971,20 +40926,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_15f11yh( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -40996,20 +40946,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -41021,20 +40966,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -41046,20 +40986,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_o762yo( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -41071,20 +41006,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -41096,20 +41026,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -41121,20 +41046,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_16sve1d( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -41146,95 +41066,117 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_xx612k( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1tz5yf( + _NativeCupertinoHttp_wrapListenerBlock_1otpo83( ffi.Pointer block, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_xx612k( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_fjrv01( + _NativeCupertinoHttp_wrapListenerBlock_1tz5yf( ffi.Pointer block, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( + _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_1tz5yf( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1otpo83( + _NativeCupertinoHttp_wrapListenerBlock_fjrv01( ffi.Pointer block, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( + _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_fjrv01( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ); @ffi.Native< @@ -41246,20 +41188,34 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_l2g8ke( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, ); @ffi.Native< @@ -41271,20 +41227,15 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_n8yd09( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< @@ -41296,20 +41247,30 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_bklti2( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_bklti2( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ); @ffi.Native< @@ -41321,20 +41282,32 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_jyim80( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_jyim80( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, ); @ffi.Native< @@ -41346,20 +41319,34 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_h68abb( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>() +external void _NativeCupertinoHttp_protocolTrampoline_h68abb( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, ); @ffi.Native< @@ -41371,20 +41358,32 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_ly2579( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>() +external void _NativeCupertinoHttp_protocolTrampoline_ly2579( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, ); @ffi.Native< @@ -41396,45 +41395,32 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer context, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1p9ui4q( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_1p9ui4q( - ffi.Pointer block, - ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_1lx650f( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, ); @ffi.Native< @@ -41446,145 +41432,80 @@ external ffi.Pointer ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_lmc3p5( - ffi.Pointer block, + ffi.Pointer context, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_lmc3p5( - ffi.Pointer block, - ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>() +external instancetype _NativeCupertinoHttp_protocolTrampoline_10z9f5k( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_t8l8el( - ffi.Pointer block, + NSInteger Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>() +external int _NativeCupertinoHttp_protocolTrampoline_1ldqghh( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_t8l8el( - ffi.Pointer block, - ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() +external ffi.Pointer + _NativeCupertinoHttp_protocolTrampoline_1q0i84( + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_vhbh5h( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_vhbh5h( + _NativeCupertinoHttp_wrapListenerBlock_ovsamd( ffi.Pointer block, - ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, ); @ffi.Native< ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_zuf90e( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_zuf90e( + _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( ffi.Pointer block, ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_ovsamd( - ffi.Pointer block, + ffi.Pointer context, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer Function()>>, - ffi.Pointer< - ffi.NativeFunction)>>)>( - isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( - ffi.Pointer block, - ffi.Pointer listnerBlock, - ffi.Pointer Function()>> newWaiter, - ffi.Pointer)>> - awaitWaiter, + ffi.Void Function(ffi.Pointer, ffi.Pointer)>() +external void _NativeCupertinoHttp_protocolTrampoline_ovsamd( + ffi.Pointer target, + ffi.Pointer arg0, ); typedef __int8_t = ffi.SignedChar; @@ -41771,7 +41692,7 @@ enum idtype_t { 0 => P_ALL, 1 => P_PID, 2 => P_PGID, - _ => throw ArgumentError("Unknown value for idtype_t: $value"), + _ => throw ArgumentError('Unknown value for idtype_t: $value'), }; } @@ -42054,7 +41975,7 @@ final class __sigaction_u extends ffi.Union { } final class __sigaction extends ffi.Struct { - external __sigaction_u __sigaction_u1; + external __sigaction_u __sigaction_u$1; external ffi.Pointer< ffi.NativeFunction< @@ -42069,7 +41990,7 @@ final class __sigaction extends ffi.Struct { } final class sigaction extends ffi.Struct { - external __sigaction_u __sigaction_u1; + external __sigaction_u __sigaction_u$1; @sigset_t() external int sa_mask; @@ -42942,9 +42863,14 @@ abstract final class ObjCBlock_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction(void Function() fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock fromFunction(void Function() fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( - objc.newClosureBlock(_ObjCBlock_ffiVoid_closureCallable, () => fn()), + objc.newClosureBlock( + _ObjCBlock_ffiVoid_closureCallable, () => fn(), keepIsolateAlive), retain: false, release: true); @@ -42955,11 +42881,14 @@ abstract final class ObjCBlock_ffiVoid { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener(void Function() fn) { + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock listener(void Function() fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), () => fn()); + _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), + () => fn(), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -42972,17 +42901,22 @@ abstract final class ObjCBlock_ffiVoid { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock blocking(void Function() fn) { + static objc.ObjCBlock blocking(void Function() fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_blockingCallable.nativeFunction.cast(), () => fn()); + _ObjCBlock_ffiVoid_blockingCallable.nativeFunction.cast(), + () => fn(), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_blockingListenerCallable.nativeFunction.cast(), - () => fn()); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv, raw, rawListener); + () => fn(), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -43066,18 +43000,21 @@ abstract final class ObjCBlock_ffiInt_ffiVoid_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer)> - fromFunction( - int Function(ffi.Pointer, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, arg1)), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Int Function(ffi.Pointer, ffi.Pointer)> fromFunction( + int Function(ffi.Pointer, ffi.Pointer) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, arg1), + keepIsolateAlive), + retain: false, + release: true); } /// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. @@ -43098,9 +43035,10 @@ extension ObjCBlock_ffiInt_ffiVoid_ffiVoid_CallExtension on objc ffi.Pointer)>()(ref.pointer, arg0, arg1); } -typedef ptrdiff_t = __darwin_ptrdiff_t; -typedef rsize_t = __darwin_size_t; -typedef wint_t = __darwin_wint_t; +typedef ptrdiff_t = ffi.Long; +typedef Dartptrdiff_t = int; +typedef rsize_t = ffi.UnsignedLong; +typedef Dartrsize_t = int; typedef u_char = ffi.UnsignedChar; typedef Dartu_char = int; typedef u_short = ffi.UnsignedShort; @@ -43178,9 +43116,6 @@ typedef NSInteger = ffi.Long; typedef DartNSInteger = int; typedef NSUInteger = ffi.UnsignedLong; typedef DartNSUInteger = int; - -final class _NSZone extends ffi.Opaque {} - typedef __gnuc_va_list = __builtin_va_list; typedef va_list = __builtin_va_list; typedef NSExceptionName = ffi.Pointer; @@ -43261,15 +43196,20 @@ abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> - fromFunction(objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + NSInteger Function( + ffi.Pointer, ffi.Pointer)> + fromFunction(objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock, ffi.Pointer)>( objc.newClosureBlock( _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true)) - .value), + fn(objc.ObjCObjectBase(arg0, retain: true, release: true), objc.ObjCObjectBase(arg1, retain: true, release: true)).value, + keepIsolateAlive), retain: false, release: true); } @@ -43314,7 +43254,7 @@ enum NSQualityOfService { 9 => NSQualityOfServiceBackground, -1 => NSQualityOfServiceDefault, _ => - throw ArgumentError("Unknown value for NSQualityOfService: $value"), + throw ArgumentError('Unknown value for NSQualityOfService: $value'), }; } @@ -43623,7 +43563,7 @@ enum CFComparisonResult { 0 => kCFCompareEqualTo, 1 => kCFCompareGreaterThan, _ => - throw ArgumentError("Unknown value for CFComparisonResult: $value"), + throw ArgumentError('Unknown value for CFComparisonResult: $value'), }; } @@ -43721,7 +43661,7 @@ final class CFAllocatorContext extends ffi.Struct { external CFAllocatorPreferredSizeCallBack preferredSize; } -typedef NSZone = _NSZone; +typedef NSZone = objc.NSZone; late final _class_NSObject = objc.getClass("NSObject"); late final _sel_version = objc.registerName("version"); final _objc_msgSend_1hz7y9r = objc.msgSendPointer @@ -43769,22 +43709,30 @@ late final _sel_awakeAfterUsingCoder_ = extension NSCoderMethods on objc.NSObject { /// version static DartNSInteger version() { + objc.checkOsVersionInternal('NSObject.version', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1hz7y9r(_class_NSObject, _sel_version); } /// setVersion: static void setVersion_(DartNSInteger aVersion) { + objc.checkOsVersionInternal('NSObject.setVersion:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_4sp4xj(_class_NSObject, _sel_setVersion_, aVersion); } /// classForCoder objc.ObjCObjectBase get classForCoder { + objc.checkOsVersionInternal('NSObject.classForCoder', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_classForCoder); return objc.ObjCObjectBase(_ret, retain: true, release: true); } /// replacementObjectForCoder: objc.ObjCObjectBase? replacementObjectForCoder_(objc.NSCoder coder) { + objc.checkOsVersionInternal('NSObject.replacementObjectForCoder:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_replacementObjectForCoder_, coder.ref.pointer); return _ret.address == 0 @@ -43794,6 +43742,8 @@ extension NSCoderMethods on objc.NSObject { /// awakeAfterUsingCoder: objc.ObjCObjectBase? awakeAfterUsingCoder_(objc.NSCoder coder) { + objc.checkOsVersionInternal('NSObject.awakeAfterUsingCoder:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), _sel_awakeAfterUsingCoder_, coder.ref.pointer); return _ret.address == 0 @@ -43818,6 +43768,8 @@ final _objc_msgSend_xtuoz7 = objc.msgSendPointer extension NSDeprecatedMethods on objc.NSObject { /// poseAsClass: static void poseAsClass_(objc.ObjCObjectBase aClass) { + objc.checkOsVersionInternal('NSObject.poseAsClass:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_xtuoz7( _class_NSObject, _sel_poseAsClass_, aClass.ref.pointer); } @@ -43830,6 +43782,8 @@ late final _sel_autoContentAccessingProxy = extension NSDiscardableContentProxy on objc.NSObject { /// autoContentAccessingProxy objc.ObjCObjectBase get autoContentAccessingProxy { + objc.checkOsVersionInternal('NSObject.autoContentAccessingProxy', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autoContentAccessingProxy); return objc.ObjCObjectBase(_ret, retain: true, release: true); @@ -43866,7 +43820,7 @@ enum NSURLCacheStoragePolicy { 1 => NSURLCacheStorageAllowedInMemoryOnly, 2 => NSURLCacheStorageNotAllowed, _ => throw ArgumentError( - "Unknown value for NSURLCacheStoragePolicy: $value"), + 'Unknown value for NSURLCacheStoragePolicy: $value'), }; } @@ -43879,10 +43833,14 @@ enum NSURLCacheStoragePolicy { /// objects that are stored in the framework's caching system. /// It is used to maintain characteristics and attributes of a cached /// object. -class NSCachedURLResponse extends objc.NSObject { +class NSCachedURLResponse extends objc.NSObject + implements objc.NSSecureCoding, objc.NSCopying { NSCachedURLResponse._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSCachedURLResponse', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); + } /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) @@ -44050,15 +44008,20 @@ abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(NSCachedURLResponse?) fn) => + void Function(NSCachedURLResponse?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable, (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : NSCachedURLResponse.castFromPointer(arg0, - retain: true, release: true))), + retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -44069,17 +44032,19 @@ abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(NSCachedURLResponse?) fn) { + void Function(NSCachedURLResponse?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : NSCachedURLResponse.castFromPointer(arg0, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -44092,18 +44057,21 @@ abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(NSCachedURLResponse?) fn) { + void Function(NSCachedURLResponse?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSCachedURLResponse_blockingCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : NSCachedURLResponse.castFromPointer(arg0, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSCachedURLResponse_blockingListenerCallable .nativeFunction @@ -44111,9 +44079,10 @@ abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : NSCachedURLResponse.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -44159,6 +44128,8 @@ extension NSURLSessionTaskAdditions on NSURLCache { /// storeCachedResponse:forDataTask: void storeCachedResponse_forDataTask_( NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { + objc.checkOsVersionInternal('NSURLCache.storeCachedResponse:forDataTask:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_pfv6jd( this.ref.pointer, _sel_storeCachedResponse_forDataTask_, @@ -44171,6 +44142,10 @@ extension NSURLSessionTaskAdditions on NSURLCache { NSURLSessionDataTask dataTask, objc.ObjCBlock completionHandler) { + objc.checkOsVersionInternal( + 'NSURLCache.getCachedResponseForDataTask:completionHandler:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); _objc_msgSend_o762yo( this.ref.pointer, _sel_getCachedResponseForDataTask_completionHandler_, @@ -44180,6 +44155,8 @@ extension NSURLSessionTaskAdditions on NSURLCache { /// removeCachedResponseForDataTask: void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { + objc.checkOsVersionInternal('NSURLCache.removeCachedResponseForDataTask:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_removeCachedResponseForDataTask_, dataTask.ref.pointer); } @@ -44238,6 +44215,8 @@ extension NSHTTPURLRequest on NSURLRequest { /// @abstract Returns the HTTP request method of the receiver. /// @result the HTTP request method of the receiver. objc.NSString? get HTTPMethod { + objc.checkOsVersionInternal('NSURLRequest.HTTPMethod', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPMethod); return _ret.address == 0 ? null @@ -44250,6 +44229,8 @@ extension NSHTTPURLRequest on NSURLRequest { /// @result a dictionary containing all the HTTP header fields of the /// receiver. objc.NSDictionary? get allHTTPHeaderFields { + objc.checkOsVersionInternal('NSURLRequest.allHTTPHeaderFields', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allHTTPHeaderFields); return _ret.address == 0 @@ -44267,6 +44248,8 @@ extension NSHTTPURLRequest on NSURLRequest { /// @result the value associated with the given header field, or nil if /// there is no value associated with the given header field. objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + objc.checkOsVersionInternal('NSURLRequest.valueForHTTPHeaderField:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); return _ret.address == 0 @@ -44280,6 +44263,8 @@ extension NSHTTPURLRequest on NSURLRequest { /// in done in an HTTP POST request. /// @result The request body data of the receiver. objc.NSData? get HTTPBody { + objc.checkOsVersionInternal('NSURLRequest.HTTPBody', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBody); return _ret.address == 0 ? null @@ -44297,6 +44282,8 @@ extension NSHTTPURLRequest on NSURLRequest { /// NSCoding protocol /// @result The request body stream of the receiver. objc.NSInputStream? get HTTPBodyStream { + objc.checkOsVersionInternal('NSURLRequest.HTTPBodyStream', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBodyStream); return _ret.address == 0 ? null @@ -44310,6 +44297,8 @@ extension NSHTTPURLRequest on NSURLRequest { /// @result YES if cookies will be sent with and set for this request; /// otherwise NO. bool get HTTPShouldHandleCookies { + objc.checkOsVersionInternal('NSURLRequest.HTTPShouldHandleCookies', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); } @@ -44320,6 +44309,8 @@ extension NSHTTPURLRequest on NSURLRequest { /// is received. NO if the receiver should wait for the previous response /// before transmitting. bool get HTTPShouldUsePipelining { + objc.checkOsVersionInternal('NSURLRequest.HTTPShouldUsePipelining', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 7, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); } } @@ -44379,11 +44370,15 @@ abstract final class ObjCBlock_bool_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> fromFunction( - bool Function(ffi.Pointer) fn) => + bool Function(ffi.Pointer) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock(_ObjCBlock_bool_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), + (ffi.Pointer arg0) => fn(arg0), keepIsolateAlive), retain: false, release: true); } @@ -44469,7 +44464,7 @@ enum NSURLRequestCachePolicy { 3 => NSURLRequestReturnCacheDataDontLoad, 5 => NSURLRequestReloadRevalidatingCacheData, _ => throw ArgumentError( - "Unknown value for NSURLRequestCachePolicy: $value"), + 'Unknown value for NSURLRequestCachePolicy: $value'), }; @override @@ -44603,7 +44598,7 @@ enum NSURLRequestNetworkServiceType { 9 => NSURLNetworkServiceTypeResponsiveAV, 11 => NSURLNetworkServiceTypeCallSignaling, _ => throw ArgumentError( - "Unknown value for NSURLRequestNetworkServiceType: $value"), + 'Unknown value for NSURLRequestNetworkServiceType: $value'), }; } @@ -44646,7 +44641,7 @@ enum NSURLRequestAttribution { 0 => NSURLRequestAttributionDeveloper, 1 => NSURLRequestAttributionUser, _ => throw ArgumentError( - "Unknown value for NSURLRequestAttribution: $value"), + 'Unknown value for NSURLRequestAttribution: $value'), }; } @@ -44669,10 +44664,10 @@ final _objc_msgSend_1cwp428 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>() + ffi.Pointer, ffi.Pointer)>>() .asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); + ffi.Pointer, ffi.Pointer)>(); late final _sel_alloc = objc.registerName("alloc"); late final _sel_self = objc.registerName("self"); ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( @@ -44739,15 +44734,20 @@ abstract final class ObjCBlock_objcObjCObject_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc .ObjCBlock Function(ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock< ffi.Pointer Function(ffi.Pointer)>( objc.newClosureBlock( _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), + fn(arg0).ref.retainAndAutorelease(), + keepIsolateAlive), retain: false, release: true); } @@ -44896,18 +44896,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, objc.NSCoder)> - fromFunction(void Function(ffi.Pointer, objc.NSCoder) fn) => - objc.ObjCBlock, objc.NSCoder)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - objc.NSCoder.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSCoder)> fromFunction( + void Function(ffi.Pointer, objc.NSCoder) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, objc.NSCoder)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.NSCoder.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -44916,16 +44919,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, objc.NSCoder)> - listener(void Function(ffi.Pointer, objc.NSCoder) fn) { + listener(void Function(ffi.Pointer, objc.NSCoder) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable.nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); + objc.NSCoder.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_18v1jvf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -44939,26 +44944,30 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock, objc.NSCoder)> - blocking(void Function(ffi.Pointer, objc.NSCoder) fn) { + blocking(void Function(ffi.Pointer, objc.NSCoder) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingCallable.nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); + objc.NSCoder.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingListenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf, raw, rawListener); + objc.NSCoder.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -45051,8 +45060,12 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)> fromFunction( - Dartinstancetype? Function(ffi.Pointer, objc.NSCoder) fn) => + Dartinstancetype? Function(ffi.Pointer, objc.NSCoder) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>( objc.newClosureBlock( _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable, @@ -45060,7 +45073,8 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { fn(arg0, objc.NSCoder.castFromPointer(arg1, retain: true, release: true)) ?.ref .retainAndReturnPointer() ?? - ffi.nullptr), + ffi.nullptr, + keepIsolateAlive), retain: false, release: true); } @@ -45092,7 +45106,8 @@ extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension } /// NSURLRequest -class NSURLRequest extends objc.NSObject { +class NSURLRequest extends objc.NSObject + implements objc.NSSecureCoding, objc.NSCopying, objc.NSMutableCopying { NSURLRequest._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); @@ -45122,6 +45137,8 @@ class NSURLRequest extends objc.NSObject { /// @param URL The URL for the request. /// @result A newly-created and autoreleased NSURLRequest instance. static NSURLRequest requestWithURL_(objc.NSURL URL) { + objc.checkOsVersionInternal('NSURLRequest.requestWithURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSURLRequest, _sel_requestWithURL_, URL.ref.pointer); return NSURLRequest.castFromPointer(_ret, retain: true, release: true); @@ -45146,6 +45163,10 @@ class NSURLRequest extends objc.NSObject { objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + objc.checkOsVersionInternal( + 'NSURLRequest.requestWithURL:cachePolicy:timeoutInterval:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1ajs603( _class_NSURLRequest, _sel_requestWithURL_cachePolicy_timeoutInterval_, @@ -45164,6 +45185,8 @@ class NSURLRequest extends objc.NSObject { /// @param URL The URL for the request. /// @result An initialized NSURLRequest. NSURLRequest initWithURL_(objc.NSURL URL) { + objc.checkOsVersionInternal('NSURLRequest.initWithURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); return NSURLRequest.castFromPointer(_ret, retain: false, release: true); @@ -45183,6 +45206,10 @@ class NSURLRequest extends objc.NSObject { /// @result An initialized NSURLRequest. NSURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + objc.checkOsVersionInternal( + 'NSURLRequest.initWithURL:cachePolicy:timeoutInterval:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1ajs603( this.ref.retainAndReturnPointer(), _sel_initWithURL_cachePolicy_timeoutInterval_, @@ -45196,6 +45223,8 @@ class NSURLRequest extends objc.NSObject { /// @abstract Returns the URL of the receiver. /// @result The URL of the receiver. objc.NSURL? get URL { + objc.checkOsVersionInternal('NSURLRequest.URL', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URL); return _ret.address == 0 ? null @@ -45206,6 +45235,8 @@ class NSURLRequest extends objc.NSObject { /// @abstract Returns the cache policy of the receiver. /// @result The cache policy of the receiver. NSURLRequestCachePolicy get cachePolicy { + objc.checkOsVersionInternal('NSURLRequest.cachePolicy', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); return NSURLRequestCachePolicy.fromValue(_ret); } @@ -45224,6 +45255,8 @@ class NSURLRequest extends objc.NSObject { /// in seconds. /// @result The timeout interval of the receiver. DartNSTimeInterval get timeoutInterval { + objc.checkOsVersionInternal('NSURLRequest.timeoutInterval', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return objc.useMsgSendVariants ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); @@ -45237,6 +45270,8 @@ class NSURLRequest extends objc.NSObject { /// See setMainDocumentURL: /// @result The main document URL. objc.NSURL? get mainDocumentURL { + objc.checkOsVersionInternal('NSURLRequest.mainDocumentURL', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_mainDocumentURL); return _ret.address == 0 ? null @@ -45249,6 +45284,8 @@ class NSURLRequest extends objc.NSObject { /// not explicitly set a networkServiceType (using the setNetworkServiceType method). /// @result The NSURLRequestNetworkServiceType associated with this request. NSURLRequestNetworkServiceType get networkServiceType { + objc.checkOsVersionInternal('NSURLRequest.networkServiceType', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 7, 0))); final _ret = _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); return NSURLRequestNetworkServiceType.fromValue(_ret); @@ -45260,6 +45297,8 @@ class NSURLRequest extends objc.NSObject { /// @result YES if the receiver is allowed to use the built in cellular radios to /// satisfy the request, NO otherwise. bool get allowsCellularAccess { + objc.checkOsVersionInternal('NSURLRequest.allowsCellularAccess', + iOS: (false, (6, 0, 0)), macOS: (false, (10, 8, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); } @@ -45269,6 +45308,8 @@ class NSURLRequest extends objc.NSObject { /// @result YES if the receiver is allowed to use an interface marked as expensive to /// satisfy the request, NO otherwise. bool get allowsExpensiveNetworkAccess { + objc.checkOsVersionInternal('NSURLRequest.allowsExpensiveNetworkAccess', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsExpensiveNetworkAccess); } @@ -45279,6 +45320,8 @@ class NSURLRequest extends objc.NSObject { /// @result YES if the receiver is allowed to use an interface marked as constrained to /// satisfy the request, NO otherwise. bool get allowsConstrainedNetworkAccess { + objc.checkOsVersionInternal('NSURLRequest.allowsConstrainedNetworkAccess', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } @@ -45289,6 +45332,8 @@ class NSURLRequest extends objc.NSObject { /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. /// The default may be YES in a future OS update. bool get assumesHTTP3Capable { + objc.checkOsVersionInternal('NSURLRequest.assumesHTTP3Capable', + iOS: (false, (14, 5, 0)), macOS: (false, (11, 3, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); } @@ -45298,6 +45343,8 @@ class NSURLRequest extends objc.NSObject { /// have not explicitly set an attribution. /// @result The NSURLRequestAttribution associated with this request. NSURLRequestAttribution get attribution { + objc.checkOsVersionInternal('NSURLRequest.attribution', + iOS: (false, (15, 0, 0)), macOS: (false, (12, 0, 0))); final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); return NSURLRequestAttribution.fromValue(_ret); } @@ -45307,6 +45354,8 @@ class NSURLRequest extends objc.NSObject { /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, /// No otherwise. Defaults to NO. bool get requiresDNSSECValidation { + objc.checkOsVersionInternal('NSURLRequest.requiresDNSSECValidation', + iOS: (false, (16, 1, 0)), macOS: (false, (13, 0, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_requiresDNSSECValidation); } @@ -45318,24 +45367,28 @@ class NSURLRequest extends objc.NSObject { /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, /// NO otherwise. Defaults to NO. bool get allowsPersistentDNS { + objc.checkOsVersionInternal('NSURLRequest.allowsPersistentDNS', + iOS: (false, (18, 0, 0)), macOS: (false, (15, 0, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsPersistentDNS); } /// init NSURLRequest init() { + objc.checkOsVersionInternal('NSURLRequest.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } /// new - static NSURLRequest new1() { + static NSURLRequest new$() { final _ret = _objc_msgSend_151sglz(_class_NSURLRequest, _sel_new); return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSURLRequest allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428(_class_NSURLRequest, _sel_allocWithZone_, zone); return NSURLRequest.castFromPointer(_ret, retain: false, release: true); @@ -45348,7 +45401,7 @@ class NSURLRequest extends objc.NSObject { } /// self - NSURLRequest self() { + NSURLRequest self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSURLRequest.castFromPointer(_ret, retain: true, release: true); } @@ -45379,6 +45432,9 @@ class NSURLRequest extends objc.NSObject { ? null : NSURLRequest.castFromPointer(_ret, retain: false, release: true); } + + /// Returns a new instance of NSURLRequest constructed with the default `new` method. + factory NSURLRequest() => new$(); } late final _sel_cachedResponseForRequest_ = @@ -45426,7 +45482,10 @@ late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); class NSURLCache extends objc.NSObject { NSURLCache._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLCache', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); + } /// Constructs a [NSURLCache] that points to the same underlying object as [other]. NSURLCache.castFrom(objc.ObjCObjectBase other) @@ -45468,6 +45527,8 @@ class NSURLCache extends objc.NSObject { /// becoming unexpectedly unretrievable. /// @result the shared NSURLCache instance. static NSURLCache getSharedURLCache() { + objc.checkOsVersionInternal('NSURLCache.sharedURLCache', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_sharedURLCache); return NSURLCache.castFromPointer(_ret, retain: true, release: true); } @@ -45497,6 +45558,8 @@ class NSURLCache extends objc.NSObject { /// becoming unexpectedly unretrievable. /// @result the shared NSURLCache instance. static void setSharedURLCache(NSURLCache value) { + objc.checkOsVersionInternal('NSURLCache.setSharedURLCache:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7( _class_NSURLCache, _sel_setSharedURLCache_, value.ref.pointer); } @@ -45518,6 +45581,10 @@ class NSURLCache extends objc.NSObject { DartNSUInteger memoryCapacity, DartNSUInteger diskCapacity, objc.NSString? path) { + objc.checkOsVersionInternal( + 'NSURLCache.initWithMemoryCapacity:diskCapacity:diskPath:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1dqnse5( this.ref.retainAndReturnPointer(), _sel_initWithMemoryCapacity_diskCapacity_diskPath_, @@ -45538,6 +45605,10 @@ class NSURLCache extends objc.NSObject { DartNSUInteger memoryCapacity, DartNSUInteger diskCapacity, objc.NSURL? directoryURL) { + objc.checkOsVersionInternal( + 'NSURLCache.initWithMemoryCapacity:diskCapacity:directoryURL:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1dqnse5( this.ref.retainAndReturnPointer(), _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, @@ -45558,6 +45629,8 @@ class NSURLCache extends objc.NSObject { /// request, or nil if there is no NSCachedURLResponse stored with the /// given request. NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { + objc.checkOsVersionInternal('NSURLCache.cachedResponseForRequest:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_cachedResponseForRequest_, request.ref.pointer); return _ret.address == 0 @@ -45574,6 +45647,8 @@ class NSURLCache extends objc.NSObject { /// @param request the NSURLRequest to use as a key for the storage. void storeCachedResponse_forRequest_( NSCachedURLResponse cachedResponse, NSURLRequest request) { + objc.checkOsVersionInternal('NSURLCache.storeCachedResponse:forRequest:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_pfv6jd(this.ref.pointer, _sel_storeCachedResponse_forRequest_, cachedResponse.ref.pointer, request.ref.pointer); } @@ -45586,6 +45661,8 @@ class NSURLCache extends objc.NSObject { /// stored with the given request. /// @param request the NSURLRequest to use as a key for the lookup. void removeCachedResponseForRequest_(NSURLRequest request) { + objc.checkOsVersionInternal('NSURLCache.removeCachedResponseForRequest:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_removeCachedResponseForRequest_, request.ref.pointer); } @@ -45595,6 +45672,8 @@ class NSURLCache extends objc.NSObject { /// @abstract Clears the given cache, removing all NSCachedURLResponse /// objects that it stores. void removeAllCachedResponses() { + objc.checkOsVersionInternal('NSURLCache.removeAllCachedResponses', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllCachedResponses); } @@ -45602,6 +45681,8 @@ class NSURLCache extends objc.NSObject { /// @method removeCachedResponsesSince: /// @abstract Clears the given cache of any cached responses since the provided date. void removeCachedResponsesSinceDate_(objc.NSDate date) { + objc.checkOsVersionInternal('NSURLCache.removeCachedResponsesSinceDate:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_removeCachedResponsesSinceDate_, date.ref.pointer); } @@ -45611,6 +45692,8 @@ class NSURLCache extends objc.NSObject { /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. /// @result The in-memory capacity, measured in bytes, for the receiver. DartNSUInteger get memoryCapacity { + objc.checkOsVersionInternal('NSURLCache.memoryCapacity', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_memoryCapacity); } @@ -45619,6 +45702,8 @@ class NSURLCache extends objc.NSObject { /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. /// @result The in-memory capacity, measured in bytes, for the receiver. set memoryCapacity(DartNSUInteger value) { + objc.checkOsVersionInternal('NSURLCache.setMemoryCapacity:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_1i9r4xy(this.ref.pointer, _sel_setMemoryCapacity_, value); } @@ -45626,6 +45711,8 @@ class NSURLCache extends objc.NSObject { /// @abstract The on-disk capacity of the receiver. /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. DartNSUInteger get diskCapacity { + objc.checkOsVersionInternal('NSURLCache.diskCapacity', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_diskCapacity); } @@ -45633,6 +45720,8 @@ class NSURLCache extends objc.NSObject { /// @abstract The on-disk capacity of the receiver. /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. set diskCapacity(DartNSUInteger value) { + objc.checkOsVersionInternal('NSURLCache.setDiskCapacity:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_1i9r4xy(this.ref.pointer, _sel_setDiskCapacity_, value); } @@ -45643,6 +45732,8 @@ class NSURLCache extends objc.NSObject { /// usage of the in-memory cache. /// @result the current usage of the in-memory cache of the receiver. DartNSUInteger get currentMemoryUsage { + objc.checkOsVersionInternal('NSURLCache.currentMemoryUsage', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentMemoryUsage); } @@ -45653,24 +45744,28 @@ class NSURLCache extends objc.NSObject { /// usage of the on-disk cache. /// @result the current usage of the on-disk cache of the receiver. DartNSUInteger get currentDiskUsage { + objc.checkOsVersionInternal('NSURLCache.currentDiskUsage', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentDiskUsage); } /// init NSURLCache init() { + objc.checkOsVersionInternal('NSURLCache.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLCache.castFromPointer(_ret, retain: false, release: true); } /// new - static NSURLCache new1() { + static NSURLCache new$() { final _ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_new); return NSURLCache.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSURLCache allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSURLCache allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428(_class_NSURLCache, _sel_allocWithZone_, zone); return NSURLCache.castFromPointer(_ret, retain: false, release: true); @@ -45683,7 +45778,7 @@ class NSURLCache extends objc.NSObject { } /// self - NSURLCache self() { + NSURLCache self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSURLCache.castFromPointer(_ret, retain: true, release: true); } @@ -45699,6 +45794,9 @@ class NSURLCache extends objc.NSObject { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); return NSURLCache.castFromPointer(_ret, retain: true, release: true); } + + /// Returns a new instance of NSURLCache constructed with the default `new` method. + factory NSURLCache() => new$(); } typedef NSNotificationName = ffi.Pointer; @@ -45778,33 +45876,9 @@ extension NSNotificationCreation on objc.NSNotification { } late final _class_NSDate = objc.getClass("NSDate"); -late final _sel_timeIntervalSinceDate_ = - objc.registerName("timeIntervalSinceDate:"); -final _objc_msgSend_mabicu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_mabicuFpret = objc.msgSendFpretPointer - .cast< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_timeIntervalSinceNow = - objc.registerName("timeIntervalSinceNow"); -late final _sel_timeIntervalSince1970 = - objc.registerName("timeIntervalSince1970"); -late final _sel_addTimeInterval_ = objc.registerName("addTimeInterval:"); +late final _sel_date = objc.registerName("date"); +late final _sel_dateWithTimeIntervalSinceNow_ = + objc.registerName("dateWithTimeIntervalSinceNow:"); final _objc_msgSend_oa8mke = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -45813,122 +45887,6 @@ final _objc_msgSend_oa8mke = objc.msgSendPointer .asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, double)>(); -late final _sel_dateByAddingTimeInterval_ = - objc.registerName("dateByAddingTimeInterval:"); -late final _sel_earlierDate_ = objc.registerName("earlierDate:"); -late final _sel_laterDate_ = objc.registerName("laterDate:"); -late final _sel_compare_ = objc.registerName("compare:"); -final _objc_msgSend_1ym6zyw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isEqualToDate_ = objc.registerName("isEqualToDate:"); -late final _sel_description = objc.registerName("description"); -late final _sel_descriptionWithLocale_ = - objc.registerName("descriptionWithLocale:"); -late final _sel_timeIntervalSinceReferenceDate = - objc.registerName("timeIntervalSinceReferenceDate"); - -/// NSExtendedDate -extension NSExtendedDate on objc.NSDate { - /// timeIntervalSinceDate: - DartNSTimeInterval timeIntervalSinceDate_(objc.NSDate anotherDate) { - return objc.useMsgSendVariants - ? _objc_msgSend_mabicuFpret(this.ref.pointer, - _sel_timeIntervalSinceDate_, anotherDate.ref.pointer) - : _objc_msgSend_mabicu(this.ref.pointer, _sel_timeIntervalSinceDate_, - anotherDate.ref.pointer); - } - - /// timeIntervalSinceNow - DartNSTimeInterval get timeIntervalSinceNow { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - this.ref.pointer, _sel_timeIntervalSinceNow) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSinceNow); - } - - /// timeIntervalSince1970 - DartNSTimeInterval get timeIntervalSince1970 { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - this.ref.pointer, _sel_timeIntervalSince1970) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSince1970); - } - - /// addTimeInterval: - objc.ObjCObjectBase addTimeInterval_(DartNSTimeInterval seconds) { - final _ret = - _objc_msgSend_oa8mke(this.ref.pointer, _sel_addTimeInterval_, seconds); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateByAddingTimeInterval: - objc.NSDate dateByAddingTimeInterval_(DartNSTimeInterval ti) { - final _ret = _objc_msgSend_oa8mke( - this.ref.pointer, _sel_dateByAddingTimeInterval_, ti); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// earlierDate: - objc.NSDate earlierDate_(objc.NSDate anotherDate) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_earlierDate_, anotherDate.ref.pointer); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// laterDate: - objc.NSDate laterDate_(objc.NSDate anotherDate) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_laterDate_, anotherDate.ref.pointer); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// compare: - objc.NSComparisonResult compare_(objc.NSDate other) { - final _ret = _objc_msgSend_1ym6zyw( - this.ref.pointer, _sel_compare_, other.ref.pointer); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// isEqualToDate: - bool isEqualToDate_(objc.NSDate otherDate) { - return _objc_msgSend_19nvye5( - this.ref.pointer, _sel_isEqualToDate_, otherDate.ref.pointer); - } - - /// description - objc.NSString get description { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithLocale: - objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// timeIntervalSinceReferenceDate - static DartNSTimeInterval getTimeIntervalSinceReferenceDate() { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - _class_NSDate, _sel_timeIntervalSinceReferenceDate) - : _objc_msgSend_1ukqyt8( - _class_NSDate, _sel_timeIntervalSinceReferenceDate); - } -} - -late final _sel_date = objc.registerName("date"); -late final _sel_dateWithTimeIntervalSinceNow_ = - objc.registerName("dateWithTimeIntervalSinceNow:"); late final _sel_dateWithTimeIntervalSinceReferenceDate_ = objc.registerName("dateWithTimeIntervalSinceReferenceDate:"); late final _sel_dateWithTimeIntervalSince1970_ = @@ -46011,6 +45969,8 @@ extension NSDateCreation on objc.NSDate { /// now static objc.NSDate getNow() { + objc.checkOsVersionInternal('NSDate.now', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_151sglz(_class_NSDate, _sel_now); return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } @@ -46069,6 +46029,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// ! /// @abstract Sets the HTTP request method of the receiver. objc.NSString get HTTPMethod { + objc.checkOsVersionInternal('NSMutableURLRequest.HTTPMethod', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPMethod); return objc.NSString.castFromPointer(_ret, retain: true, release: true); } @@ -46076,6 +46038,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// ! /// @abstract Sets the HTTP request method of the receiver. set HTTPMethod(objc.NSString value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setHTTPMethod:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7( this.ref.pointer, _sel_setHTTPMethod_, value.ref.pointer); } @@ -46091,6 +46055,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// the key or value for a key-value pair answers NO when sent this /// message, the key-value pair is skipped. objc.NSDictionary? get allHTTPHeaderFields { + objc.checkOsVersionInternal('NSMutableURLRequest.allHTTPHeaderFields', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allHTTPHeaderFields); return _ret.address == 0 @@ -46109,6 +46075,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// the key or value for a key-value pair answers NO when sent this /// message, the key-value pair is skipped. set allHTTPHeaderFields(objc.NSDictionary? value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setAllHTTPHeaderFields:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setAllHTTPHeaderFields_, value?.ref.pointer ?? ffi.nullptr); } @@ -46123,6 +46091,10 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// @param value the header field value. /// @param field the header field name (case-insensitive). void setValue_forHTTPHeaderField_(objc.NSString? value, objc.NSString field) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setValue:forHTTPHeaderField:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); _objc_msgSend_pfv6jd(this.ref.pointer, _sel_setValue_forHTTPHeaderField_, value?.ref.pointer ?? ffi.nullptr, field.ref.pointer); } @@ -46141,6 +46113,10 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// @param value the header field value. /// @param field the header field name (case-insensitive). void addValue_forHTTPHeaderField_(objc.NSString value, objc.NSString field) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.addValue:forHTTPHeaderField:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); _objc_msgSend_pfv6jd(this.ref.pointer, _sel_addValue_forHTTPHeaderField_, value.ref.pointer, field.ref.pointer); } @@ -46150,6 +46126,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// @discussion This data is sent as the message body of the request, as /// in done in an HTTP POST request. objc.NSData? get HTTPBody { + objc.checkOsVersionInternal('NSMutableURLRequest.HTTPBody', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBody); return _ret.address == 0 ? null @@ -46161,6 +46139,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// @discussion This data is sent as the message body of the request, as /// in done in an HTTP POST request. set HTTPBody(objc.NSData? value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setHTTPBody:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7( this.ref.pointer, _sel_setHTTPBody_, value?.ref.pointer ?? ffi.nullptr); } @@ -46173,6 +46153,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// and the body data (set by setHTTPBody:, above) are mutually exclusive /// - setting one will clear the other. objc.NSInputStream? get HTTPBodyStream { + objc.checkOsVersionInternal('NSMutableURLRequest.HTTPBodyStream', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBodyStream); return _ret.address == 0 ? null @@ -46187,6 +46169,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// and the body data (set by setHTTPBody:, above) are mutually exclusive /// - setting one will clear the other. set HTTPBodyStream(objc.NSInputStream? value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setHTTPBodyStream:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setHTTPBodyStream_, value?.ref.pointer ?? ffi.nullptr); } @@ -46199,6 +46183,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// stored to the cookie manager by default. /// NOTE: In releases prior to 10.3, this value is ignored bool get HTTPShouldHandleCookies { + objc.checkOsVersionInternal('NSMutableURLRequest.HTTPShouldHandleCookies', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); } @@ -46210,6 +46196,10 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// stored to the cookie manager by default. /// NOTE: In releases prior to 10.3, this value is ignored set HTTPShouldHandleCookies(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setHTTPShouldHandleCookies:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setHTTPShouldHandleCookies_, value); } @@ -46230,6 +46220,8 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// pipelining (disconnecting, sending resources misordered, omitting part of /// a resource, etc.). bool get HTTPShouldUsePipelining { + objc.checkOsVersionInternal('NSMutableURLRequest.HTTPShouldUsePipelining', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 7, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); } @@ -46249,6 +46241,10 @@ extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// pipelining (disconnecting, sending resources misordered, omitting part of /// a resource, etc.). set HTTPShouldUsePipelining(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setHTTPShouldUsePipelining:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 7, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); } @@ -46337,7 +46333,10 @@ late final _sel_setAllowsPersistentDNS_ = class NSMutableURLRequest extends NSURLRequest { NSMutableURLRequest._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSMutableURLRequest', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); + } /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) @@ -46357,6 +46356,8 @@ class NSMutableURLRequest extends NSURLRequest { /// ! /// @abstract The URL of the receiver. objc.NSURL? get URL { + objc.checkOsVersionInternal('NSMutableURLRequest.URL', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URL); return _ret.address == 0 ? null @@ -46366,6 +46367,8 @@ class NSMutableURLRequest extends NSURLRequest { /// ! /// @abstract The URL of the receiver. set URL(objc.NSURL? value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7( this.ref.pointer, _sel_setURL_, value?.ref.pointer ?? ffi.nullptr); } @@ -46373,6 +46376,8 @@ class NSMutableURLRequest extends NSURLRequest { /// ! /// @abstract The cache policy of the receiver. NSURLRequestCachePolicy get cachePolicy { + objc.checkOsVersionInternal('NSMutableURLRequest.cachePolicy', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); return NSURLRequestCachePolicy.fromValue(_ret); } @@ -46380,6 +46385,8 @@ class NSMutableURLRequest extends NSURLRequest { /// ! /// @abstract The cache policy of the receiver. set cachePolicy(NSURLRequestCachePolicy value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setCachePolicy:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_1yjxuv2(this.ref.pointer, _sel_setCachePolicy_, value.value); } @@ -46396,6 +46403,8 @@ class NSMutableURLRequest extends NSURLRequest { /// is considered to have timed out. This timeout interval is measured /// in seconds. DartNSTimeInterval get timeoutInterval { + objc.checkOsVersionInternal('NSMutableURLRequest.timeoutInterval', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return objc.useMsgSendVariants ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); @@ -46414,6 +46423,8 @@ class NSMutableURLRequest extends NSURLRequest { /// is considered to have timed out. This timeout interval is measured /// in seconds. set timeoutInterval(DartNSTimeInterval value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setTimeoutInterval:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_hwm8nu(this.ref.pointer, _sel_setTimeoutInterval_, value); } @@ -46427,6 +46438,8 @@ class NSMutableURLRequest extends NSURLRequest { /// as a sub-resource of a user-specified URL, and possibly other things /// in the future. objc.NSURL? get mainDocumentURL { + objc.checkOsVersionInternal('NSMutableURLRequest.mainDocumentURL', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_mainDocumentURL); return _ret.address == 0 ? null @@ -46443,6 +46456,8 @@ class NSMutableURLRequest extends NSURLRequest { /// as a sub-resource of a user-specified URL, and possibly other things /// in the future. set mainDocumentURL(objc.NSURL? value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setMainDocumentURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setMainDocumentURL_, value?.ref.pointer ?? ffi.nullptr); } @@ -46452,6 +46467,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion This method is used to provide the network layers with a hint as to the purpose /// of the request. Most clients should not need to use this method. NSURLRequestNetworkServiceType get networkServiceType { + objc.checkOsVersionInternal('NSMutableURLRequest.networkServiceType', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 7, 0))); final _ret = _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); return NSURLRequestNetworkServiceType.fromValue(_ret); @@ -46462,6 +46479,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion This method is used to provide the network layers with a hint as to the purpose /// of the request. Most clients should not need to use this method. set networkServiceType(NSURLRequestNetworkServiceType value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setNetworkServiceType:', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 7, 0))); _objc_msgSend_1mse4s1( this.ref.pointer, _sel_setNetworkServiceType_, value.value); } @@ -46472,6 +46491,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use the built in /// cellular radios to satisfy the request, YES otherwise. The default is YES. bool get allowsCellularAccess { + objc.checkOsVersionInternal('NSMutableURLRequest.allowsCellularAccess', + iOS: (false, (6, 0, 0)), macOS: (false, (10, 8, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); } @@ -46481,6 +46502,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use the built in /// cellular radios to satisfy the request, YES otherwise. The default is YES. set allowsCellularAccess(bool value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setAllowsCellularAccess:', + iOS: (false, (6, 0, 0)), macOS: (false, (10, 8, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsCellularAccess_, value); } @@ -46491,6 +46514,10 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to /// satisfy the request, YES otherwise. bool get allowsExpensiveNetworkAccess { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.allowsExpensiveNetworkAccess', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsExpensiveNetworkAccess); } @@ -46501,6 +46528,10 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to /// satisfy the request, YES otherwise. set allowsExpensiveNetworkAccess(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAllowsExpensiveNetworkAccess:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); } @@ -46511,6 +46542,10 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to /// satisfy the request, YES otherwise. bool get allowsConstrainedNetworkAccess { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.allowsConstrainedNetworkAccess', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } @@ -46521,6 +46556,10 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to /// satisfy the request, YES otherwise. set allowsConstrainedNetworkAccess(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAllowsConstrainedNetworkAccess:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); } @@ -46531,6 +46570,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. /// The default may be YES in a future OS update. bool get assumesHTTP3Capable { + objc.checkOsVersionInternal('NSMutableURLRequest.assumesHTTP3Capable', + iOS: (false, (14, 5, 0)), macOS: (false, (11, 3, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); } @@ -46540,6 +46581,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. /// The default may be YES in a future OS update. set assumesHTTP3Capable(bool value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setAssumesHTTP3Capable:', + iOS: (false, (14, 5, 0)), macOS: (false, (11, 3, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAssumesHTTP3Capable_, value); } @@ -46549,6 +46592,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the /// user. Defaults to NSURLRequestAttributionDeveloper. NSURLRequestAttribution get attribution { + objc.checkOsVersionInternal('NSMutableURLRequest.attribution', + iOS: (false, (15, 0, 0)), macOS: (false, (12, 0, 0))); final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); return NSURLRequestAttribution.fromValue(_ret); } @@ -46558,6 +46603,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the /// user. Defaults to NSURLRequestAttributionDeveloper. set attribution(NSURLRequestAttribution value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setAttribution:', + iOS: (false, (15, 0, 0)), macOS: (false, (12, 0, 0))); _objc_msgSend_1nw1jep(this.ref.pointer, _sel_setAttribution_, value.value); } @@ -46566,6 +46613,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, /// No otherwise. Defaults to NO. bool get requiresDNSSECValidation { + objc.checkOsVersionInternal('NSMutableURLRequest.requiresDNSSECValidation', + iOS: (false, (16, 1, 0)), macOS: (false, (13, 0, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_requiresDNSSECValidation); } @@ -46575,6 +46624,10 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, /// No otherwise. Defaults to NO. set requiresDNSSECValidation(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setRequiresDNSSECValidation:', + iOS: (false, (16, 1, 0)), + macOS: (false, (13, 0, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); } @@ -46586,6 +46639,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, /// NO otherwise. Defaults to NO. bool get allowsPersistentDNS { + objc.checkOsVersionInternal('NSMutableURLRequest.allowsPersistentDNS', + iOS: (false, (18, 0, 0)), macOS: (false, (15, 0, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsPersistentDNS); } @@ -46596,6 +46651,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, /// NO otherwise. Defaults to NO. set allowsPersistentDNS(bool value) { + objc.checkOsVersionInternal('NSMutableURLRequest.setAllowsPersistentDNS:', + iOS: (false, (18, 0, 0)), macOS: (false, (15, 0, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsPersistentDNS_, value); } @@ -46610,6 +46667,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @param URL The URL for the request. /// @result A newly-created and autoreleased NSURLRequest instance. static NSMutableURLRequest requestWithURL_(objc.NSURL URL) { + objc.checkOsVersionInternal('NSMutableURLRequest.requestWithURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSMutableURLRequest, _sel_requestWithURL_, URL.ref.pointer); return NSMutableURLRequest.castFromPointer(_ret, @@ -46636,6 +46695,10 @@ class NSMutableURLRequest extends NSURLRequest { objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.requestWithURL:cachePolicy:timeoutInterval:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1ajs603( _class_NSMutableURLRequest, _sel_requestWithURL_cachePolicy_timeoutInterval_, @@ -46655,6 +46718,8 @@ class NSMutableURLRequest extends NSURLRequest { /// @param URL The URL for the request. /// @result An initialized NSURLRequest. NSMutableURLRequest initWithURL_(objc.NSURL URL) { + objc.checkOsVersionInternal('NSMutableURLRequest.initWithURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); return NSMutableURLRequest.castFromPointer(_ret, @@ -46675,6 +46740,10 @@ class NSMutableURLRequest extends NSURLRequest { /// @result An initialized NSURLRequest. NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.initWithURL:cachePolicy:timeoutInterval:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_1ajs603( this.ref.retainAndReturnPointer(), _sel_initWithURL_cachePolicy_timeoutInterval_, @@ -46687,6 +46756,8 @@ class NSMutableURLRequest extends NSURLRequest { /// init NSMutableURLRequest init() { + objc.checkOsVersionInternal('NSMutableURLRequest.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSMutableURLRequest.castFromPointer(_ret, @@ -46694,14 +46765,14 @@ class NSMutableURLRequest extends NSURLRequest { } /// new - static NSMutableURLRequest new1() { + static NSMutableURLRequest new$() { final _ret = _objc_msgSend_151sglz(_class_NSMutableURLRequest, _sel_new); return NSMutableURLRequest.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSMutableURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSMutableURLRequest allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428( _class_NSMutableURLRequest, _sel_allocWithZone_, zone); return NSMutableURLRequest.castFromPointer(_ret, @@ -46716,7 +46787,7 @@ class NSMutableURLRequest extends NSURLRequest { } /// self - NSMutableURLRequest self() { + NSMutableURLRequest self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSMutableURLRequest.castFromPointer(_ret, retain: true, release: true); @@ -46745,6 +46816,9 @@ class NSMutableURLRequest extends NSURLRequest { : NSMutableURLRequest.castFromPointer(_ret, retain: false, release: true); } + + /// Returns a new instance of NSMutableURLRequest constructed with the default `new` method. + factory NSMutableURLRequest() => new$(); } enum NSHTTPCookieAcceptPolicy { @@ -46760,7 +46834,7 @@ enum NSHTTPCookieAcceptPolicy { 1 => NSHTTPCookieAcceptPolicyNever, 2 => NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain, _ => throw ArgumentError( - "Unknown value for NSHTTPCookieAcceptPolicy: $value"), + 'Unknown value for NSHTTPCookieAcceptPolicy: $value'), }; } @@ -46771,7 +46845,10 @@ enum NSHTTPCookieAcceptPolicy { class NSHTTPCookieStorage extends objc.NSObject { NSHTTPCookieStorage._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSHTTPCookieStorage', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); + } /// Constructs a [NSHTTPCookieStorage] that points to the same underlying object as [other]. NSHTTPCookieStorage.castFrom(objc.ObjCObjectBase other) @@ -46785,6 +46862,27 @@ class NSHTTPCookieStorage extends objc.NSObject { late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); + +/// WARNING: NSProgressReporting is a stub. To generate bindings for this class, include +/// NSProgressReporting in your config's objc-protocols list. +/// +/// NSProgressReporting +interface class NSProgressReporting extends objc.ObjCProtocolBase + implements objc.NSObjectProtocol { + NSProgressReporting._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSProgressReporting] that points to the same underlying object as [other]. + NSProgressReporting.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSProgressReporting] that wraps the given raw object pointer. + NSProgressReporting.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + late final _sel_taskIdentifier = objc.registerName("taskIdentifier"); late final _sel_originalRequest = objc.registerName("originalRequest"); late final _sel_currentRequest = objc.registerName("currentRequest"); @@ -46825,7 +46923,8 @@ late final _sel_textEncodingName = objc.registerName("textEncodingName"); late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); /// NSURLResponse -class NSURLResponse extends objc.NSObject { +class NSURLResponse extends objc.NSObject + implements objc.NSSecureCoding, objc.NSCopying { NSURLResponse._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); @@ -46859,6 +46958,10 @@ class NSURLResponse extends objc.NSObject { objc.NSString? MIMEType, DartNSInteger length, objc.NSString? name) { + objc.checkOsVersionInternal( + 'NSURLResponse.initWithURL:MIMEType:expectedContentLength:textEncodingName:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_l9ppnx( this.ref.retainAndReturnPointer(), _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, @@ -46873,6 +46976,8 @@ class NSURLResponse extends objc.NSObject { /// @abstract Returns the URL of the receiver. /// @result The URL of the receiver. objc.NSURL? get URL { + objc.checkOsVersionInternal('NSURLResponse.URL', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URL); return _ret.address == 0 ? null @@ -46889,6 +46994,8 @@ class NSURLResponse extends objc.NSObject { /// be made if the origin source did not report any such information. /// @result The MIME type of the receiver. objc.NSString? get MIMEType { + objc.checkOsVersionInternal('NSURLResponse.MIMEType', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_MIMEType); return _ret.address == 0 ? null @@ -46907,6 +47014,8 @@ class NSURLResponse extends objc.NSObject { /// there is no expectation that can be arrived at regarding expected /// content length. int get expectedContentLength { + objc.checkOsVersionInternal('NSURLResponse.expectedContentLength', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); return _objc_msgSend_1k101e3(this.ref.pointer, _sel_expectedContentLength); } @@ -46920,6 +47029,8 @@ class NSURLResponse extends objc.NSObject { /// @result The name of the text encoding of the receiver, or nil if no /// text encoding was specified. objc.NSString? get textEncodingName { + objc.checkOsVersionInternal('NSURLResponse.textEncodingName', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_textEncodingName); return _ret.address == 0 ? null @@ -46937,6 +47048,8 @@ class NSURLResponse extends objc.NSObject { /// This method always returns a valid filename. /// @result A suggested filename to use if saving the resource to disk. objc.NSString? get suggestedFilename { + objc.checkOsVersionInternal('NSURLResponse.suggestedFilename', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_suggestedFilename); return _ret.address == 0 @@ -46946,19 +47059,21 @@ class NSURLResponse extends objc.NSObject { /// init NSURLResponse init() { + objc.checkOsVersionInternal('NSURLResponse.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } /// new - static NSURLResponse new1() { + static NSURLResponse new$() { final _ret = _objc_msgSend_151sglz(_class_NSURLResponse, _sel_new); return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSURLResponse allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428(_class_NSURLResponse, _sel_allocWithZone_, zone); return NSURLResponse.castFromPointer(_ret, retain: false, release: true); @@ -46971,7 +47086,7 @@ class NSURLResponse extends objc.NSObject { } /// self - NSURLResponse self() { + NSURLResponse self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSURLResponse.castFromPointer(_ret, retain: true, release: true); } @@ -47008,9 +47123,33 @@ class NSURLResponse extends objc.NSObject { ? null : NSURLResponse.castFromPointer(_ret, retain: false, release: true); } + + /// Returns a new instance of NSURLResponse constructed with the default `new` method. + factory NSURLResponse() => new$(); } late final _sel_response = objc.registerName("response"); + +/// WARNING: NSURLSessionTaskDelegate is a stub. To generate bindings for this class, include +/// NSURLSessionTaskDelegate in your config's objc-protocols list. +/// +/// Messages related to the operation of a specific task. +interface class NSURLSessionTaskDelegate extends objc.ObjCProtocolBase + implements NSURLSessionDelegate { + NSURLSessionTaskDelegate._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionTaskDelegate] that points to the same underlying object as [other]. + NSURLSessionTaskDelegate.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionTaskDelegate] that wraps the given raw object pointer. + NSURLSessionTaskDelegate.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + late final _sel_delegate = objc.registerName("delegate"); late final _sel_setDelegate_ = objc.registerName("setDelegate:"); @@ -47021,7 +47160,10 @@ late final _sel_setDelegate_ = objc.registerName("setDelegate:"); class NSProgress extends objc.NSObject { NSProgress._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSProgress', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); + } /// Constructs a [NSProgress] that points to the same underlying object as [other]. NSProgress.castFrom(objc.ObjCObjectBase other) @@ -47092,13 +47234,18 @@ abstract final class ObjCBlock_NSProgress_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - fromFunction(NSProgress Function(ffi.Pointer) fn) => + fromFunction(NSProgress Function(ffi.Pointer) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_NSProgress_ffiVoid_closureCallable, (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), + fn(arg0).ref.retainAndAutorelease(), + keepIsolateAlive), retain: false, release: true); } @@ -47179,7 +47326,7 @@ enum NSURLSessionTaskState { 2 => NSURLSessionTaskStateCanceling, 3 => NSURLSessionTaskStateCompleted, _ => throw ArgumentError( - "Unknown value for NSURLSessionTaskState: $value"), + 'Unknown value for NSURLSessionTaskState: $value'), }; } @@ -47228,10 +47375,14 @@ late final _sel_setPrefersIncrementalDelivery_ = /// NSURLSessionTask - a cancelable object that refers to the lifetime /// of processing a given request. -class NSURLSessionTask extends objc.NSObject { +class NSURLSessionTask extends objc.NSObject + implements objc.NSCopying, NSProgressReporting { NSURLSessionTask._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionTask', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); + } /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. NSURLSessionTask.castFrom(objc.ObjCObjectBase other) @@ -47250,11 +47401,15 @@ class NSURLSessionTask extends objc.NSObject { /// an identifier for this task, assigned by and unique to the owning session DartNSUInteger get taskIdentifier { + objc.checkOsVersionInternal('NSURLSessionTask.taskIdentifier', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_taskIdentifier); } /// may be nil if this is a stream task NSURLRequest? get originalRequest { + objc.checkOsVersionInternal('NSURLSessionTask.originalRequest', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_originalRequest); return _ret.address == 0 ? null @@ -47263,6 +47418,8 @@ class NSURLSessionTask extends objc.NSObject { /// may differ from originalRequest due to http server redirection NSURLRequest? get currentRequest { + objc.checkOsVersionInternal('NSURLSessionTask.currentRequest', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_currentRequest); return _ret.address == 0 ? null @@ -47271,6 +47428,8 @@ class NSURLSessionTask extends objc.NSObject { /// may be nil if no response has been received NSURLResponse? get response { + objc.checkOsVersionInternal('NSURLSessionTask.response', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_response); return _ret.address == 0 ? null @@ -47284,11 +47443,14 @@ class NSURLSessionTask extends objc.NSObject { /// /// Delegate is strongly referenced until the task completes, after which it is /// reset to `nil`. - objc.ObjCObjectBase? get delegate { + NSURLSessionTaskDelegate? get delegate { + objc.checkOsVersionInternal('NSURLSessionTask.delegate', + iOS: (false, (15, 0, 0)), macOS: (false, (12, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_delegate); return _ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : NSURLSessionTaskDelegate.castFromPointer(_ret, + retain: true, release: true); } /// Sets a task-specific delegate. Methods not implemented on this delegate will @@ -47298,7 +47460,9 @@ class NSURLSessionTask extends objc.NSObject { /// /// Delegate is strongly referenced until the task completes, after which it is /// reset to `nil`. - set delegate(objc.ObjCObjectBase? value) { + set delegate(NSURLSessionTaskDelegate? value) { + objc.checkOsVersionInternal('NSURLSessionTask.setDelegate:', + iOS: (false, (15, 0, 0)), macOS: (false, (12, 0, 0))); _objc_msgSend_xtuoz7( this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); } @@ -47315,6 +47479,8 @@ class NSURLSessionTask extends objc.NSObject { /// Only applies to tasks created from background NSURLSession instances; has no /// effect for tasks created from other session types. objc.NSDate? get earliestBeginDate { + objc.checkOsVersionInternal('NSURLSessionTask.earliestBeginDate', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_earliestBeginDate); return _ret.address == 0 @@ -47328,6 +47494,8 @@ class NSURLSessionTask extends objc.NSObject { /// Only applies to tasks created from background NSURLSession instances; has no /// effect for tasks created from other session types. set earliestBeginDate(objc.NSDate? value) { + objc.checkOsVersionInternal('NSURLSessionTask.setEarliestBeginDate:', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setEarliestBeginDate_, value?.ref.pointer ?? ffi.nullptr); } @@ -47336,6 +47504,10 @@ class NSURLSessionTask extends objc.NSObject { /// be sent and received by this task. These values are used by system scheduling /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. int get countOfBytesClientExpectsToSend { + objc.checkOsVersionInternal( + 'NSURLSessionTask.countOfBytesClientExpectsToSend', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); return _objc_msgSend_pysgoz( this.ref.pointer, _sel_countOfBytesClientExpectsToSend); } @@ -47344,40 +47516,62 @@ class NSURLSessionTask extends objc.NSObject { /// be sent and received by this task. These values are used by system scheduling /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. set countOfBytesClientExpectsToSend(int value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setCountOfBytesClientExpectsToSend:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); _objc_msgSend_17gvxvj( this.ref.pointer, _sel_setCountOfBytesClientExpectsToSend_, value); } /// countOfBytesClientExpectsToReceive int get countOfBytesClientExpectsToReceive { + objc.checkOsVersionInternal( + 'NSURLSessionTask.countOfBytesClientExpectsToReceive', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); return _objc_msgSend_pysgoz( this.ref.pointer, _sel_countOfBytesClientExpectsToReceive); } /// setCountOfBytesClientExpectsToReceive: set countOfBytesClientExpectsToReceive(int value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setCountOfBytesClientExpectsToReceive:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); _objc_msgSend_17gvxvj( this.ref.pointer, _sel_setCountOfBytesClientExpectsToReceive_, value); } /// number of body bytes already sent int get countOfBytesSent { + objc.checkOsVersionInternal('NSURLSessionTask.countOfBytesSent', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesSent); } /// number of body bytes already received int get countOfBytesReceived { + objc.checkOsVersionInternal('NSURLSessionTask.countOfBytesReceived', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesReceived); } /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request int get countOfBytesExpectedToSend { + objc.checkOsVersionInternal('NSURLSessionTask.countOfBytesExpectedToSend', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); return _objc_msgSend_pysgoz( this.ref.pointer, _sel_countOfBytesExpectedToSend); } /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. int get countOfBytesExpectedToReceive { + objc.checkOsVersionInternal( + 'NSURLSessionTask.countOfBytesExpectedToReceive', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); return _objc_msgSend_pysgoz( this.ref.pointer, _sel_countOfBytesExpectedToReceive); } @@ -47385,6 +47579,8 @@ class NSURLSessionTask extends objc.NSObject { /// The taskDescription property is available for the developer to /// provide a descriptive label for the task. objc.NSString? get taskDescription { + objc.checkOsVersionInternal('NSURLSessionTask.taskDescription', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_taskDescription); return _ret.address == 0 ? null @@ -47394,6 +47590,8 @@ class NSURLSessionTask extends objc.NSObject { /// The taskDescription property is available for the developer to /// provide a descriptive label for the task. set taskDescription(objc.NSString? value) { + objc.checkOsVersionInternal('NSURLSessionTask.setTaskDescription:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setTaskDescription_, value?.ref.pointer ?? ffi.nullptr); } @@ -47404,11 +47602,15 @@ class NSURLSessionTask extends objc.NSObject { /// cases, the task may signal other work before it acknowledges the /// cancelation. -cancel may be sent to a task that has been suspended. void cancel() { + objc.checkOsVersionInternal('NSURLSessionTask.cancel', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancel); } /// The current state of the task within the session. NSURLSessionTaskState get state { + objc.checkOsVersionInternal('NSURLSessionTask.state', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1vze0g9(this.ref.pointer, _sel_state); return NSURLSessionTaskState.fromValue(_ret); } @@ -47416,6 +47618,8 @@ class NSURLSessionTask extends objc.NSObject { /// The error, if any, delivered via -URLSession:task:didCompleteWithError: /// This property will be nil in the event that no error occurred. objc.NSError? get error { + objc.checkOsVersionInternal('NSURLSessionTask.error', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_error); return _ret.address == 0 ? null @@ -47430,11 +47634,15 @@ class NSURLSessionTask extends objc.NSObject { /// will be disabled while a task is suspended. -suspend and -resume are /// nestable. void suspend() { + objc.checkOsVersionInternal('NSURLSessionTask.suspend', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_suspend); } /// resume void resume() { + objc.checkOsVersionInternal('NSURLSessionTask.resume', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_resume); } @@ -47452,6 +47660,8 @@ class NSURLSessionTask extends objc.NSObject { /// priority levels are provided: NSURLSessionTaskPriorityLow and /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. double get priority { + objc.checkOsVersionInternal('NSURLSessionTask.priority', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); return objc.useMsgSendVariants ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_priority) : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_priority); @@ -47471,6 +47681,8 @@ class NSURLSessionTask extends objc.NSObject { /// priority levels are provided: NSURLSessionTaskPriorityLow and /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. set priority(double value) { + objc.checkOsVersionInternal('NSURLSessionTask.setPriority:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_v5hmet(this.ref.pointer, _sel_setPriority_, value); } @@ -47483,6 +47695,8 @@ class NSURLSessionTask extends objc.NSObject { /// Defaults to true unless this task is created with completion-handler based /// convenience methods, or if it is a download task. bool get prefersIncrementalDelivery { + objc.checkOsVersionInternal('NSURLSessionTask.prefersIncrementalDelivery', + iOS: (false, (14, 5, 0)), macOS: (false, (11, 3, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_prefersIncrementalDelivery); } @@ -47496,25 +47710,31 @@ class NSURLSessionTask extends objc.NSObject { /// Defaults to true unless this task is created with completion-handler based /// convenience methods, or if it is a download task. set prefersIncrementalDelivery(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setPrefersIncrementalDelivery:', + iOS: (false, (14, 5, 0)), + macOS: (false, (11, 3, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setPrefersIncrementalDelivery_, value); } /// init NSURLSessionTask init() { + objc.checkOsVersionInternal('NSURLSessionTask.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } /// new - static NSURLSessionTask new1() { + static NSURLSessionTask new$() { final _ret = _objc_msgSend_151sglz(_class_NSURLSessionTask, _sel_new); return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSURLSessionTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSURLSessionTask allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428( _class_NSURLSessionTask, _sel_allocWithZone_, zone); return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); @@ -47527,7 +47747,7 @@ class NSURLSessionTask extends objc.NSObject { } /// self - NSURLSessionTask self() { + NSURLSessionTask self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); } @@ -47543,6 +47763,9 @@ class NSURLSessionTask extends objc.NSObject { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); } + + /// Returns a new instance of NSURLSessionTask constructed with the default `new` method. + factory NSURLSessionTask() => new$(); } late final _sel_storeCookies_forTask_ = @@ -47653,15 +47876,19 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock?)> - fromFunction(void Function(objc.ObjCObjectBase?) fn) => + fromFunction(void Function(objc.ObjCObjectBase?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock?)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_closureCallable, (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, - retain: true, release: true))), + : objc.ObjCObjectBase(arg0, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -47672,16 +47899,18 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock?)> - listener(void Function(objc.ObjCObjectBase?) fn) { + listener(void Function(objc.ObjCObjectBase?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, retain: false, release: true))); + : objc.ObjCObjectBase(arg0, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock?)>( @@ -47696,26 +47925,30 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock?)> - blocking(void Function(objc.ObjCObjectBase?) fn) { + blocking(void Function(objc.ObjCObjectBase?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_blockingCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, retain: false, release: true))); + : objc.ObjCObjectBase(arg0, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_blockingListenerCallable .nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + : objc.ObjCObjectBase(arg0, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock?)>( @@ -47743,10 +47976,12 @@ late final _sel_getCookiesForTask_completionHandler_ = objc.registerName("getCookiesForTask:completionHandler:"); /// NSURLSessionTaskAdditions -extension NSURLSessionTaskAdditions1 on NSHTTPCookieStorage { +extension NSURLSessionTaskAdditions$1 on NSHTTPCookieStorage { /// storeCookies:forTask: void storeCookies_forTask_( objc.ObjCObjectBase cookies, NSURLSessionTask task) { + objc.checkOsVersionInternal('NSHTTPCookieStorage.storeCookies:forTask:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_pfv6jd(this.ref.pointer, _sel_storeCookies_forTask_, cookies.ref.pointer, task.ref.pointer); } @@ -47756,6 +47991,10 @@ extension NSURLSessionTaskAdditions1 on NSHTTPCookieStorage { NSURLSessionTask task, objc.ObjCBlock?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSHTTPCookieStorage.getCookiesForTask:completionHandler:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); _objc_msgSend_o762yo( this.ref.pointer, _sel_getCookiesForTask_completionHandler_, @@ -47764,892 +48003,179 @@ extension NSURLSessionTaskAdditions1 on NSHTTPCookieStorage { } } -late final _class_NSEnumerator = objc.getClass("NSEnumerator"); -late final _sel_allObjects = objc.registerName("allObjects"); - -/// NSExtendedEnumerator -extension NSExtendedEnumerator on objc.NSEnumerator { - /// allObjects - objc.ObjCObjectBase get allObjects { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allObjects); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - late final _class_NSDictionary = objc.getClass("NSDictionary"); -late final _sel_allKeys = objc.registerName("allKeys"); -late final _sel_allKeysForObject_ = objc.registerName("allKeysForObject:"); -late final _sel_allValues = objc.registerName("allValues"); -late final _sel_descriptionInStringsFileFormat = - objc.registerName("descriptionInStringsFileFormat"); -late final _sel_descriptionWithLocale_indent_ = - objc.registerName("descriptionWithLocale:indent:"); -final _objc_msgSend_1k4kd9s = objc.msgSendPointer +late final _sel_getObjects_andKeys_ = objc.registerName("getObjects:andKeys:"); +final _objc_msgSend_hefmm1 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() + ffi.Pointer>, + ffi.Pointer>)>>() .asFunction< - ffi.Pointer Function( + void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_isEqualToDictionary_ = - objc.registerName("isEqualToDictionary:"); -late final _sel_objectEnumerator = objc.registerName("objectEnumerator"); -late final _sel_objectsForKeys_notFoundMarker_ = - objc.registerName("objectsForKeys:notFoundMarker:"); -late final _sel_writeToURL_error_ = objc.registerName("writeToURL:error:"); -final _objc_msgSend_l9p60w = objc.msgSendPointer + ffi.Pointer>, + ffi.Pointer>)>(); +late final _sel_dictionaryWithContentsOfFile_ = + objc.registerName("dictionaryWithContentsOfFile:"); +late final _sel_dictionaryWithContentsOfURL_ = + objc.registerName("dictionaryWithContentsOfURL:"); +late final _sel_initWithContentsOfFile_ = + objc.registerName("initWithContentsOfFile:"); +late final _sel_initWithContentsOfURL_ = + objc.registerName("initWithContentsOfURL:"); +late final _sel_writeToFile_atomically_ = + objc.registerName("writeToFile:atomically:"); +final _objc_msgSend_1iyq28l = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>() + ffi.Bool)>>() .asFunction< bool Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_keysSortedByValueUsingSelector_ = - objc.registerName("keysSortedByValueUsingSelector:"); -final _objc_msgSend_3ctkt6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_getObjects_andKeys_count_ = - objc.registerName("getObjects:andKeys:count:"); -final _objc_msgSend_n2svg2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.UnsignedLong)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); -late final _sel_objectForKeyedSubscript_ = - objc.registerName("objectForKeyedSubscript:"); -void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} + bool)>(); +late final _sel_writeToURL_atomically_ = + objc.registerName("writeToURL:atomically:"); -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); +/// NSDeprecated +extension NSDeprecated on objc.NSDictionary { + /// getObjects:andKeys: + void getObjects_andKeys_(ffi.Pointer> objects, + ffi.Pointer> keys) { + objc.checkOsVersionInternal('NSDictionary.getObjects:andKeys:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + _objc_msgSend_hefmm1( + this.ref.pointer, _sel_getObjects_andKeys_, objects, keys); } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_blockingCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_blockingTrampoline) - ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); + /// dictionaryWithContentsOfFile: + static objc.NSDictionary? dictionaryWithContentsOfFile_(objc.NSString path) { + objc.checkOsVersionInternal('NSDictionary.dictionaryWithContentsOfFile:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + final _ret = _objc_msgSend_1sotr3r(_class_NSDictionary, + _sel_dictionaryWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// dictionaryWithContentsOfURL: + static objc.NSDictionary? dictionaryWithContentsOfURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSDictionary.dictionaryWithContentsOfURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + final _ret = _objc_msgSend_1sotr3r(_class_NSDictionary, + _sel_dictionaryWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer, ffi.Pointer)> - fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => - objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), - arg2)), - retain: false, - release: true); + /// initWithContentsOfFile: + objc.NSDictionary? initWithContentsOfFile_(objc.NSString path) { + objc.checkOsVersionInternal('NSDictionary.initWithContentsOfFile:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> listener( - void Function( - objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), arg2)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1o83rbn(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(wrapper, retain: false, release: true); + /// initWithContentsOfURL: + objc.NSDictionary? initWithContentsOfURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSDictionary.initWithContentsOfURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); } - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> blocking( - void Function( - objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_blockingCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), arg2)); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), arg2)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1o83rbn, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(wrapper, retain: false, release: true); + /// writeToFile:atomically: + bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + objc.checkOsVersionInternal('NSDictionary.writeToFile:atomically:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToFile_atomically_, + path.ref.pointer, useAuxiliaryFile); } -} -/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> { - void call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, - ffi.Pointer arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); + /// writeToURL:atomically: + bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + objc.checkOsVersionInternal('NSDictionary.writeToURL:atomically:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToURL_atomically_, + url.ref.pointer, atomically); + } } -late final _sel_enumerateKeysAndObjectsUsingBlock_ = - objc.registerName("enumerateKeysAndObjectsUsingBlock:"); -final _objc_msgSend_f167m6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_ = - objc.registerName("enumerateKeysAndObjectsWithOptions:usingBlock:"); -final _objc_msgSend_yx8yc6 = objc.msgSendPointer +late final _sel_dictionary = objc.registerName("dictionary"); +late final _sel_dictionaryWithObject_forKey_ = + objc.registerName("dictionaryWithObject:forKey:"); +late final _sel_dictionaryWithObjects_forKeys_count_ = + objc.registerName("dictionaryWithObjects:forKeys:count:"); +final _objc_msgSend_1dydpdi = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() + ffi.Pointer>, + ffi.Pointer>, + ffi.UnsignedLong)>>() .asFunction< - void Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_keysSortedByValueUsingComparator_ = - objc.registerName("keysSortedByValueUsingComparator:"); -final _objc_msgSend_nnxkei = objc.msgSendPointer + ffi.Pointer>, + ffi.Pointer>, + int)>(); +late final _sel_dictionaryWithObjectsAndKeys_ = + objc.registerName("dictionaryWithObjectsAndKeys:"); +late final _sel_dictionaryWithDictionary_ = + objc.registerName("dictionaryWithDictionary:"); +late final _sel_dictionaryWithObjects_forKeys_ = + objc.registerName("dictionaryWithObjects:forKeys:"); +late final _sel_initWithObjectsAndKeys_ = + objc.registerName("initWithObjectsAndKeys:"); +late final _sel_initWithDictionary_ = objc.registerName("initWithDictionary:"); +late final _sel_initWithDictionary_copyItems_ = + objc.registerName("initWithDictionary:copyItems:"); +final _objc_msgSend_17amj0z = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>() + ffi.Pointer, + ffi.Bool)>>() .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_keysSortedByValueWithOptions_usingComparator_ = - objc.registerName("keysSortedByValueWithOptions:usingComparator:"); -final _objc_msgSend_1x5ew3h = objc.msgSendPointer + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_initWithObjects_forKeys_ = + objc.registerName("initWithObjects:forKeys:"); +late final _sel_initWithContentsOfURL_error_ = + objc.registerName("initWithContentsOfURL:error:"); +final _objc_msgSend_1lhpu4m = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline, - false) - .cast(); -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline, - false) - .cast(); - -/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject_bool { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer, ffi.Pointer)> - fromFunction(bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => - objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), - arg2)), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_CallExtension - on objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> { - bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, - ffi.Pointer arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); -} - -late final _sel_keysOfEntriesPassingTest_ = - objc.registerName("keysOfEntriesPassingTest:"); -late final _sel_keysOfEntriesWithOptions_passingTest_ = - objc.registerName("keysOfEntriesWithOptions:passingTest:"); -final _objc_msgSend_13x5boi = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - -/// NSExtendedDictionary -extension NSExtendedDictionary on objc.NSDictionary { - /// allKeys - objc.ObjCObjectBase get allKeys { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allKeys); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// allKeysForObject: - objc.ObjCObjectBase allKeysForObject_(objc.ObjCObjectBase anObject) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_allKeysForObject_, anObject.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// allValues - objc.ObjCObjectBase get allValues { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allValues); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// description - objc.NSString get description { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionInStringsFileFormat - objc.NSString get descriptionInStringsFileFormat { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, _sel_descriptionInStringsFileFormat); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithLocale: - objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithLocale:indent: - objc.NSString descriptionWithLocale_indent_( - objc.ObjCObjectBase? locale, DartNSUInteger level) { - final _ret = _objc_msgSend_1k4kd9s( - this.ref.pointer, - _sel_descriptionWithLocale_indent_, - locale?.ref.pointer ?? ffi.nullptr, - level); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isEqualToDictionary: - bool isEqualToDictionary_(objc.NSDictionary otherDictionary) { - return _objc_msgSend_19nvye5(this.ref.pointer, _sel_isEqualToDictionary_, - otherDictionary.ref.pointer); - } - - /// objectEnumerator - objc.NSEnumerator objectEnumerator() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_objectEnumerator); - return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); - } - - /// objectsForKeys:notFoundMarker: - objc.ObjCObjectBase objectsForKeys_notFoundMarker_( - objc.ObjCObjectBase keys, objc.ObjCObjectBase marker) { - final _ret = _objc_msgSend_15qeuct( - this.ref.pointer, - _sel_objectsForKeys_notFoundMarker_, - keys.ref.pointer, - marker.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// writeToURL:error: - bool writeToURL_error_( - objc.NSURL url, ffi.Pointer> error) { - return _objc_msgSend_l9p60w( - this.ref.pointer, _sel_writeToURL_error_, url.ref.pointer, error); - } - - /// keysSortedByValueUsingSelector: - objc.ObjCObjectBase keysSortedByValueUsingSelector_( - ffi.Pointer comparator) { - final _ret = _objc_msgSend_3ctkt6( - this.ref.pointer, _sel_keysSortedByValueUsingSelector_, comparator); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// getObjects:andKeys:count: - void getObjects_andKeys_count_( - ffi.Pointer> objects, - ffi.Pointer> keys, - DartNSUInteger count) { - _objc_msgSend_n2svg2( - this.ref.pointer, _sel_getObjects_andKeys_count_, objects, keys, count); - } - - /// objectForKeyedSubscript: - objc.ObjCObjectBase? objectForKeyedSubscript_(objc.ObjCObjectBase key) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_objectForKeyedSubscript_, key.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// enumerateKeysAndObjectsUsingBlock: - void enumerateKeysAndObjectsUsingBlock_( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - block) { - _objc_msgSend_f167m6(this.ref.pointer, - _sel_enumerateKeysAndObjectsUsingBlock_, block.ref.pointer); - } - - /// enumerateKeysAndObjectsWithOptions:usingBlock: - void enumerateKeysAndObjectsWithOptions_usingBlock_( - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - block) { - _objc_msgSend_yx8yc6( - this.ref.pointer, - _sel_enumerateKeysAndObjectsWithOptions_usingBlock_, - opts.value, - block.ref.pointer); - } - - /// keysSortedByValueUsingComparator: - objc.ObjCObjectBase keysSortedByValueUsingComparator_( - DartNSComparator cmptr) { - final _ret = _objc_msgSend_nnxkei(this.ref.pointer, - _sel_keysSortedByValueUsingComparator_, cmptr.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// keysSortedByValueWithOptions:usingComparator: - objc.ObjCObjectBase keysSortedByValueWithOptions_usingComparator_( - objc.NSSortOptions opts, DartNSComparator cmptr) { - final _ret = _objc_msgSend_1x5ew3h( - this.ref.pointer, - _sel_keysSortedByValueWithOptions_usingComparator_, - opts.value, - cmptr.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// keysOfEntriesPassingTest: - objc.ObjCObjectBase keysOfEntriesPassingTest_( - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - predicate) { - final _ret = _objc_msgSend_nnxkei(this.ref.pointer, - _sel_keysOfEntriesPassingTest_, predicate.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// keysOfEntriesWithOptions:passingTest: - objc.ObjCObjectBase keysOfEntriesWithOptions_passingTest_( - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - predicate) { - final _ret = _objc_msgSend_13x5boi( - this.ref.pointer, - _sel_keysOfEntriesWithOptions_passingTest_, - opts.value, - predicate.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _sel_getObjects_andKeys_ = objc.registerName("getObjects:andKeys:"); -final _objc_msgSend_hefmm1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_dictionaryWithContentsOfFile_ = - objc.registerName("dictionaryWithContentsOfFile:"); -late final _sel_dictionaryWithContentsOfURL_ = - objc.registerName("dictionaryWithContentsOfURL:"); -late final _sel_initWithContentsOfFile_ = - objc.registerName("initWithContentsOfFile:"); -late final _sel_initWithContentsOfURL_ = - objc.registerName("initWithContentsOfURL:"); -late final _sel_writeToFile_atomically_ = - objc.registerName("writeToFile:atomically:"); -final _objc_msgSend_1iyq28l = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_writeToURL_atomically_ = - objc.registerName("writeToURL:atomically:"); - -/// NSDeprecated -extension NSDeprecated on objc.NSDictionary { - /// getObjects:andKeys: - void getObjects_andKeys_(ffi.Pointer> objects, - ffi.Pointer> keys) { - _objc_msgSend_hefmm1( - this.ref.pointer, _sel_getObjects_andKeys_, objects, keys); - } - - /// dictionaryWithContentsOfFile: - static objc.NSDictionary? dictionaryWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_1sotr3r(_class_NSDictionary, - _sel_dictionaryWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// dictionaryWithContentsOfURL: - static objc.NSDictionary? dictionaryWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r(_class_NSDictionary, - _sel_dictionaryWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithContentsOfFile: - objc.NSDictionary? initWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithContentsOfURL: - objc.NSDictionary? initWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); - } - - /// writeToFile:atomically: - bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { - return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToFile_atomically_, - path.ref.pointer, useAuxiliaryFile); - } - - /// writeToURL:atomically: - bool writeToURL_atomically_(objc.NSURL url, bool atomically) { - return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToURL_atomically_, - url.ref.pointer, atomically); - } -} - -late final _sel_dictionary = objc.registerName("dictionary"); -late final _sel_dictionaryWithObject_forKey_ = - objc.registerName("dictionaryWithObject:forKey:"); -late final _sel_dictionaryWithObjects_forKeys_count_ = - objc.registerName("dictionaryWithObjects:forKeys:count:"); -final _objc_msgSend_1dydpdi = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); -late final _sel_dictionaryWithObjectsAndKeys_ = - objc.registerName("dictionaryWithObjectsAndKeys:"); -late final _sel_dictionaryWithDictionary_ = - objc.registerName("dictionaryWithDictionary:"); -late final _sel_dictionaryWithObjects_forKeys_ = - objc.registerName("dictionaryWithObjects:forKeys:"); -late final _sel_initWithObjectsAndKeys_ = - objc.registerName("initWithObjectsAndKeys:"); -late final _sel_initWithDictionary_ = objc.registerName("initWithDictionary:"); -late final _sel_initWithDictionary_copyItems_ = - objc.registerName("initWithDictionary:copyItems:"); -final _objc_msgSend_17amj0z = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_initWithObjects_forKeys_ = - objc.registerName("initWithObjects:forKeys:"); -late final _sel_initWithContentsOfURL_error_ = - objc.registerName("initWithContentsOfURL:error:"); -final _objc_msgSend_1lhpu4m = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() + ffi.Pointer, + ffi.Pointer>)>>() .asFunction< ffi.Pointer Function( ffi.Pointer, @@ -48748,6 +48274,8 @@ extension NSDictionaryCreation on objc.NSDictionary { /// initWithContentsOfURL:error: objc.NSDictionary? initWithContentsOfURL_error_( objc.NSURL url, ffi.Pointer> error) { + objc.checkOsVersionInternal('NSDictionary.initWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_1lhpu4m(this.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_error_, url.ref.pointer, error); return _ret.address == 0 @@ -48758,6 +48286,10 @@ extension NSDictionaryCreation on objc.NSDictionary { /// dictionaryWithContentsOfURL:error: static objc.NSDictionary? dictionaryWithContentsOfURL_error_( objc.NSURL url, ffi.Pointer> error) { + objc.checkOsVersionInternal( + 'NSDictionary.dictionaryWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_1lhpu4m(_class_NSDictionary, _sel_dictionaryWithContentsOfURL_error_, url.ref.pointer, error); return _ret.address == 0 @@ -48767,48 +48299,6 @@ extension NSDictionaryCreation on objc.NSDictionary { } late final _class_NSMutableDictionary = objc.getClass("NSMutableDictionary"); -late final _sel_addEntriesFromDictionary_ = - objc.registerName("addEntriesFromDictionary:"); -late final _sel_removeAllObjects = objc.registerName("removeAllObjects"); -late final _sel_removeObjectsForKeys_ = - objc.registerName("removeObjectsForKeys:"); -late final _sel_setDictionary_ = objc.registerName("setDictionary:"); -late final _sel_setObject_forKeyedSubscript_ = - objc.registerName("setObject:forKeyedSubscript:"); - -/// NSExtendedMutableDictionary -extension NSExtendedMutableDictionary on objc.NSMutableDictionary { - /// addEntriesFromDictionary: - void addEntriesFromDictionary_(objc.NSDictionary otherDictionary) { - _objc_msgSend_xtuoz7(this.ref.pointer, _sel_addEntriesFromDictionary_, - otherDictionary.ref.pointer); - } - - /// removeAllObjects - void removeAllObjects() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); - } - - /// removeObjectsForKeys: - void removeObjectsForKeys_(objc.ObjCObjectBase keyArray) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_removeObjectsForKeys_, keyArray.ref.pointer); - } - - /// setDictionary: - void setDictionary_(objc.NSDictionary otherDictionary) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_setDictionary_, otherDictionary.ref.pointer); - } - - /// setObject:forKeyedSubscript: - void setObject_forKeyedSubscript_( - objc.ObjCObjectBase? obj, objc.ObjCObjectBase key) { - _objc_msgSend_pfv6jd(this.ref.pointer, _sel_setObject_forKeyedSubscript_, - obj?.ref.pointer ?? ffi.nullptr, key.ref.pointer); - } -} - late final _sel_dictionaryWithCapacity_ = objc.registerName("dictionaryWithCapacity:"); final _objc_msgSend_14hpxwa = objc.msgSendPointer @@ -48881,6 +48371,8 @@ late final _sel_sharedKeySetForKeys_ = extension NSSharedKeySetDictionary on objc.NSDictionary { /// sharedKeySetForKeys: static objc.ObjCObjectBase sharedKeySetForKeys_(objc.ObjCObjectBase keys) { + objc.checkOsVersionInternal('NSDictionary.sharedKeySetForKeys:', + iOS: (false, (6, 0, 0)), macOS: (false, (10, 8, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSDictionary, _sel_sharedKeySetForKeys_, keys.ref.pointer); return objc.ObjCObjectBase(_ret, retain: true, release: true); @@ -48891,10 +48383,14 @@ late final _sel_dictionaryWithSharedKeySet_ = objc.registerName("dictionaryWithSharedKeySet:"); /// NSSharedKeySetDictionary -extension NSSharedKeySetDictionary1 on objc.NSMutableDictionary { +extension NSSharedKeySetDictionary$1 on objc.NSMutableDictionary { /// dictionaryWithSharedKeySet: static objc.NSMutableDictionary dictionaryWithSharedKeySet_( objc.ObjCObjectBase keyset) { + objc.checkOsVersionInternal( + 'NSMutableDictionary.dictionaryWithSharedKeySet:', + iOS: (false, (6, 0, 0)), + macOS: (false, (10, 8, 0))); final _ret = _objc_msgSend_1sotr3r(_class_NSMutableDictionary, _sel_dictionaryWithSharedKeySet_, keyset.ref.pointer); return objc.NSMutableDictionary.castFromPointer(_ret, @@ -49021,20 +48517,24 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)> fromFunction( - DartNSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - DartNSUInteger) - fn) => - objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>( - objc.newClosureBlock( - _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer> arg2, int arg3) => - fn(arg0, arg1, arg2, arg3)), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc + .ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)> + fromFunction(DartNSUInteger Function(ffi.Pointer, ffi.Pointer, ffi.Pointer>, DartNSUInteger) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>( + objc.newClosureBlock( + _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + int arg3) => + fn(arg0, arg1, arg2, arg3), + keepIsolateAlive), + retain: false, + release: true); } /// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>`. @@ -49156,19 +48656,24 @@ abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - objc.ObjCBlock? Function(NSProgress)> fromFunction( - DartNSProgressUnpublishingHandler? Function(NSProgress) fn) => - objc.ObjCBlock? Function(NSProgress)>( - objc.newClosureBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, - (ffi.Pointer arg0) => - fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) - ?.ref - .retainAndAutorelease() ?? - ffi.nullptr), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc + .ObjCBlock? Function(NSProgress)> + fromFunction(DartNSProgressUnpublishingHandler? Function(NSProgress) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock? Function(NSProgress)>( + objc.newClosureBlock( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, + (ffi.Pointer arg0) => + fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) + ?.ref + .retainAndAutorelease() ?? + ffi.nullptr, + keepIsolateAlive), + retain: false, + release: true); } /// Call operator for `objc.ObjCBlock? Function(NSProgress)>`. @@ -49354,6 +48859,8 @@ final class SecKeychainAttributeInfo extends ffi.Struct { external ffi.Pointer format; } +typedef wint_t = __darwin_wint_t; + final class _RuneEntry extends ffi.Struct { @__darwin_rune_t() external int __min; @@ -49668,7 +49175,7 @@ enum clockid_t { 9 => _CLOCK_UPTIME_RAW_APPROX, 12 => _CLOCK_PROCESS_CPUTIME_ID, 16 => _CLOCK_THREAD_CPUTIME_ID, - _ => throw ArgumentError("Unknown value for clockid_t: $value"), + _ => throw ArgumentError('Unknown value for clockid_t: $value'), }; } @@ -49932,7 +49439,7 @@ enum CFNotificationSuspensionBehavior { 3 => CFNotificationSuspensionBehaviorHold, 4 => CFNotificationSuspensionBehaviorDeliverImmediately, _ => throw ArgumentError( - "Unknown value for CFNotificationSuspensionBehavior: $value"), + 'Unknown value for CFNotificationSuspensionBehavior: $value'), }; } @@ -49960,7 +49467,7 @@ enum CFLocaleLanguageDirection { 3 => kCFLocaleLanguageDirectionTopToBottom, 4 => kCFLocaleLanguageDirectionBottomToTop, _ => throw ArgumentError( - "Unknown value for CFLocaleLanguageDirection: $value"), + 'Unknown value for CFLocaleLanguageDirection: $value'), }; } @@ -50032,7 +49539,7 @@ enum CFDataSearchFlags { static CFDataSearchFlags fromValue(int value) => switch (value) { 1 => kCFDataSearchBackwards, 2 => kCFDataSearchAnchored, - _ => throw ArgumentError("Unknown value for CFDataSearchFlags: $value"), + _ => throw ArgumentError('Unknown value for CFDataSearchFlags: $value'), }; } @@ -50078,7 +49585,7 @@ enum CFCharacterSetPredefinedSet { 15 => kCFCharacterSetNewline, 12 => kCFCharacterSetIllegal, _ => throw ArgumentError( - "Unknown value for CFCharacterSetPredefinedSet: $value"), + 'Unknown value for CFCharacterSetPredefinedSet: $value'), }; } @@ -50114,7 +49621,7 @@ enum CFStringCompareFlags { 256 => kCFCompareWidthInsensitive, 512 => kCFCompareForcedOrdering, _ => - throw ArgumentError("Unknown value for CFStringCompareFlags: $value"), + throw ArgumentError('Unknown value for CFStringCompareFlags: $value'), }; } @@ -50133,7 +49640,7 @@ enum CFStringNormalizationForm { 2 => kCFStringNormalizationFormC, 3 => kCFStringNormalizationFormKC, _ => throw ArgumentError( - "Unknown value for CFStringNormalizationForm: $value"), + 'Unknown value for CFStringNormalizationForm: $value'), }; } @@ -50175,7 +49682,7 @@ enum CFTimeZoneNameStyle { 4 => kCFTimeZoneNameStyleGeneric, 5 => kCFTimeZoneNameStyleShortGeneric, _ => - throw ArgumentError("Unknown value for CFTimeZoneNameStyle: $value"), + throw ArgumentError('Unknown value for CFTimeZoneNameStyle: $value'), }; } @@ -50219,7 +49726,7 @@ enum CFCalendarUnit { 8192 => kCFCalendarUnitWeekOfYear, 16384 => kCFCalendarUnitYearForWeekOfYear, 65536 => kCFCalendarUnitDayOfYear, - _ => throw ArgumentError("Unknown value for CFCalendarUnit: $value"), + _ => throw ArgumentError('Unknown value for CFCalendarUnit: $value'), }; } @@ -50311,7 +49818,7 @@ enum CFDateFormatterStyle { 3 => kCFDateFormatterLongStyle, 4 => kCFDateFormatterFullStyle, _ => - throw ArgumentError("Unknown value for CFDateFormatterStyle: $value"), + throw ArgumentError('Unknown value for CFDateFormatterStyle: $value'), }; } @@ -50350,7 +49857,7 @@ enum CFISO8601DateFormatOptions { 1632 => kCFISO8601DateFormatWithFullTime, 1907 => kCFISO8601DateFormatWithInternetDateTime, _ => throw ArgumentError( - "Unknown value for CFISO8601DateFormatOptions: $value"), + 'Unknown value for CFISO8601DateFormatOptions: $value'), }; } @@ -50398,7 +49905,7 @@ enum CFNumberType { 14 => kCFNumberCFIndexType, 15 => kCFNumberNSIntegerType, 16 => kCFNumberCGFloatType, - _ => throw ArgumentError("Unknown value for CFNumberType: $value"), + _ => throw ArgumentError('Unknown value for CFNumberType: $value'), }; @override @@ -50445,7 +49952,7 @@ enum CFNumberFormatterStyle { 9 => kCFNumberFormatterCurrencyPluralStyle, 10 => kCFNumberFormatterCurrencyAccountingStyle, _ => throw ArgumentError( - "Unknown value for CFNumberFormatterStyle: $value"), + 'Unknown value for CFNumberFormatterStyle: $value'), }; } @@ -50461,7 +49968,7 @@ enum CFURLPathStyle { 0 => kCFURLPOSIXPathStyle, 1 => kCFURLHFSPathStyle, 2 => kCFURLWindowsPathStyle, - _ => throw ArgumentError("Unknown value for CFURLPathStyle: $value"), + _ => throw ArgumentError('Unknown value for CFURLPathStyle: $value'), }; } @@ -50500,7 +50007,7 @@ enum CFURLComponentType { 11 => kCFURLComponentQuery, 12 => kCFURLComponentFragment, _ => - throw ArgumentError("Unknown value for CFURLComponentType: $value"), + throw ArgumentError('Unknown value for CFURLComponentType: $value'), }; } @@ -50525,7 +50032,7 @@ enum CFURLBookmarkCreationOptions { 536870912 => kCFURLBookmarkCreationWithoutImplicitSecurityScope, 256 => kCFURLBookmarkCreationPreferFileIDResolutionMask, _ => throw ArgumentError( - "Unknown value for CFURLBookmarkCreationOptions: $value"), + 'Unknown value for CFURLBookmarkCreationOptions: $value'), }; } @@ -50549,7 +50056,7 @@ enum CFURLBookmarkResolutionOptions { 1024 => kCFURLBookmarkResolutionWithSecurityScope, 32768 => kCFURLBookmarkResolutionWithoutImplicitStartAccessing, _ => throw ArgumentError( - "Unknown value for CFURLBookmarkResolutionOptions: $value"), + 'Unknown value for CFURLBookmarkResolutionOptions: $value'), }; @override @@ -50742,7 +50249,7 @@ enum CFRunLoopRunResult { 3 => kCFRunLoopRunTimedOut, 4 => kCFRunLoopRunHandledSource, _ => - throw ArgumentError("Unknown value for CFRunLoopRunResult: $value"), + throw ArgumentError('Unknown value for CFRunLoopRunResult: $value'), }; } @@ -50766,7 +50273,7 @@ enum CFRunLoopActivity { 64 => kCFRunLoopAfterWaiting, 128 => kCFRunLoopExit, 268435455 => kCFRunLoopAllActivities, - _ => throw ArgumentError("Unknown value for CFRunLoopActivity: $value"), + _ => throw ArgumentError('Unknown value for CFRunLoopActivity: $value'), }; } @@ -51003,16 +50510,20 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, CFOptionFlags)> - fromFunction(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, CFOptionFlags)> + fromFunction(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock< ffi.Void Function( ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable, (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1))), + fn(arg0, CFRunLoopActivity.fromValue(arg1)), + keepIsolateAlive), retain: false, release: true); @@ -51023,17 +50534,19 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> - listener(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) { + listener(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable .nativeFunction .cast(), (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1))); + fn(arg0, CFRunLoopActivity.fromValue(arg1)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -51047,26 +50560,30 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> - blocking(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) { + blocking(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingCallable .nativeFunction .cast(), (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1))); + fn(arg0, CFRunLoopActivity.fromValue(arg1)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingListenerCallable .nativeFunction .cast(), (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv, raw, rawListener); + fn(arg0, CFRunLoopActivity.fromValue(arg1)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -51210,12 +50727,17 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - fromFunction(void Function(CFRunLoopTimerRef) fn) => + fromFunction(void Function(CFRunLoopTimerRef) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable, - (CFRunLoopTimerRef arg0) => fn(arg0)), + (CFRunLoopTimerRef arg0) => fn(arg0), + keepIsolateAlive), retain: false, release: true); @@ -51226,14 +50748,16 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - listener(void Function(CFRunLoopTimerRef) fn) { + listener(void Function(CFRunLoopTimerRef) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable.nativeFunction .cast(), - (CFRunLoopTimerRef arg0) => fn(arg0)); + (CFRunLoopTimerRef arg0) => fn(arg0), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock)>( @@ -51248,22 +50772,26 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock)> - blocking(void Function(CFRunLoopTimerRef) fn) { + blocking(void Function(CFRunLoopTimerRef) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingCallable.nativeFunction .cast(), - (CFRunLoopTimerRef arg0) => fn(arg0)); + (CFRunLoopTimerRef arg0) => fn(arg0), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingListenerCallable .nativeFunction .cast(), - (CFRunLoopTimerRef arg0) => fn(arg0)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol, raw, rawListener); + (CFRunLoopTimerRef arg0) => fn(arg0), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock)>( @@ -51302,7 +50830,7 @@ enum CFSocketError { 0 => kCFSocketSuccess, -1 => kCFSocketError, -2 => kCFSocketTimeout, - _ => throw ArgumentError("Unknown value for CFSocketError: $value"), + _ => throw ArgumentError('Unknown value for CFSocketError: $value'), }; } @@ -51338,7 +50866,7 @@ enum CFSocketCallBackType { 4 => kCFSocketConnectCallBack, 8 => kCFSocketWriteCallBack, _ => - throw ArgumentError("Unknown value for CFSocketCallBackType: $value"), + throw ArgumentError('Unknown value for CFSocketCallBackType: $value'), }; } @@ -51600,7 +51128,7 @@ enum filesec_property_t { 100 => FILESEC_ACL_RAW, 101 => FILESEC_ACL_ALLOCSIZE, _ => - throw ArgumentError("Unknown value for filesec_property_t: $value"), + throw ArgumentError('Unknown value for filesec_property_t: $value'), }; } @@ -51731,7 +51259,7 @@ enum qos_class_t { 17 => QOS_CLASS_UTILITY, 9 => QOS_CLASS_BACKGROUND, 0 => QOS_CLASS_UNSPECIFIED, - _ => throw ArgumentError("Unknown value for qos_class_t: $value"), + _ => throw ArgumentError('Unknown value for qos_class_t: $value'), }; } @@ -51840,11 +51368,15 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(int) fn) => + void Function(int) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiSize_closureCallable, - (int arg0) => fn(arg0)), + (int arg0) => fn(arg0), keepIsolateAlive), retain: false, release: true); @@ -51855,13 +51387,15 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(int) fn) { + void Function(int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiSize_listenerCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); + (int arg0) => fn(arg0), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_6enxqz(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -51874,20 +51408,24 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(int) fn) { + void Function(int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiSize_blockingCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); + (int arg0) => fn(arg0), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiSize_blockingListenerCallable.nativeFunction .cast(), - (int arg0) => fn(arg0)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_6enxqz, raw, rawListener); + (int arg0) => fn(arg0), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_6enxqz( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -51930,7 +51468,7 @@ enum dispatch_autorelease_frequency_t { 1 => DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM, 2 => DISPATCH_AUTORELEASE_FREQUENCY_NEVER, _ => throw ArgumentError( - "Unknown value for dispatch_autorelease_frequency_t: $value"), + 'Unknown value for dispatch_autorelease_frequency_t: $value'), }; } @@ -51953,7 +51491,7 @@ enum dispatch_block_flags_t { 16 => DISPATCH_BLOCK_INHERIT_QOS_CLASS, 32 => DISPATCH_BLOCK_ENFORCE_QOS_CLASS, _ => throw ArgumentError( - "Unknown value for dispatch_block_flags_t: $value"), + 'Unknown value for dispatch_block_flags_t: $value'), }; } @@ -52278,17 +51816,22 @@ abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, ffi.Size)> fromFunction( - bool Function(Dartdispatch_data_t, int, ffi.Pointer, int) - fn) => - objc.ObjCBlock, ffi.Size)>( - objc.newClosureBlock( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable, - (dispatch_data_t arg0, int arg1, ffi.Pointer arg2, - int arg3) => - fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), arg1, arg2, arg3)), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc + .ObjCBlock, ffi.Size)> + fromFunction(bool Function(Dartdispatch_data_t, int, ffi.Pointer, int) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, ffi.Size)>( + objc.newClosureBlock( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable, + (dispatch_data_t arg0, int arg1, ffi.Pointer arg2, + int arg3) => + fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), arg1, arg2, arg3), + keepIsolateAlive), + retain: false, + release: true); } /// Call operator for `objc.ObjCBlock, ffi.Size)>`. @@ -52431,15 +51974,19 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(Dartdispatch_data_t, int) fn) => + void Function(Dartdispatch_data_t, int) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable, (dispatch_data_t arg0, int arg1) => fn( - objc.NSObject.castFromPointer(arg0, - retain: true, release: true), - arg1)), + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + arg1), + keepIsolateAlive), retain: false, release: true); @@ -52450,16 +51997,18 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(Dartdispatch_data_t, int) fn) { + void Function(Dartdispatch_data_t, int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable.nativeFunction .cast(), (dispatch_data_t arg0, int arg1) => fn( objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg1)); + arg1), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_18kzm6a(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -52472,26 +52021,30 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(Dartdispatch_data_t, int) fn) { + void Function(Dartdispatch_data_t, int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingCallable.nativeFunction .cast(), (dispatch_data_t arg0, int arg1) => fn( objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg1)); + arg1), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingListenerCallable .nativeFunction .cast(), (dispatch_data_t arg0, int arg1) => fn( objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg1)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a, raw, rawListener); + arg1), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -52512,7 +52065,7 @@ extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt_CallExtension int)>()(ref.pointer, arg0.ref.pointer, arg1); } -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrTrampoline( +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrTrampoline( ffi.Pointer block, dispatch_data_t arg0, int arg1) => @@ -52521,25 +52074,26 @@ void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrTrampoline( ffi.NativeFunction< ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1)>>() .asFunction()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrCallable = +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrTrampoline) + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureTrampoline( +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureTrampoline( ffi.Pointer block, dispatch_data_t arg0, int arg1) => (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureCallable = +ffi.Pointer + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureTrampoline) + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerTrampoline( +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerTrampoline( ffi.Pointer block, dispatch_data_t arg0, int arg1) { (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( arg0, arg1); @@ -52549,13 +52103,13 @@ void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerTrampoline( ffi.NativeCallable< ffi.Void Function( ffi.Pointer, dispatch_data_t, ffi.Int)> - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerCallable = ffi + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerCallable = ffi .NativeCallable< ffi.Void Function(ffi.Pointer, dispatch_data_t, ffi.Int)>.listener( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerTrampoline) + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerTrampoline) ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingTrampoline( +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingTrampoline( ffi.Pointer block, ffi.Pointer waiter, dispatch_data_t arg0, @@ -52573,24 +52127,24 @@ void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingTrampoline( ffi.NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer, dispatch_data_t, ffi.Int)> - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingCallable = ffi + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingCallable = ffi .NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer, dispatch_data_t, ffi.Int)>.isolateLocal( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingTrampoline) + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingTrampoline) ..keepIsolateAlive = false; ffi.NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer, dispatch_data_t, ffi.Int)> - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingListenerCallable = ffi + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingListenerCallable = ffi .NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer, dispatch_data_t, ffi.Int)>.listener( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingTrampoline) + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingTrampoline) ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { +abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1 { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock castFromPointer(ffi.Pointer pointer, @@ -52609,7 +52163,7 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { ptr) => objc.ObjCBlock( objc.newPointerBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrCallable, + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -52619,17 +52173,21 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(Dartdispatch_data_t?, int) fn) => + void Function(Dartdispatch_data_t?, int) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureCallable, + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureCallable, (dispatch_data_t arg0, int arg1) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, - retain: true, release: true), - arg1)), + : objc.NSObject.castFromPointer(arg0, retain: true, release: true), + arg1), + keepIsolateAlive), retain: false, release: true); @@ -52640,19 +52198,22 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(Dartdispatch_data_t?, int) fn) { + void Function(Dartdispatch_data_t?, int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerCallable.nativeFunction + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerCallable + .nativeFunction .cast(), (dispatch_data_t arg0, int arg1) => fn( arg0.address == 0 ? null : objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg1)); + arg1), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_18kzm6a(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -52665,22 +52226,26 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(Dartdispatch_data_t?, int) fn) { + void Function(Dartdispatch_data_t?, int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingCallable.nativeFunction + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingCallable + .nativeFunction .cast(), (dispatch_data_t arg0, int arg1) => fn( arg0.address == 0 ? null : objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg1)); + arg1), + keepIsolateAlive); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_blockingListenerCallable + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingListenerCallable .nativeFunction .cast(), (dispatch_data_t arg0, int arg1) => fn( @@ -52688,9 +52253,10 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { ? null : objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg1)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a, raw, rawListener); + arg1), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -52699,7 +52265,7 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_CallExtension +extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_CallExtension on objc.ObjCBlock { void call(Dartdispatch_data_t? arg0, int arg1) => ref.pointer.ref.invoke .cast< @@ -52805,11 +52371,15 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(int) fn) => + void Function(int) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiInt_closureCallable, - (int arg0) => fn(arg0)), + (int arg0) => fn(arg0), keepIsolateAlive), retain: false, release: true); @@ -52820,13 +52390,15 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(int) fn) { + void Function(int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiInt_listenerCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); + (int arg0) => fn(arg0), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_9o8504(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -52839,20 +52411,24 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(int) fn) { + void Function(int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiInt_blockingCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); + (int arg0) => fn(arg0), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiInt_blockingListenerCallable.nativeFunction .cast(), - (int arg0) => fn(arg0)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_9o8504, raw, rawListener); + (int arg0) => fn(arg0), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_9o8504( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -52999,17 +52575,20 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock - fromFunction(void Function(bool, Dartdispatch_data_t?, int) fn) => + fromFunction(void Function(bool, Dartdispatch_data_t?, int) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable, (bool arg0, dispatch_data_t arg1, int arg2) => fn( arg0, - arg1.address == 0 - ? null - : objc.NSObject.castFromPointer(arg1, retain: true, release: true), - arg2)), + arg1.address == 0 ? null : objc.NSObject.castFromPointer(arg1, retain: true, release: true), + arg2), + keepIsolateAlive), retain: false, release: true); @@ -53020,10 +52599,11 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock - listener(void Function(bool, Dartdispatch_data_t?, int) fn) { + listener(void Function(bool, Dartdispatch_data_t?, int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable .nativeFunction @@ -53034,7 +52614,8 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { ? null : objc.NSObject.castFromPointer(arg1, retain: false, release: true), - arg2)); + arg2), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_og5b6y(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock( @@ -53049,11 +52630,13 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock - blocking(void Function(bool, Dartdispatch_data_t?, int) fn) { + blocking(void Function(bool, Dartdispatch_data_t?, int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingCallable .nativeFunction @@ -53064,7 +52647,8 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { ? null : objc.NSObject.castFromPointer(arg1, retain: false, release: true), - arg2)); + arg2), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingListenerCallable .nativeFunction @@ -53075,9 +52659,10 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { ? null : objc.NSObject.castFromPointer(arg1, retain: false, release: true), - arg2)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_og5b6y, raw, rawListener); + arg2), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_og5b6y( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock( @@ -53144,7 +52729,7 @@ enum CFStreamStatus { 5 => kCFStreamStatusAtEnd, 6 => kCFStreamStatusClosed, 7 => kCFStreamStatusError, - _ => throw ArgumentError("Unknown value for CFStreamStatus: $value"), + _ => throw ArgumentError('Unknown value for CFStreamStatus: $value'), }; } @@ -53166,7 +52751,7 @@ enum CFStreamEventType { 4 => kCFStreamEventCanAcceptBytes, 8 => kCFStreamEventErrorOccurred, 16 => kCFStreamEventEndEncountered, - _ => throw ArgumentError("Unknown value for CFStreamEventType: $value"), + _ => throw ArgumentError('Unknown value for CFStreamEventType: $value'), }; } @@ -53230,7 +52815,7 @@ enum CFPropertyListFormat { 100 => kCFPropertyListXMLFormat_v1_0, 200 => kCFPropertyListBinaryFormat_v1_0, _ => - throw ArgumentError("Unknown value for CFPropertyListFormat: $value"), + throw ArgumentError('Unknown value for CFPropertyListFormat: $value'), }; } @@ -53535,7 +53120,7 @@ enum CFURLEnumeratorOptions { 32 => kCFURLEnumeratorIncludeDirectoriesPostOrder, 64 => kCFURLEnumeratorGenerateRelativePathURLs, _ => throw ArgumentError( - "Unknown value for CFURLEnumeratorOptions: $value"), + 'Unknown value for CFURLEnumeratorOptions: $value'), }; } @@ -53554,7 +53139,7 @@ enum CFURLEnumeratorResult { 3 => kCFURLEnumeratorError, 4 => kCFURLEnumeratorDirectoryPostOrderSuccess, _ => throw ArgumentError( - "Unknown value for CFURLEnumeratorResult: $value"), + 'Unknown value for CFURLEnumeratorResult: $value'), }; } @@ -53723,7 +53308,7 @@ enum acl_perm_t { 4096 => ACL_WRITE_SECURITY, 8192 => ACL_CHANGE_OWNER, 1048576 => ACL_SYNCHRONIZE, - _ => throw ArgumentError("Unknown value for acl_perm_t: $value"), + _ => throw ArgumentError('Unknown value for acl_perm_t: $value'), }; @override @@ -53752,7 +53337,7 @@ enum acl_tag_t { 0 => ACL_UNDEFINED_TAG, 1 => ACL_EXTENDED_ALLOW, 2 => ACL_EXTENDED_DENY, - _ => throw ArgumentError("Unknown value for acl_tag_t: $value"), + _ => throw ArgumentError('Unknown value for acl_tag_t: $value'), }; } @@ -53776,7 +53361,7 @@ enum acl_type_t { 3 => ACL_TYPE_CODA, 4 => ACL_TYPE_NTFS, 5 => ACL_TYPE_NWFS, - _ => throw ArgumentError("Unknown value for acl_type_t: $value"), + _ => throw ArgumentError('Unknown value for acl_type_t: $value'), }; } @@ -53800,7 +53385,7 @@ enum acl_flag_t { 64 => ACL_ENTRY_DIRECTORY_INHERIT, 128 => ACL_ENTRY_LIMIT_INHERIT, 256 => ACL_ENTRY_ONLY_INHERIT, - _ => throw ArgumentError("Unknown value for acl_flag_t: $value"), + _ => throw ArgumentError('Unknown value for acl_flag_t: $value'), }; } @@ -53841,7 +53426,7 @@ enum CFFileSecurityClearOptions { 16 => kCFFileSecurityClearGroupUUID, 32 => kCFFileSecurityClearAccessControlList, _ => throw ArgumentError( - "Unknown value for CFFileSecurityClearOptions: $value"), + 'Unknown value for CFFileSecurityClearOptions: $value'), }; } @@ -53870,7 +53455,7 @@ enum CFStringTokenizerTokenType { 16 => kCFStringTokenizerTokenHasNonLettersMask, 32 => kCFStringTokenizerTokenIsCJWordMask, _ => throw ArgumentError( - "Unknown value for CFStringTokenizerTokenType: $value"), + 'Unknown value for CFStringTokenizerTokenType: $value'), }; } @@ -53961,7 +53546,7 @@ enum CFXMLNodeTypeCode { 13 => kCFXMLNodeTypeNotation, 14 => kCFXMLNodeTypeElementTypeDeclaration, 15 => kCFXMLNodeTypeAttributeListDeclaration, - _ => throw ArgumentError("Unknown value for CFXMLNodeTypeCode: $value"), + _ => throw ArgumentError('Unknown value for CFXMLNodeTypeCode: $value'), }; } @@ -54038,7 +53623,7 @@ enum CFXMLEntityTypeCode { 3 => kCFXMLEntityTypeUnparsed, 4 => kCFXMLEntityTypeCharacter, _ => - throw ArgumentError("Unknown value for CFXMLEntityTypeCode: $value"), + throw ArgumentError('Unknown value for CFXMLEntityTypeCode: $value'), }; } @@ -54111,7 +53696,7 @@ enum CFXMLParserStatusCode { 14 => kCFXMLErrorMalformedParsedCharacterData, 15 => kCFXMLErrorNoData, _ => throw ArgumentError( - "Unknown value for CFXMLParserStatusCode: $value"), + 'Unknown value for CFXMLParserStatusCode: $value'), }; } @@ -55817,7 +55402,7 @@ enum extension_data_format { 1 => CSSM_X509_DATAFORMAT_PARSED, 2 => CSSM_X509_DATAFORMAT_PAIR, _ => throw ArgumentError( - "Unknown value for extension_data_format: $value"), + 'Unknown value for extension_data_format: $value'), }; } @@ -56029,7 +55614,7 @@ enum __CE_GeneralNameType { 7 => GNT_IPAddress, 8 => GNT_RegisteredID, _ => - throw ArgumentError("Unknown value for __CE_GeneralNameType: $value"), + throw ArgumentError('Unknown value for __CE_GeneralNameType: $value'), }; } @@ -56151,7 +55736,7 @@ enum __CE_CrlDistributionPointNameType { 0 => CE_CDNT_FullName, 1 => CE_CDNT_NameRelativeToCrlIssuer, _ => throw ArgumentError( - "Unknown value for __CE_CrlDistributionPointNameType: $value"), + 'Unknown value for __CE_CrlDistributionPointNameType: $value'), }; } @@ -56388,7 +55973,7 @@ enum __CE_DataType { 18 => DT_PolicyMappings, 19 => DT_PolicyConstraints, 20 => DT_InhibitAnyPolicy, - _ => throw ArgumentError("Unknown value for __CE_DataType: $value"), + _ => throw ArgumentError('Unknown value for __CE_DataType: $value'), }; } @@ -56448,7 +56033,7 @@ final class __CE_DataAndType extends ffi.Struct { __CE_DataType get type => __CE_DataType.fromValue(typeAsInt); - external CE_Data extension1; + external CE_Data extension$; @CSSM_BOOL() external int critical; @@ -56700,7 +56285,7 @@ enum SecTrustResultType { 6 => kSecTrustResultFatalTrustFailure, 7 => kSecTrustResultOtherError, _ => - throw ArgumentError("Unknown value for SecTrustResultType: $value"), + throw ArgumentError('Unknown value for SecTrustResultType: $value'), }; } @@ -56812,14 +56397,19 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)> fromFunction( - void Function(SecTrustRef, SecTrustResultType) fn) => + void Function(SecTrustRef, SecTrustResultType) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock, ffi.Uint32)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable, (SecTrustRef arg0, int arg1) => - fn(arg0, SecTrustResultType.fromValue(arg1))), + fn(arg0, SecTrustResultType.fromValue(arg1)), + keepIsolateAlive), retain: false, release: true); @@ -56830,16 +56420,18 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, ffi.Uint32)> - listener(void Function(SecTrustRef, SecTrustResultType) fn) { + listener(void Function(SecTrustRef, SecTrustResultType) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable .nativeFunction .cast(), (SecTrustRef arg0, int arg1) => - fn(arg0, SecTrustResultType.fromValue(arg1))); + fn(arg0, SecTrustResultType.fromValue(arg1)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -56853,25 +56445,29 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock, ffi.Uint32)> - blocking(void Function(SecTrustRef, SecTrustResultType) fn) { + blocking(void Function(SecTrustRef, SecTrustResultType) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingCallable .nativeFunction .cast(), (SecTrustRef arg0, int arg1) => - fn(arg0, SecTrustResultType.fromValue(arg1))); + fn(arg0, SecTrustResultType.fromValue(arg1)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingListenerCallable .nativeFunction .cast(), (SecTrustRef arg0, int arg1) => - fn(arg0, SecTrustResultType.fromValue(arg1))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt, raw, rawListener); + fn(arg0, SecTrustResultType.fromValue(arg1)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -57026,15 +56622,19 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)> - fromFunction(void Function(SecTrustRef, bool, CFErrorRef) fn) => + fromFunction(void Function(SecTrustRef, bool, CFErrorRef) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, - ffi.Pointer<__CFError>)>( + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable, - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => - fn(arg0, arg1, arg2)), + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), + keepIsolateAlive), retain: false, release: true); @@ -57045,17 +56645,19 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> listener( - void Function(SecTrustRef, bool, CFErrorRef) fn) { + void Function(SecTrustRef, bool, CFErrorRef) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable .nativeFunction .cast(), - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2)); + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_k73ff5(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -57069,25 +56671,29 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> blocking( - void Function(SecTrustRef, bool, CFErrorRef) fn) { + void Function(SecTrustRef, bool, CFErrorRef) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingCallable .nativeFunction .cast(), - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2)); + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingListenerCallable .nativeFunction .cast(), - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_k73ff5, raw, rawListener); + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_k73ff5( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -57138,7 +56744,7 @@ enum SecTrustOptionFlags { 32 => kSecTrustOptionUseTrustSettings, 64 => kSecTrustOptionImplicitAnchors, _ => - throw ArgumentError("Unknown value for SecTrustOptionFlags: $value"), + throw ArgumentError('Unknown value for SecTrustOptionFlags: $value'), }; } @@ -57162,7 +56768,7 @@ enum SSLCiphersuiteGroup { 3 => kSSLCiphersuiteGroupATS, 4 => kSSLCiphersuiteGroupATSCompatibility, _ => - throw ArgumentError("Unknown value for SSLCiphersuiteGroup: $value"), + throw ArgumentError('Unknown value for SSLCiphersuiteGroup: $value'), }; } @@ -57192,7 +56798,7 @@ enum tls_protocol_version_t { -257 => tls_protocol_version_DTLSv10, -259 => tls_protocol_version_DTLSv12, _ => throw ArgumentError( - "Unknown value for tls_protocol_version_t: $value"), + 'Unknown value for tls_protocol_version_t: $value'), }; } @@ -57254,7 +56860,7 @@ enum tls_ciphersuite_t { 4865 => tls_ciphersuite_AES_128_GCM_SHA256, 4866 => tls_ciphersuite_AES_256_GCM_SHA384, 4867 => tls_ciphersuite_CHACHA20_POLY1305_SHA256, - _ => throw ArgumentError("Unknown value for tls_ciphersuite_t: $value"), + _ => throw ArgumentError('Unknown value for tls_ciphersuite_t: $value'), }; } @@ -57275,7 +56881,7 @@ enum tls_ciphersuite_group_t { 3 => tls_ciphersuite_group_ats, 4 => tls_ciphersuite_group_ats_compatibility, _ => throw ArgumentError( - "Unknown value for tls_ciphersuite_group_t: $value"), + 'Unknown value for tls_ciphersuite_group_t: $value'), }; } @@ -57311,7 +56917,7 @@ enum SSLProtocol { 3 => kSSLProtocol3Only, 5 => kTLSProtocol1Only, 6 => kSSLProtocolAll, - _ => throw ArgumentError("Unknown value for SSLProtocol: $value"), + _ => throw ArgumentError('Unknown value for SSLProtocol: $value'), }; } @@ -57409,13 +57015,18 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(Dartsec_certificate_t) fn) => + void Function(Dartsec_certificate_t) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_seccertificatet_closureCallable, (sec_certificate_t arg0) => fn(objc.NSObject.castFromPointer(arg0, - retain: true, release: true))), + retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -57426,15 +57037,17 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(Dartsec_certificate_t) fn) { + void Function(Dartsec_certificate_t) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_seccertificatet_listenerCallable.nativeFunction .cast(), (sec_certificate_t arg0) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true))); + objc.NSObject.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -57447,24 +57060,28 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(Dartsec_certificate_t) fn) { + void Function(Dartsec_certificate_t) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_seccertificatet_blockingCallable.nativeFunction .cast(), (sec_certificate_t arg0) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true))); + objc.NSObject.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_seccertificatet_blockingListenerCallable .nativeFunction .cast(), (sec_certificate_t arg0) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + objc.NSObject.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -57577,11 +57194,15 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(int) fn) => + void Function(int) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock(_ObjCBlock_ffiVoid_Uint16_closureCallable, - (int arg0) => fn(arg0)), + (int arg0) => fn(arg0), keepIsolateAlive), retain: false, release: true); @@ -57592,13 +57213,15 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(int) fn) { + void Function(int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_Uint16_listenerCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); + (int arg0) => fn(arg0), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_15f11yh(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -57611,20 +57234,24 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(int) fn) { + void Function(int) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_Uint16_blockingCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); + (int arg0) => fn(arg0), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_Uint16_blockingListenerCallable.nativeFunction .cast(), - (int arg0) => fn(arg0)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_15f11yh, raw, rawListener); + (int arg0) => fn(arg0), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_15f11yh( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -57765,15 +57392,19 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) => + void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable, (dispatch_data_t arg0, dispatch_data_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, - retain: true, release: true), - objc.NSObject.castFromPointer(arg1, retain: true, release: true))), + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + objc.NSObject.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -57784,17 +57415,19 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock - listener(void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) { + listener(void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable .nativeFunction .cast(), (dispatch_data_t arg0, dispatch_data_t arg1) => fn( objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true))); + objc.NSObject.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock( @@ -57809,27 +57442,31 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock - blocking(void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) { + blocking(void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingCallable .nativeFunction .cast(), (dispatch_data_t arg0, dispatch_data_t arg1) => fn( objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true))); + objc.NSObject.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingListenerCallable .nativeFunction .cast(), (dispatch_data_t arg0, dispatch_data_t arg1) => fn( objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd, raw, rawListener); + objc.NSObject.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock( @@ -57950,15 +57587,19 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(Dartdispatch_data_t?) fn) => + void Function(Dartdispatch_data_t?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_closureCallable, (dispatch_data_t arg0) => fn(arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, - retain: true, release: true))), + : objc.NSObject.castFromPointer(arg0, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -57969,16 +57610,18 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(Dartdispatch_data_t?) fn) { + void Function(Dartdispatch_data_t?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_listenerCallable.nativeFunction.cast(), (dispatch_data_t arg0) => fn(arg0.address == 0 ? null : objc.NSObject.castFromPointer(arg0, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -57991,26 +57634,30 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(Dartdispatch_data_t?) fn) { + void Function(Dartdispatch_data_t?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_blockingCallable.nativeFunction.cast(), (dispatch_data_t arg0) => fn(arg0.address == 0 ? null : objc.NSObject.castFromPointer(arg0, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_dispatchdatat_blockingListenerCallable.nativeFunction .cast(), (dispatch_data_t arg0) => fn(arg0.address == 0 ? null : objc.NSObject.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -58201,15 +57848,19 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t?, Dartsec_protocol_pre_shared_key_selection_complete_t) fn) => + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t?, Dartsec_protocol_pre_shared_key_selection_complete_t) fn, {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable, (sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2) => fn( objc.NSObject.castFromPointer(arg0, retain: true, release: true), arg1.address == 0 ? null : objc.NSObject.castFromPointer(arg1, retain: true, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg2, retain: true, release: true))), + ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg2, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -58220,14 +57871,15 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.NSObject?, objc.ObjCBlock)> listener( void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t?, Dartsec_protocol_pre_shared_key_selection_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable .nativeFunction @@ -58242,7 +57894,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro : objc.NSObject.castFromPointer(arg1, retain: false, release: true), ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_18qun1e(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -58257,15 +57910,17 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.NSObject?, objc.ObjCBlock)> blocking( void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t?, Dartsec_protocol_pre_shared_key_selection_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingCallable .nativeFunction @@ -58280,7 +57935,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro : objc.NSObject.castFromPointer(arg1, retain: false, release: true), ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingListenerCallable .nativeFunction @@ -58295,9 +57951,10 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro : objc.NSObject.castFromPointer(arg1, retain: false, release: true), ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_18qun1e, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -58485,15 +58142,19 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) fn) => + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable, - (sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) => - fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), - ObjCBlock_ffiVoid.castFromPointer(arg1, retain: true, release: true))), + (sec_protocol_metadata_t arg0, sec_protocol_key_update_complete_t arg1) => fn( + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + ObjCBlock_ffiVoid.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -58504,14 +58165,15 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.ObjCBlock)> listener( void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable .nativeFunction @@ -58522,7 +58184,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate objc.NSObject.castFromPointer(arg0, retain: false, release: true), ObjCBlock_ffiVoid.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_o762yo(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -58537,15 +58200,17 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.ObjCBlock)> blocking( void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingCallable .nativeFunction @@ -58556,7 +58221,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate objc.NSObject.castFromPointer(arg0, retain: false, release: true), ObjCBlock_ffiVoid.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingListenerCallable .nativeFunction @@ -58567,9 +58233,10 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate objc.NSObject.castFromPointer(arg0, retain: false, release: true), ObjCBlock_ffiVoid.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_o762yo, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_o762yo( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -58749,15 +58416,19 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable, (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => fn( objc.NSObject.castFromPointer(arg0, retain: true, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg1, retain: true, release: true))), + ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -58768,15 +58439,16 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( objc.NSObject, objc.ObjCBlock)> listener( void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable .nativeFunction @@ -58787,7 +58459,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge objc.NSObject.castFromPointer(arg0, retain: false, release: true), ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_o762yo(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -58802,8 +58475,9 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -58811,7 +58485,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge blocking( void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingCallable .nativeFunction @@ -58822,7 +58497,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge objc.NSObject.castFromPointer(arg0, retain: false, release: true), ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingListenerCallable .nativeFunction @@ -58833,9 +58509,10 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge objc.NSObject.castFromPointer(arg0, retain: false, release: true), ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_o762yo, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_o762yo( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -58961,11 +58638,15 @@ abstract final class ObjCBlock_ffiVoid_bool { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(bool) fn) => + void Function(bool) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_closureCallable, (bool arg0) => fn(arg0)), + objc.newClosureBlock(_ObjCBlock_ffiVoid_bool_closureCallable, + (bool arg0) => fn(arg0), keepIsolateAlive), retain: false, release: true); @@ -58976,13 +58657,15 @@ abstract final class ObjCBlock_ffiVoid_bool { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(bool) fn) { + void Function(bool) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_bool_listenerCallable.nativeFunction.cast(), - (bool arg0) => fn(arg0)); + (bool arg0) => fn(arg0), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -58995,19 +58678,23 @@ abstract final class ObjCBlock_ffiVoid_bool { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(bool) fn) { + void Function(bool) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_bool_blockingCallable.nativeFunction.cast(), - (bool arg0) => fn(arg0)); + (bool arg0) => fn(arg0), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_bool_blockingListenerCallable.nativeFunction.cast(), - (bool arg0) => fn(arg0)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9, raw, rawListener); + (bool arg0) => fn(arg0), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -59186,16 +58873,20 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, Dartsec_protocol_verify_complete_t) fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, Dartsec_protocol_verify_complete_t) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable, (sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2) => fn( objc.NSObject.castFromPointer(arg0, retain: true, release: true), objc.NSObject.castFromPointer(arg1, retain: true, release: true), - ObjCBlock_ffiVoid_bool.castFromPointer(arg2, retain: true, release: true))), + ObjCBlock_ffiVoid_bool.castFromPointer(arg2, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -59206,14 +58897,15 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.NSObject, objc.ObjCBlock)> listener( void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, Dartsec_protocol_verify_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable .nativeFunction @@ -59226,7 +58918,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco objc.NSObject.castFromPointer(arg1, retain: false, release: true), ObjCBlock_ffiVoid_bool.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_18qun1e(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -59241,15 +58934,17 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.NSObject, objc.ObjCBlock)> blocking( void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, Dartsec_protocol_verify_complete_t) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingCallable .nativeFunction @@ -59262,7 +58957,8 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco objc.NSObject.castFromPointer(arg1, retain: false, release: true), ObjCBlock_ffiVoid_bool.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingListenerCallable .nativeFunction @@ -59275,9 +58971,10 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco objc.NSObject.castFromPointer(arg1, retain: false, release: true), ObjCBlock_ffiVoid_bool.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_18qun1e, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -59347,7 +59044,7 @@ enum SSLSessionOption { 7 => kSSLSessionOptionBreakOnClientHello, 8 => kSSLSessionOptionAllowRenegotiation, 9 => kSSLSessionOptionEnableSessionTickets, - _ => throw ArgumentError("Unknown value for SSLSessionOption: $value"), + _ => throw ArgumentError('Unknown value for SSLSessionOption: $value'), }; } @@ -59367,7 +59064,7 @@ enum SSLSessionState { 2 => kSSLConnected, 3 => kSSLClosed, 4 => kSSLAborted, - _ => throw ArgumentError("Unknown value for SSLSessionState: $value"), + _ => throw ArgumentError('Unknown value for SSLSessionState: $value'), }; } @@ -59386,7 +59083,7 @@ enum SSLClientCertificateState { 2 => kSSLClientCertSent, 3 => kSSLClientCertRejected, _ => throw ArgumentError( - "Unknown value for SSLClientCertificateState: $value"), + 'Unknown value for SSLClientCertificateState: $value'), }; } @@ -59415,7 +59112,7 @@ enum SSLProtocolSide { static SSLProtocolSide fromValue(int value) => switch (value) { 0 => kSSLServerSide, 1 => kSSLClientSide, - _ => throw ArgumentError("Unknown value for SSLProtocolSide: $value"), + _ => throw ArgumentError('Unknown value for SSLProtocolSide: $value'), }; } @@ -59429,7 +59126,7 @@ enum SSLConnectionType { static SSLConnectionType fromValue(int value) => switch (value) { 0 => kSSLStreamType, 1 => kSSLDatagramType, - _ => throw ArgumentError("Unknown value for SSLConnectionType: $value"), + _ => throw ArgumentError('Unknown value for SSLConnectionType: $value'), }; } @@ -59445,7 +59142,7 @@ enum SSLAuthenticate { 0 => kNeverAuthenticate, 1 => kAlwaysAuthenticate, 2 => kTryAuthenticate, - _ => throw ArgumentError("Unknown value for SSLAuthenticate: $value"), + _ => throw ArgumentError('Unknown value for SSLAuthenticate: $value'), }; } @@ -59610,18 +59307,20 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) => + void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 ? null : objc.NSData.castFromPointer(arg0, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0.address == 0 ? null : objc.NSData.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -59632,11 +59331,12 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc .ObjCBlock - listener(void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) { + listener(void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable .nativeFunction @@ -59655,7 +59355,8 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -59669,12 +59370,14 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc .ObjCBlock - blocking(void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) { + blocking(void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingCallable .nativeFunction @@ -59693,7 +59396,8 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingListenerCallable .nativeFunction @@ -59712,9 +59416,10 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -59776,7 +59481,10 @@ late final _sel_dataTaskWithURL_completionHandler_ = class NSURLSessionUploadTask extends NSURLSessionDataTask { NSURLSessionUploadTask._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionUploadTask', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); + } /// Constructs a [NSURLSessionUploadTask] that points to the same underlying object as [other]. NSURLSessionUploadTask.castFrom(objc.ObjCObjectBase other) @@ -59916,15 +59624,20 @@ abstract final class ObjCBlock_ffiVoid_NSData { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(objc.NSData?) fn) => + void Function(objc.NSData?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_closureCallable, (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : objc.NSData.castFromPointer(arg0, - retain: true, release: true))), + retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -59935,15 +59648,17 @@ abstract final class ObjCBlock_ffiVoid_NSData { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(objc.NSData?) fn) { + void Function(objc.NSData?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_listenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true))); + : objc.NSData.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -59956,24 +59671,28 @@ abstract final class ObjCBlock_ffiVoid_NSData { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(objc.NSData?) fn) { + void Function(objc.NSData?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_blockingCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true))); + : objc.NSData.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_blockingListenerCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + : objc.NSData.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -59997,13 +59716,26 @@ extension ObjCBlock_ffiVoid_NSData_CallExtension late final _sel_cancelByProducingResumeData_ = objc.registerName("cancelByProducingResumeData:"); +final _objc_msgSend_f167m6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// NSURLSessionDownloadTask is a task that represents a download to /// local storage. class NSURLSessionDownloadTask extends NSURLSessionTask { NSURLSessionDownloadTask._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionDownloadTask', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); + } /// Constructs a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. NSURLSessionDownloadTask.castFrom(objc.ObjCObjectBase other) @@ -60028,12 +59760,18 @@ class NSURLSessionDownloadTask extends NSURLSessionTask { /// called with nil resumeData. void cancelByProducingResumeData_( objc.ObjCBlock completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadTask.cancelByProducingResumeData:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_f167m6(this.ref.pointer, _sel_cancelByProducingResumeData_, completionHandler.ref.pointer); } /// init NSURLSessionDownloadTask init() { + objc.checkOsVersionInternal('NSURLSessionDownloadTask.init', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLSessionDownloadTask.castFromPointer(_ret, @@ -60041,49 +59779,17 @@ class NSURLSessionDownloadTask extends NSURLSessionTask { } /// new - static NSURLSessionDownloadTask new1() { + static NSURLSessionDownloadTask new$() { + objc.checkOsVersionInternal('NSURLSessionDownloadTask.new', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(_class_NSURLSessionDownloadTask, _sel_new); return NSURLSessionDownloadTask.castFromPointer(_ret, retain: false, release: true); } - /// allocWithZone: - static NSURLSessionDownloadTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLSessionDownloadTask, _sel_allocWithZone_, zone); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSURLSessionDownloadTask alloc() { - final _ret = - _objc_msgSend_151sglz(_class_NSURLSessionDownloadTask, _sel_alloc); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// self - NSURLSessionDownloadTask self() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } - - /// retain - NSURLSessionDownloadTask retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } - - /// autorelease - NSURLSessionDownloadTask autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } + /// Returns a new instance of NSURLSessionDownloadTask constructed with the default `new` method. + factory NSURLSessionDownloadTask() => new$(); } void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( @@ -60246,18 +59952,20 @@ abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) => + void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 ? null : objc.NSURL.castFromPointer(arg0, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0.address == 0 ? null : objc.NSURL.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -60268,11 +59976,12 @@ abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc .ObjCBlock - listener(void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) { + listener(void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable .nativeFunction @@ -60291,7 +60000,8 @@ abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -60305,12 +60015,14 @@ abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc .ObjCBlock - blocking(void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) { + blocking(void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingCallable .nativeFunction @@ -60329,7 +60041,8 @@ abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingListenerCallable .nativeFunction @@ -60348,9 +60061,10 @@ abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -60409,6 +60123,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.dataTaskWithRequest:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_dataTaskWithRequest_completionHandler_, @@ -60424,6 +60142,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.dataTaskWithURL:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_dataTaskWithURL_completionHandler_, @@ -60440,6 +60162,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.uploadTaskWithRequest:fromFile:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_2wiv66( this.ref.pointer, _sel_uploadTaskWithRequest_fromFile_completionHandler_, @@ -60457,6 +60183,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.uploadTaskWithRequest:fromData:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_2wiv66( this.ref.pointer, _sel_uploadTaskWithRequest_fromData_completionHandler_, @@ -60478,6 +60208,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.uploadTaskWithResumeData:completionHandler:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_uploadTaskWithResumeData_completionHandler_, @@ -60496,6 +60230,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.downloadTaskWithRequest:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_downloadTaskWithRequest_completionHandler_, @@ -60511,6 +60249,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.downloadTaskWithURL:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_downloadTaskWithURL_completionHandler_, @@ -60526,6 +60268,10 @@ extension NSURLSessionAsynchronousConvenience on NSURLSession { objc.ObjCBlock< ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.downloadTaskWithResumeData:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_downloadTaskWithResumeData_completionHandler_, @@ -60547,6 +60293,10 @@ extension NSURLSessionDeprecated on NSURLSessionConfiguration { /// backgroundSessionConfiguration: static NSURLSessionConfiguration backgroundSessionConfiguration_( objc.NSString identifier) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.backgroundSessionConfiguration:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r(_class_NSURLSessionConfiguration, _sel_backgroundSessionConfiguration_, identifier.ref.pointer); return NSURLSessionConfiguration.castFromPointer(_ret, @@ -60751,7 +60501,7 @@ enum NSURLSessionMultipathServiceType { 2 => NSURLSessionMultipathServiceTypeInteractive, 3 => NSURLSessionMultipathServiceTypeAggregate, _ => throw ArgumentError( - "Unknown value for NSURLSessionMultipathServiceType: $value"), + 'Unknown value for NSURLSessionMultipathServiceType: $value'), }; } @@ -60788,10 +60538,14 @@ final _objc_msgSend_1hx005a = objc.msgSendPointer /// /// A background session can be used to perform networking operations /// on behalf of a suspended application, within certain constraints. -class NSURLSessionConfiguration extends objc.NSObject { +class NSURLSessionConfiguration extends objc.NSObject + implements objc.NSCopying { NSURLSessionConfiguration._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionConfiguration', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); + } /// Constructs a [NSURLSessionConfiguration] that points to the same underlying object as [other]. NSURLSessionConfiguration.castFrom(objc.ObjCObjectBase other) @@ -60810,6 +60564,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// defaultSessionConfiguration static NSURLSessionConfiguration getDefaultSessionConfiguration() { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.defaultSessionConfiguration', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSURLSessionConfiguration, _sel_defaultSessionConfiguration); return NSURLSessionConfiguration.castFromPointer(_ret, @@ -60818,6 +60576,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// ephemeralSessionConfiguration static NSURLSessionConfiguration getEphemeralSessionConfiguration() { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.ephemeralSessionConfiguration', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSURLSessionConfiguration, _sel_ephemeralSessionConfiguration); return NSURLSessionConfiguration.castFromPointer(_ret, @@ -60827,6 +60589,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// backgroundSessionConfigurationWithIdentifier: static NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier_(objc.NSString identifier) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSURLSessionConfiguration, _sel_backgroundSessionConfigurationWithIdentifier_, @@ -60837,6 +60603,8 @@ class NSURLSessionConfiguration extends objc.NSObject { /// identifier for the background session configuration objc.NSString? get identifier { + objc.checkOsVersionInternal('NSURLSessionConfiguration.identifier', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_identifier); return _ret.address == 0 ? null @@ -60845,6 +60613,8 @@ class NSURLSessionConfiguration extends objc.NSObject { /// default cache policy for requests NSURLRequestCachePolicy get requestCachePolicy { + objc.checkOsVersionInternal('NSURLSessionConfiguration.requestCachePolicy', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_requestCachePolicy); return NSURLRequestCachePolicy.fromValue(_ret); @@ -60852,12 +60622,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// default cache policy for requests set requestCachePolicy(NSURLRequestCachePolicy value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setRequestCachePolicy:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_1yjxuv2( this.ref.pointer, _sel_setRequestCachePolicy_, value.value); } /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. DartNSTimeInterval get timeoutIntervalForRequest { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.timeoutIntervalForRequest', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); return objc.useMsgSendVariants ? _objc_msgSend_1ukqyt8Fpret( this.ref.pointer, _sel_timeoutIntervalForRequest) @@ -60867,12 +60645,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. set timeoutIntervalForRequest(DartNSTimeInterval value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setTimeoutIntervalForRequest:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_hwm8nu( this.ref.pointer, _sel_setTimeoutIntervalForRequest_, value); } /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. DartNSTimeInterval get timeoutIntervalForResource { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.timeoutIntervalForResource', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); return objc.useMsgSendVariants ? _objc_msgSend_1ukqyt8Fpret( this.ref.pointer, _sel_timeoutIntervalForResource) @@ -60882,12 +60668,18 @@ class NSURLSessionConfiguration extends objc.NSObject { /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. set timeoutIntervalForResource(DartNSTimeInterval value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setTimeoutIntervalForResource:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_hwm8nu( this.ref.pointer, _sel_setTimeoutIntervalForResource_, value); } /// type of service for requests. NSURLRequestNetworkServiceType get networkServiceType { + objc.checkOsVersionInternal('NSURLSessionConfiguration.networkServiceType', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); return NSURLRequestNetworkServiceType.fromValue(_ret); @@ -60895,53 +60687,89 @@ class NSURLSessionConfiguration extends objc.NSObject { /// type of service for requests. set networkServiceType(NSURLRequestNetworkServiceType value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setNetworkServiceType:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_1mse4s1( this.ref.pointer, _sel_setNetworkServiceType_, value.value); } /// allow request to route over cellular. bool get allowsCellularAccess { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.allowsCellularAccess', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); } /// allow request to route over cellular. set allowsCellularAccess(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setAllowsCellularAccess:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsCellularAccess_, value); } /// allow request to route over expensive networks. Defaults to YES. bool get allowsExpensiveNetworkAccess { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.allowsExpensiveNetworkAccess', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsExpensiveNetworkAccess); } /// allow request to route over expensive networks. Defaults to YES. set allowsExpensiveNetworkAccess(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setAllowsExpensiveNetworkAccess:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); } /// allow request to route over networks in constrained mode. Defaults to YES. bool get allowsConstrainedNetworkAccess { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.allowsConstrainedNetworkAccess', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } /// allow request to route over networks in constrained mode. Defaults to YES. set allowsConstrainedNetworkAccess(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setAllowsConstrainedNetworkAccess:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); } /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. bool get requiresDNSSECValidation { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.requiresDNSSECValidation', + iOS: (false, (16, 0, 0)), + macOS: (false, (13, 0, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_requiresDNSSECValidation); } /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. set requiresDNSSECValidation(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setRequiresDNSSECValidation:', + iOS: (false, (16, 0, 0)), + macOS: (false, (13, 0, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); } @@ -60959,6 +60787,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Default value is NO. Ignored by background sessions, as background sessions /// always wait for connectivity. bool get waitsForConnectivity { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.waitsForConnectivity', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_waitsForConnectivity); } @@ -60975,17 +60807,25 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Default value is NO. Ignored by background sessions, as background sessions /// always wait for connectivity. set waitsForConnectivity(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setWaitsForConnectivity:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setWaitsForConnectivity_, value); } /// allows background tasks to be scheduled at the discretion of the system for optimal performance. bool get discretionary { + objc.checkOsVersionInternal('NSURLSessionConfiguration.isDiscretionary', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 10, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_isDiscretionary); } /// allows background tasks to be scheduled at the discretion of the system for optimal performance. set discretionary(bool value) { + objc.checkOsVersionInternal('NSURLSessionConfiguration.setDiscretionary:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_1s56lr9(this.ref.pointer, _sel_setDiscretionary_, value); } @@ -60993,6 +60833,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. objc.NSString? get sharedContainerIdentifier { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.sharedContainerIdentifier', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_sharedContainerIdentifier); return _ret.address == 0 @@ -61004,6 +60848,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. set sharedContainerIdentifier(objc.NSString? value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setSharedContainerIdentifier:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setSharedContainerIdentifier_, value?.ref.pointer ?? ffi.nullptr); } @@ -61014,6 +60862,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// /// NOTE: macOS apps based on AppKit do not support background launch. bool get sessionSendsLaunchEvents { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.sessionSendsLaunchEvents', + iOS: (false, (7, 0, 0)), + macOS: (false, (11, 0, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_sessionSendsLaunchEvents); } @@ -61024,12 +60876,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// /// NOTE: macOS apps based on AppKit do not support background launch. set sessionSendsLaunchEvents(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setSessionSendsLaunchEvents:', + iOS: (false, (7, 0, 0)), + macOS: (false, (11, 0, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setSessionSendsLaunchEvents_, value); } /// The proxy dictionary, as described by objc.NSDictionary? get connectionProxyDictionary { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.connectionProxyDictionary', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_connectionProxyDictionary); return _ret.address == 0 @@ -61039,12 +60899,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The proxy dictionary, as described by set connectionProxyDictionary(objc.NSDictionary? value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setConnectionProxyDictionary:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setConnectionProxyDictionary_, value?.ref.pointer ?? ffi.nullptr); } /// The minimum allowable versions of the TLS protocol, from SSLProtocol get TLSMinimumSupportedProtocol { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.TLSMinimumSupportedProtocol', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_cbopi9( this.ref.pointer, _sel_TLSMinimumSupportedProtocol); return SSLProtocol.fromValue(_ret); @@ -61052,12 +60920,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The minimum allowable versions of the TLS protocol, from set TLSMinimumSupportedProtocol(SSLProtocol value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setTLSMinimumSupportedProtocol:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_268k8x( this.ref.pointer, _sel_setTLSMinimumSupportedProtocol_, value.value); } /// The maximum allowable versions of the TLS protocol, from SSLProtocol get TLSMaximumSupportedProtocol { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.TLSMaximumSupportedProtocol', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_cbopi9( this.ref.pointer, _sel_TLSMaximumSupportedProtocol); return SSLProtocol.fromValue(_ret); @@ -61065,12 +60941,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The maximum allowable versions of the TLS protocol, from set TLSMaximumSupportedProtocol(SSLProtocol value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setTLSMaximumSupportedProtocol:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_268k8x( this.ref.pointer, _sel_setTLSMaximumSupportedProtocol_, value.value); } /// The minimum allowable versions of the TLS protocol, from tls_protocol_version_t get TLSMinimumSupportedProtocolVersion { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.TLSMinimumSupportedProtocolVersion', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_9jpwfb( this.ref.pointer, _sel_TLSMinimumSupportedProtocolVersion); return tls_protocol_version_t.fromValue(_ret); @@ -61078,12 +60962,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The minimum allowable versions of the TLS protocol, from set TLSMinimumSupportedProtocolVersion(tls_protocol_version_t value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setTLSMinimumSupportedProtocolVersion:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_1mvuct7(this.ref.pointer, _sel_setTLSMinimumSupportedProtocolVersion_, value.value); } /// The maximum allowable versions of the TLS protocol, from tls_protocol_version_t get TLSMaximumSupportedProtocolVersion { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.TLSMaximumSupportedProtocolVersion', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_9jpwfb( this.ref.pointer, _sel_TLSMaximumSupportedProtocolVersion); return tls_protocol_version_t.fromValue(_ret); @@ -61091,34 +60983,58 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The maximum allowable versions of the TLS protocol, from set TLSMaximumSupportedProtocolVersion(tls_protocol_version_t value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setTLSMaximumSupportedProtocolVersion:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_1mvuct7(this.ref.pointer, _sel_setTLSMaximumSupportedProtocolVersion_, value.value); } /// Allow the use of HTTP pipelining bool get HTTPShouldUsePipelining { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPShouldUsePipelining', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); } /// Allow the use of HTTP pipelining set HTTPShouldUsePipelining(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setHTTPShouldUsePipelining:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); } /// Allow the session to set cookies on requests bool get HTTPShouldSetCookies { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPShouldSetCookies', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldSetCookies); } /// Allow the session to set cookies on requests set HTTPShouldSetCookies(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setHTTPShouldSetCookies:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setHTTPShouldSetCookies_, value); } /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. NSHTTPCookieAcceptPolicy get HTTPCookieAcceptPolicy { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPCookieAcceptPolicy', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_104dkoq(this.ref.pointer, _sel_HTTPCookieAcceptPolicy); return NSHTTPCookieAcceptPolicy.fromValue(_ret); @@ -61126,6 +61042,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. set HTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setHTTPCookieAcceptPolicy:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_3q55ys( this.ref.pointer, _sel_setHTTPCookieAcceptPolicy_, value.value); } @@ -61133,6 +61053,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Specifies additional headers which will be set on outgoing requests. /// Note that these headers are added to the request only if not already present. objc.NSDictionary? get HTTPAdditionalHeaders { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPAdditionalHeaders', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPAdditionalHeaders); return _ret.address == 0 @@ -61143,24 +61067,38 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Specifies additional headers which will be set on outgoing requests. /// Note that these headers are added to the request only if not already present. set HTTPAdditionalHeaders(objc.NSDictionary? value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setHTTPAdditionalHeaders:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setHTTPAdditionalHeaders_, value?.ref.pointer ?? ffi.nullptr); } /// The maximum number of simultaneous persistent connections per host DartNSInteger get HTTPMaximumConnectionsPerHost { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPMaximumConnectionsPerHost', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); return _objc_msgSend_1hz7y9r( this.ref.pointer, _sel_HTTPMaximumConnectionsPerHost); } /// The maximum number of simultaneous persistent connections per host set HTTPMaximumConnectionsPerHost(DartNSInteger value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setHTTPMaximumConnectionsPerHost:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_4sp4xj( this.ref.pointer, _sel_setHTTPMaximumConnectionsPerHost_, value); } /// The cookie storage object to use, or nil to indicate that no cookies should be handled NSHTTPCookieStorage? get HTTPCookieStorage { + objc.checkOsVersionInternal('NSURLSessionConfiguration.HTTPCookieStorage', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPCookieStorage); return _ret.address == 0 @@ -61171,12 +61109,20 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The cookie storage object to use, or nil to indicate that no cookies should be handled set HTTPCookieStorage(NSHTTPCookieStorage? value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setHTTPCookieStorage:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setHTTPCookieStorage_, value?.ref.pointer ?? ffi.nullptr); } /// The credential storage object, or nil to indicate that no credential storage is to be used NSURLCredentialStorage? get URLCredentialStorage { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.URLCredentialStorage', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URLCredentialStorage); return _ret.address == 0 @@ -61187,12 +61133,18 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The credential storage object, or nil to indicate that no credential storage is to be used set URLCredentialStorage(NSURLCredentialStorage? value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setURLCredentialStorage:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setURLCredentialStorage_, value?.ref.pointer ?? ffi.nullptr); } /// The URL resource cache, or nil to indicate that no caching is to be performed NSURLCache? get URLCache { + objc.checkOsVersionInternal('NSURLSessionConfiguration.URLCache', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URLCache); return _ret.address == 0 ? null @@ -61201,6 +61153,8 @@ class NSURLSessionConfiguration extends objc.NSObject { /// The URL resource cache, or nil to indicate that no caching is to be performed set URLCache(NSURLCache? value) { + objc.checkOsVersionInternal('NSURLSessionConfiguration.setURLCache:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7( this.ref.pointer, _sel_setURLCache_, value?.ref.pointer ?? ffi.nullptr); } @@ -61208,6 +61162,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) bool get shouldUseExtendedBackgroundIdleMode { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.shouldUseExtendedBackgroundIdleMode', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0))); return _objc_msgSend_91o635( this.ref.pointer, _sel_shouldUseExtendedBackgroundIdleMode); } @@ -61215,6 +61173,10 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) set shouldUseExtendedBackgroundIdleMode(bool value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setShouldUseExtendedBackgroundIdleMode:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0))); _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setShouldUseExtendedBackgroundIdleMode_, value); } @@ -61228,6 +61190,8 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Custom NSURLProtocol subclasses are not available to background /// sessions. objc.ObjCObjectBase? get protocolClasses { + objc.checkOsVersionInternal('NSURLSessionConfiguration.protocolClasses', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_protocolClasses); return _ret.address == 0 ? null @@ -61243,12 +61207,18 @@ class NSURLSessionConfiguration extends objc.NSObject { /// Custom NSURLProtocol subclasses are not available to background /// sessions. set protocolClasses(objc.ObjCObjectBase? value) { + objc.checkOsVersionInternal('NSURLSessionConfiguration.setProtocolClasses:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setProtocolClasses_, value?.ref.pointer ?? ffi.nullptr); } /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone NSURLSessionMultipathServiceType get multipathServiceType { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.multipathServiceType', + iOS: (false, (11, 0, 0)), + macOS: (true, null)); final _ret = _objc_msgSend_1wxwnc0(this.ref.pointer, _sel_multipathServiceType); return NSURLSessionMultipathServiceType.fromValue(_ret); @@ -61256,12 +61226,18 @@ class NSURLSessionConfiguration extends objc.NSObject { /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone set multipathServiceType(NSURLSessionMultipathServiceType value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setMultipathServiceType:', + iOS: (false, (11, 0, 0)), + macOS: (true, null)); _objc_msgSend_1hx005a( this.ref.pointer, _sel_setMultipathServiceType_, value.value); } /// init NSURLSessionConfiguration init() { + objc.checkOsVersionInternal('NSURLSessionConfiguration.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLSessionConfiguration.castFromPointer(_ret, @@ -61269,7 +61245,7 @@ class NSURLSessionConfiguration extends objc.NSObject { } /// new - static NSURLSessionConfiguration new1() { + static NSURLSessionConfiguration new$() { final _ret = _objc_msgSend_151sglz(_class_NSURLSessionConfiguration, _sel_new); return NSURLSessionConfiguration.castFromPointer(_ret, @@ -61277,7 +61253,8 @@ class NSURLSessionConfiguration extends objc.NSObject { } /// allocWithZone: - static NSURLSessionConfiguration allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSURLSessionConfiguration allocWithZone_( + ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428( _class_NSURLSessionConfiguration, _sel_allocWithZone_, zone); return NSURLSessionConfiguration.castFromPointer(_ret, @@ -61293,7 +61270,7 @@ class NSURLSessionConfiguration extends objc.NSObject { } /// self - NSURLSessionConfiguration self() { + NSURLSessionConfiguration self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSURLSessionConfiguration.castFromPointer(_ret, retain: true, release: true); @@ -61312,24 +61289,52 @@ class NSURLSessionConfiguration extends objc.NSObject { return NSURLSessionConfiguration.castFromPointer(_ret, retain: true, release: true); } + + /// Returns a new instance of NSURLSessionConfiguration constructed with the default `new` method. + factory NSURLSessionConfiguration() => new$(); } late final _sel_sessionWithConfiguration_ = objc.registerName("sessionWithConfiguration:"); + +/// WARNING: NSURLSessionDelegate is a stub. To generate bindings for this class, include +/// NSURLSessionDelegate in your config's objc-protocols list. +/// +/// Messages related to the URL session as a whole +interface class NSURLSessionDelegate extends objc.ObjCProtocolBase + implements objc.NSObjectProtocol { + NSURLSessionDelegate._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionDelegate] that points to the same underlying object as [other]. + NSURLSessionDelegate.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionDelegate] that wraps the given raw object pointer. + NSURLSessionDelegate.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + late final _class_NSOperationQueue = objc.getClass("NSOperationQueue"); late final _sel_operations = objc.registerName("operations"); late final _sel_operationCount = objc.registerName("operationCount"); /// NSDeprecated -extension NSDeprecated1 on NSOperationQueue { +extension NSDeprecated$1 on NSOperationQueue { /// These two functions are inherently a race condition and should be avoided if possible objc.NSArray get operations { + objc.checkOsVersionInternal('NSOperationQueue.operations', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_operations); return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } /// operationCount DartNSUInteger get operationCount { + objc.checkOsVersionInternal('NSOperationQueue.operationCount', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_operationCount); } } @@ -61341,7 +61346,10 @@ extension NSDeprecated1 on NSOperationQueue { class NSOperation extends objc.NSObject { NSOperation._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSOperation', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); + } /// Constructs a [NSOperation] that points to the same underlying object as [other]. NSOperation.castFrom(objc.ObjCObjectBase other) @@ -61400,29 +61408,6 @@ final _objc_msgSend_n2da1l = objc.msgSendPointer .asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); - -/// ! -/// @typedef dispatch_queue_t -/// -/// @abstract -/// Dispatch queues invoke workitems submitted to them. -/// -/// @discussion -/// Dispatch queues come in many flavors, the most common one being the dispatch -/// serial queue (See dispatch_queue_serial_t). -/// -/// The system manages a pool of threads which process dispatch queues and invoke -/// workitems submitted to them. -/// -/// Conceptually a dispatch queue may have its own thread of execution, and -/// interaction between queues is highly asynchronous. -/// -/// Dispatch queues are reference counted via calls to dispatch_retain() and -/// dispatch_release(). Pending workitems submitted to a queue also hold a -/// reference to the queue until they have finished. Once all references to a -/// queue have been released, the queue will be deallocated by the system. -typedef dispatch_queue_t1 = ffi.Pointer; -typedef Dartdispatch_queue_t1 = objc.NSObject; late final _sel_underlyingQueue = objc.registerName("underlyingQueue"); late final _sel_setUnderlyingQueue_ = objc.registerName("setUnderlyingQueue:"); late final _sel_cancelAllOperations = objc.registerName("cancelAllOperations"); @@ -61432,7 +61417,7 @@ late final _sel_currentQueue = objc.registerName("currentQueue"); late final _sel_mainQueue = objc.registerName("mainQueue"); /// NSOperationQueue -class NSOperationQueue extends objc.NSObject { +class NSOperationQueue extends objc.NSObject implements NSProgressReporting { NSOperationQueue._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); @@ -61460,17 +61445,25 @@ class NSOperationQueue extends objc.NSObject { /// addOperation: void addOperation_(NSOperation op) { + objc.checkOsVersionInternal('NSOperationQueue.addOperation:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_addOperation_, op.ref.pointer); } /// addOperations:waitUntilFinished: void addOperations_waitUntilFinished_(objc.NSArray ops, bool wait) { + objc.checkOsVersionInternal( + 'NSOperationQueue.addOperations:waitUntilFinished:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0))); _objc_msgSend_6p7ndb(this.ref.pointer, _sel_addOperations_waitUntilFinished_, ops.ref.pointer, wait); } /// addOperationWithBlock: void addOperationWithBlock_(objc.ObjCBlock block) { + objc.checkOsVersionInternal('NSOperationQueue.addOperationWithBlock:', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); _objc_msgSend_f167m6( this.ref.pointer, _sel_addOperationWithBlock_, block.ref.pointer); } @@ -61481,34 +61474,48 @@ class NSOperationQueue extends objc.NSObject { /// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the /// `dispatch_barrier_async` function. void addBarrierBlock_(objc.ObjCBlock barrier) { + objc.checkOsVersionInternal('NSOperationQueue.addBarrierBlock:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); _objc_msgSend_f167m6( this.ref.pointer, _sel_addBarrierBlock_, barrier.ref.pointer); } /// maxConcurrentOperationCount DartNSInteger get maxConcurrentOperationCount { + objc.checkOsVersionInternal('NSOperationQueue.maxConcurrentOperationCount', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); return _objc_msgSend_1hz7y9r( this.ref.pointer, _sel_maxConcurrentOperationCount); } /// setMaxConcurrentOperationCount: set maxConcurrentOperationCount(DartNSInteger value) { + objc.checkOsVersionInternal( + 'NSOperationQueue.setMaxConcurrentOperationCount:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0))); _objc_msgSend_4sp4xj( this.ref.pointer, _sel_setMaxConcurrentOperationCount_, value); } /// isSuspended bool get suspended { + objc.checkOsVersionInternal('NSOperationQueue.isSuspended', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); return _objc_msgSend_91o635(this.ref.pointer, _sel_isSuspended); } /// setSuspended: set suspended(bool value) { + objc.checkOsVersionInternal('NSOperationQueue.setSuspended:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); _objc_msgSend_1s56lr9(this.ref.pointer, _sel_setSuspended_, value); } /// name objc.NSString? get name { + objc.checkOsVersionInternal('NSOperationQueue.name', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_name); return _ret.address == 0 ? null @@ -61517,24 +61524,32 @@ class NSOperationQueue extends objc.NSObject { /// setName: set name(objc.NSString? value) { + objc.checkOsVersionInternal('NSOperationQueue.setName:', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); _objc_msgSend_xtuoz7( this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); } /// qualityOfService NSQualityOfService get qualityOfService { + objc.checkOsVersionInternal('NSOperationQueue.qualityOfService', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); final _ret = _objc_msgSend_oi8iq9(this.ref.pointer, _sel_qualityOfService); return NSQualityOfService.fromValue(_ret); } /// setQualityOfService: set qualityOfService(NSQualityOfService value) { + objc.checkOsVersionInternal('NSOperationQueue.setQualityOfService:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_n2da1l( this.ref.pointer, _sel_setQualityOfService_, value.value); } /// actually retain - Dartdispatch_queue_t1? get underlyingQueue { + Dartdispatch_queue_t? get underlyingQueue { + objc.checkOsVersionInternal('NSOperationQueue.underlyingQueue', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_underlyingQueue); return _ret.address == 0 ? null @@ -61542,24 +61557,34 @@ class NSOperationQueue extends objc.NSObject { } /// actually retain - set underlyingQueue(Dartdispatch_queue_t1? value) { + set underlyingQueue(Dartdispatch_queue_t? value) { + objc.checkOsVersionInternal('NSOperationQueue.setUnderlyingQueue:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setUnderlyingQueue_, value?.ref.pointer ?? ffi.nullptr); } /// cancelAllOperations void cancelAllOperations() { + objc.checkOsVersionInternal('NSOperationQueue.cancelAllOperations', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancelAllOperations); } /// waitUntilAllOperationsAreFinished void waitUntilAllOperationsAreFinished() { + objc.checkOsVersionInternal( + 'NSOperationQueue.waitUntilAllOperationsAreFinished', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0))); _objc_msgSend_1pl9qdv( this.ref.pointer, _sel_waitUntilAllOperationsAreFinished); } /// currentQueue static NSOperationQueue? getCurrentQueue() { + objc.checkOsVersionInternal('NSOperationQueue.currentQueue', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_currentQueue); return _ret.address == 0 @@ -61569,25 +61594,29 @@ class NSOperationQueue extends objc.NSObject { /// mainQueue static NSOperationQueue getMainQueue() { + objc.checkOsVersionInternal('NSOperationQueue.mainQueue', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_mainQueue); return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } /// init NSOperationQueue init() { + objc.checkOsVersionInternal('NSOperationQueue.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); } /// new - static NSOperationQueue new1() { + static NSOperationQueue new$() { final _ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_new); return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSOperationQueue allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSOperationQueue allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428( _class_NSOperationQueue, _sel_allocWithZone_, zone); return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); @@ -61600,7 +61629,7 @@ class NSOperationQueue extends objc.NSObject { } /// self - NSOperationQueue self() { + NSOperationQueue self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } @@ -61616,6 +61645,9 @@ class NSOperationQueue extends objc.NSObject { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } + + /// Returns a new instance of NSOperationQueue constructed with the default `new` method. + factory NSOperationQueue() => new$(); } late final _sel_sessionWithConfiguration_delegate_delegateQueue_ = @@ -61800,16 +61832,20 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer, ffi.Pointer)> - fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, ffi.Pointer, ffi.Pointer)> + fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( objc.ObjCObjectBase(arg0, retain: true, release: true), objc.ObjCObjectBase(arg1, retain: true, release: true), - objc.ObjCObjectBase(arg2, retain: true, release: true))), + objc.ObjCObjectBase(arg2, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -61820,14 +61856,15 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)> listener( void Function( objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerCallable .nativeFunction @@ -61837,7 +61874,8 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj fn( objc.ObjCObjectBase(arg0, retain: false, release: true), objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.ObjCObjectBase(arg2, retain: false, release: true))); + objc.ObjCObjectBase(arg2, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -61854,15 +61892,17 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)> blocking( void Function( objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_blockingCallable .nativeFunction @@ -61872,7 +61912,8 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj fn( objc.ObjCObjectBase(arg0, retain: false, release: true), objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.ObjCObjectBase(arg2, retain: false, release: true))); + objc.ObjCObjectBase(arg2, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_blockingListenerCallable .nativeFunction @@ -61882,9 +61923,10 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj fn( objc.ObjCObjectBase(arg0, retain: false, release: true), objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.ObjCObjectBase(arg2, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7, raw, rawListener); + objc.ObjCObjectBase(arg2, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -61922,7 +61964,7 @@ extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_CallExt late final _sel_getTasksWithCompletionHandler_ = objc.registerName("getTasksWithCompletionHandler:"); -void _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrTrampoline( +void _ObjCBlock_ffiVoid_objcObjCObject$1_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => block.ref.target @@ -61930,24 +61972,24 @@ void _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrTrampoline( ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>>() .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrCallable = +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject$1_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrTrampoline) + _ObjCBlock_ffiVoid_objcObjCObject$1_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject1_closureTrampoline( +void _ObjCBlock_ffiVoid_objcObjCObject$1_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0) => (objc.getBlockClosure(block) as void Function( ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject1_closureCallable = +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject$1_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject1_closureTrampoline) + _ObjCBlock_ffiVoid_objcObjCObject$1_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject1_listenerTrampoline( +void _ObjCBlock_ffiVoid_objcObjCObject$1_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0) { (objc.getBlockClosure(block) as void Function( ffi.Pointer))(arg0); @@ -61957,12 +61999,12 @@ void _ObjCBlock_ffiVoid_objcObjCObject1_listenerTrampoline( ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject1_listenerCallable = ffi.NativeCallable< + _ObjCBlock_ffiVoid_objcObjCObject$1_listenerCallable = ffi.NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject1_listenerTrampoline) + _ObjCBlock_ffiVoid_objcObjCObject$1_listenerTrampoline) ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_objcObjCObject1_blockingTrampoline( +void _ObjCBlock_ffiVoid_objcObjCObject$1_blockingTrampoline( ffi.Pointer block, ffi.Pointer waiter, ffi.Pointer arg0) { @@ -61979,25 +62021,25 @@ void _ObjCBlock_ffiVoid_objcObjCObject1_blockingTrampoline( ffi.NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject1_blockingCallable = ffi.NativeCallable< + _ObjCBlock_ffiVoid_objcObjCObject$1_blockingCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_objcObjCObject1_blockingTrampoline) + _ObjCBlock_ffiVoid_objcObjCObject$1_blockingTrampoline) ..keepIsolateAlive = false; ffi.NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject1_blockingListenerCallable = ffi + _ObjCBlock_ffiVoid_objcObjCObject$1_blockingListenerCallable = ffi .NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject1_blockingTrampoline) + _ObjCBlock_ffiVoid_objcObjCObject$1_blockingTrampoline) ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject1 { +abstract final class ObjCBlock_ffiVoid_objcObjCObject$1 { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, @@ -62019,7 +62061,7 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject1 { ptr) => objc.ObjCBlock)>( objc.newPointerBlock( - _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrCallable, ptr.cast()), + _ObjCBlock_ffiVoid_objcObjCObject$1_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -62028,13 +62070,18 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject1 { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - fromFunction(void Function(objc.ObjCObjectBase) fn) => + fromFunction(void Function(objc.ObjCObjectBase) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject1_closureCallable, + _ObjCBlock_ffiVoid_objcObjCObject$1_closureCallable, (ffi.Pointer arg0) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true))), + objc.ObjCObjectBase(arg0, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -62045,15 +62092,17 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject1 { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - listener(void Function(objc.ObjCObjectBase) fn) { + listener(void Function(objc.ObjCObjectBase) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject1_listenerCallable.nativeFunction + _ObjCBlock_ffiVoid_objcObjCObject$1_listenerCallable.nativeFunction .cast(), (ffi.Pointer arg0) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true))); + fn(objc.ObjCObjectBase(arg0, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock)>( @@ -62068,24 +62117,28 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject1 { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock)> - blocking(void Function(objc.ObjCObjectBase) fn) { + blocking(void Function(objc.ObjCObjectBase) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject1_blockingCallable.nativeFunction + _ObjCBlock_ffiVoid_objcObjCObject$1_blockingCallable.nativeFunction .cast(), (ffi.Pointer arg0) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true))); + fn(objc.ObjCObjectBase(arg0, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject1_blockingListenerCallable + _ObjCBlock_ffiVoid_objcObjCObject$1_blockingListenerCallable .nativeFunction .cast(), (ffi.Pointer arg0) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + fn(objc.ObjCObjectBase(arg0, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock)>( @@ -62096,7 +62149,7 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject1 { } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_objcObjCObject1_CallExtension +extension ObjCBlock_ffiVoid_objcObjCObject$1_CallExtension on objc.ObjCBlock)> { void call(objc.ObjCObjectBase arg0) => ref.pointer.ref.invoke .cast< @@ -62154,7 +62207,10 @@ late final _sel_downloadTaskWithResumeData_ = class NSURLSessionStreamTask extends NSURLSessionTask { NSURLSessionStreamTask._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionStreamTask', + iOS: (false, (9, 0, 0)), macOS: (false, (10, 11, 0))); + } /// Constructs a [NSURLSessionStreamTask] that points to the same underlying object as [other]. NSURLSessionStreamTask.castFrom(objc.ObjCObjectBase other) @@ -62223,7 +62279,7 @@ enum NSURLSessionWebSocketMessageType { 0 => NSURLSessionWebSocketMessageTypeData, 1 => NSURLSessionWebSocketMessageTypeString, _ => throw ArgumentError( - "Unknown value for NSURLSessionWebSocketMessageType: $value"), + 'Unknown value for NSURLSessionWebSocketMessageType: $value'), }; } @@ -62245,7 +62301,10 @@ late final _sel_string = objc.registerName("string"); class NSURLSessionWebSocketMessage extends objc.NSObject { NSURLSessionWebSocketMessage._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionWebSocketMessage', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); + } /// Constructs a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. NSURLSessionWebSocketMessage.castFrom(objc.ObjCObjectBase other) @@ -62266,6 +62325,8 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { /// Create a message with data type NSURLSessionWebSocketMessage initWithData_(objc.NSData data) { + objc.checkOsVersionInternal('NSURLSessionWebSocketMessage.initWithData:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), _sel_initWithData_, data.ref.pointer); return NSURLSessionWebSocketMessage.castFromPointer(_ret, @@ -62274,6 +62335,8 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { /// Create a message with string type NSURLSessionWebSocketMessage initWithString_(objc.NSString string) { + objc.checkOsVersionInternal('NSURLSessionWebSocketMessage.initWithString:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), _sel_initWithString_, string.ref.pointer); return NSURLSessionWebSocketMessage.castFromPointer(_ret, @@ -62282,12 +62345,16 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { /// type NSURLSessionWebSocketMessageType get type { + objc.checkOsVersionInternal('NSURLSessionWebSocketMessage.type', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1qouven(this.ref.pointer, _sel_type); return NSURLSessionWebSocketMessageType.fromValue(_ret); } /// data objc.NSData? get data { + objc.checkOsVersionInternal('NSURLSessionWebSocketMessage.data', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_data); return _ret.address == 0 ? null @@ -62296,6 +62363,8 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { /// string objc.NSString? get string { + objc.checkOsVersionInternal('NSURLSessionWebSocketMessage.string', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_string); return _ret.address == 0 ? null @@ -62304,6 +62373,8 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { /// init NSURLSessionWebSocketMessage init() { + objc.checkOsVersionInternal('NSURLSessionWebSocketMessage.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLSessionWebSocketMessage.castFromPointer(_ret, @@ -62311,7 +62382,7 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { } /// new - static NSURLSessionWebSocketMessage new1() { + static NSURLSessionWebSocketMessage new$() { final _ret = _objc_msgSend_151sglz(_class_NSURLSessionWebSocketMessage, _sel_new); return NSURLSessionWebSocketMessage.castFromPointer(_ret, @@ -62320,7 +62391,7 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { /// allocWithZone: static NSURLSessionWebSocketMessage allocWithZone_( - ffi.Pointer<_NSZone> zone) { + ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428( _class_NSURLSessionWebSocketMessage, _sel_allocWithZone_, zone); return NSURLSessionWebSocketMessage.castFromPointer(_ret, @@ -62336,7 +62407,7 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { } /// self - NSURLSessionWebSocketMessage self() { + NSURLSessionWebSocketMessage self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSURLSessionWebSocketMessage.castFromPointer(_ret, retain: true, release: true); @@ -62355,6 +62426,9 @@ class NSURLSessionWebSocketMessage extends objc.NSObject { return NSURLSessionWebSocketMessage.castFromPointer(_ret, retain: true, release: true); } + + /// Returns a new instance of NSURLSessionWebSocketMessage constructed with the default `new` method. + factory NSURLSessionWebSocketMessage() => new$(); } void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( @@ -62461,15 +62535,20 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(objc.NSError?) fn) => + void Function(objc.NSError?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSError_closureCallable, (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : objc.NSError.castFromPointer(arg0, - retain: true, release: true))), + retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -62480,16 +62559,17 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(objc.NSError?) fn) { + void Function(objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSError_listenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, - retain: false, release: true))); + : objc.NSError.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -62502,26 +62582,28 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(objc.NSError?) fn) { + void Function(objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSError_blockingCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, - retain: false, release: true))); + : objc.NSError.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSError_blockingListenerCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + : objc.NSError.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -62679,8 +62761,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) => + void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable, @@ -62688,7 +62774,8 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { arg0.address == 0 ? null : NSURLSessionWebSocketMessage.castFromPointer(arg0, retain: true, release: true), - arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -62699,11 +62786,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> - listener(void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) { + listener(void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable .nativeFunction @@ -62718,7 +62806,8 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -62732,12 +62821,14 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> - blocking(void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) { + blocking(void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingCallable .nativeFunction @@ -62752,7 +62843,8 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingListenerCallable .nativeFunction @@ -62767,9 +62859,10 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -62861,7 +62954,10 @@ late final _sel_closeReason = objc.registerName("closeReason"); class NSURLSessionWebSocketTask extends NSURLSessionTask { NSURLSessionWebSocketTask._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionWebSocketTask', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); + } /// Constructs a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. NSURLSessionWebSocketTask.castFrom(objc.ObjCObjectBase other) @@ -62884,6 +62980,10 @@ class NSURLSessionWebSocketTask extends NSURLSessionTask { /// that they have been written to the kernel. void sendMessage_completionHandler_(NSURLSessionWebSocketMessage message, objc.ObjCBlock completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.sendMessage:completionHandler:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_o762yo(this.ref.pointer, _sel_sendMessage_completionHandler_, message.ref.pointer, completionHandler.ref.pointer); } @@ -62895,6 +62995,10 @@ class NSURLSessionWebSocketTask extends NSURLSessionTask { objc.ObjCBlock< ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.receiveMessageWithCompletionHandler:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_f167m6( this.ref.pointer, _sel_receiveMessageWithCompletionHandler_, @@ -62907,6 +63011,10 @@ class NSURLSessionWebSocketTask extends NSURLSessionTask { /// Note - the pongReceiveHandler will always be called in the order in which the pings were sent. void sendPingWithPongReceiveHandler_( objc.ObjCBlock pongReceiveHandler) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.sendPingWithPongReceiveHandler:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_f167m6(this.ref.pointer, _sel_sendPingWithPongReceiveHandler_, pongReceiveHandler.ref.pointer); } @@ -62915,27 +63023,41 @@ class NSURLSessionWebSocketTask extends NSURLSessionTask { /// Simply calling cancel on the task will result in a cancellation frame being sent without any reason. void cancelWithCloseCode_reason_( DartNSInteger closeCode, objc.NSData? reason) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.cancelWithCloseCode:reason:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_tqzk0b(this.ref.pointer, _sel_cancelWithCloseCode_reason_, closeCode, reason?.ref.pointer ?? ffi.nullptr); } /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached DartNSInteger get maximumMessageSize { + objc.checkOsVersionInternal('NSURLSessionWebSocketTask.maximumMessageSize', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_maximumMessageSize); } /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached set maximumMessageSize(DartNSInteger value) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.setMaximumMessageSize:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); _objc_msgSend_4sp4xj(this.ref.pointer, _sel_setMaximumMessageSize_, value); } /// A task can be queried for it's close code at any point. When the task is not closed, it will be set to NSURLSessionWebSocketCloseCodeInvalid DartNSInteger get closeCode { + objc.checkOsVersionInternal('NSURLSessionWebSocketTask.closeCode', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); return _objc_msgSend_1rhk8uh(this.ref.pointer, _sel_closeCode); } /// A task can be queried for it's close reason at any point. A nil value indicates no closeReason or that the task is still running objc.NSData? get closeReason { + objc.checkOsVersionInternal('NSURLSessionWebSocketTask.closeReason', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_closeReason); return _ret.address == 0 ? null @@ -62944,6 +63066,8 @@ class NSURLSessionWebSocketTask extends NSURLSessionTask { /// init NSURLSessionWebSocketTask init() { + objc.checkOsVersionInternal('NSURLSessionWebSocketTask.init', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLSessionWebSocketTask.castFromPointer(_ret, @@ -62951,49 +63075,17 @@ class NSURLSessionWebSocketTask extends NSURLSessionTask { } /// new - static NSURLSessionWebSocketTask new1() { + static NSURLSessionWebSocketTask new$() { + objc.checkOsVersionInternal('NSURLSessionWebSocketTask.new', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(_class_NSURLSessionWebSocketTask, _sel_new); return NSURLSessionWebSocketTask.castFromPointer(_ret, retain: false, release: true); } - /// allocWithZone: - static NSURLSessionWebSocketTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLSessionWebSocketTask, _sel_allocWithZone_, zone); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSURLSessionWebSocketTask alloc() { - final _ret = - _objc_msgSend_151sglz(_class_NSURLSessionWebSocketTask, _sel_alloc); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// self - NSURLSessionWebSocketTask self() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: true, release: true); - } - - /// retain - NSURLSessionWebSocketTask retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: true, release: true); - } - - /// autorelease - NSURLSessionWebSocketTask autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: true, release: true); - } + /// Returns a new instance of NSURLSessionWebSocketTask constructed with the default `new` method. + factory NSURLSessionWebSocketTask() => new$(); } late final _sel_webSocketTaskWithURL_ = @@ -63065,7 +63157,10 @@ late final _sel_webSocketTaskWithRequest_ = class NSURLSession extends objc.NSObject { NSURLSession._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSession', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); + } /// Constructs a [NSURLSession] that points to the same underlying object as [other]. NSURLSession.castFrom(objc.ObjCObjectBase other) @@ -63085,6 +63180,8 @@ class NSURLSession extends objc.NSObject { /// The shared session uses the currently set global NSURLCache, /// NSHTTPCookieStorage and NSURLCredentialStorage objects. static NSURLSession getSharedSession() { + objc.checkOsVersionInternal('NSURLSession.sharedSession', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_sharedSession); return NSURLSession.castFromPointer(_ret, retain: true, release: true); } @@ -63096,6 +63193,8 @@ class NSURLSession extends objc.NSObject { /// the delegate has been sent the URLSession:didBecomeInvalidWithError: message. static NSURLSession sessionWithConfiguration_( NSURLSessionConfiguration configuration) { + objc.checkOsVersionInternal('NSURLSession.sessionWithConfiguration:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r(_class_NSURLSession, _sel_sessionWithConfiguration_, configuration.ref.pointer); return NSURLSession.castFromPointer(_ret, retain: true, release: true); @@ -63104,8 +63203,12 @@ class NSURLSession extends objc.NSObject { /// sessionWithConfiguration:delegate:delegateQueue: static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( NSURLSessionConfiguration configuration, - objc.ObjCObjectBase? delegate, + NSURLSessionDelegate? delegate, NSOperationQueue? queue) { + objc.checkOsVersionInternal( + 'NSURLSession.sessionWithConfiguration:delegate:delegateQueue:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_11spmsz( _class_NSURLSession, _sel_sessionWithConfiguration_delegate_delegateQueue_, @@ -63117,20 +63220,27 @@ class NSURLSession extends objc.NSObject { /// delegateQueue NSOperationQueue get delegateQueue { + objc.checkOsVersionInternal('NSURLSession.delegateQueue', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_delegateQueue); return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } /// delegate - objc.ObjCObjectBase? get delegate { + NSURLSessionDelegate? get delegate { + objc.checkOsVersionInternal('NSURLSession.delegate', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_delegate); return _ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : NSURLSessionDelegate.castFromPointer(_ret, + retain: true, release: true); } /// configuration NSURLSessionConfiguration get configuration { + objc.checkOsVersionInternal('NSURLSession.configuration', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_configuration); return NSURLSessionConfiguration.castFromPointer(_ret, retain: true, release: true); @@ -63139,6 +63249,8 @@ class NSURLSession extends objc.NSObject { /// The sessionDescription property is available for the developer to /// provide a descriptive label for the session. objc.NSString? get sessionDescription { + objc.checkOsVersionInternal('NSURLSession.sessionDescription', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_sessionDescription); return _ret.address == 0 @@ -63149,6 +63261,8 @@ class NSURLSession extends objc.NSObject { /// The sessionDescription property is available for the developer to /// provide a descriptive label for the session. set sessionDescription(objc.NSString? value) { + objc.checkOsVersionInternal('NSURLSession.setSessionDescription:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setSessionDescription_, value?.ref.pointer ?? ffi.nullptr); } @@ -63165,6 +63279,8 @@ class NSURLSession extends objc.NSObject { /// session with the same identifier until URLSession:didBecomeInvalidWithError: has /// been issued. void finishTasksAndInvalidate() { + objc.checkOsVersionInternal('NSURLSession.finishTasksAndInvalidate', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_finishTasksAndInvalidate); } @@ -63173,12 +63289,16 @@ class NSURLSession extends objc.NSObject { /// cancellation is subject to the state of the task, and some tasks may /// have already have completed at the time they are sent -cancel. void invalidateAndCancel() { + objc.checkOsVersionInternal('NSURLSession.invalidateAndCancel', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_invalidateAndCancel); } /// empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue. void resetWithCompletionHandler_( objc.ObjCBlock completionHandler) { + objc.checkOsVersionInternal('NSURLSession.resetWithCompletionHandler:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_f167m6(this.ref.pointer, _sel_resetWithCompletionHandler_, completionHandler.ref.pointer); } @@ -63186,6 +63306,8 @@ class NSURLSession extends objc.NSObject { /// flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue. void flushWithCompletionHandler_( objc.ObjCBlock completionHandler) { + objc.checkOsVersionInternal('NSURLSession.flushWithCompletionHandler:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_f167m6(this.ref.pointer, _sel_flushWithCompletionHandler_, completionHandler.ref.pointer); } @@ -63196,6 +63318,8 @@ class NSURLSession extends objc.NSObject { ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)> completionHandler) { + objc.checkOsVersionInternal('NSURLSession.getTasksWithCompletionHandler:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); _objc_msgSend_f167m6(this.ref.pointer, _sel_getTasksWithCompletionHandler_, completionHandler.ref.pointer); } @@ -63204,12 +63328,18 @@ class NSURLSession extends objc.NSObject { void getAllTasksWithCompletionHandler_( objc.ObjCBlock)> completionHandler) { + objc.checkOsVersionInternal( + 'NSURLSession.getAllTasksWithCompletionHandler:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0))); _objc_msgSend_f167m6(this.ref.pointer, _sel_getAllTasksWithCompletionHandler_, completionHandler.ref.pointer); } /// Creates a data task with the given request. The request may have a body stream. NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest request) { + objc.checkOsVersionInternal('NSURLSession.dataTaskWithRequest:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_dataTaskWithRequest_, request.ref.pointer); return NSURLSessionDataTask.castFromPointer(_ret, @@ -63218,6 +63348,8 @@ class NSURLSession extends objc.NSObject { /// Creates a data task to retrieve the contents of the given URL. NSURLSessionDataTask dataTaskWithURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSURLSession.dataTaskWithURL:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_dataTaskWithURL_, url.ref.pointer); return NSURLSessionDataTask.castFromPointer(_ret, @@ -63227,6 +63359,8 @@ class NSURLSession extends objc.NSObject { /// Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( NSURLRequest request, objc.NSURL fileURL) { + objc.checkOsVersionInternal('NSURLSession.uploadTaskWithRequest:fromFile:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_15qeuct( this.ref.pointer, _sel_uploadTaskWithRequest_fromFile_, @@ -63239,6 +63373,8 @@ class NSURLSession extends objc.NSObject { /// Creates an upload task with the given request. The body of the request is provided from the bodyData. NSURLSessionUploadTask uploadTaskWithRequest_fromData_( NSURLRequest request, objc.NSData bodyData) { + objc.checkOsVersionInternal('NSURLSession.uploadTaskWithRequest:fromData:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_15qeuct( this.ref.pointer, _sel_uploadTaskWithRequest_fromData_, @@ -63257,6 +63393,8 @@ class NSURLSession extends objc.NSObject { /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. /// - Returns: A new session upload task, or nil if the resumeData is invalid. NSURLSessionUploadTask uploadTaskWithResumeData_(objc.NSData resumeData) { + objc.checkOsVersionInternal('NSURLSession.uploadTaskWithResumeData:', + iOS: (false, (17, 0, 0)), macOS: (false, (14, 0, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, _sel_uploadTaskWithResumeData_, resumeData.ref.pointer); return NSURLSessionUploadTask.castFromPointer(_ret, @@ -63265,6 +63403,8 @@ class NSURLSession extends objc.NSObject { /// Creates an upload task with the given request. The previously set body stream of the request (if any) is ignored and the URLSession:task:needNewBodyStream: delegate will be called when the body payload is required. NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest request) { + objc.checkOsVersionInternal('NSURLSession.uploadTaskWithStreamedRequest:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, _sel_uploadTaskWithStreamedRequest_, request.ref.pointer); return NSURLSessionUploadTask.castFromPointer(_ret, @@ -63273,6 +63413,8 @@ class NSURLSession extends objc.NSObject { /// Creates a download task with the given request. NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest request) { + objc.checkOsVersionInternal('NSURLSession.downloadTaskWithRequest:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_downloadTaskWithRequest_, request.ref.pointer); return NSURLSessionDownloadTask.castFromPointer(_ret, @@ -63281,6 +63423,8 @@ class NSURLSession extends objc.NSObject { /// Creates a download task to download the contents of the given URL. NSURLSessionDownloadTask downloadTaskWithURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSURLSession.downloadTaskWithURL:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_downloadTaskWithURL_, url.ref.pointer); return NSURLSessionDownloadTask.castFromPointer(_ret, @@ -63289,6 +63433,8 @@ class NSURLSession extends objc.NSObject { /// Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called. NSURLSessionDownloadTask downloadTaskWithResumeData_(objc.NSData resumeData) { + objc.checkOsVersionInternal('NSURLSession.downloadTaskWithResumeData:', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, _sel_downloadTaskWithResumeData_, resumeData.ref.pointer); return NSURLSessionDownloadTask.castFromPointer(_ret, @@ -63298,6 +63444,8 @@ class NSURLSession extends objc.NSObject { /// Creates a bidirectional stream task to a given host and port. NSURLSessionStreamTask streamTaskWithHostName_port_( objc.NSString hostname, DartNSInteger port) { + objc.checkOsVersionInternal('NSURLSession.streamTaskWithHostName:port:', + iOS: (false, (9, 0, 0)), macOS: (false, (10, 11, 0))); final _ret = _objc_msgSend_9slupp(this.ref.pointer, _sel_streamTaskWithHostName_port_, hostname.ref.pointer, port); return NSURLSessionStreamTask.castFromPointer(_ret, @@ -63307,6 +63455,8 @@ class NSURLSession extends objc.NSObject { /// Creates a bidirectional stream task with an NSNetService to identify the endpoint. /// The NSNetService will be resolved before any IO completes. NSURLSessionStreamTask streamTaskWithNetService_(NSNetService service) { + objc.checkOsVersionInternal('NSURLSession.streamTaskWithNetService:', + iOS: (false, (9, 0, 0)), macOS: (false, (10, 11, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_streamTaskWithNetService_, service.ref.pointer); return NSURLSessionStreamTask.castFromPointer(_ret, @@ -63315,6 +63465,8 @@ class NSURLSession extends objc.NSObject { /// Creates a WebSocket task given the url. The given url must have a ws or wss scheme. NSURLSessionWebSocketTask webSocketTaskWithURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSURLSession.webSocketTaskWithURL:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_webSocketTaskWithURL_, url.ref.pointer); return NSURLSessionWebSocketTask.castFromPointer(_ret, @@ -63326,6 +63478,8 @@ class NSURLSession extends objc.NSObject { /// Note - The protocol will not affect the WebSocket framing. More details on the protocol can be found by reading the WebSocket RFC NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( objc.NSURL url, objc.ObjCObjectBase protocols) { + objc.checkOsVersionInternal('NSURLSession.webSocketTaskWithURL:protocols:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_15qeuct( this.ref.pointer, _sel_webSocketTaskWithURL_protocols_, @@ -63339,6 +63493,8 @@ class NSURLSession extends objc.NSObject { /// Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol /// and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server. NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest request) { + objc.checkOsVersionInternal('NSURLSession.webSocketTaskWithRequest:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_webSocketTaskWithRequest_, request.ref.pointer); return NSURLSessionWebSocketTask.castFromPointer(_ret, @@ -63347,19 +63503,21 @@ class NSURLSession extends objc.NSObject { /// init NSURLSession init() { + objc.checkOsVersionInternal('NSURLSession.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSURLSession.castFromPointer(_ret, retain: false, release: true); } /// new - static NSURLSession new1() { + static NSURLSession new$() { final _ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_new); return NSURLSession.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSURLSession allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSURLSession allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428(_class_NSURLSession, _sel_allocWithZone_, zone); return NSURLSession.castFromPointer(_ret, retain: false, release: true); @@ -63372,7 +63530,7 @@ class NSURLSession extends objc.NSObject { } /// self - NSURLSession self() { + NSURLSession self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSURLSession.castFromPointer(_ret, retain: true, release: true); } @@ -63388,6 +63546,9 @@ class NSURLSession extends objc.NSObject { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); return NSURLSession.castFromPointer(_ret, retain: true, release: true); } + + /// Returns a new instance of NSURLSession constructed with the default `new` method. + factory NSURLSession() => new$(); } /// Disposition options for various delegate messages @@ -63410,7 +63571,7 @@ enum NSURLSessionDelayedRequestDisposition { 1 => NSURLSessionDelayedRequestUseNewRequest, 2 => NSURLSessionDelayedRequestCancel, _ => throw ArgumentError( - "Unknown value for NSURLSessionDelayedRequestDisposition: $value"), + 'Unknown value for NSURLSessionDelayedRequestDisposition: $value'), }; } @@ -63437,7 +63598,7 @@ enum NSURLSessionAuthChallengeDisposition { 2 => NSURLSessionAuthChallengeCancelAuthenticationChallenge, 3 => NSURLSessionAuthChallengeRejectProtectionSpace, _ => throw ArgumentError( - "Unknown value for NSURLSessionAuthChallengeDisposition: $value"), + 'Unknown value for NSURLSessionAuthChallengeDisposition: $value'), }; } @@ -63464,12 +63625,23 @@ enum NSURLSessionResponseDisposition { 2 => NSURLSessionResponseBecomeDownload, 3 => NSURLSessionResponseBecomeStream, _ => throw ArgumentError( - "Unknown value for NSURLSessionResponseDisposition: $value"), + 'Unknown value for NSURLSessionResponseDisposition: $value'), }; } late final _protocol_NSURLSessionDataDelegate = objc.getProtocol("NSURLSessionDataDelegate"); +late final _sel_conformsToProtocol_ = objc.registerName("conformsToProtocol:"); +final _objc_msgSend_e3qsqz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline( ffi.Pointer block, int arg0) => block.ref.target @@ -63566,13 +63738,17 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(NSURLSessionResponseDisposition) fn) => + void Function(NSURLSessionResponseDisposition) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable, - (int arg0) => - fn(NSURLSessionResponseDisposition.fromValue(arg0))), + (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), + keepIsolateAlive), retain: false, release: true); @@ -63583,15 +63759,17 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(NSURLSessionResponseDisposition) fn) { + void Function(NSURLSessionResponseDisposition) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable .nativeFunction .cast(), - (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); + (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_16sve1d(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -63604,23 +63782,27 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(NSURLSessionResponseDisposition) fn) { + void Function(NSURLSessionResponseDisposition) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingCallable .nativeFunction .cast(), - (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); + (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingListenerCallable .nativeFunction .cast(), - (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_16sve1d, raw, rawListener); + (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_16sve1d( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -63642,6 +63824,235 @@ extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension late final _sel_URLSession_dataTask_didReceiveResponse_completionHandler_ = objc .registerName("URLSession:dataTask:didReceiveResponse:completionHandler:"); +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSInteger arg0, + ffi.Pointer arg1)>>() + .asFunction)>()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline) + ..keepIsolateAlive = false; +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + int arg0, + ffi.Pointer arg1) { + try { + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSInteger, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>.isolateLocal( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline) + ..keepIsolateAlive = false; +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSInteger, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLRequest?)> fromFunctionPointer( + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock + fromFunction(void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable, + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock listener( + void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn, + {bool keepIsolateAlive = true}) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable + .nativeFunction + .cast(), + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1otpo83(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } + + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock blocking( + void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn, + {bool keepIsolateAlive = true}) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingCallable + .nativeFunction + .cast(), + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, + retain: false, release: true)), + keepIsolateAlive); + final rawListener = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingListenerCallable + .nativeFunction + .cast(), + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( + raw, rawListener, objc.objCContext); + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionDelayedRequestDisposition arg0, NSURLRequest? arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + NSInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, int, + ffi.Pointer)>()( + ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); +} + void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline( ffi.Pointer block, @@ -63855,8 +64266,11 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) fn) => + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) fn, {bool keepIsolateAlive = true}) => objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable, @@ -63865,7 +64279,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), NSURLResponse.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer(arg4, retain: true, release: true))), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer(arg4, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -63876,8 +64291,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, @@ -63887,7 +64302,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.ObjCBlock)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable .nativeFunction @@ -63906,7 +64322,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLResponse.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionResponseDisposition - .castFromPointer(arg4, retain: false, release: true))); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xx612k(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -63925,8 +64342,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -63937,7 +64355,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.ObjCBlock)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingCallable .nativeFunction @@ -63956,7 +64375,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLResponse.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionResponseDisposition - .castFromPointer(arg4, retain: false, release: true))); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingListenerCallable .nativeFunction @@ -63975,9 +64395,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLResponse.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionResponseDisposition - .castFromPointer(arg4, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xx612k, raw, rawListener); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xx612k( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -64034,6 +64455,250 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLRespo late final _sel_URLSession_dataTask_didBecomeDownloadTask_ = objc.registerName("URLSession:dataTask:didBecomeDownloadTask:"); +late final _class_NSHTTPURLResponse = objc.getClass("NSHTTPURLResponse"); +late final _sel_initWithURL_statusCode_HTTPVersion_headerFields_ = + objc.registerName("initWithURL:statusCode:HTTPVersion:headerFields:"); +final _objc_msgSend_xw7l5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_statusCode = objc.registerName("statusCode"); +late final _sel_allHeaderFields = objc.registerName("allHeaderFields"); +late final _sel_localizedStringForStatusCode_ = + objc.registerName("localizedStringForStatusCode:"); +final _objc_msgSend_qugqlf = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); + +/// NSHTTPURLResponse +class NSHTTPURLResponse extends NSURLResponse { + NSHTTPURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSHTTPURLResponse] that points to the same underlying object as [other]. + NSHTTPURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSHTTPURLResponse] that wraps the given raw object pointer. + NSHTTPURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSHTTPURLResponse]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_19nvye5( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPURLResponse); + } + + /// ! + /// @method initWithURL:statusCode:HTTPVersion:headerFields: + /// @abstract initializer for NSHTTPURLResponse objects. + /// @param url the URL from which the response was generated. + /// @param statusCode an HTTP status code. + /// @param HTTPVersion The version of the HTTP response as represented by the server. This is typically represented as "HTTP/1.1". + /// @param headerFields A dictionary representing the header keys and values of the server response. + /// @result the instance of the object, or NULL if an error occurred during initialization. + /// @discussion This API was introduced in Mac OS X 10.7.2 and iOS 5.0 and is not available prior to those releases. + NSHTTPURLResponse? initWithURL_statusCode_HTTPVersion_headerFields_( + objc.NSURL url, + DartNSInteger statusCode, + objc.NSString? HTTPVersion, + objc.NSDictionary? headerFields) { + objc.checkOsVersionInternal( + 'NSHTTPURLResponse.initWithURL:statusCode:HTTPVersion:headerFields:', + iOS: (false, (5, 0, 0)), + macOS: (false, (10, 7, 0))); + final _ret = _objc_msgSend_xw7l5( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_statusCode_HTTPVersion_headerFields_, + url.ref.pointer, + statusCode, + HTTPVersion?.ref.pointer ?? ffi.nullptr, + headerFields?.ref.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); + } + + /// ! + /// @abstract Returns the HTTP status code of the receiver. + /// @result The HTTP status code of the receiver. + DartNSInteger get statusCode { + objc.checkOsVersionInternal('NSHTTPURLResponse.statusCode', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); + return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_statusCode); + } + + /// ! + /// @abstract Returns a dictionary containing all the HTTP header fields + /// of the receiver. + /// @discussion By examining this header dictionary, clients can see + /// the "raw" header information which was reported to the protocol + /// implementation by the HTTP server. This may be of use to + /// sophisticated or special-purpose HTTP clients. + /// @result A dictionary containing all the HTTP header fields of the + /// receiver. + objc.NSDictionary get allHeaderFields { + objc.checkOsVersionInternal('NSHTTPURLResponse.allHeaderFields', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0))); + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allHeaderFields); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @method valueForHTTPHeaderField: + /// @abstract Returns the value which corresponds to the given header + /// field. Note that, in keeping with the HTTP RFC, HTTP header field + /// names are case-insensitive. + /// @param field the header field name to use for the lookup + /// (case-insensitive). + /// @result the value associated with the given header field, or nil if + /// there is no value associated with the given header field. + objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + objc.checkOsVersionInternal('NSHTTPURLResponse.valueForHTTPHeaderField:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); + final _ret = _objc_msgSend_1sotr3r( + this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @method localizedStringForStatusCode: + /// @abstract Convenience method which returns a localized string + /// corresponding to the status code for this response. + /// @param statusCode the status code to use to produce a localized string. + /// @result A localized string corresponding to the given status code. + static objc.NSString localizedStringForStatusCode_(DartNSInteger statusCode) { + objc.checkOsVersionInternal( + 'NSHTTPURLResponse.localizedStringForStatusCode:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); + final _ret = _objc_msgSend_qugqlf(_class_NSHTTPURLResponse, + _sel_localizedStringForStatusCode_, statusCode); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: + /// @abstract Initialize an NSURLResponse with the provided values. + /// @param URL the URL + /// @param MIMEType the MIME content type of the response + /// @param length the expected content length of the associated data + /// @param name the name of the text encoding for the associated data, if applicable, else nil + /// @result The initialized NSURLResponse. + /// @discussion This is the designated initializer for NSURLResponse. + NSHTTPURLResponse + initWithURL_MIMEType_expectedContentLength_textEncodingName_( + objc.NSURL URL, + objc.NSString? MIMEType, + DartNSInteger length, + objc.NSString? name) { + objc.checkOsVersionInternal( + 'NSHTTPURLResponse.initWithURL:MIMEType:expectedContentLength:textEncodingName:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0))); + final _ret = _objc_msgSend_l9ppnx( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.ref.pointer, + MIMEType?.ref.pointer ?? ffi.nullptr, + length, + name?.ref.pointer ?? ffi.nullptr); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// init + NSHTTPURLResponse init() { + objc.checkOsVersionInternal('NSHTTPURLResponse.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); + final _ret = + _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// new + static NSHTTPURLResponse new$() { + final _ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_new); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSHTTPURLResponse allocWithZone_(ffi.Pointer zone) { + final _ret = _objc_msgSend_1cwp428( + _class_NSHTTPURLResponse, _sel_allocWithZone_, zone); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSHTTPURLResponse alloc() { + final _ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_alloc); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// self + NSHTTPURLResponse self$1() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); + return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + NSHTTPURLResponse retain() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); + return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + NSHTTPURLResponse autorelease() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); + return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635( + _class_NSHTTPURLResponse, _sel_supportsSecureCoding); + } + + /// initWithCoder: + NSHTTPURLResponse? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); + } + + /// Returns a new instance of NSHTTPURLResponse constructed with the default `new` method. + factory NSHTTPURLResponse() => new$(); +} + void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline( ffi.Pointer block, @@ -64215,21 +64880,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + NSURLSessionDownloadTask.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -64238,14 +64905,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable .nativeFunction @@ -64261,7 +64929,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionDownloadTask.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -64278,15 +64947,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingCallable .nativeFunction @@ -64302,7 +64973,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionDownloadTask.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingListenerCallable .nativeFunction @@ -64318,9 +64990,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionDownloadTask.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -64541,21 +65214,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionStreamTask.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + NSURLSessionStreamTask.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -64564,14 +65239,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable .nativeFunction @@ -64587,7 +65263,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionStreamTask.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -64604,15 +65281,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingCallable .nativeFunction @@ -64628,7 +65307,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionStreamTask.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingListenerCallable .nativeFunction @@ -64644,9 +65324,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionStreamTask.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -64869,21 +65550,22 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) fn, {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - objc.NSData.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + objc.NSData.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -64892,14 +65574,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable .nativeFunction @@ -64915,7 +65598,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), objc.NSData.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -64932,15 +65616,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingCallable .nativeFunction @@ -64956,7 +65642,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), objc.NSData.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingListenerCallable .nativeFunction @@ -64972,9 +65659,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), objc.NSData.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -65227,8 +65915,11 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) fn) => + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) fn, {bool keepIsolateAlive = true}) => objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable, @@ -65237,7 +65928,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), NSCachedURLResponse.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, retain: true, release: true))), + ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -65248,8 +65940,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, @@ -65263,7 +65955,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable .nativeFunction @@ -65282,7 +65975,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSCachedURLResponse.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xx612k(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -65303,8 +65997,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -65319,7 +66014,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingCallable .nativeFunction @@ -65338,7 +66034,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSCachedURLResponse.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingListenerCallable .nativeFunction @@ -65357,9 +66054,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSCachedURLResponse.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xx612k, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xx612k( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -65579,18 +66277,20 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) => + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true))), + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -65601,12 +66301,13 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, NSURLSessionTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) { + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable .nativeFunction @@ -65618,7 +66319,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { NSURLSession.castFromPointer(arg1, retain: false, release: true), NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_fjrv01(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -65632,13 +66334,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, NSURLSessionTask)> blocking( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) { + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingCallable .nativeFunction @@ -65650,7 +66354,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { NSURLSession.castFromPointer(arg1, retain: false, release: true), NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingListenerCallable .nativeFunction @@ -65662,9 +66367,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { NSURLSession.castFromPointer(arg1, retain: false, release: true), NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_fjrv01, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -65697,224 +66403,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); } -void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, - ffi.Pointer arg1)>>() - .asFunction)>()( - arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline) - ..keepIsolateAlive = false; -void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - int arg0, - ffi.Pointer arg1) { - try { - (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSInteger, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSInteger, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLRequest?)> fromFunctionPointer( - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock - fromFunction(void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable, - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionDelayedRequestDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLRequest.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionDelayedRequestDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLRequest.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1otpo83(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock blocking( - void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionDelayedRequestDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLRequest.castFromPointer(arg1, - retain: false, release: true))); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingListenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionDelayedRequestDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLRequest.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1otpo83, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_CallExtension - on objc.ObjCBlock { - void call(NSURLSessionDelayedRequestDisposition arg0, NSURLRequest? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - NSInteger arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()( - ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); -} - late final _sel_URLSession_task_willBeginDelayedRequest_completionHandler_ = objc.registerName( "URLSession:task:willBeginDelayedRequest:completionHandler:"); @@ -66131,8 +66619,11 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock) fn) => + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock) fn, {bool keepIsolateAlive = true}) => objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable, @@ -66141,7 +66632,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), NSURLRequest.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer(arg4, retain: true, release: true))), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer(arg4, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -66152,8 +66644,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, @@ -66168,7 +66660,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTask, NSURLRequest, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable .nativeFunction @@ -66187,7 +66680,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLRequest.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest - .castFromPointer(arg4, retain: false, release: true))); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xx612k(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -66208,8 +66702,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -66225,7 +66720,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTask, NSURLRequest, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingCallable .nativeFunction @@ -66244,7 +66740,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLRequest.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest - .castFromPointer(arg4, retain: false, release: true))); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingListenerCallable .nativeFunction @@ -66263,9 +66760,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLRequest.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest - .castFromPointer(arg4, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xx612k, raw, rawListener); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xx612k( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -66324,227 +66822,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_f late final _sel_URLSession_taskIsWaitingForConnectivity_ = objc.registerName("URLSession:taskIsWaitingForConnectivity:"); -late final _class_NSHTTPURLResponse = objc.getClass("NSHTTPURLResponse"); -late final _sel_initWithURL_statusCode_HTTPVersion_headerFields_ = - objc.registerName("initWithURL:statusCode:HTTPVersion:headerFields:"); -final _objc_msgSend_xw7l5 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_statusCode = objc.registerName("statusCode"); -late final _sel_allHeaderFields = objc.registerName("allHeaderFields"); -late final _sel_localizedStringForStatusCode_ = - objc.registerName("localizedStringForStatusCode:"); -final _objc_msgSend_qugqlf = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); - -/// NSHTTPURLResponse -class NSHTTPURLResponse extends NSURLResponse { - NSHTTPURLResponse._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSHTTPURLResponse] that points to the same underlying object as [other]. - NSHTTPURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSHTTPURLResponse] that wraps the given raw object pointer. - NSHTTPURLResponse.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSHTTPURLResponse]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPURLResponse); - } - - /// ! - /// @method initWithURL:statusCode:HTTPVersion:headerFields: - /// @abstract initializer for NSHTTPURLResponse objects. - /// @param url the URL from which the response was generated. - /// @param statusCode an HTTP status code. - /// @param HTTPVersion The version of the HTTP response as represented by the server. This is typically represented as "HTTP/1.1". - /// @param headerFields A dictionary representing the header keys and values of the server response. - /// @result the instance of the object, or NULL if an error occurred during initialization. - /// @discussion This API was introduced in Mac OS X 10.7.2 and iOS 5.0 and is not available prior to those releases. - NSHTTPURLResponse? initWithURL_statusCode_HTTPVersion_headerFields_( - objc.NSURL url, - DartNSInteger statusCode, - objc.NSString? HTTPVersion, - objc.NSDictionary? headerFields) { - final _ret = _objc_msgSend_xw7l5( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_statusCode_HTTPVersion_headerFields_, - url.ref.pointer, - statusCode, - HTTPVersion?.ref.pointer ?? ffi.nullptr, - headerFields?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); - } - - /// ! - /// @abstract Returns the HTTP status code of the receiver. - /// @result The HTTP status code of the receiver. - DartNSInteger get statusCode { - return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_statusCode); - } - - /// ! - /// @abstract Returns a dictionary containing all the HTTP header fields - /// of the receiver. - /// @discussion By examining this header dictionary, clients can see - /// the "raw" header information which was reported to the protocol - /// implementation by the HTTP server. This may be of use to - /// sophisticated or special-purpose HTTP clients. - /// @result A dictionary containing all the HTTP header fields of the - /// receiver. - objc.NSDictionary get allHeaderFields { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allHeaderFields); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @method valueForHTTPHeaderField: - /// @abstract Returns the value which corresponds to the given header - /// field. Note that, in keeping with the HTTP RFC, HTTP header field - /// names are case-insensitive. - /// @param field the header field name to use for the lookup - /// (case-insensitive). - /// @result the value associated with the given header field, or nil if - /// there is no value associated with the given header field. - objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @method localizedStringForStatusCode: - /// @abstract Convenience method which returns a localized string - /// corresponding to the status code for this response. - /// @param statusCode the status code to use to produce a localized string. - /// @result A localized string corresponding to the given status code. - static objc.NSString localizedStringForStatusCode_(DartNSInteger statusCode) { - final _ret = _objc_msgSend_qugqlf(_class_NSHTTPURLResponse, - _sel_localizedStringForStatusCode_, statusCode); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: - /// @abstract Initialize an NSURLResponse with the provided values. - /// @param URL the URL - /// @param MIMEType the MIME content type of the response - /// @param length the expected content length of the associated data - /// @param name the name of the text encoding for the associated data, if applicable, else nil - /// @result The initialized NSURLResponse. - /// @discussion This is the designated initializer for NSURLResponse. - NSHTTPURLResponse - initWithURL_MIMEType_expectedContentLength_textEncodingName_( - objc.NSURL URL, - objc.NSString? MIMEType, - DartNSInteger length, - objc.NSString? name) { - final _ret = _objc_msgSend_l9ppnx( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, - URL.ref.pointer, - MIMEType?.ref.pointer ?? ffi.nullptr, - length, - name?.ref.pointer ?? ffi.nullptr); - return NSHTTPURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// init - NSHTTPURLResponse init() { - final _ret = - _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); - return NSHTTPURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSHTTPURLResponse new1() { - final _ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_new); - return NSHTTPURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSHTTPURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSHTTPURLResponse, _sel_allocWithZone_, zone); - return NSHTTPURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSHTTPURLResponse alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_alloc); - return NSHTTPURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// self - NSHTTPURLResponse self() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSHTTPURLResponse retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSHTTPURLResponse autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635( - _class_NSHTTPURLResponse, _sel_supportsSecureCoding); - } - - /// initWithCoder: - NSHTTPURLResponse? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); - } -} - void _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => @@ -66650,15 +66927,20 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(NSURLRequest?) fn) => + void Function(NSURLRequest?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLRequest_closureCallable, (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : NSURLRequest.castFromPointer(arg0, - retain: true, release: true))), + retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -66669,16 +66951,17 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(NSURLRequest?) fn) { + void Function(NSURLRequest?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : NSURLRequest.castFromPointer(arg0, - retain: false, release: true))); + : NSURLRequest.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -66691,26 +66974,28 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(NSURLRequest?) fn) { + void Function(NSURLRequest?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLRequest_blockingCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : NSURLRequest.castFromPointer(arg0, - retain: false, release: true))); + : NSURLRequest.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLRequest_blockingListenerCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : NSURLRequest.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + : NSURLRequest.castFromPointer(arg0, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -66970,20 +67255,24 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true), - NSURLRequest.castFromPointer(arg4, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, retain: true, release: true))), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true), + NSURLRequest.castFromPointer(arg4, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -66992,8 +67281,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, @@ -67009,7 +67298,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable .nativeFunction @@ -67031,7 +67321,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSURLRequest.castFromPointer(arg4, retain: false, release: true), ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_l2g8ke(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -67051,8 +67342,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -67069,7 +67361,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingCallable .nativeFunction @@ -67091,7 +67384,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSURLRequest.castFromPointer(arg4, retain: false, release: true), ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingListenerCallable .nativeFunction @@ -67113,9 +67407,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSURLRequest.castFromPointer(arg4, retain: false, release: true), ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -67341,8 +67636,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock - fromFunction(void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) fn) => + fromFunction(void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable, @@ -67350,7 +67649,8 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR NSURLSessionAuthChallengeDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLCredential.castFromPointer(arg1, retain: true, release: true))), + : NSURLCredential.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -67361,12 +67661,13 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable .nativeFunction @@ -67376,7 +67677,8 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR arg1.address == 0 ? null : NSURLCredential.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_n8yd09(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock( @@ -67391,13 +67693,15 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingCallable .nativeFunction @@ -67407,7 +67711,8 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR arg1.address == 0 ? null : NSURLCredential.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingListenerCallable .nativeFunction @@ -67417,9 +67722,10 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR arg1.address == 0 ? null : NSURLCredential.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_n8yd09, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_n8yd09( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock( @@ -67659,8 +67965,11 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock) fn, {bool keepIsolateAlive = true}) => objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, @@ -67669,7 +67978,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), NSURLAuthenticationChallenge.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg4, retain: true, release: true))), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg4, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -67680,8 +67990,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, @@ -67696,7 +68006,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable .nativeFunction @@ -67715,7 +68026,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLAuthenticationChallenge.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg4, retain: false, release: true))); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xx612k(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -67735,8 +68047,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -67752,7 +68065,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingCallable .nativeFunction @@ -67771,7 +68085,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLAuthenticationChallenge.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg4, retain: false, release: true))); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingListenerCallable .nativeFunction @@ -67790,9 +68105,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLAuthenticationChallenge.castFromPointer(arg3, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg4, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xx612k, raw, rawListener); + .castFromPointer(arg4, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xx612k( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -67949,15 +68265,19 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(objc.NSInputStream?) fn) => + void Function(objc.NSInputStream?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSInputStream_closureCallable, (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSInputStream.castFromPointer(arg0, - retain: true, release: true))), + : objc.NSInputStream.castFromPointer(arg0, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -67968,16 +68288,18 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock listener( - void Function(objc.NSInputStream?) fn) { + void Function(objc.NSInputStream?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSInputStream_listenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : objc.NSInputStream.castFromPointer(arg0, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, @@ -67990,26 +68312,30 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock blocking( - void Function(objc.NSInputStream?) fn) { + void Function(objc.NSInputStream?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSInputStream_blockingCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : objc.NSInputStream.castFromPointer(arg0, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSInputStream_blockingListenerCallable.nativeFunction .cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null : objc.NSInputStream.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock(wrapper, @@ -68222,21 +68548,22 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock) fn, {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -68245,14 +68572,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable .nativeFunction @@ -68268,7 +68596,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_bklti2(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -68288,15 +68617,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingCallable .nativeFunction @@ -68312,7 +68643,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingListenerCallable .nativeFunction @@ -68328,9 +68660,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_bklti2, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_bklti2( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -68587,8 +68920,11 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, objc.ObjCBlock) fn) => + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, objc.ObjCBlock) fn, {bool keepIsolateAlive = true}) => objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable, @@ -68597,7 +68933,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), arg3, - ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, retain: true, release: true))), + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -68608,8 +68945,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, @@ -68619,7 +68956,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int objc.ObjCBlock)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable .nativeFunction @@ -68637,7 +68975,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int retain: false, release: true), arg3, ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_jyim80(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -68658,8 +68997,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -68670,7 +69010,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int objc.ObjCBlock)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingCallable .nativeFunction @@ -68688,7 +69029,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int retain: false, release: true), arg3, ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingListenerCallable .nativeFunction @@ -68706,9 +69048,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int retain: false, release: true), arg3, ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_jyim80, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_jyim80( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -68986,25 +69329,26 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, int, int) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4, - arg5)), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc + .ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, int, int) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn(arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), arg3, arg4, arg5), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -69013,14 +69357,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, int, int) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable .nativeFunction @@ -69039,7 +69384,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int retain: false, release: true), arg3, arg4, - arg5)); + arg5), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_h68abb(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -69058,15 +69404,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, int, int) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingCallable .nativeFunction @@ -69085,7 +69433,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int retain: false, release: true), arg3, arg4, - arg5)); + arg5), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingListenerCallable .nativeFunction @@ -69104,9 +69453,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int retain: false, release: true), arg3, arg4, - arg5)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_h68abb, raw, rawListener); + arg5), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_h68abb( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -69334,21 +69684,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -69357,14 +69709,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable .nativeFunction @@ -69380,7 +69733,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), NSHTTPURLResponse.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -69394,15 +69748,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingCallable .nativeFunction @@ -69418,7 +69774,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), NSHTTPURLResponse.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingListenerCallable .nativeFunction @@ -69434,9 +69791,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), NSHTTPURLResponse.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -69478,7 +69836,10 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo class NSURLSessionTaskMetrics extends objc.NSObject { NSURLSessionTaskMetrics._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSURLSessionTaskMetrics', + iOS: (false, (10, 0, 0)), macOS: (false, (10, 12, 0))); + } /// Constructs a [NSURLSessionTaskMetrics] that points to the same underlying object as [other]. NSURLSessionTaskMetrics.castFrom(objc.ObjCObjectBase other) @@ -69673,21 +70034,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionTaskMetrics.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + NSURLSessionTaskMetrics.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -69696,14 +70059,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable .nativeFunction @@ -69719,7 +70083,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionTaskMetrics.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -69733,15 +70098,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingCallable .nativeFunction @@ -69757,7 +70124,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionTaskMetrics.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingListenerCallable .nativeFunction @@ -69773,9 +70141,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), NSURLSessionTaskMetrics.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -69995,21 +70364,22 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) fn, {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -70018,14 +70388,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable .nativeFunction @@ -70043,7 +70414,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -70057,15 +70429,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingCallable .nativeFunction @@ -70083,7 +70457,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingListenerCallable .nativeFunction @@ -70101,9 +70476,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -70297,18 +70673,22 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, NSURLSession, objc.NSError?)> - fromFunction(void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) => - objc.ObjCBlock, NSURLSession, objc.NSError?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, objc.NSError?)> fromFunction( + void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -70317,12 +70697,13 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, objc.NSError?)> listener( - void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) { + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> + listener( + void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable .nativeFunction @@ -70336,7 +70717,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_fjrv01(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -70350,13 +70732,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, objc.NSError?)> blocking( - void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) { + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> + blocking( + void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingCallable .nativeFunction @@ -70370,7 +70754,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingListenerCallable .nativeFunction @@ -70384,9 +70769,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_fjrv01, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -70609,21 +70995,22 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) fn, {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLAuthenticationChallenge.castFromPointer(arg2, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -70632,8 +71019,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, @@ -70646,7 +71033,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable .nativeFunction @@ -70662,7 +71050,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC NSURLAuthenticationChallenge.castFromPointer(arg2, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg3, retain: false, release: true))); + .castFromPointer(arg3, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_bklti2(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -70681,8 +71070,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function( @@ -70696,7 +71086,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingCallable .nativeFunction @@ -70712,7 +71103,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC NSURLAuthenticationChallenge.castFromPointer(arg2, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg3, retain: false, release: true))); + .castFromPointer(arg3, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingListenerCallable .nativeFunction @@ -70728,9 +71120,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC NSURLAuthenticationChallenge.castFromPointer(arg2, retain: false, release: true), ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg3, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_bklti2, raw, rawListener); + .castFromPointer(arg3, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_bklti2( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -70905,18 +71298,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession)> - fromFunction(void Function(ffi.Pointer, NSURLSession) fn) => - objc.ObjCBlock, NSURLSession)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession)> fromFunction( + void Function(ffi.Pointer, NSURLSession) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -70925,16 +71321,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, NSURLSession)> - listener(void Function(ffi.Pointer, NSURLSession) fn) { + listener(void Function(ffi.Pointer, NSURLSession) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable.nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true))); + NSURLSession.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_18v1jvf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -70948,26 +71346,30 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock, NSURLSession)> - blocking(void Function(ffi.Pointer, NSURLSession) fn) { + blocking(void Function(ffi.Pointer, NSURLSession) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingCallable.nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true))); + NSURLSession.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingListenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf, raw, rawListener); + NSURLSession.castFromPointer(arg1, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -70995,13 +71397,41 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension /// Messages related to the operation of a task that delivers data /// directly to the delegate. -abstract final class NSURLSessionDataDelegate { +interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase + implements NSURLSessionTaskDelegate { + NSURLSessionDataDelegate._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionDataDelegate] that points to the same underlying object as [other]. + NSURLSessionDataDelegate.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionDataDelegate] that wraps the given raw object pointer. + NSURLSessionDataDelegate.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionDataDelegate]. + static bool conformsTo(objc.ObjCObjectBase obj) { + return _objc_msgSend_e3qsqz(obj.ref.pointer, _sel_conformsToProtocol_, + _protocol_NSURLSessionDataDelegate); + } + + /// Returns the [objc.Protocol] object for this protocol. + static objc.Protocol get $protocol => + objc.Protocol.castFromPointer(_protocol_NSURLSessionDataDelegate.cast()); + /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionDataDelegate implement( {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? URLSession_dataTask_didBecomeDownloadTask_, void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? URLSession_dataTask_didBecomeStreamTask_, @@ -71027,8 +71457,10 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionDataDelegate'); NSURLSessionDataDelegate .URLSession_dataTask_didReceiveResponse_completionHandler_ .implement( @@ -71081,11 +71513,15 @@ abstract final class NSURLSessionDataDelegate { .implement(builder, URLSession_didReceiveChallenge_completionHandler_); NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionDataDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilder(objc.ObjCProtocolBuilder builder, {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? URLSession_dataTask_didReceiveResponse_completionHandler_, @@ -71115,7 +71551,8 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionDataDelegate .URLSession_dataTask_didReceiveResponse_completionHandler_ .implement( @@ -71168,15 +71605,20 @@ abstract final class NSURLSessionDataDelegate { .implement(builder, URLSession_didReceiveChallenge_completionHandler_); NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionDataDelegate implementAsListener( {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? URLSession_dataTask_didBecomeDownloadTask_, void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? URLSession_dataTask_didBecomeStreamTask_, @@ -71202,8 +71644,10 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionDataDelegate'); NSURLSessionDataDelegate .URLSession_dataTask_didReceiveResponse_completionHandler_ .implementAsListener( @@ -71261,12 +71705,16 @@ abstract final class NSURLSessionDataDelegate { NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionDataDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will /// be. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? URLSession_dataTask_didReceiveResponse_completionHandler_, @@ -71296,7 +71744,8 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionDataDelegate .URLSession_dataTask_didReceiveResponse_completionHandler_ .implementAsListener( @@ -71354,15 +71803,20 @@ abstract final class NSURLSessionDataDelegate { NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as blocking listeners will be. - static objc.ObjCObjectBase implementAsBlocking( + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionDataDelegate implementAsBlocking( {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? URLSession_dataTask_didBecomeDownloadTask_, void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? URLSession_dataTask_didBecomeStreamTask_, @@ -71388,8 +71842,10 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionDataDelegate'); NSURLSessionDataDelegate .URLSession_dataTask_didReceiveResponse_completionHandler_ .implementAsBlocking( @@ -71447,12 +71903,16 @@ abstract final class NSURLSessionDataDelegate { NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionDataDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as blocking /// listeners will be. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsBlocking(objc.ObjCProtocolBuilder builder, {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? URLSession_dataTask_didReceiveResponse_completionHandler_, @@ -71482,7 +71942,8 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionDataDelegate .URLSession_dataTask_didReceiveResponse_completionHandler_ .implementAsBlocking( @@ -71540,6 +72001,7 @@ abstract final class NSURLSessionDataDelegate { NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// The task has received a response and no further messages will be @@ -71555,6 +72017,17 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, @@ -71601,6 +72074,16 @@ abstract final class NSURLSessionDataDelegate { NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didBecomeDownloadTask_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didBecomeDownloadTask_, @@ -71647,6 +72130,16 @@ abstract final class NSURLSessionDataDelegate { NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didBecomeStreamTask_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didBecomeStreamTask_, @@ -71681,6 +72174,16 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didReceiveData_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_didReceiveData_, @@ -71715,6 +72218,17 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_willCacheResponse_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_dataTask_willCacheResponse_completionHandler_, @@ -71765,6 +72279,15 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_didCreateTask_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_didCreateTask_, @@ -71814,6 +72337,17 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, @@ -71869,6 +72403,15 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, @@ -71906,6 +72449,18 @@ abstract final class NSURLSessionDataDelegate { NSURLRequest, objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_l2g8ke) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, @@ -71960,6 +72515,17 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, @@ -72013,6 +72579,16 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStream_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_bklti2) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStream_, @@ -72064,6 +72640,17 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_jyim80) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, @@ -72112,6 +72699,17 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, int, int, int)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>>(_NativeCupertinoHttp_protocolTrampoline_h68abb) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, @@ -72141,6 +72739,16 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, @@ -72171,6 +72779,16 @@ abstract final class NSURLSessionDataDelegate { NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, @@ -72204,6 +72822,16 @@ abstract final class NSURLSessionDataDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didCompleteWithError_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didCompleteWithError_, @@ -72234,6 +72862,15 @@ abstract final class NSURLSessionDataDelegate { .ObjCProtocolListenableMethod( _protocol_NSURLSessionDataDelegate, _sel_URLSession_didBecomeInvalidWithError_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_didBecomeInvalidWithError_, @@ -72268,6 +72905,16 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDataDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_bklti2) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, @@ -72320,6 +72967,12 @@ abstract final class NSURLSessionDataDelegate { objc.ObjCProtocolListenableMethod( _protocol_NSURLSessionDataDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_18v1jvf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, @@ -72525,21 +73178,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - objc.NSURL.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + objc.NSURL.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -72548,14 +73203,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable .nativeFunction @@ -72570,8 +73226,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload retain: false, release: true), NSURLSessionDownloadTask.castFromPointer(arg2, retain: false, release: true), - objc.NSURL - .castFromPointer(arg3, retain: false, release: true))); + objc.NSURL.castFromPointer(arg3, retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -72588,15 +73244,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingCallable .nativeFunction @@ -72611,8 +73269,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload retain: false, release: true), NSURLSessionDownloadTask.castFromPointer(arg2, retain: false, release: true), - objc.NSURL - .castFromPointer(arg3, retain: false, release: true))); + objc.NSURL.castFromPointer(arg3, retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingListenerCallable .nativeFunction @@ -72627,10 +73285,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload retain: false, release: true), NSURLSessionDownloadTask.castFromPointer(arg2, retain: false, release: true), - objc.NSURL - .castFromPointer(arg3, retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + objc.NSURL.castFromPointer(arg3, retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -72894,25 +73552,26 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4, - arg5)), - retain: false, - release: true); + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc + .ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn(arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), arg3, arg4, arg5), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -72921,14 +73580,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable .nativeFunction @@ -72947,7 +73607,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload retain: false, release: true), arg3, arg4, - arg5)); + arg5), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_h68abb(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -72966,15 +73627,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingCallable .nativeFunction @@ -72993,7 +73656,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload retain: false, release: true), arg3, arg4, - arg5)); + arg5), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingListenerCallable .nativeFunction @@ -73012,9 +73676,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload retain: false, release: true), arg3, arg4, - arg5)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_h68abb, raw, rawListener); + arg5), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_h68abb( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -73262,17 +73927,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc + .ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, int arg4) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4)), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4) => + fn(arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), arg3, arg4), + keepIsolateAlive), retain: false, release: true); @@ -73283,14 +73954,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable .nativeFunction @@ -73304,7 +73976,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload NSURLSessionDownloadTask.castFromPointer(arg2, retain: false, release: true), arg3, - arg4)); + arg4), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ly2579(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -73322,15 +73995,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingCallable .nativeFunction @@ -73344,7 +74019,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload NSURLSessionDownloadTask.castFromPointer(arg2, retain: false, release: true), arg3, - arg4)); + arg4), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingListenerCallable .nativeFunction @@ -73358,9 +74034,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload NSURLSessionDownloadTask.castFromPointer(arg2, retain: false, release: true), arg3, - arg4)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_ly2579, raw, rawListener); + arg4), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_ly2579( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -73403,10 +74080,39 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_ /// Messages related to the operation of a task that writes data to a /// file and notifies the delegate upon completion. -abstract final class NSURLSessionDownloadDelegate { +interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase + implements NSURLSessionTaskDelegate { + NSURLSessionDownloadDelegate._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionDownloadDelegate] that points to the same underlying object as [other]. + NSURLSessionDownloadDelegate.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionDownloadDelegate] that wraps the given raw object pointer. + NSURLSessionDownloadDelegate.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionDownloadDelegate]. + static bool conformsTo(objc.ObjCObjectBase obj) { + return _objc_msgSend_e3qsqz(obj.ref.pointer, _sel_conformsToProtocol_, + _protocol_NSURLSessionDownloadDelegate); + } + + /// Returns the [objc.Protocol] object for this protocol. + static objc.Protocol get $protocol => objc.Protocol.castFromPointer( + _protocol_NSURLSessionDownloadDelegate.cast()); + /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionDownloadDelegate implement( {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) URLSession_downloadTask_didFinishDownloadingToURL_, void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? @@ -73438,8 +74144,10 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionDownloadDelegate'); NSURLSessionDownloadDelegate .URLSession_downloadTask_didFinishDownloadingToURL_ .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); @@ -73492,11 +74200,15 @@ abstract final class NSURLSessionDownloadDelegate { NSURLSessionDownloadDelegate .URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionDownloadDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilder(objc.ObjCProtocolBuilder builder, {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) URLSession_downloadTask_didFinishDownloadingToURL_, @@ -73529,7 +74241,8 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionDownloadDelegate .URLSession_downloadTask_didFinishDownloadingToURL_ .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); @@ -73582,12 +74295,16 @@ abstract final class NSURLSessionDownloadDelegate { NSURLSessionDownloadDelegate .URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionDownloadDelegate implementAsListener( {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) URLSession_downloadTask_didFinishDownloadingToURL_, void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? @@ -73619,8 +74336,10 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionDownloadDelegate'); NSURLSessionDownloadDelegate .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsListener( @@ -73678,12 +74397,16 @@ abstract final class NSURLSessionDownloadDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionDownloadDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will /// be. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) URLSession_downloadTask_didFinishDownloadingToURL_, @@ -73716,7 +74439,8 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionDownloadDelegate .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsListener( @@ -73774,12 +74498,16 @@ abstract final class NSURLSessionDownloadDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as blocking listeners will be. - static objc.ObjCObjectBase implementAsBlocking( + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionDownloadDelegate implementAsBlocking( {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) URLSession_downloadTask_didFinishDownloadingToURL_, void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? @@ -73811,8 +74539,10 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionDownloadDelegate'); NSURLSessionDownloadDelegate .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsBlocking( @@ -73870,12 +74600,16 @@ abstract final class NSURLSessionDownloadDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionDownloadDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as blocking /// listeners will be. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsBlocking(objc.ObjCProtocolBuilder builder, {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) URLSession_downloadTask_didFinishDownloadingToURL_, @@ -73908,7 +74642,8 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionDownloadDelegate .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsBlocking( @@ -73966,6 +74701,7 @@ abstract final class NSURLSessionDownloadDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// Sent when a download task that has completed a download. The delegate should @@ -73977,6 +74713,16 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_downloadTask_didFinishDownloadingToURL_, @@ -74006,6 +74752,17 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>>(_NativeCupertinoHttp_protocolTrampoline_h68abb) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, @@ -74053,6 +74810,16 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionDownloadTask, int, int)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>>(_NativeCupertinoHttp_protocolTrampoline_ly2579) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, @@ -74085,6 +74852,15 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didCreateTask_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didCreateTask_, @@ -74134,6 +74910,17 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, @@ -74189,6 +74976,15 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, @@ -74226,6 +75022,18 @@ abstract final class NSURLSessionDownloadDelegate { NSURLRequest, objc.ObjCBlock)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_l2g8ke) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, @@ -74280,6 +75088,17 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, @@ -74333,6 +75152,16 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStream_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_bklti2) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStream_, @@ -74384,6 +75213,17 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_jyim80) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, @@ -74432,6 +75272,17 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, int, int, int)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>>(_NativeCupertinoHttp_protocolTrampoline_h68abb) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, @@ -74461,6 +75312,16 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, @@ -74491,6 +75352,16 @@ abstract final class NSURLSessionDownloadDelegate { NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, @@ -74524,6 +75395,16 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didCompleteWithError_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didCompleteWithError_, @@ -74554,6 +75435,15 @@ abstract final class NSURLSessionDownloadDelegate { .ObjCProtocolListenableMethod( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didBecomeInvalidWithError_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didBecomeInvalidWithError_, @@ -74588,6 +75478,16 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_bklti2) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, @@ -74640,6 +75540,12 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCProtocolListenableMethod( _protocol_NSURLSessionDownloadDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_18v1jvf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, @@ -74845,21 +75751,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), - arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -74868,14 +75776,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable .nativeFunction @@ -74893,7 +75802,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -74910,15 +75820,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingCallable .nativeFunction @@ -74936,7 +75848,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingListenerCallable .nativeFunction @@ -74954,9 +75867,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -75198,23 +76112,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - fn( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) fn, {bool keepIsolateAlive = true}) => + objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, ffi.Pointer arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), arg3, - arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); + arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -75223,14 +76137,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> listener( void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable .nativeFunction @@ -75250,7 +76165,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1lx650f(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -75268,15 +76184,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> blocking( void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) - fn) { + fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingCallable .nativeFunction @@ -75296,7 +76214,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingListenerCallable .nativeFunction @@ -75316,9 +76235,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1lx650f, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -75369,175 +76289,39 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURL } /// NSURLSessionWebSocketDelegate -abstract final class NSURLSessionWebSocketDelegate { - /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? - URLSession_webSocketTask_didCloseWithCode_reason_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ - .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_ - .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionWebSocketDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } +interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase + implements NSURLSessionTaskDelegate { + NSURLSessionWebSocketDelegate._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? - URLSession_webSocketTask_didCloseWithCode_reason_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ - .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_ - .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionWebSocketDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + /// Constructs a [NSURLSessionWebSocketDelegate] that points to the same underlying object as [other]. + NSURLSessionWebSocketDelegate.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionWebSocketDelegate] that wraps the given raw object pointer. + NSURLSessionWebSocketDelegate.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketDelegate]. + static bool conformsTo(objc.ObjCObjectBase obj) { + return _objc_msgSend_e3qsqz(obj.ref.pointer, _sel_conformsToProtocol_, + _protocol_NSURLSessionWebSocketDelegate); } + /// Returns the [objc.Protocol] object for this protocol. + static objc.Protocol get $protocol => objc.Protocol.castFromPointer( + _protocol_NSURLSessionWebSocketDelegate.cast()); + /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionWebSocketDelegate implement( {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? @@ -75567,8 +76351,186 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionWebSocketDelegate'); + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); + return NSURLSessionWebSocketDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); + } + + /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + /// + /// Note: You cannot call this method after you have called `builder.build`. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); + } + + /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionWebSocketDelegate implementAsListener( + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionWebSocketDelegate'); NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ .implementAsListener( builder, URLSession_webSocketTask_didOpenWithProtocol_); @@ -75621,12 +76583,16 @@ abstract final class NSURLSessionWebSocketDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionWebSocketDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will /// be. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? URLSession_webSocketTask_didOpenWithProtocol_, @@ -75657,7 +76623,8 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ .implementAsListener( builder, URLSession_webSocketTask_didOpenWithProtocol_); @@ -75710,12 +76677,16 @@ abstract final class NSURLSessionWebSocketDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as blocking listeners will be. - static objc.ObjCObjectBase implementAsBlocking( + /// + /// If `$keepIsolateAlive` is true, this protocol will keep this isolate + /// alive until it is garbage collected by both Dart and ObjC. + static NSURLSessionWebSocketDelegate implementAsBlocking( {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? @@ -75745,8 +76716,10 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { + final builder = + objc.ObjCProtocolBuilder(debugName: 'NSURLSessionWebSocketDelegate'); NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ .implementAsBlocking( builder, URLSession_webSocketTask_didOpenWithProtocol_); @@ -75799,12 +76772,16 @@ abstract final class NSURLSessionWebSocketDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + builder.addProtocol($protocol); + return NSURLSessionWebSocketDelegate.castFrom( + builder.build(keepIsolateAlive: $keepIsolateAlive)); } /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as blocking /// listeners will be. + /// + /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsBlocking(objc.ObjCProtocolBuilder builder, {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? URLSession_webSocketTask_didOpenWithProtocol_, @@ -75835,7 +76812,8 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, + bool $keepIsolateAlive = true}) { NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ .implementAsBlocking( builder, URLSession_webSocketTask_didOpenWithProtocol_); @@ -75888,6 +76866,7 @@ abstract final class NSURLSessionWebSocketDelegate { .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_); + builder.addProtocol($protocol); } /// Indicates that the WebSocket handshake was successful and the connection has been upgraded to webSockets. @@ -75898,6 +76877,16 @@ abstract final class NSURLSessionWebSocketDelegate { NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_webSocketTask_didOpenWithProtocol_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_webSocketTask_didOpenWithProtocol_, @@ -75933,6 +76922,17 @@ abstract final class NSURLSessionWebSocketDelegate { objc.NSData?)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1lx650f) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_webSocketTask_didCloseWithCode_reason_, @@ -75980,6 +76980,15 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_didCreateTask_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_didCreateTask_, @@ -76029,6 +77038,17 @@ abstract final class NSURLSessionWebSocketDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, @@ -76084,6 +77104,15 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, @@ -76121,6 +77150,18 @@ abstract final class NSURLSessionWebSocketDelegate { NSURLRequest, objc.ObjCBlock)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_l2g8ke) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, @@ -76175,6 +77216,17 @@ abstract final class NSURLSessionWebSocketDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, @@ -76228,6 +77280,16 @@ abstract final class NSURLSessionWebSocketDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_needNewBodyStream_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_bklti2) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_needNewBodyStream_, @@ -76279,6 +77341,17 @@ abstract final class NSURLSessionWebSocketDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_jyim80) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, @@ -76327,6 +77400,17 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask, int, int, int)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>>(_NativeCupertinoHttp_protocolTrampoline_h68abb) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, @@ -76356,6 +77440,16 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, @@ -76386,6 +77480,16 @@ abstract final class NSURLSessionWebSocketDelegate { NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, @@ -76419,6 +77523,16 @@ abstract final class NSURLSessionWebSocketDelegate { void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didCompleteWithError_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_task_didCompleteWithError_, @@ -76449,6 +77563,15 @@ abstract final class NSURLSessionWebSocketDelegate { .ObjCProtocolListenableMethod( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_didBecomeInvalidWithError_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_didBecomeInvalidWithError_, @@ -76483,6 +77606,16 @@ abstract final class NSURLSessionWebSocketDelegate { objc.ObjCBlock)>( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_bklti2) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, @@ -76535,6 +77668,12 @@ abstract final class NSURLSessionWebSocketDelegate { objc.ObjCProtocolListenableMethod( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( + _NativeCupertinoHttp_protocolTrampoline_18v1jvf) + .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, @@ -76655,217 +77794,6 @@ extension NSValueExtensionMethods on objc.NSValue { } } -late final _class_NSNumber = objc.getClass("NSNumber"); -late final _sel_numberWithChar_ = objc.registerName("numberWithChar:"); -final _objc_msgSend_13mclwd = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Char)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithUnsignedChar_ = - objc.registerName("numberWithUnsignedChar:"); -final _objc_msgSend_7uautw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedChar)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithShort_ = objc.registerName("numberWithShort:"); -final _objc_msgSend_68x6r1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Short)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithUnsignedShort_ = - objc.registerName("numberWithUnsignedShort:"); -final _objc_msgSend_1njucl2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedShort)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithInt_ = objc.registerName("numberWithInt:"); -final _objc_msgSend_14hvw5k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithUnsignedInt_ = - objc.registerName("numberWithUnsignedInt:"); -final _objc_msgSend_degb40 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithLong_ = objc.registerName("numberWithLong:"); -late final _sel_numberWithUnsignedLong_ = - objc.registerName("numberWithUnsignedLong:"); -late final _sel_numberWithLongLong_ = objc.registerName("numberWithLongLong:"); -final _objc_msgSend_16f0drb = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.LongLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithUnsignedLongLong_ = - objc.registerName("numberWithUnsignedLongLong:"); -final _objc_msgSend_1x2hskc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLongLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_numberWithFloat_ = objc.registerName("numberWithFloat:"); -final _objc_msgSend_et8cuh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_numberWithDouble_ = objc.registerName("numberWithDouble:"); -late final _sel_numberWithBool_ = objc.registerName("numberWithBool:"); -final _objc_msgSend_1t6aok9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, bool)>(); -late final _sel_numberWithInteger_ = objc.registerName("numberWithInteger:"); -late final _sel_numberWithUnsignedInteger_ = - objc.registerName("numberWithUnsignedInteger:"); - -/// NSNumberCreation -extension NSNumberCreation on objc.NSNumber { - /// numberWithChar: - static objc.NSNumber numberWithChar_(int value) { - final _ret = - _objc_msgSend_13mclwd(_class_NSNumber, _sel_numberWithChar_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithUnsignedChar: - static objc.NSNumber numberWithUnsignedChar_(int value) { - final _ret = _objc_msgSend_7uautw( - _class_NSNumber, _sel_numberWithUnsignedChar_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithShort: - static objc.NSNumber numberWithShort_(int value) { - final _ret = - _objc_msgSend_68x6r1(_class_NSNumber, _sel_numberWithShort_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithUnsignedShort: - static objc.NSNumber numberWithUnsignedShort_(int value) { - final _ret = _objc_msgSend_1njucl2( - _class_NSNumber, _sel_numberWithUnsignedShort_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithInt: - static objc.NSNumber numberWithInt_(int value) { - final _ret = - _objc_msgSend_14hvw5k(_class_NSNumber, _sel_numberWithInt_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithUnsignedInt: - static objc.NSNumber numberWithUnsignedInt_(int value) { - final _ret = _objc_msgSend_degb40( - _class_NSNumber, _sel_numberWithUnsignedInt_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithLong: - static objc.NSNumber numberWithLong_(int value) { - final _ret = - _objc_msgSend_qugqlf(_class_NSNumber, _sel_numberWithLong_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithUnsignedLong: - static objc.NSNumber numberWithUnsignedLong_(int value) { - final _ret = _objc_msgSend_14hpxwa( - _class_NSNumber, _sel_numberWithUnsignedLong_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithLongLong: - static objc.NSNumber numberWithLongLong_(int value) { - final _ret = - _objc_msgSend_16f0drb(_class_NSNumber, _sel_numberWithLongLong_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithUnsignedLongLong: - static objc.NSNumber numberWithUnsignedLongLong_(int value) { - final _ret = _objc_msgSend_1x2hskc( - _class_NSNumber, _sel_numberWithUnsignedLongLong_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithFloat: - static objc.NSNumber numberWithFloat_(double value) { - final _ret = - _objc_msgSend_et8cuh(_class_NSNumber, _sel_numberWithFloat_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithDouble: - static objc.NSNumber numberWithDouble_(double value) { - final _ret = - _objc_msgSend_oa8mke(_class_NSNumber, _sel_numberWithDouble_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithBool: - static objc.NSNumber numberWithBool_(bool value) { - final _ret = - _objc_msgSend_1t6aok9(_class_NSNumber, _sel_numberWithBool_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithInteger: - static objc.NSNumber numberWithInteger_(DartNSInteger value) { - final _ret = - _objc_msgSend_qugqlf(_class_NSNumber, _sel_numberWithInteger_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// numberWithUnsignedInteger: - static objc.NSNumber numberWithUnsignedInteger_(DartNSUInteger value) { - final _ret = _objc_msgSend_14hpxwa( - _class_NSNumber, _sel_numberWithUnsignedInteger_, value); - return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } -} - late final _sel_getValue_ = objc.registerName("getValue:"); final _objc_msgSend_ovsamd = objc.msgSendPointer .cast< @@ -76877,9 +77805,11 @@ final _objc_msgSend_ovsamd = objc.msgSendPointer ffi.Pointer, ffi.Pointer)>(); /// NSDeprecated -extension NSDeprecated2 on objc.NSValue { +extension NSDeprecated$2 on objc.NSValue { /// getValue: void getValue_(ffi.Pointer value) { + objc.checkOsVersionInternal('NSValue.getValue:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_ovsamd(this.ref.pointer, _sel_getValue_, value); } } @@ -76938,480 +77868,166 @@ extension NSValueRangeExtensions on objc.NSValue { } late final _class_NSArray = objc.getClass("NSArray"); -late final _sel_arrayByAddingObject_ = - objc.registerName("arrayByAddingObject:"); -late final _sel_arrayByAddingObjectsFromArray_ = - objc.registerName("arrayByAddingObjectsFromArray:"); -late final _sel_componentsJoinedByString_ = - objc.registerName("componentsJoinedByString:"); -late final _sel_containsObject_ = objc.registerName("containsObject:"); -late final _sel_firstObjectCommonWithArray_ = - objc.registerName("firstObjectCommonWithArray:"); -late final _sel_getObjects_range_ = objc.registerName("getObjects:range:"); -final _objc_msgSend_o16d3k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - objc.NSRange)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - objc.NSRange)>(); -late final _sel_indexOfObject_ = objc.registerName("indexOfObject:"); -final _objc_msgSend_1vd1c5m = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_indexOfObject_inRange_ = - objc.registerName("indexOfObject:inRange:"); -final _objc_msgSend_zug4wi = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>>() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>(); -late final _sel_indexOfObjectIdenticalTo_ = - objc.registerName("indexOfObjectIdenticalTo:"); -late final _sel_indexOfObjectIdenticalTo_inRange_ = - objc.registerName("indexOfObjectIdenticalTo:inRange:"); -late final _sel_isEqualToArray_ = objc.registerName("isEqualToArray:"); -late final _sel_firstObject = objc.registerName("firstObject"); -late final _sel_lastObject = objc.registerName("lastObject"); -late final _sel_reverseObjectEnumerator = - objc.registerName("reverseObjectEnumerator"); -late final _sel_sortedArrayHint = objc.registerName("sortedArrayHint"); -late final _sel_sortedArrayUsingFunction_context_ = - objc.registerName("sortedArrayUsingFunction:context:"); -final _objc_msgSend_1ffoev1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>(); -late final _sel_sortedArrayUsingFunction_context_hint_ = - objc.registerName("sortedArrayUsingFunction:context:hint:"); -final _objc_msgSend_1i2r70j = objc.msgSendPointer +late final _sel_array = objc.registerName("array"); +late final _sel_arrayWithObject_ = objc.registerName("arrayWithObject:"); +late final _sel_arrayWithObjects_count_ = + objc.registerName("arrayWithObjects:count:"); +final _objc_msgSend_zmbtbd = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, - ffi.Pointer, - ffi.Pointer)>>() + ffi.Pointer>, + ffi.UnsignedLong)>>() .asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_sortedArrayUsingSelector_ = - objc.registerName("sortedArrayUsingSelector:"); -late final _sel_subarrayWithRange_ = objc.registerName("subarrayWithRange:"); -late final _sel_makeObjectsPerformSelector_ = - objc.registerName("makeObjectsPerformSelector:"); -final _objc_msgSend_1d9e4oe = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_makeObjectsPerformSelector_withObject_ = - objc.registerName("makeObjectsPerformSelector:withObject:"); -final _objc_msgSend_1qv0eq4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_objectsAtIndexes_ = objc.registerName("objectsAtIndexes:"); -late final _sel_objectAtIndexedSubscript_ = - objc.registerName("objectAtIndexedSubscript:"); -void _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - int, ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - int, ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} + ffi.Pointer>, + int)>(); +late final _sel_arrayWithObjects_ = objc.registerName("arrayWithObjects:"); +late final _sel_arrayWithArray_ = objc.registerName("arrayWithArray:"); +late final _sel_initWithObjects_ = objc.registerName("initWithObjects:"); +late final _sel_initWithArray_ = objc.registerName("initWithArray:"); +late final _sel_initWithArray_copyItems_ = + objc.registerName("initWithArray:copyItems:"); +late final _sel_arrayWithContentsOfURL_error_ = + objc.registerName("arrayWithContentsOfURL:error:"); -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) { - try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - int, ffi.Pointer))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); +/// NSArrayCreation +extension NSArrayCreation on objc.NSArray { + /// array + static objc.NSArray array() { + final _ret = _objc_msgSend_151sglz(_class_NSArray, _sel_array); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } -} -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_blockingCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_blockingTrampoline) - ..keepIsolateAlive = false; + /// arrayWithObject: + static objc.NSArray arrayWithObject_(objc.ObjCObjectBase anObject) { + final _ret = _objc_msgSend_1sotr3r( + _class_NSArray, _sel_arrayWithObject_, anObject.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } -/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>(pointer, - retain: retain, release: release); + /// arrayWithObjects:count: + static objc.NSArray arrayWithObjects_count_( + ffi.Pointer> objects, DartNSUInteger cnt) { + final _ret = _objc_msgSend_zmbtbd( + _class_NSArray, _sel_arrayWithObjects_count_, objects, cnt); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + /// arrayWithObjects: + static objc.NSArray arrayWithObjects_(objc.ObjCObjectBase firstObj) { + final _ret = _objc_msgSend_1sotr3r( + _class_NSArray, _sel_arrayWithObjects_, firstObj.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> - fromFunction(void Function(objc.ObjCObjectBase, DartNSUInteger, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureCallable, - (ffi.Pointer arg0, int arg1, ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: true, release: true), arg1, arg2)), - retain: false, - release: true); + /// arrayWithArray: + static objc.NSArray arrayWithArray_(objc.NSArray array) { + final _ret = _objc_msgSend_1sotr3r( + _class_NSArray, _sel_arrayWithArray_, array.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> listener( - void Function(objc.ObjCObjectBase, DartNSUInteger, ffi.Pointer) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true), arg1, - arg2)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1p9ui4q(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)>(wrapper, retain: false, release: true); + /// initWithObjects: + objc.NSArray initWithObjects_(objc.ObjCObjectBase firstObj) { + final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), + _sel_initWithObjects_, firstObj.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: false, release: true); } - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> blocking( - void Function(objc.ObjCObjectBase, DartNSUInteger, ffi.Pointer) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_blockingCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true), arg1, - arg2)); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true), arg1, - arg2)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1p9ui4q, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)>(wrapper, retain: false, release: true); + /// initWithArray: + objc.NSArray initWithArray_(objc.NSArray array) { + final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), + _sel_initWithArray_, array.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: false, release: true); } -} -/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. -extension ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> { - void call(objc.ObjCObjectBase arg0, DartNSUInteger arg1, - ffi.Pointer arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1, arg2); + /// initWithArray:copyItems: + objc.NSArray initWithArray_copyItems_(objc.NSArray array, bool flag) { + final _ret = _objc_msgSend_17amj0z(this.ref.retainAndReturnPointer(), + _sel_initWithArray_copyItems_, array.ref.pointer, flag); + return objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithContentsOfURL:error: + objc.NSArray? initWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + objc.checkOsVersionInternal('NSArray.initWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); + final _ret = _objc_msgSend_1lhpu4m(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, url.ref.pointer, error); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// arrayWithContentsOfURL:error: + static objc.NSArray? arrayWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + objc.checkOsVersionInternal('NSArray.arrayWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); + final _ret = _objc_msgSend_1lhpu4m(_class_NSArray, + _sel_arrayWithContentsOfURL_error_, url.ref.pointer, error); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } } -late final _sel_enumerateObjectsUsingBlock_ = - objc.registerName("enumerateObjectsUsingBlock:"); -late final _sel_enumerateObjectsWithOptions_usingBlock_ = - objc.registerName("enumerateObjectsWithOptions:usingBlock:"); -late final _sel_enumerateObjectsAtIndexes_options_usingBlock_ = - objc.registerName("enumerateObjectsAtIndexes:options:usingBlock:"); -final _objc_msgSend_a3wp08 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -bool _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrTrampoline( +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => + ffi.Pointer arg1) => block.ref.target .cast< ffi.NativeFunction< ffi.Bool Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>>() + ffi.Pointer arg1)>>() .asFunction< - bool Function(ffi.Pointer, int, - ffi.Pointer)>()(arg0, arg1, arg2); + bool Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); ffi.Pointer - _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrCallable = + _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Bool Function( ffi.Pointer, ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrTrampoline, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline, false) .cast(); -bool _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureTrampoline( +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => + ffi.Pointer arg1) => (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - int, ffi.Pointer))(arg0, arg1, arg2); + ffi.Pointer))(arg0, arg1); ffi.Pointer - _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureCallable = + _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable = ffi.Pointer.fromFunction< ffi.Bool Function( ffi.Pointer, ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureTrampoline, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline, false) .cast(); -/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_objcObjCObject_NSUInteger_bool { +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< ffi.Bool Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>(pointer, + ffi.Pointer)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -77420,13 +78036,13 @@ abstract final class ObjCBlock_bool_objcObjCObject_NSUInteger_bool { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc - .ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> ptr) => + .ObjCBlock, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => objc.ObjCBlock< ffi.Bool Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( + ffi.Pointer)>( objc.newPointerBlock( - _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrCallable, + _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -77436,754 +78052,72 @@ abstract final class ObjCBlock_bool_objcObjCObject_NSUInteger_bool { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> - fromFunction(bool Function(objc.ObjCObjectBase, DartNSUInteger, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock, ffi.Pointer)> + fromFunction(bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock, ffi.Pointer)>( objc.newClosureBlock( - _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureCallable, - (ffi.Pointer arg0, int arg1, ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: true, release: true), arg1, arg2)), + _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); } -/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. -extension ObjCBlock_bool_objcObjCObject_NSUInteger_bool_CallExtension +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_bool_objcObjCObject_objcObjCObject_CallExtension on objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> { - bool call(objc.ObjCObjectBase arg0, DartNSUInteger arg1, - ffi.Pointer arg2) => + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> { + bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Bool Function( ffi.Pointer block, ffi.Pointer arg0, - NSUInteger arg1, - ffi.Pointer arg2)>>() + ffi.Pointer arg1)>>() .asFunction< bool Function( ffi.Pointer, ffi.Pointer, - int, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1, arg2); + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); } -late final _sel_indexOfObjectPassingTest_ = - objc.registerName("indexOfObjectPassingTest:"); -final _objc_msgSend_10mlopr = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_indexOfObjectWithOptions_passingTest_ = - objc.registerName("indexOfObjectWithOptions:passingTest:"); -final _objc_msgSend_1698hqz = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_indexOfObjectAtIndexes_options_passingTest_ = - objc.registerName("indexOfObjectAtIndexes:options:passingTest:"); -final _objc_msgSend_k1x6mt = objc.msgSendPointer +late final _sel_differenceFromArray_withOptions_usingEquivalenceTest_ = + objc.registerName("differenceFromArray:withOptions:usingEquivalenceTest:"); +final _objc_msgSend_1415lvo = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.UnsignedLong Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, NSUInteger, ffi.Pointer)>>() .asFunction< - int Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); -late final _sel_indexesOfObjectsPassingTest_ = - objc.registerName("indexesOfObjectsPassingTest:"); -late final _sel_indexesOfObjectsWithOptions_passingTest_ = - objc.registerName("indexesOfObjectsWithOptions:passingTest:"); -late final _sel_indexesOfObjectsAtIndexes_options_passingTest_ = - objc.registerName("indexesOfObjectsAtIndexes:options:passingTest:"); -final _objc_msgSend_1i9v144 = objc.msgSendPointer +late final _sel_differenceFromArray_withOptions_ = + objc.registerName("differenceFromArray:withOptions:"); +final _objc_msgSend_1wtpmu7 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_sortedArrayUsingComparator_ = - objc.registerName("sortedArrayUsingComparator:"); -late final _sel_sortedArrayWithOptions_usingComparator_ = - objc.registerName("sortedArrayWithOptions:usingComparator:"); -late final _sel_indexOfObject_inSortedRange_options_usingComparator_ = - objc.registerName("indexOfObject:inSortedRange:options:usingComparator:"); -final _objc_msgSend_kshx9d = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - int, - ffi.Pointer)>(); - -/// NSExtendedArray -extension NSExtendedArray on objc.NSArray { - /// arrayByAddingObject: - objc.NSArray arrayByAddingObject_(objc.ObjCObjectBase anObject) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_arrayByAddingObject_, anObject.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayByAddingObjectsFromArray: - objc.NSArray arrayByAddingObjectsFromArray_(objc.NSArray otherArray) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_arrayByAddingObjectsFromArray_, otherArray.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// componentsJoinedByString: - objc.NSString componentsJoinedByString_(objc.NSString separator) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_componentsJoinedByString_, separator.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// containsObject: - bool containsObject_(objc.ObjCObjectBase anObject) { - return _objc_msgSend_19nvye5( - this.ref.pointer, _sel_containsObject_, anObject.ref.pointer); - } - - /// description - objc.NSString get description { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithLocale: - objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithLocale:indent: - objc.NSString descriptionWithLocale_indent_( - objc.ObjCObjectBase? locale, DartNSUInteger level) { - final _ret = _objc_msgSend_1k4kd9s( - this.ref.pointer, - _sel_descriptionWithLocale_indent_, - locale?.ref.pointer ?? ffi.nullptr, - level); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// firstObjectCommonWithArray: - objc.ObjCObjectBase? firstObjectCommonWithArray_(objc.NSArray otherArray) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_firstObjectCommonWithArray_, otherArray.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// getObjects:range: - void getObjects_range_( - ffi.Pointer> objects, NSRange range) { - _objc_msgSend_o16d3k( - this.ref.pointer, _sel_getObjects_range_, objects, range); - } - - /// indexOfObject: - DartNSUInteger indexOfObject_(objc.ObjCObjectBase anObject) { - return _objc_msgSend_1vd1c5m( - this.ref.pointer, _sel_indexOfObject_, anObject.ref.pointer); - } - - /// indexOfObject:inRange: - DartNSUInteger indexOfObject_inRange_( - objc.ObjCObjectBase anObject, NSRange range) { - return _objc_msgSend_zug4wi(this.ref.pointer, _sel_indexOfObject_inRange_, - anObject.ref.pointer, range); - } - - /// indexOfObjectIdenticalTo: - DartNSUInteger indexOfObjectIdenticalTo_(objc.ObjCObjectBase anObject) { - return _objc_msgSend_1vd1c5m( - this.ref.pointer, _sel_indexOfObjectIdenticalTo_, anObject.ref.pointer); - } - - /// indexOfObjectIdenticalTo:inRange: - DartNSUInteger indexOfObjectIdenticalTo_inRange_( - objc.ObjCObjectBase anObject, NSRange range) { - return _objc_msgSend_zug4wi(this.ref.pointer, - _sel_indexOfObjectIdenticalTo_inRange_, anObject.ref.pointer, range); - } - - /// isEqualToArray: - bool isEqualToArray_(objc.NSArray otherArray) { - return _objc_msgSend_19nvye5( - this.ref.pointer, _sel_isEqualToArray_, otherArray.ref.pointer); - } - - /// firstObject - objc.ObjCObjectBase? get firstObject { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_firstObject); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// lastObject - objc.ObjCObjectBase? get lastObject { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_lastObject); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// objectEnumerator - objc.NSEnumerator objectEnumerator() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_objectEnumerator); - return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); - } - - /// reverseObjectEnumerator - objc.NSEnumerator reverseObjectEnumerator() { - final _ret = - _objc_msgSend_151sglz(this.ref.pointer, _sel_reverseObjectEnumerator); - return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); - } - - /// sortedArrayHint - objc.NSData get sortedArrayHint { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_sortedArrayHint); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// sortedArrayUsingFunction:context: - objc.NSArray sortedArrayUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - comparator, - ffi.Pointer context) { - final _ret = _objc_msgSend_1ffoev1(this.ref.pointer, - _sel_sortedArrayUsingFunction_context_, comparator, context); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// sortedArrayUsingFunction:context:hint: - objc.NSArray sortedArrayUsingFunction_context_hint_( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - comparator, - ffi.Pointer context, - objc.NSData? hint) { - final _ret = _objc_msgSend_1i2r70j( - this.ref.pointer, - _sel_sortedArrayUsingFunction_context_hint_, - comparator, - context, - hint?.ref.pointer ?? ffi.nullptr); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// sortedArrayUsingSelector: - objc.NSArray sortedArrayUsingSelector_( - ffi.Pointer comparator) { - final _ret = _objc_msgSend_3ctkt6( - this.ref.pointer, _sel_sortedArrayUsingSelector_, comparator); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// subarrayWithRange: - objc.NSArray subarrayWithRange_(NSRange range) { - final _ret = - _objc_msgSend_1k1o1s7(this.ref.pointer, _sel_subarrayWithRange_, range); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// writeToURL:error: - bool writeToURL_error_( - objc.NSURL url, ffi.Pointer> error) { - return _objc_msgSend_l9p60w( - this.ref.pointer, _sel_writeToURL_error_, url.ref.pointer, error); - } - - /// makeObjectsPerformSelector: - void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _objc_msgSend_1d9e4oe( - this.ref.pointer, _sel_makeObjectsPerformSelector_, aSelector); - } - - /// makeObjectsPerformSelector:withObject: - void makeObjectsPerformSelector_withObject_( - ffi.Pointer aSelector, objc.ObjCObjectBase? argument) { - _objc_msgSend_1qv0eq4( - this.ref.pointer, - _sel_makeObjectsPerformSelector_withObject_, - aSelector, - argument?.ref.pointer ?? ffi.nullptr); - } - - /// objectsAtIndexes: - objc.NSArray objectsAtIndexes_(objc.NSIndexSet indexes) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_objectsAtIndexes_, indexes.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// objectAtIndexedSubscript: - objc.ObjCObjectBase objectAtIndexedSubscript_(DartNSUInteger idx) { - final _ret = _objc_msgSend_14hpxwa( - this.ref.pointer, _sel_objectAtIndexedSubscript_, idx); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// enumerateObjectsUsingBlock: - void enumerateObjectsUsingBlock_( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - block) { - _objc_msgSend_f167m6( - this.ref.pointer, _sel_enumerateObjectsUsingBlock_, block.ref.pointer); - } - - /// enumerateObjectsWithOptions:usingBlock: - void enumerateObjectsWithOptions_usingBlock_( - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - block) { - _objc_msgSend_yx8yc6( - this.ref.pointer, - _sel_enumerateObjectsWithOptions_usingBlock_, - opts.value, - block.ref.pointer); - } - - /// enumerateObjectsAtIndexes:options:usingBlock: - void enumerateObjectsAtIndexes_options_usingBlock_( - objc.NSIndexSet s, - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - block) { - _objc_msgSend_a3wp08( - this.ref.pointer, - _sel_enumerateObjectsAtIndexes_options_usingBlock_, - s.ref.pointer, - opts.value, - block.ref.pointer); - } - - /// indexOfObjectPassingTest: - DartNSUInteger indexOfObjectPassingTest_( - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - predicate) { - return _objc_msgSend_10mlopr(this.ref.pointer, - _sel_indexOfObjectPassingTest_, predicate.ref.pointer); - } - - /// indexOfObjectWithOptions:passingTest: - DartNSUInteger indexOfObjectWithOptions_passingTest_( - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - predicate) { - return _objc_msgSend_1698hqz( - this.ref.pointer, - _sel_indexOfObjectWithOptions_passingTest_, - opts.value, - predicate.ref.pointer); - } - - /// indexOfObjectAtIndexes:options:passingTest: - DartNSUInteger indexOfObjectAtIndexes_options_passingTest_( - objc.NSIndexSet s, - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - predicate) { - return _objc_msgSend_k1x6mt( - this.ref.pointer, - _sel_indexOfObjectAtIndexes_options_passingTest_, - s.ref.pointer, - opts.value, - predicate.ref.pointer); - } - - /// indexesOfObjectsPassingTest: - objc.NSIndexSet indexesOfObjectsPassingTest_( - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - predicate) { - final _ret = _objc_msgSend_nnxkei(this.ref.pointer, - _sel_indexesOfObjectsPassingTest_, predicate.ref.pointer); - return objc.NSIndexSet.castFromPointer(_ret, retain: true, release: true); - } - - /// indexesOfObjectsWithOptions:passingTest: - objc.NSIndexSet indexesOfObjectsWithOptions_passingTest_( - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - predicate) { - final _ret = _objc_msgSend_13x5boi( - this.ref.pointer, - _sel_indexesOfObjectsWithOptions_passingTest_, - opts.value, - predicate.ref.pointer); - return objc.NSIndexSet.castFromPointer(_ret, retain: true, release: true); - } - - /// indexesOfObjectsAtIndexes:options:passingTest: - objc.NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( - objc.NSIndexSet s, - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - predicate) { - final _ret = _objc_msgSend_1i9v144( - this.ref.pointer, - _sel_indexesOfObjectsAtIndexes_options_passingTest_, - s.ref.pointer, - opts.value, - predicate.ref.pointer); - return objc.NSIndexSet.castFromPointer(_ret, retain: true, release: true); - } - - /// sortedArrayUsingComparator: - objc.NSArray sortedArrayUsingComparator_(DartNSComparator cmptr) { - final _ret = _objc_msgSend_nnxkei( - this.ref.pointer, _sel_sortedArrayUsingComparator_, cmptr.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// sortedArrayWithOptions:usingComparator: - objc.NSArray sortedArrayWithOptions_usingComparator_( - objc.NSSortOptions opts, DartNSComparator cmptr) { - final _ret = _objc_msgSend_1x5ew3h( - this.ref.pointer, - _sel_sortedArrayWithOptions_usingComparator_, - opts.value, - cmptr.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// indexOfObject:inSortedRange:options:usingComparator: - DartNSUInteger indexOfObject_inSortedRange_options_usingComparator_( - objc.ObjCObjectBase obj, - NSRange r, - objc.NSBinarySearchingOptions opts, - DartNSComparator cmp) { - return _objc_msgSend_kshx9d( - this.ref.pointer, - _sel_indexOfObject_inSortedRange_options_usingComparator_, - obj.ref.pointer, - r, - opts.value, - cmp.ref.pointer); - } -} - -late final _sel_array = objc.registerName("array"); -late final _sel_arrayWithObject_ = objc.registerName("arrayWithObject:"); -late final _sel_arrayWithObjects_count_ = - objc.registerName("arrayWithObjects:count:"); -final _objc_msgSend_zmbtbd = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - int)>(); -late final _sel_arrayWithObjects_ = objc.registerName("arrayWithObjects:"); -late final _sel_arrayWithArray_ = objc.registerName("arrayWithArray:"); -late final _sel_initWithObjects_ = objc.registerName("initWithObjects:"); -late final _sel_initWithArray_ = objc.registerName("initWithArray:"); -late final _sel_initWithArray_copyItems_ = - objc.registerName("initWithArray:copyItems:"); -late final _sel_arrayWithContentsOfURL_error_ = - objc.registerName("arrayWithContentsOfURL:error:"); - -/// NSArrayCreation -extension NSArrayCreation on objc.NSArray { - /// array - static objc.NSArray array() { - final _ret = _objc_msgSend_151sglz(_class_NSArray, _sel_array); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayWithObject: - static objc.NSArray arrayWithObject_(objc.ObjCObjectBase anObject) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, _sel_arrayWithObject_, anObject.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayWithObjects:count: - static objc.NSArray arrayWithObjects_count_( - ffi.Pointer> objects, DartNSUInteger cnt) { - final _ret = _objc_msgSend_zmbtbd( - _class_NSArray, _sel_arrayWithObjects_count_, objects, cnt); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayWithObjects: - static objc.NSArray arrayWithObjects_(objc.ObjCObjectBase firstObj) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, _sel_arrayWithObjects_, firstObj.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayWithArray: - static objc.NSArray arrayWithArray_(objc.NSArray array) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, _sel_arrayWithArray_, array.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithObjects: - objc.NSArray initWithObjects_(objc.ObjCObjectBase firstObj) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithObjects_, firstObj.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithArray: - objc.NSArray initWithArray_(objc.NSArray array) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithArray_, array.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithArray:copyItems: - objc.NSArray initWithArray_copyItems_(objc.NSArray array, bool flag) { - final _ret = _objc_msgSend_17amj0z(this.ref.retainAndReturnPointer(), - _sel_initWithArray_copyItems_, array.ref.pointer, flag); - return objc.NSArray.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithContentsOfURL:error: - objc.NSArray? initWithContentsOfURL_error_( - objc.NSURL url, ffi.Pointer> error) { - final _ret = _objc_msgSend_1lhpu4m(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_error_, url.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: false, release: true); - } - - /// arrayWithContentsOfURL:error: - static objc.NSArray? arrayWithContentsOfURL_error_( - objc.NSURL url, ffi.Pointer> error) { - final _ret = _objc_msgSend_1lhpu4m(_class_NSArray, - _sel_arrayWithContentsOfURL_error_, url.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } -} - -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline, - false) - .cast(); -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline, - false) - .cast(); - -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer)>( - objc.newPointerBlock( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer)> - fromFunction(bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => - objc.ObjCBlock, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true))), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_bool_objcObjCObject_objcObjCObject_CallExtension - on objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)> { - bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer); -} - -late final _sel_differenceFromArray_withOptions_usingEquivalenceTest_ = - objc.registerName("differenceFromArray:withOptions:usingEquivalenceTest:"); -final _objc_msgSend_1415lvo = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_differenceFromArray_withOptions_ = - objc.registerName("differenceFromArray:withOptions:"); -final _objc_msgSend_1wtpmu7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>() + NSUInteger)>>() .asFunction< ffi.Pointer Function( ffi.Pointer, @@ -78206,6 +78140,10 @@ extension NSArrayDiffing on objc.NSArray { ffi.Bool Function(ffi.Pointer, ffi.Pointer)> block) { + objc.checkOsVersionInternal( + 'NSArray.differenceFromArray:withOptions:usingEquivalenceTest:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1415lvo( this.ref.pointer, _sel_differenceFromArray_withOptions_usingEquivalenceTest_, @@ -78220,6 +78158,8 @@ extension NSArrayDiffing on objc.NSArray { objc.NSOrderedCollectionDifference differenceFromArray_withOptions_( objc.NSArray other, objc.NSOrderedCollectionDifferenceCalculationOptions options) { + objc.checkOsVersionInternal('NSArray.differenceFromArray:withOptions:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1wtpmu7( this.ref.pointer, _sel_differenceFromArray_withOptions_, @@ -78231,6 +78171,8 @@ extension NSArrayDiffing on objc.NSArray { /// differenceFromArray: objc.NSOrderedCollectionDifference differenceFromArray_(objc.NSArray other) { + objc.checkOsVersionInternal('NSArray.differenceFromArray:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_differenceFromArray_, other.ref.pointer); return objc.NSOrderedCollectionDifference.castFromPointer(_ret, @@ -78240,6 +78182,8 @@ extension NSArrayDiffing on objc.NSArray { /// arrayByApplyingDifference: objc.NSArray? arrayByApplyingDifference_( objc.NSOrderedCollectionDifference difference) { + objc.checkOsVersionInternal('NSArray.arrayByApplyingDifference:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, _sel_arrayByApplyingDifference_, difference.ref.pointer); return _ret.address == 0 @@ -78267,14 +78211,18 @@ late final _sel_arrayWithContentsOfURL_ = objc.registerName("arrayWithContentsOfURL:"); /// NSDeprecated -extension NSDeprecated3 on objc.NSArray { +extension NSDeprecated$3 on objc.NSArray { /// getObjects: void getObjects_(ffi.Pointer> objects) { + objc.checkOsVersionInternal('NSArray.getObjects:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_1dau4w(this.ref.pointer, _sel_getObjects_, objects); } /// arrayWithContentsOfFile: static objc.NSArray? arrayWithContentsOfFile_(objc.NSString path) { + objc.checkOsVersionInternal('NSArray.arrayWithContentsOfFile:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSArray, _sel_arrayWithContentsOfFile_, path.ref.pointer); return _ret.address == 0 @@ -78284,6 +78232,8 @@ extension NSDeprecated3 on objc.NSArray { /// arrayWithContentsOfURL: static objc.NSArray? arrayWithContentsOfURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSArray.arrayWithContentsOfURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSArray, _sel_arrayWithContentsOfURL_, url.ref.pointer); return _ret.address == 0 @@ -78293,6 +78243,8 @@ extension NSDeprecated3 on objc.NSArray { /// initWithContentsOfFile: objc.NSArray? initWithContentsOfFile_(objc.NSString path) { + objc.checkOsVersionInternal('NSArray.initWithContentsOfFile:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), _sel_initWithContentsOfFile_, path.ref.pointer); return _ret.address == 0 @@ -78302,6 +78254,8 @@ extension NSDeprecated3 on objc.NSArray { /// initWithContentsOfURL: objc.NSArray? initWithContentsOfURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSArray.initWithContentsOfURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_, url.ref.pointer); return _ret.address == 0 @@ -78311,454 +78265,145 @@ extension NSDeprecated3 on objc.NSArray { /// writeToFile:atomically: bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + objc.checkOsVersionInternal('NSArray.writeToFile:atomically:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToFile_atomically_, path.ref.pointer, useAuxiliaryFile); } /// writeToURL:atomically: bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + objc.checkOsVersionInternal('NSArray.writeToURL:atomically:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToURL_atomically_, url.ref.pointer, atomically); } } late final _class_NSMutableArray = objc.getClass("NSMutableArray"); -late final _sel_addObjectsFromArray_ = - objc.registerName("addObjectsFromArray:"); -late final _sel_exchangeObjectAtIndex_withObjectAtIndex_ = - objc.registerName("exchangeObjectAtIndex:withObjectAtIndex:"); -final _objc_msgSend_bfp043 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int, int)>(); -late final _sel_removeObject_inRange_ = - objc.registerName("removeObject:inRange:"); -final _objc_msgSend_1oteutl = objc.msgSendPointer - .cast< - ffi.NativeFunction< +late final _sel_arrayWithCapacity_ = objc.registerName("arrayWithCapacity:"); + +/// NSMutableArrayCreation +extension NSMutableArrayCreation on objc.NSMutableArray { + /// arrayWithCapacity: + static objc.NSMutableArray arrayWithCapacity_(DartNSUInteger numItems) { + final _ret = _objc_msgSend_14hpxwa( + _class_NSMutableArray, _sel_arrayWithCapacity_, numItems); + return objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } + + /// arrayWithContentsOfFile: + static objc.NSMutableArray? arrayWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_1sotr3r( + _class_NSMutableArray, _sel_arrayWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } + + /// arrayWithContentsOfURL: + static objc.NSMutableArray? arrayWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_1sotr3r( + _class_NSMutableArray, _sel_arrayWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithContentsOfFile: + objc.NSMutableArray? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: false, release: true); + } + + /// initWithContentsOfURL: + objc.NSMutableArray? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: false, release: true); + } +} + +late final _sel_applyDifference_ = objc.registerName("applyDifference:"); + +/// NSMutableArrayDiffing +extension NSMutableArrayDiffing on objc.NSMutableArray { + /// applyDifference: + void applyDifference_(objc.NSOrderedCollectionDifference difference) { + objc.checkOsVersionInternal('NSMutableArray.applyDifference:', + iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); + _objc_msgSend_xtuoz7( + this.ref.pointer, _sel_applyDifference_, difference.ref.pointer); + } +} + +void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerCallable = ffi + .NativeCallable< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>(); -late final _sel_removeObject_ = objc.registerName("removeObject:"); -late final _sel_removeObjectIdenticalTo_inRange_ = - objc.registerName("removeObjectIdenticalTo:inRange:"); -late final _sel_removeObjectIdenticalTo_ = - objc.registerName("removeObjectIdenticalTo:"); -late final _sel_removeObjectsFromIndices_numIndices_ = - objc.registerName("removeObjectsFromIndices:numIndices:"); -final _objc_msgSend_swohtd = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_removeObjectsInArray_ = - objc.registerName("removeObjectsInArray:"); -late final _sel_removeObjectsInRange_ = - objc.registerName("removeObjectsInRange:"); -final _objc_msgSend_1e3pm0z = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, objc.NSRange)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, objc.NSRange)>(); -late final _sel_replaceObjectsInRange_withObjectsFromArray_range_ = - objc.registerName("replaceObjectsInRange:withObjectsFromArray:range:"); -final _objc_msgSend_15bolr3 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - ffi.Pointer, - objc.NSRange)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - ffi.Pointer, - objc.NSRange)>(); -late final _sel_replaceObjectsInRange_withObjectsFromArray_ = - objc.registerName("replaceObjectsInRange:withObjectsFromArray:"); -final _objc_msgSend_1tv4uax = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - ffi.Pointer)>(); -late final _sel_setArray_ = objc.registerName("setArray:"); -late final _sel_sortUsingFunction_context_ = - objc.registerName("sortUsingFunction:context:"); -final _objc_msgSend_1bvics1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>(); -late final _sel_sortUsingSelector_ = objc.registerName("sortUsingSelector:"); -late final _sel_insertObjects_atIndexes_ = - objc.registerName("insertObjects:atIndexes:"); -late final _sel_removeObjectsAtIndexes_ = - objc.registerName("removeObjectsAtIndexes:"); -late final _sel_replaceObjectsAtIndexes_withObjects_ = - objc.registerName("replaceObjectsAtIndexes:withObjects:"); -late final _sel_setObject_atIndexedSubscript_ = - objc.registerName("setObject:atIndexedSubscript:"); -final _objc_msgSend_djsa9o = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_sortUsingComparator_ = - objc.registerName("sortUsingComparator:"); -late final _sel_sortWithOptions_usingComparator_ = - objc.registerName("sortWithOptions:usingComparator:"); -final _objc_msgSend_jjgvjt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - -/// NSExtendedMutableArray -extension NSExtendedMutableArray on objc.NSMutableArray { - /// addObjectsFromArray: - void addObjectsFromArray_(objc.NSArray otherArray) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_addObjectsFromArray_, otherArray.ref.pointer); - } - - /// exchangeObjectAtIndex:withObjectAtIndex: - void exchangeObjectAtIndex_withObjectAtIndex_( - DartNSUInteger idx1, DartNSUInteger idx2) { - _objc_msgSend_bfp043(this.ref.pointer, - _sel_exchangeObjectAtIndex_withObjectAtIndex_, idx1, idx2); - } - - /// removeAllObjects - void removeAllObjects() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); - } - - /// removeObject:inRange: - void removeObject_inRange_(objc.ObjCObjectBase anObject, NSRange range) { - _objc_msgSend_1oteutl(this.ref.pointer, _sel_removeObject_inRange_, - anObject.ref.pointer, range); - } - - /// removeObject: - void removeObject_(objc.ObjCObjectBase anObject) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_removeObject_, anObject.ref.pointer); - } - - /// removeObjectIdenticalTo:inRange: - void removeObjectIdenticalTo_inRange_( - objc.ObjCObjectBase anObject, NSRange range) { - _objc_msgSend_1oteutl(this.ref.pointer, - _sel_removeObjectIdenticalTo_inRange_, anObject.ref.pointer, range); - } - - /// removeObjectIdenticalTo: - void removeObjectIdenticalTo_(objc.ObjCObjectBase anObject) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_removeObjectIdenticalTo_, anObject.ref.pointer); - } - - /// removeObjectsFromIndices:numIndices: - void removeObjectsFromIndices_numIndices_( - ffi.Pointer indices, DartNSUInteger cnt) { - _objc_msgSend_swohtd(this.ref.pointer, - _sel_removeObjectsFromIndices_numIndices_, indices, cnt); - } - - /// removeObjectsInArray: - void removeObjectsInArray_(objc.NSArray otherArray) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_removeObjectsInArray_, otherArray.ref.pointer); - } - - /// removeObjectsInRange: - void removeObjectsInRange_(NSRange range) { - _objc_msgSend_1e3pm0z(this.ref.pointer, _sel_removeObjectsInRange_, range); - } - - /// replaceObjectsInRange:withObjectsFromArray:range: - void replaceObjectsInRange_withObjectsFromArray_range_( - NSRange range, objc.NSArray otherArray, NSRange otherRange) { - _objc_msgSend_15bolr3( - this.ref.pointer, - _sel_replaceObjectsInRange_withObjectsFromArray_range_, - range, - otherArray.ref.pointer, - otherRange); - } - - /// replaceObjectsInRange:withObjectsFromArray: - void replaceObjectsInRange_withObjectsFromArray_( - NSRange range, objc.NSArray otherArray) { - _objc_msgSend_1tv4uax( - this.ref.pointer, - _sel_replaceObjectsInRange_withObjectsFromArray_, - range, - otherArray.ref.pointer); - } - - /// setArray: - void setArray_(objc.NSArray otherArray) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_setArray_, otherArray.ref.pointer); - } - - /// sortUsingFunction:context: - void sortUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context) { - _objc_msgSend_1bvics1( - this.ref.pointer, _sel_sortUsingFunction_context_, compare, context); - } - - /// sortUsingSelector: - void sortUsingSelector_(ffi.Pointer comparator) { - _objc_msgSend_1d9e4oe( - this.ref.pointer, _sel_sortUsingSelector_, comparator); - } - - /// insertObjects:atIndexes: - void insertObjects_atIndexes_(objc.NSArray objects, objc.NSIndexSet indexes) { - _objc_msgSend_pfv6jd(this.ref.pointer, _sel_insertObjects_atIndexes_, - objects.ref.pointer, indexes.ref.pointer); - } - - /// removeObjectsAtIndexes: - void removeObjectsAtIndexes_(objc.NSIndexSet indexes) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_removeObjectsAtIndexes_, indexes.ref.pointer); - } - - /// replaceObjectsAtIndexes:withObjects: - void replaceObjectsAtIndexes_withObjects_( - objc.NSIndexSet indexes, objc.NSArray objects) { - _objc_msgSend_pfv6jd( - this.ref.pointer, - _sel_replaceObjectsAtIndexes_withObjects_, - indexes.ref.pointer, - objects.ref.pointer); - } - - /// setObject:atIndexedSubscript: - void setObject_atIndexedSubscript_( - objc.ObjCObjectBase obj, DartNSUInteger idx) { - _objc_msgSend_djsa9o(this.ref.pointer, _sel_setObject_atIndexedSubscript_, - obj.ref.pointer, idx); - } - - /// sortUsingComparator: - void sortUsingComparator_(DartNSComparator cmptr) { - _objc_msgSend_f167m6( - this.ref.pointer, _sel_sortUsingComparator_, cmptr.ref.pointer); - } - - /// sortWithOptions:usingComparator: - void sortWithOptions_usingComparator_( - objc.NSSortOptions opts, DartNSComparator cmptr) { - _objc_msgSend_jjgvjt(this.ref.pointer, - _sel_sortWithOptions_usingComparator_, opts.value, cmptr.ref.pointer); - } -} - -late final _sel_arrayWithCapacity_ = objc.registerName("arrayWithCapacity:"); - -/// NSMutableArrayCreation -extension NSMutableArrayCreation on objc.NSMutableArray { - /// arrayWithCapacity: - static objc.NSMutableArray arrayWithCapacity_(DartNSUInteger numItems) { - final _ret = _objc_msgSend_14hpxwa( - _class_NSMutableArray, _sel_arrayWithCapacity_, numItems); - return objc.NSMutableArray.castFromPointer(_ret, - retain: true, release: true); - } - - /// arrayWithContentsOfFile: - static objc.NSMutableArray? arrayWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSMutableArray, _sel_arrayWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: true, release: true); - } - - /// arrayWithContentsOfURL: - static objc.NSMutableArray? arrayWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSMutableArray, _sel_arrayWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: true, release: true); - } - - /// initWithContentsOfFile: - objc.NSMutableArray? initWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithContentsOfURL: - objc.NSMutableArray? initWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _sel_applyDifference_ = objc.registerName("applyDifference:"); - -/// NSMutableArrayDiffing -extension NSMutableArrayDiffing on objc.NSMutableArray { - /// applyDifference: - void applyDifference_(objc.NSOrderedCollectionDifference difference) { - _objc_msgSend_xtuoz7( - this.ref.pointer, _sel_applyDifference_, difference.ref.pointer); - } -} - -void _ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerTrampoline) + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerTrampoline) ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_objcObjCObject_NSError_blockingTrampoline( +void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingTrampoline( ffi.Pointer block, ffi.Pointer waiter, ffi.Pointer arg0, @@ -78779,14 +78424,14 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_NSError_blockingCallable = ffi + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingCallable = ffi .NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_blockingTrampoline) + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingTrampoline) ..keepIsolateAlive = false; ffi.NativeCallable< ffi.Void Function( @@ -78794,18 +78439,18 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_NSError_blockingListenerCallable = ffi + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingListenerCallable = ffi .NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_blockingTrampoline) + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingTrampoline) ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock?, objc.NSError)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { +abstract final class ObjCBlock_ffiVoid_idNSSecureCoding_NSError { /// Returns a block that wraps the given raw block pointer. static objc .ObjCBlock?, objc.NSError)> @@ -78827,7 +78472,7 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { ffi.Pointer arg1)>> ptr) => objc.ObjCBlock?, objc.NSError)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -78836,16 +78481,21 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock?, objc.NSError)> fromFunction( - void Function(objc.ObjCObjectBase?, objc.NSError) fn) => + void Function(objc.NSSecureCoding?, objc.NSError) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock?, objc.NSError)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureCallable, + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.NSError.castFromPointer(arg1, retain: true, release: true))), + : objc.NSSecureCoding.castFromPointer(arg0, retain: true, release: true), + objc.NSError.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -78856,13 +78506,14 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc .ObjCBlock?, objc.NSError)> - listener(void Function(objc.ObjCObjectBase?, objc.NSError) fn) { + listener(void Function(objc.NSSecureCoding?, objc.NSError) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerCallable + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, @@ -78870,9 +78521,11 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { fn( arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, retain: false, release: true), + : objc.NSSecureCoding.castFromPointer(arg0, + retain: false, release: true), objc.NSError.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< @@ -78886,14 +78539,16 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc .ObjCBlock?, objc.NSError)> - blocking(void Function(objc.ObjCObjectBase?, objc.NSError) fn) { + blocking(void Function(objc.NSSecureCoding?, objc.NSError) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_blockingCallable + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingCallable .nativeFunction .cast(), (ffi.Pointer arg0, @@ -78901,11 +78556,13 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { fn( arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, retain: false, release: true), + : objc.NSSecureCoding.castFromPointer(arg0, + retain: false, release: true), objc.NSError.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_NSError_blockingListenerCallable + _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingListenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, @@ -78913,11 +78570,13 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { fn( arg0.address == 0 ? null - : objc.ObjCObjectBase(arg0, retain: false, release: true), + : objc.NSSecureCoding.castFromPointer(arg0, + retain: false, release: true), objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< @@ -78927,9 +78586,9 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { } /// Call operator for `objc.ObjCBlock?, objc.NSError)>`. -extension ObjCBlock_ffiVoid_objcObjCObject_NSError_CallExtension on objc +extension ObjCBlock_ffiVoid_idNSSecureCoding_NSError_CallExtension on objc .ObjCBlock?, objc.NSError)> { - void call(objc.ObjCObjectBase? arg0, objc.NSError arg1) => + void call(objc.NSSecureCoding? arg0, objc.NSError arg1) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -79039,3158 +78698,298 @@ void } catch (e) { } finally { objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. -abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)> - castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)> - fromFunctionPointer(ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)>(objc.newPointerBlock(_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrCallable, ptr.cast()), retain: false, release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)> - fromFunction(void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, objc.NSDictionary) fn) => - objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureCallable, - (NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - ObjCBlock_ffiVoid_objcObjCObject_NSError.castFromPointer(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), - objc.NSDictionary.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)> listener( - void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, - objc.NSDictionary) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerCallable - .nativeFunction - .cast(), - (NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - ObjCBlock_ffiVoid_objcObjCObject_NSError.castFromPointer(arg0, - retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.NSDictionary.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1b3bb6a(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)>(wrapper, retain: false, release: true); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)> blocking( - void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, - objc.NSDictionary) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingCallable - .nativeFunction - .cast(), - (NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - ObjCBlock_ffiVoid_objcObjCObject_NSError.castFromPointer(arg0, - retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.NSDictionary.castFromPointer(arg2, - retain: false, release: true))); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingListenerCallable - .nativeFunction - .cast(), - (NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - ObjCBlock_ffiVoid_objcObjCObject_NSError.castFromPointer(arg0, - retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.NSDictionary.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. -extension ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)> { - void call(DartNSItemProviderCompletionHandler arg0, objc.ObjCObjectBase arg1, - objc.NSDictionary arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); -} - -typedef NSItemProviderLoadHandler = ffi.Pointer; -typedef DartNSItemProviderLoadHandler = objc.ObjCBlock< - ffi.Void Function( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError)>, - ffi.Pointer, - objc.NSDictionary)>; -late final _class_NSItemProvider = objc.getClass("NSItemProvider"); -late final _sel_previewImageHandler = objc.registerName("previewImageHandler"); -final _objc_msgSend_uwvaik = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setPreviewImageHandler_ = - objc.registerName("setPreviewImageHandler:"); -late final _sel_loadPreviewImageWithOptions_completionHandler_ = - objc.registerName("loadPreviewImageWithOptions:completionHandler:"); - -/// NSPreviewSupport -extension NSPreviewSupport on objc.NSItemProvider { - /// previewImageHandler - DartNSItemProviderLoadHandler? get previewImageHandler { - final _ret = - _objc_msgSend_uwvaik(this.ref.pointer, _sel_previewImageHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary - .castFromPointer(_ret, retain: true, release: true); - } - - /// setPreviewImageHandler: - set previewImageHandler(DartNSItemProviderLoadHandler? value) { - _objc_msgSend_f167m6(this.ref.pointer, _sel_setPreviewImageHandler_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// loadPreviewImageWithOptions:completionHandler: - void loadPreviewImageWithOptions_completionHandler_(objc.NSDictionary options, - DartNSItemProviderCompletionHandler completionHandler) { - _objc_msgSend_o762yo( - this.ref.pointer, - _sel_loadPreviewImageWithOptions_completionHandler_, - options.ref.pointer, - completionHandler.ref.pointer); - } -} - -typedef NSStringEncoding = NSUInteger; -late final _class_NSString = objc.getClass("NSString"); -late final _sel_substringFromIndex_ = objc.registerName("substringFromIndex:"); -late final _sel_substringToIndex_ = objc.registerName("substringToIndex:"); -late final _sel_substringWithRange_ = objc.registerName("substringWithRange:"); -late final _sel_getCharacters_range_ = - objc.registerName("getCharacters:range:"); -final _objc_msgSend_898fog = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>(); -late final _sel_compare_options_ = objc.registerName("compare:options:"); -final _objc_msgSend_pg1fnv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_compare_options_range_ = - objc.registerName("compare:options:range:"); -final _objc_msgSend_xrqic1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - objc.NSRange)>>() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - objc.NSRange)>(); -late final _sel_compare_options_range_locale_ = - objc.registerName("compare:options:range:locale:"); -final _objc_msgSend_1895u4n = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - objc.NSRange, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - objc.NSRange, - ffi.Pointer)>(); -late final _sel_caseInsensitiveCompare_ = - objc.registerName("caseInsensitiveCompare:"); -late final _sel_localizedCompare_ = objc.registerName("localizedCompare:"); -late final _sel_localizedCaseInsensitiveCompare_ = - objc.registerName("localizedCaseInsensitiveCompare:"); -late final _sel_localizedStandardCompare_ = - objc.registerName("localizedStandardCompare:"); -late final _sel_isEqualToString_ = objc.registerName("isEqualToString:"); -late final _sel_hasPrefix_ = objc.registerName("hasPrefix:"); -late final _sel_hasSuffix_ = objc.registerName("hasSuffix:"); -late final _sel_commonPrefixWithString_options_ = - objc.registerName("commonPrefixWithString:options:"); -final _objc_msgSend_diypgk = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_containsString_ = objc.registerName("containsString:"); -late final _sel_localizedCaseInsensitiveContainsString_ = - objc.registerName("localizedCaseInsensitiveContainsString:"); -late final _sel_localizedStandardContainsString_ = - objc.registerName("localizedStandardContainsString:"); -late final _sel_localizedStandardRangeOfString_ = - objc.registerName("localizedStandardRangeOfString:"); -final _objc_msgSend_182fzon = objc.msgSendPointer - .cast< - ffi.NativeFunction< - objc.NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - objc.NSRange Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_182fzonStret = objc.msgSendStretPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_rangeOfString_ = objc.registerName("rangeOfString:"); -late final _sel_rangeOfString_options_ = - objc.registerName("rangeOfString:options:"); -final _objc_msgSend_102xxo4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - objc.NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>() - .asFunction< - objc.NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -final _objc_msgSend_102xxo4Stret = objc.msgSendStretPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_rangeOfString_options_range_ = - objc.registerName("rangeOfString:options:range:"); -final _objc_msgSend_1nmlvqc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - objc.NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - objc.NSRange)>>() - .asFunction< - objc.NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - objc.NSRange)>(); -final _objc_msgSend_1nmlvqcStret = objc.msgSendStretPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - objc.NSRange)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - objc.NSRange)>(); -late final _sel_rangeOfString_options_range_locale_ = - objc.registerName("rangeOfString:options:range:locale:"); -final _objc_msgSend_gg0462 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - objc.NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - objc.NSRange, - ffi.Pointer)>>() - .asFunction< - objc.NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - objc.NSRange, - ffi.Pointer)>(); -final _objc_msgSend_gg0462Stret = objc.msgSendStretPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - objc.NSRange, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - objc.NSRange, - ffi.Pointer)>(); -late final _sel_rangeOfCharacterFromSet_ = - objc.registerName("rangeOfCharacterFromSet:"); -late final _sel_rangeOfCharacterFromSet_options_ = - objc.registerName("rangeOfCharacterFromSet:options:"); -late final _sel_rangeOfCharacterFromSet_options_range_ = - objc.registerName("rangeOfCharacterFromSet:options:range:"); -late final _sel_rangeOfComposedCharacterSequenceAtIndex_ = - objc.registerName("rangeOfComposedCharacterSequenceAtIndex:"); -final _objc_msgSend_d3i1uy = objc.msgSendPointer - .cast< - ffi.NativeFunction< - objc.NSRange Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - objc.NSRange Function(ffi.Pointer, - ffi.Pointer, int)>(); -final _objc_msgSend_d3i1uyStret = objc.msgSendStretPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_rangeOfComposedCharacterSequencesForRange_ = - objc.registerName("rangeOfComposedCharacterSequencesForRange:"); -final _objc_msgSend_uimyc7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - objc.NSRange Function(ffi.Pointer, - ffi.Pointer, objc.NSRange)>>() - .asFunction< - objc.NSRange Function(ffi.Pointer, - ffi.Pointer, objc.NSRange)>(); -final _objc_msgSend_uimyc7Stret = objc.msgSendStretPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, objc.NSRange)>(); -late final _sel_stringByAppendingString_ = - objc.registerName("stringByAppendingString:"); -late final _sel_stringByAppendingFormat_ = - objc.registerName("stringByAppendingFormat:"); -late final _sel_doubleValue = objc.registerName("doubleValue"); -late final _sel_floatValue = objc.registerName("floatValue"); -late final _sel_intValue = objc.registerName("intValue"); -final _objc_msgSend_13yqbb6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_integerValue = objc.registerName("integerValue"); -late final _sel_longLongValue = objc.registerName("longLongValue"); -late final _sel_boolValue = objc.registerName("boolValue"); -late final _sel_uppercaseString = objc.registerName("uppercaseString"); -late final _sel_lowercaseString = objc.registerName("lowercaseString"); -late final _sel_capitalizedString = objc.registerName("capitalizedString"); -late final _sel_localizedUppercaseString = - objc.registerName("localizedUppercaseString"); -late final _sel_localizedLowercaseString = - objc.registerName("localizedLowercaseString"); -late final _sel_localizedCapitalizedString = - objc.registerName("localizedCapitalizedString"); -late final _sel_uppercaseStringWithLocale_ = - objc.registerName("uppercaseStringWithLocale:"); -late final _sel_lowercaseStringWithLocale_ = - objc.registerName("lowercaseStringWithLocale:"); -late final _sel_capitalizedStringWithLocale_ = - objc.registerName("capitalizedStringWithLocale:"); -late final _sel_getLineStart_end_contentsEnd_forRange_ = - objc.registerName("getLineStart:end:contentsEnd:forRange:"); -final _objc_msgSend_ourvf2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - objc.NSRange)>(); -late final _sel_lineRangeForRange_ = objc.registerName("lineRangeForRange:"); -late final _sel_getParagraphStart_end_contentsEnd_forRange_ = - objc.registerName("getParagraphStart:end:contentsEnd:forRange:"); -late final _sel_paragraphRangeForRange_ = - objc.registerName("paragraphRangeForRange:"); -void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - NSRange arg1, NSRange arg2, ffi.Pointer arg3)>>() - .asFunction< - void Function(ffi.Pointer, NSRange, NSRange, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - NSRange, NSRange, ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - NSRange, NSRange, ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) { - try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - NSRange, NSRange, ffi.Pointer))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - objc.NSString?, objc.NSRange, objc.NSRange, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer arg0, NSRange arg1, NSRange arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunction( - void Function(objc.NSString?, NSRange, NSRange, ffi.Pointer) - fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureCallable, - (ffi.Pointer arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - fn(arg0.address == 0 ? null : objc.NSString.castFromPointer(arg0, retain: true, release: true), arg1, arg2, arg3)), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)> listener( - void Function(objc.NSString?, NSRange, NSRange, ffi.Pointer) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - fn( - arg0.address == 0 - ? null - : objc.NSString.castFromPointer(arg0, - retain: false, release: true), - arg1, - arg2, - arg3)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_lmc3p5(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)>(wrapper, retain: false, release: true); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)> blocking( - void Function(objc.NSString?, NSRange, NSRange, ffi.Pointer) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_blockingCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - fn( - arg0.address == 0 - ? null - : objc.NSString.castFromPointer(arg0, - retain: false, release: true), - arg1, - arg2, - arg3)); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - fn( - arg0.address == 0 - ? null - : objc.NSString.castFromPointer(arg0, - retain: false, release: true), - arg1, - arg2, - arg3)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_lmc3p5, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_CallExtension - on objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)> { - void call(objc.NSString? arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1, arg2, arg3); -} - -late final _sel_enumerateSubstringsInRange_options_usingBlock_ = - objc.registerName("enumerateSubstringsInRange:options:usingBlock:"); -final _objc_msgSend_14ew8zr = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - int, - ffi.Pointer)>(); -void _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSString_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSString_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSString_bool_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSString_bool_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_bool_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSString_bool_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1) { - try { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSString_bool_blockingCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.isolateLocal( - _ObjCBlock_ffiVoid_NSString_bool_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSString_bool_blockingListenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_bool_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_NSString_bool { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(objc.NSString, ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSString_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(void Function(objc.NSString, ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_bool_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - objc.NSString.castFromPointer(arg0, - retain: true, release: true), - arg1)), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock)> - listener(void Function(objc.NSString, ffi.Pointer) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_bool_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - objc.NSString.castFromPointer(arg0, retain: false, release: true), - arg1)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_t8l8el(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSString, ffi.Pointer)>(wrapper, - retain: false, release: true); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock)> - blocking(void Function(objc.NSString, ffi.Pointer) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_bool_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - objc.NSString.castFromPointer(arg0, retain: false, release: true), - arg1)); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSString_bool_blockingListenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - objc.NSString.castFromPointer(arg0, retain: false, release: true), - arg1)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_t8l8el, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSString, ffi.Pointer)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_NSString_bool_CallExtension - on objc.ObjCBlock)> { - void call(objc.NSString arg0, ffi.Pointer arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0.ref.pointer, arg1); -} - -late final _sel_enumerateLinesUsingBlock_ = - objc.registerName("enumerateLinesUsingBlock:"); -late final _sel_UTF8String = objc.registerName("UTF8String"); -final _objc_msgSend_1fuqfwb = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_fastestEncoding = objc.registerName("fastestEncoding"); -late final _sel_smallestEncoding = objc.registerName("smallestEncoding"); -late final _sel_dataUsingEncoding_allowLossyConversion_ = - objc.registerName("dataUsingEncoding:allowLossyConversion:"); -final _objc_msgSend_hiwitm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong, ffi.Bool)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, bool)>(); -late final _sel_dataUsingEncoding_ = objc.registerName("dataUsingEncoding:"); -late final _sel_canBeConvertedToEncoding_ = - objc.registerName("canBeConvertedToEncoding:"); -final _objc_msgSend_6peh6o = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_cStringUsingEncoding_ = - objc.registerName("cStringUsingEncoding:"); -final _objc_msgSend_1jtxufi = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_getCString_maxLength_encoding_ = - objc.registerName("getCString:maxLength:encoding:"); -final _objc_msgSend_1lv8yz3 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int)>(); -late final _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_ = - objc.registerName( - "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); -final _objc_msgSend_i30zh3 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.UnsignedLong, - NSUInteger, - objc.NSRange, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int, - int, - objc.NSRange, - ffi.Pointer)>(); -late final _sel_maximumLengthOfBytesUsingEncoding_ = - objc.registerName("maximumLengthOfBytesUsingEncoding:"); -final _objc_msgSend_12py2ux = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_lengthOfBytesUsingEncoding_ = - objc.registerName("lengthOfBytesUsingEncoding:"); -late final _sel_availableStringEncodings = - objc.registerName("availableStringEncodings"); -final _objc_msgSend_1h2q612 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_localizedNameOfStringEncoding_ = - objc.registerName("localizedNameOfStringEncoding:"); -late final _sel_defaultCStringEncoding = - objc.registerName("defaultCStringEncoding"); -late final _sel_decomposedStringWithCanonicalMapping = - objc.registerName("decomposedStringWithCanonicalMapping"); -late final _sel_precomposedStringWithCanonicalMapping = - objc.registerName("precomposedStringWithCanonicalMapping"); -late final _sel_decomposedStringWithCompatibilityMapping = - objc.registerName("decomposedStringWithCompatibilityMapping"); -late final _sel_precomposedStringWithCompatibilityMapping = - objc.registerName("precomposedStringWithCompatibilityMapping"); -late final _sel_componentsSeparatedByString_ = - objc.registerName("componentsSeparatedByString:"); -late final _sel_componentsSeparatedByCharactersInSet_ = - objc.registerName("componentsSeparatedByCharactersInSet:"); -late final _sel_stringByTrimmingCharactersInSet_ = - objc.registerName("stringByTrimmingCharactersInSet:"); -late final _sel_stringByPaddingToLength_withString_startingAtIndex_ = - objc.registerName("stringByPaddingToLength:withString:startingAtIndex:"); -final _objc_msgSend_1tfztp = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); -late final _sel_stringByFoldingWithOptions_locale_ = - objc.registerName("stringByFoldingWithOptions:locale:"); -final _objc_msgSend_11cbyu0 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_stringByReplacingOccurrencesOfString_withString_options_range_ = - objc.registerName( - "stringByReplacingOccurrencesOfString:withString:options:range:"); -final _objc_msgSend_2u4jm6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - objc.NSRange)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - objc.NSRange)>(); -late final _sel_stringByReplacingOccurrencesOfString_withString_ = - objc.registerName("stringByReplacingOccurrencesOfString:withString:"); -late final _sel_stringByReplacingCharactersInRange_withString_ = - objc.registerName("stringByReplacingCharactersInRange:withString:"); -final _objc_msgSend_bstjp9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - objc.NSRange, - ffi.Pointer)>(); -typedef NSStringTransform = ffi.Pointer; -typedef DartNSStringTransform = objc.NSString; -late final _sel_stringByApplyingTransform_reverse_ = - objc.registerName("stringByApplyingTransform:reverse:"); -late final _sel_writeToURL_atomically_encoding_error_ = - objc.registerName("writeToURL:atomically:encoding:error:"); -final _objc_msgSend_dv3z6r = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.UnsignedLong, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - int, - ffi.Pointer>)>(); -late final _sel_writeToFile_atomically_encoding_error_ = - objc.registerName("writeToFile:atomically:encoding:error:"); -late final _sel_hash = objc.registerName("hash"); -late final _sel_initWithCharactersNoCopy_length_freeWhenDone_ = - objc.registerName("initWithCharactersNoCopy:length:freeWhenDone:"); -final _objc_msgSend_lh0jh5 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - bool)>(); -void _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction, int)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_unichar_NSUInteger_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( - arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_unichar_NSUInteger_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_unichar_NSUInteger_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( - arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer, NSUInteger)> - _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>.listener( - _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_unichar_NSUInteger_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - int arg1) { - try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( - arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, NSUInteger)> - _ObjCBlock_ffiVoid_unichar_NSUInteger_blockingCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>.isolateLocal( - _ObjCBlock_ffiVoid_unichar_NSUInteger_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, NSUInteger)> - _ObjCBlock_ffiVoid_unichar_NSUInteger_blockingListenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>.listener( - _ObjCBlock_ffiVoid_unichar_NSUInteger_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong)>`. -abstract final class ObjCBlock_ffiVoid_unichar_NSUInteger { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock, ffi.UnsignedLong)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)> fromFunctionPointer( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) => - objc.ObjCBlock, ffi.UnsignedLong)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)> fromFunction( - void Function(ffi.Pointer, DartNSUInteger) fn) => - objc.ObjCBlock, ffi.UnsignedLong)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_unichar_NSUInteger_closureCallable, - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc - .ObjCBlock, ffi.UnsignedLong)> - listener(void Function(ffi.Pointer, DartNSUInteger) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_vhbh5h(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>(wrapper, - retain: false, release: true); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc - .ObjCBlock, ffi.UnsignedLong)> - blocking(void Function(ffi.Pointer, DartNSUInteger) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_unichar_NSUInteger_blockingCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_unichar_NSUInteger_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_vhbh5h, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong)>`. -extension ObjCBlock_ffiVoid_unichar_NSUInteger_CallExtension on objc - .ObjCBlock, ffi.UnsignedLong)> { - void call(ffi.Pointer arg0, DartNSUInteger arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>()(ref.pointer, arg0, arg1); -} - -late final _sel_initWithCharactersNoCopy_length_deallocator_ = - objc.registerName("initWithCharactersNoCopy:length:deallocator:"); -final _objc_msgSend_talwei = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_initWithCharacters_length_ = - objc.registerName("initWithCharacters:length:"); -final _objc_msgSend_9x4k8x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_initWithUTF8String_ = objc.registerName("initWithUTF8String:"); -final _objc_msgSend_56zxyn = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_initWithFormat_ = objc.registerName("initWithFormat:"); -late final _sel_initWithFormat_locale_ = - objc.registerName("initWithFormat:locale:"); -late final _sel_initWithValidatedFormat_validFormatSpecifiers_error_ = - objc.registerName("initWithValidatedFormat:validFormatSpecifiers:error:"); -final _objc_msgSend_1pnyuds = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_ = - objc.registerName( - "initWithValidatedFormat:validFormatSpecifiers:locale:error:"); -final _objc_msgSend_1k0ezzm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_initWithData_encoding_ = - objc.registerName("initWithData:encoding:"); -late final _sel_initWithBytes_length_encoding_ = - objc.registerName("initWithBytes:length:encoding:"); -final _objc_msgSend_9b3h4v = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int)>(); -late final _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_ = - objc.registerName("initWithBytesNoCopy:length:encoding:freeWhenDone:"); -final _objc_msgSend_k4j8m3 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - bool)>(); -void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction, int)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( - arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - int arg1) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( - arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer, NSUInteger)> - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - int arg1) { - try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( - arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, NSUInteger)> - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_blockingCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, NSUInteger)> - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_blockingListenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSUInteger { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock, ffi.UnsignedLong)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)> fromFunctionPointer( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) => - objc.ObjCBlock, ffi.UnsignedLong)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.UnsignedLong)> - fromFunction(void Function(ffi.Pointer, DartNSUInteger) fn) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureCallable, - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc - .ObjCBlock, ffi.UnsignedLong)> - listener(void Function(ffi.Pointer, DartNSUInteger) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_zuf90e(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>(wrapper, - retain: false, release: true); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc - .ObjCBlock, ffi.UnsignedLong)> - blocking(void Function(ffi.Pointer, DartNSUInteger) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_blockingCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_zuf90e, raw, rawListener); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSUInteger_CallExtension on objc - .ObjCBlock, ffi.UnsignedLong)> { - void call(ffi.Pointer arg0, DartNSUInteger arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>()(ref.pointer, arg0, arg1); -} - -late final _sel_initWithBytesNoCopy_length_encoding_deallocator_ = - objc.registerName("initWithBytesNoCopy:length:encoding:deallocator:"); -final _objc_msgSend_1lbgrac = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer)>(); -late final _sel_stringWithString_ = objc.registerName("stringWithString:"); -late final _sel_stringWithCharacters_length_ = - objc.registerName("stringWithCharacters:length:"); -late final _sel_stringWithUTF8String_ = - objc.registerName("stringWithUTF8String:"); -late final _sel_stringWithFormat_ = objc.registerName("stringWithFormat:"); -late final _sel_localizedStringWithFormat_ = - objc.registerName("localizedStringWithFormat:"); -late final _sel_stringWithValidatedFormat_validFormatSpecifiers_error_ = - objc.registerName("stringWithValidatedFormat:validFormatSpecifiers:error:"); -late final _sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_ = - objc.registerName( - "localizedStringWithValidatedFormat:validFormatSpecifiers:error:"); -late final _sel_initWithCString_encoding_ = - objc.registerName("initWithCString:encoding:"); -final _objc_msgSend_erqryg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); -late final _sel_stringWithCString_encoding_ = - objc.registerName("stringWithCString:encoding:"); -late final _sel_initWithContentsOfURL_encoding_error_ = - objc.registerName("initWithContentsOfURL:encoding:error:"); -final _objc_msgSend_1nomli1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); -late final _sel_initWithContentsOfFile_encoding_error_ = - objc.registerName("initWithContentsOfFile:encoding:error:"); -late final _sel_stringWithContentsOfURL_encoding_error_ = - objc.registerName("stringWithContentsOfURL:encoding:error:"); -late final _sel_stringWithContentsOfFile_encoding_error_ = - objc.registerName("stringWithContentsOfFile:encoding:error:"); -late final _sel_initWithContentsOfURL_usedEncoding_error_ = - objc.registerName("initWithContentsOfURL:usedEncoding:error:"); -final _objc_msgSend_1alewu7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_initWithContentsOfFile_usedEncoding_error_ = - objc.registerName("initWithContentsOfFile:usedEncoding:error:"); -late final _sel_stringWithContentsOfURL_usedEncoding_error_ = - objc.registerName("stringWithContentsOfURL:usedEncoding:error:"); -late final _sel_stringWithContentsOfFile_usedEncoding_error_ = - objc.registerName("stringWithContentsOfFile:usedEncoding:error:"); - -/// NSStringExtensionMethods -extension NSStringExtensionMethods on objc.NSString { - /// substringFromIndex: - objc.NSString substringFromIndex_(DartNSUInteger from) { - final _ret = - _objc_msgSend_14hpxwa(this.ref.pointer, _sel_substringFromIndex_, from); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// substringToIndex: - objc.NSString substringToIndex_(DartNSUInteger to) { - final _ret = - _objc_msgSend_14hpxwa(this.ref.pointer, _sel_substringToIndex_, to); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// substringWithRange: - objc.NSString substringWithRange_(NSRange range) { - final _ret = _objc_msgSend_1k1o1s7( - this.ref.pointer, _sel_substringWithRange_, range); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// getCharacters:range: - void getCharacters_range_(ffi.Pointer buffer, NSRange range) { - _objc_msgSend_898fog( - this.ref.pointer, _sel_getCharacters_range_, buffer, range); - } - - /// compare: - objc.NSComparisonResult compare_(objc.NSString string) { - final _ret = _objc_msgSend_1ym6zyw( - this.ref.pointer, _sel_compare_, string.ref.pointer); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// compare:options: - objc.NSComparisonResult compare_options_( - objc.NSString string, objc.NSStringCompareOptions mask) { - final _ret = _objc_msgSend_pg1fnv(this.ref.pointer, _sel_compare_options_, - string.ref.pointer, mask.value); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// compare:options:range: - objc.NSComparisonResult compare_options_range_(objc.NSString string, - objc.NSStringCompareOptions mask, NSRange rangeOfReceiverToCompare) { - final _ret = _objc_msgSend_xrqic1( - this.ref.pointer, - _sel_compare_options_range_, - string.ref.pointer, - mask.value, - rangeOfReceiverToCompare); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// compare:options:range:locale: - objc.NSComparisonResult compare_options_range_locale_( - objc.NSString string, - objc.NSStringCompareOptions mask, - NSRange rangeOfReceiverToCompare, - objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_1895u4n( - this.ref.pointer, - _sel_compare_options_range_locale_, - string.ref.pointer, - mask.value, - rangeOfReceiverToCompare, - locale?.ref.pointer ?? ffi.nullptr); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// caseInsensitiveCompare: - objc.NSComparisonResult caseInsensitiveCompare_(objc.NSString string) { - final _ret = _objc_msgSend_1ym6zyw( - this.ref.pointer, _sel_caseInsensitiveCompare_, string.ref.pointer); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// localizedCompare: - objc.NSComparisonResult localizedCompare_(objc.NSString string) { - final _ret = _objc_msgSend_1ym6zyw( - this.ref.pointer, _sel_localizedCompare_, string.ref.pointer); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// localizedCaseInsensitiveCompare: - objc.NSComparisonResult localizedCaseInsensitiveCompare_( - objc.NSString string) { - final _ret = _objc_msgSend_1ym6zyw(this.ref.pointer, - _sel_localizedCaseInsensitiveCompare_, string.ref.pointer); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// localizedStandardCompare: - objc.NSComparisonResult localizedStandardCompare_(objc.NSString string) { - final _ret = _objc_msgSend_1ym6zyw( - this.ref.pointer, _sel_localizedStandardCompare_, string.ref.pointer); - return objc.NSComparisonResult.fromValue(_ret); - } - - /// isEqualToString: - bool isEqualToString_(objc.NSString aString) { - return _objc_msgSend_19nvye5( - this.ref.pointer, _sel_isEqualToString_, aString.ref.pointer); - } - - /// hasPrefix: - bool hasPrefix_(objc.NSString str) { - return _objc_msgSend_19nvye5( - this.ref.pointer, _sel_hasPrefix_, str.ref.pointer); - } - - /// hasSuffix: - bool hasSuffix_(objc.NSString str) { - return _objc_msgSend_19nvye5( - this.ref.pointer, _sel_hasSuffix_, str.ref.pointer); - } - - /// commonPrefixWithString:options: - objc.NSString commonPrefixWithString_options_( - objc.NSString str, objc.NSStringCompareOptions mask) { - final _ret = _objc_msgSend_diypgk(this.ref.pointer, - _sel_commonPrefixWithString_options_, str.ref.pointer, mask.value); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// containsString: - bool containsString_(objc.NSString str) { - return _objc_msgSend_19nvye5( - this.ref.pointer, _sel_containsString_, str.ref.pointer); - } - - /// localizedCaseInsensitiveContainsString: - bool localizedCaseInsensitiveContainsString_(objc.NSString str) { - return _objc_msgSend_19nvye5(this.ref.pointer, - _sel_localizedCaseInsensitiveContainsString_, str.ref.pointer); - } - - /// localizedStandardContainsString: - bool localizedStandardContainsString_(objc.NSString str) { - return _objc_msgSend_19nvye5(this.ref.pointer, - _sel_localizedStandardContainsString_, str.ref.pointer); - } - - /// localizedStandardRangeOfString: - NSRange localizedStandardRangeOfString_(objc.NSString str) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_182fzonStret(_ptr, this.ref.pointer, - _sel_localizedStandardRangeOfString_, str.ref.pointer) - : _ptr.ref = _objc_msgSend_182fzon(this.ref.pointer, - _sel_localizedStandardRangeOfString_, str.ref.pointer); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfString: - NSRange rangeOfString_(objc.NSString searchString) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_182fzonStret(_ptr, this.ref.pointer, - _sel_rangeOfString_, searchString.ref.pointer) - : _ptr.ref = _objc_msgSend_182fzon( - this.ref.pointer, _sel_rangeOfString_, searchString.ref.pointer); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfString:options: - NSRange rangeOfString_options_( - objc.NSString searchString, objc.NSStringCompareOptions mask) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_102xxo4Stret(_ptr, this.ref.pointer, - _sel_rangeOfString_options_, searchString.ref.pointer, mask.value) - : _ptr.ref = _objc_msgSend_102xxo4(this.ref.pointer, - _sel_rangeOfString_options_, searchString.ref.pointer, mask.value); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfString:options:range: - NSRange rangeOfString_options_range_(objc.NSString searchString, - objc.NSStringCompareOptions mask, NSRange rangeOfReceiverToSearch) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_1nmlvqcStret( - _ptr, - this.ref.pointer, - _sel_rangeOfString_options_range_, - searchString.ref.pointer, - mask.value, - rangeOfReceiverToSearch) - : _ptr.ref = _objc_msgSend_1nmlvqc( - this.ref.pointer, - _sel_rangeOfString_options_range_, - searchString.ref.pointer, - mask.value, - rangeOfReceiverToSearch); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfString:options:range:locale: - NSRange rangeOfString_options_range_locale_( - objc.NSString searchString, - objc.NSStringCompareOptions mask, - NSRange rangeOfReceiverToSearch, - objc.NSLocale? locale) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_gg0462Stret( - _ptr, - this.ref.pointer, - _sel_rangeOfString_options_range_locale_, - searchString.ref.pointer, - mask.value, - rangeOfReceiverToSearch, - locale?.ref.pointer ?? ffi.nullptr) - : _ptr.ref = _objc_msgSend_gg0462( - this.ref.pointer, - _sel_rangeOfString_options_range_locale_, - searchString.ref.pointer, - mask.value, - rangeOfReceiverToSearch, - locale?.ref.pointer ?? ffi.nullptr); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfCharacterFromSet: - NSRange rangeOfCharacterFromSet_(objc.NSCharacterSet searchSet) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_182fzonStret(_ptr, this.ref.pointer, - _sel_rangeOfCharacterFromSet_, searchSet.ref.pointer) - : _ptr.ref = _objc_msgSend_182fzon(this.ref.pointer, - _sel_rangeOfCharacterFromSet_, searchSet.ref.pointer); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfCharacterFromSet:options: - NSRange rangeOfCharacterFromSet_options_( - objc.NSCharacterSet searchSet, objc.NSStringCompareOptions mask) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_102xxo4Stret( - _ptr, - this.ref.pointer, - _sel_rangeOfCharacterFromSet_options_, - searchSet.ref.pointer, - mask.value) - : _ptr.ref = _objc_msgSend_102xxo4( - this.ref.pointer, - _sel_rangeOfCharacterFromSet_options_, - searchSet.ref.pointer, - mask.value); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfCharacterFromSet:options:range: - NSRange rangeOfCharacterFromSet_options_range_(objc.NSCharacterSet searchSet, - objc.NSStringCompareOptions mask, NSRange rangeOfReceiverToSearch) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_1nmlvqcStret( - _ptr, - this.ref.pointer, - _sel_rangeOfCharacterFromSet_options_range_, - searchSet.ref.pointer, - mask.value, - rangeOfReceiverToSearch) - : _ptr.ref = _objc_msgSend_1nmlvqc( - this.ref.pointer, - _sel_rangeOfCharacterFromSet_options_range_, - searchSet.ref.pointer, - mask.value, - rangeOfReceiverToSearch); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfComposedCharacterSequenceAtIndex: - NSRange rangeOfComposedCharacterSequenceAtIndex_(DartNSUInteger index) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_d3i1uyStret(_ptr, this.ref.pointer, - _sel_rangeOfComposedCharacterSequenceAtIndex_, index) - : _ptr.ref = _objc_msgSend_d3i1uy(this.ref.pointer, - _sel_rangeOfComposedCharacterSequenceAtIndex_, index); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// rangeOfComposedCharacterSequencesForRange: - NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_uimyc7Stret(_ptr, this.ref.pointer, - _sel_rangeOfComposedCharacterSequencesForRange_, range) - : _ptr.ref = _objc_msgSend_uimyc7(this.ref.pointer, - _sel_rangeOfComposedCharacterSequencesForRange_, range); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// stringByAppendingString: - objc.NSString stringByAppendingString_(objc.NSString aString) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_stringByAppendingString_, aString.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByAppendingFormat: - objc.NSString stringByAppendingFormat_(objc.NSString format) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, _sel_stringByAppendingFormat_, format.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// doubleValue - double get doubleValue { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_doubleValue) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_doubleValue); - } - - /// floatValue - double get floatValue { - return objc.useMsgSendVariants - ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_floatValue) - : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_floatValue); - } - - /// intValue - int get intValue { - return _objc_msgSend_13yqbb6(this.ref.pointer, _sel_intValue); - } - - /// integerValue - DartNSInteger get integerValue { - return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_integerValue); - } - - /// longLongValue - int get longLongValue { - return _objc_msgSend_1k101e3(this.ref.pointer, _sel_longLongValue); - } - - /// boolValue - bool get boolValue { - return _objc_msgSend_91o635(this.ref.pointer, _sel_boolValue); - } - - /// uppercaseString - objc.NSString get uppercaseString { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_uppercaseString); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// lowercaseString - objc.NSString get lowercaseString { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_lowercaseString); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// capitalizedString - objc.NSString get capitalizedString { - final _ret = - _objc_msgSend_151sglz(this.ref.pointer, _sel_capitalizedString); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// localizedUppercaseString - objc.NSString get localizedUppercaseString { - final _ret = - _objc_msgSend_151sglz(this.ref.pointer, _sel_localizedUppercaseString); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// localizedLowercaseString - objc.NSString get localizedLowercaseString { - final _ret = - _objc_msgSend_151sglz(this.ref.pointer, _sel_localizedLowercaseString); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// localizedCapitalizedString - objc.NSString get localizedCapitalizedString { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, _sel_localizedCapitalizedString); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// uppercaseStringWithLocale: - objc.NSString uppercaseStringWithLocale_(objc.NSLocale? locale) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_uppercaseStringWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// lowercaseStringWithLocale: - objc.NSString lowercaseStringWithLocale_(objc.NSLocale? locale) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_lowercaseStringWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// capitalizedStringWithLocale: - objc.NSString capitalizedStringWithLocale_(objc.NSLocale? locale) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_capitalizedStringWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// getLineStart:end:contentsEnd:forRange: - void getLineStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range) { - _objc_msgSend_ourvf2( - this.ref.pointer, - _sel_getLineStart_end_contentsEnd_forRange_, - startPtr, - lineEndPtr, - contentsEndPtr, - range); - } - - /// lineRangeForRange: - NSRange lineRangeForRange_(NSRange range) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_uimyc7Stret( - _ptr, this.ref.pointer, _sel_lineRangeForRange_, range) - : _ptr.ref = _objc_msgSend_uimyc7( - this.ref.pointer, _sel_lineRangeForRange_, range); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// getParagraphStart:end:contentsEnd:forRange: - void getParagraphStart_end_contentsEnd_forRange_( - ffi.Pointer startPtr, - ffi.Pointer parEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range) { - _objc_msgSend_ourvf2( - this.ref.pointer, - _sel_getParagraphStart_end_contentsEnd_forRange_, - startPtr, - parEndPtr, - contentsEndPtr, - range); - } - - /// paragraphRangeForRange: - NSRange paragraphRangeForRange_(NSRange range) { - final _ptr = pkg_ffi.calloc(); - objc.useMsgSendVariants - ? _objc_msgSend_uimyc7Stret( - _ptr, this.ref.pointer, _sel_paragraphRangeForRange_, range) - : _ptr.ref = _objc_msgSend_uimyc7( - this.ref.pointer, _sel_paragraphRangeForRange_, range); - final _finalizable = _ptr.cast().asTypedList( - ffi.sizeOf(), - finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create(_finalizable); - } - - /// enumerateSubstringsInRange:options:usingBlock: - void enumerateSubstringsInRange_options_usingBlock_( - NSRange range, - objc.NSStringEnumerationOptions opts, - objc.ObjCBlock< - ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, - ffi.Pointer)> - block) { - _objc_msgSend_14ew8zr( - this.ref.pointer, - _sel_enumerateSubstringsInRange_options_usingBlock_, - range, - opts.value, - block.ref.pointer); - } - - /// enumerateLinesUsingBlock: - void enumerateLinesUsingBlock_( - objc.ObjCBlock)> - block) { - _objc_msgSend_f167m6( - this.ref.pointer, _sel_enumerateLinesUsingBlock_, block.ref.pointer); - } - - /// UTF8String - ffi.Pointer get UTF8String { - return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_UTF8String); - } - - /// fastestEncoding - DartNSUInteger get fastestEncoding { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_fastestEncoding); - } - - /// smallestEncoding - DartNSUInteger get smallestEncoding { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_smallestEncoding); - } - - /// dataUsingEncoding:allowLossyConversion: - objc.NSData? dataUsingEncoding_allowLossyConversion_( - DartNSUInteger encoding, bool lossy) { - final _ret = _objc_msgSend_hiwitm(this.ref.pointer, - _sel_dataUsingEncoding_allowLossyConversion_, encoding, lossy); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// dataUsingEncoding: - objc.NSData? dataUsingEncoding_(DartNSUInteger encoding) { - final _ret = _objc_msgSend_14hpxwa( - this.ref.pointer, _sel_dataUsingEncoding_, encoding); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// canBeConvertedToEncoding: - bool canBeConvertedToEncoding_(DartNSUInteger encoding) { - return _objc_msgSend_6peh6o( - this.ref.pointer, _sel_canBeConvertedToEncoding_, encoding); - } - - /// cStringUsingEncoding: - ffi.Pointer cStringUsingEncoding_(DartNSUInteger encoding) { - return _objc_msgSend_1jtxufi( - this.ref.pointer, _sel_cStringUsingEncoding_, encoding); - } - - /// getCString:maxLength:encoding: - bool getCString_maxLength_encoding_(ffi.Pointer buffer, - DartNSUInteger maxBufferCount, DartNSUInteger encoding) { - return _objc_msgSend_1lv8yz3(this.ref.pointer, - _sel_getCString_maxLength_encoding_, buffer, maxBufferCount, encoding); - } - - /// getBytes:maxLength:usedLength:encoding:options:range:remainingRange: - bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( - ffi.Pointer buffer, - DartNSUInteger maxBufferCount, - ffi.Pointer usedBufferCount, - DartNSUInteger encoding, - objc.NSStringEncodingConversionOptions options, - NSRange range, - NSRangePointer leftover) { - return _objc_msgSend_i30zh3( - this.ref.pointer, - _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options.value, - range, - leftover); - } - - /// maximumLengthOfBytesUsingEncoding: - DartNSUInteger maximumLengthOfBytesUsingEncoding_(DartNSUInteger enc) { - return _objc_msgSend_12py2ux( - this.ref.pointer, _sel_maximumLengthOfBytesUsingEncoding_, enc); - } - - /// lengthOfBytesUsingEncoding: - DartNSUInteger lengthOfBytesUsingEncoding_(DartNSUInteger enc) { - return _objc_msgSend_12py2ux( - this.ref.pointer, _sel_lengthOfBytesUsingEncoding_, enc); - } - - /// availableStringEncodings - static ffi.Pointer getAvailableStringEncodings() { - return _objc_msgSend_1h2q612( - _class_NSString, _sel_availableStringEncodings); - } - - /// localizedNameOfStringEncoding: - static objc.NSString localizedNameOfStringEncoding_(DartNSUInteger encoding) { - final _ret = _objc_msgSend_14hpxwa( - _class_NSString, _sel_localizedNameOfStringEncoding_, encoding); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// defaultCStringEncoding - static DartNSUInteger getDefaultCStringEncoding() { - return _objc_msgSend_xw2lbc(_class_NSString, _sel_defaultCStringEncoding); - } - - /// decomposedStringWithCanonicalMapping - objc.NSString get decomposedStringWithCanonicalMapping { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, _sel_decomposedStringWithCanonicalMapping); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// precomposedStringWithCanonicalMapping - objc.NSString get precomposedStringWithCanonicalMapping { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, _sel_precomposedStringWithCanonicalMapping); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// decomposedStringWithCompatibilityMapping - objc.NSString get decomposedStringWithCompatibilityMapping { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, _sel_decomposedStringWithCompatibilityMapping); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// precomposedStringWithCompatibilityMapping - objc.NSString get precomposedStringWithCompatibilityMapping { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, _sel_precomposedStringWithCompatibilityMapping); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// componentsSeparatedByString: - objc.NSArray componentsSeparatedByString_(objc.NSString separator) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_componentsSeparatedByString_, separator.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// componentsSeparatedByCharactersInSet: - objc.NSArray componentsSeparatedByCharactersInSet_( - objc.NSCharacterSet separator) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_componentsSeparatedByCharactersInSet_, separator.ref.pointer); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByTrimmingCharactersInSet: - objc.NSString stringByTrimmingCharactersInSet_(objc.NSCharacterSet set) { - final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, - _sel_stringByTrimmingCharactersInSet_, set.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByPaddingToLength:withString:startingAtIndex: - objc.NSString stringByPaddingToLength_withString_startingAtIndex_( - DartNSUInteger newLength, - objc.NSString padString, - DartNSUInteger padIndex) { - final _ret = _objc_msgSend_1tfztp( - this.ref.pointer, - _sel_stringByPaddingToLength_withString_startingAtIndex_, - newLength, - padString.ref.pointer, - padIndex); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByFoldingWithOptions:locale: - objc.NSString stringByFoldingWithOptions_locale_( - objc.NSStringCompareOptions options, objc.NSLocale? locale) { - final _ret = _objc_msgSend_11cbyu0( - this.ref.pointer, - _sel_stringByFoldingWithOptions_locale_, - options.value, - locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByReplacingOccurrencesOfString:withString:options:range: - objc.NSString stringByReplacingOccurrencesOfString_withString_options_range_( - objc.NSString target, - objc.NSString replacement, - objc.NSStringCompareOptions options, - NSRange searchRange) { - final _ret = _objc_msgSend_2u4jm6( - this.ref.pointer, - _sel_stringByReplacingOccurrencesOfString_withString_options_range_, - target.ref.pointer, - replacement.ref.pointer, - options.value, - searchRange); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByReplacingOccurrencesOfString:withString: - objc.NSString stringByReplacingOccurrencesOfString_withString_( - objc.NSString target, objc.NSString replacement) { - final _ret = _objc_msgSend_15qeuct( - this.ref.pointer, - _sel_stringByReplacingOccurrencesOfString_withString_, - target.ref.pointer, - replacement.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByReplacingCharactersInRange:withString: - objc.NSString stringByReplacingCharactersInRange_withString_( - NSRange range, objc.NSString replacement) { - final _ret = _objc_msgSend_bstjp9( - this.ref.pointer, - _sel_stringByReplacingCharactersInRange_withString_, - range, - replacement.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringByApplyingTransform:reverse: - objc.NSString? stringByApplyingTransform_reverse_( - DartNSStringTransform transform, bool reverse) { - final _ret = _objc_msgSend_17amj0z( - this.ref.pointer, - _sel_stringByApplyingTransform_reverse_, - transform.ref.pointer, - reverse); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// writeToURL:atomically:encoding:error: - bool writeToURL_atomically_encoding_error_( - objc.NSURL url, - bool useAuxiliaryFile, - DartNSUInteger enc, - ffi.Pointer> error) { - return _objc_msgSend_dv3z6r( - this.ref.pointer, - _sel_writeToURL_atomically_encoding_error_, - url.ref.pointer, - useAuxiliaryFile, - enc, - error); - } - - /// writeToFile:atomically:encoding:error: - bool writeToFile_atomically_encoding_error_( - objc.NSString path, - bool useAuxiliaryFile, - DartNSUInteger enc, - ffi.Pointer> error) { - return _objc_msgSend_dv3z6r( - this.ref.pointer, - _sel_writeToFile_atomically_encoding_error_, - path.ref.pointer, - useAuxiliaryFile, - enc, - error); - } - - /// description - objc.NSString get description { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// hash - DartNSUInteger get hash { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_hash); - } - - /// initWithCharactersNoCopy:length:freeWhenDone: - objc.NSString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, DartNSUInteger length, bool freeBuffer) { - final _ret = _objc_msgSend_lh0jh5( - this.ref.retainAndReturnPointer(), - _sel_initWithCharactersNoCopy_length_freeWhenDone_, - characters, - length, - freeBuffer); - return objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCharactersNoCopy:length:deallocator: - objc.NSString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, - DartNSUInteger len, - objc.ObjCBlock, ffi.UnsignedLong)>? - deallocator) { - final _ret = _objc_msgSend_talwei( - this.ref.retainAndReturnPointer(), - _sel_initWithCharactersNoCopy_length_deallocator_, - chars, - len, - deallocator?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCharacters:length: - objc.NSString initWithCharacters_length_( - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _objc_msgSend_9x4k8x(this.ref.retainAndReturnPointer(), - _sel_initWithCharacters_length_, characters, length); - return objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithUTF8String: - objc.NSString? initWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _objc_msgSend_56zxyn(this.ref.retainAndReturnPointer(), - _sel_initWithUTF8String_, nullTerminatedCString); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithString: - objc.NSString initWithString_(objc.NSString aString) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithString_, aString.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithFormat: - objc.NSString initWithFormat_(objc.NSString format) { - final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), - _sel_initWithFormat_, format.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithFormat:locale: - objc.NSString initWithFormat_locale_( - objc.NSString format, objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_15qeuct( - this.ref.retainAndReturnPointer(), - _sel_initWithFormat_locale_, - format.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithValidatedFormat:validFormatSpecifiers:error: - objc.NSString? initWithValidatedFormat_validFormatSpecifiers_error_( - objc.NSString format, - objc.NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1pnyuds( - this.ref.retainAndReturnPointer(), - _sel_initWithValidatedFormat_validFormatSpecifiers_error_, - format.ref.pointer, - validFormatSpecifiers.ref.pointer, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithValidatedFormat:validFormatSpecifiers:locale:error: - objc.NSString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( - objc.NSString format, - objc.NSString validFormatSpecifiers, - objc.ObjCObjectBase? locale, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1k0ezzm( - this.ref.retainAndReturnPointer(), - _sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_, - format.ref.pointer, - validFormatSpecifiers.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithData:encoding: - objc.NSString? initWithData_encoding_( - objc.NSData data, DartNSUInteger encoding) { - final _ret = _objc_msgSend_1k4kd9s(this.ref.retainAndReturnPointer(), - _sel_initWithData_encoding_, data.ref.pointer, encoding); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithBytes:length:encoding: - objc.NSString? initWithBytes_length_encoding_(ffi.Pointer bytes, - DartNSUInteger len, DartNSUInteger encoding) { - final _ret = _objc_msgSend_9b3h4v(this.ref.retainAndReturnPointer(), - _sel_initWithBytes_length_encoding_, bytes, len, encoding); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithBytesNoCopy:length:encoding:freeWhenDone: - objc.NSString? initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - bool freeBuffer) { - final _ret = _objc_msgSend_k4j8m3( - this.ref.retainAndReturnPointer(), - _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_, - bytes, - len, - encoding, - freeBuffer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithBytesNoCopy:length:encoding:deallocator: - objc.NSString? initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>? - deallocator) { - final _ret = _objc_msgSend_1lbgrac( - this.ref.retainAndReturnPointer(), - _sel_initWithBytesNoCopy_length_encoding_deallocator_, - bytes, - len, - encoding, - deallocator?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } - - /// string - static objc.NSString string() { - final _ret = _objc_msgSend_151sglz(_class_NSString, _sel_string); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringWithString: - static objc.NSString stringWithString_(objc.NSString string) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSString, _sel_stringWithString_, string.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringWithCharacters:length: - static objc.NSString stringWithCharacters_length_( - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _objc_msgSend_9x4k8x( - _class_NSString, _sel_stringWithCharacters_length_, characters, length); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringWithUTF8String: - static objc.NSString? stringWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _objc_msgSend_56zxyn( - _class_NSString, _sel_stringWithUTF8String_, nullTerminatedCString); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringWithFormat: - static objc.NSString stringWithFormat_(objc.NSString format) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSString, _sel_stringWithFormat_, format.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// localizedStringWithFormat: - static objc.NSString localizedStringWithFormat_(objc.NSString format) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSString, _sel_localizedStringWithFormat_, format.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// stringWithValidatedFormat:validFormatSpecifiers:error: - static objc.NSString? stringWithValidatedFormat_validFormatSpecifiers_error_( - objc.NSString format, - objc.NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1pnyuds( - _class_NSString, - _sel_stringWithValidatedFormat_validFormatSpecifiers_error_, - format.ref.pointer, - validFormatSpecifiers.ref.pointer, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// localizedStringWithValidatedFormat:validFormatSpecifiers:error: - static objc.NSString? - localizedStringWithValidatedFormat_validFormatSpecifiers_error_( - objc.NSString format, - objc.NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1pnyuds( - _class_NSString, - _sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_, - format.ref.pointer, - validFormatSpecifiers.ref.pointer, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + objc.objectRelease(block.cast()); } +} - /// initWithCString:encoding: - objc.NSString? initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, DartNSUInteger encoding) { - final _ret = _objc_msgSend_erqryg(this.ref.retainAndReturnPointer(), - _sel_initWithCString_encoding_, nullTerminatedCString, encoding); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>.isolateLocal( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingTrampoline) + ..keepIsolateAlive = false; +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingTrampoline) + ..keepIsolateAlive = false; - /// stringWithCString:encoding: - static objc.NSString? stringWithCString_encoding_( - ffi.Pointer cString, DartNSUInteger enc) { - final _ret = _objc_msgSend_erqryg( - _class_NSString, _sel_stringWithCString_encoding_, cString, enc); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +/// Construction methods for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. +abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> + castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>(pointer, retain: retain, release: release); - /// initWithContentsOfURL:encoding:error: - objc.NSString? initWithContentsOfURL_encoding_error_(objc.NSURL url, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _objc_msgSend_1nomli1( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_encoding_error_, - url.ref.pointer, - enc, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> + fromFunctionPointer(ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>(objc.newPointerBlock(_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrCallable, ptr.cast()), retain: false, release: true); - /// initWithContentsOfFile:encoding:error: - objc.NSString? initWithContentsOfFile_encoding_error_(objc.NSString path, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _objc_msgSend_1nomli1( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_encoding_error_, - path.ref.pointer, - enc, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)> + fromFunction(void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, objc.NSDictionary) fn, + {bool keepIsolateAlive = true}) => + objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureCallable, + (NSItemProviderCompletionHandler arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + objc.NSDictionary.castFromPointer(arg2, retain: true, release: true)), + keepIsolateAlive), + retain: false, + release: true); - /// stringWithContentsOfURL:encoding:error: - static objc.NSString? stringWithContentsOfURL_encoding_error_(objc.NSURL url, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _objc_msgSend_1nomli1( - _class_NSString, - _sel_stringWithContentsOfURL_encoding_error_, - url.ref.pointer, - enc, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> listener( + void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, + objc.NSDictionary) + fn, + {bool keepIsolateAlive = true}) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerCallable + .nativeFunction + .cast(), + (NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer(arg0, + retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), + objc.NSDictionary.castFromPointer(arg2, + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1b3bb6a(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>(wrapper, retain: false, release: true); } - /// stringWithContentsOfFile:encoding:error: - static objc.NSString? stringWithContentsOfFile_encoding_error_( - objc.NSString path, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1nomli1( - _class_NSString, - _sel_stringWithContentsOfFile_encoding_error_, - path.ref.pointer, - enc, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> blocking( + void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, + objc.NSDictionary) + fn, + {bool keepIsolateAlive = true}) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingCallable + .nativeFunction + .cast(), + (NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer(arg0, + retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), + objc.NSDictionary.castFromPointer(arg2, + retain: false, release: true)), + keepIsolateAlive); + final rawListener = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingListenerCallable + .nativeFunction + .cast(), + (NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer(arg0, + retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), + objc.NSDictionary.castFromPointer(arg2, + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( + raw, rawListener, objc.objCContext); + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>(wrapper, retain: false, release: true); } +} - /// initWithContentsOfURL:usedEncoding:error: - objc.NSString? initWithContentsOfURL_usedEncoding_error_( - objc.NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1alewu7( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_usedEncoding_error_, - url.ref.pointer, - enc, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); - } +/// Call operator for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. +extension ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> { + void call(DartNSItemProviderCompletionHandler arg0, objc.ObjCObjectBase arg1, + objc.NSDictionary arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); +} - /// initWithContentsOfFile:usedEncoding:error: - objc.NSString? initWithContentsOfFile_usedEncoding_error_( - objc.NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1alewu7( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_usedEncoding_error_, - path.ref.pointer, - enc, - error); +typedef NSItemProviderLoadHandler = ffi.Pointer; +typedef DartNSItemProviderLoadHandler = objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>; +late final _class_NSItemProvider = objc.getClass("NSItemProvider"); +late final _sel_previewImageHandler = objc.registerName("previewImageHandler"); +final _objc_msgSend_uwvaik = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPreviewImageHandler_ = + objc.registerName("setPreviewImageHandler:"); +late final _sel_loadPreviewImageWithOptions_completionHandler_ = + objc.registerName("loadPreviewImageWithOptions:completionHandler:"); + +/// NSPreviewSupport +extension NSPreviewSupport on objc.NSItemProvider { + /// previewImageHandler + DartNSItemProviderLoadHandler? get previewImageHandler { + objc.checkOsVersionInternal('NSItemProvider.previewImageHandler', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); + final _ret = + _objc_msgSend_uwvaik(this.ref.pointer, _sel_previewImageHandler); return _ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: false, release: true); + : ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary + .castFromPointer(_ret, retain: true, release: true); } - /// stringWithContentsOfURL:usedEncoding:error: - static objc.NSString? stringWithContentsOfURL_usedEncoding_error_( - objc.NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1alewu7( - _class_NSString, - _sel_stringWithContentsOfURL_usedEncoding_error_, - url.ref.pointer, - enc, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// setPreviewImageHandler: + set previewImageHandler(DartNSItemProviderLoadHandler? value) { + objc.checkOsVersionInternal('NSItemProvider.setPreviewImageHandler:', + iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0))); + _objc_msgSend_f167m6(this.ref.pointer, _sel_setPreviewImageHandler_, + value?.ref.pointer ?? ffi.nullptr); } - /// stringWithContentsOfFile:usedEncoding:error: - static objc.NSString? stringWithContentsOfFile_usedEncoding_error_( - objc.NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1alewu7( - _class_NSString, - _sel_stringWithContentsOfFile_usedEncoding_error_, - path.ref.pointer, - enc, - error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// loadPreviewImageWithOptions:completionHandler: + void loadPreviewImageWithOptions_completionHandler_(objc.NSDictionary options, + DartNSItemProviderCompletionHandler completionHandler) { + objc.checkOsVersionInternal( + 'NSItemProvider.loadPreviewImageWithOptions:completionHandler:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); + _objc_msgSend_o762yo( + this.ref.pointer, + _sel_loadPreviewImageWithOptions_completionHandler_, + options.ref.pointer, + completionHandler.ref.pointer); } } +typedef NSStringEncoding = NSUInteger; +typedef NSStringTransform = ffi.Pointer; +typedef DartNSStringTransform = objc.NSString; typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; typedef DartNSStringEncodingDetectionOptionsKey = objc.NSString; +late final _class_NSString = objc.getClass("NSString"); late final _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_ = objc.registerName( "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); @@ -82222,6 +79021,10 @@ extension NSStringEncodingDetection on objc.NSString { objc.NSDictionary? opts, ffi.Pointer> string, ffi.Pointer usedLossyConversion) { + objc.checkOsVersionInternal( + 'NSString.stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); return _objc_msgSend_1q2ox4r( _class_NSString, _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_, @@ -82292,13 +79095,18 @@ abstract final class ObjCBlock_NSArray_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> - fromFunction(objc.NSArray Function(ffi.Pointer) fn) => + fromFunction(objc.NSArray Function(ffi.Pointer) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_NSArray_ffiVoid_closureCallable, (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), + fn(arg0).ref.retainAndAutorelease(), + keepIsolateAlive), retain: false, release: true); } @@ -82323,6 +79131,22 @@ extension ObjCBlock_NSArray_ffiVoid_CallExtension late final _sel_objectWithItemProviderData_typeIdentifier_error_ = objc.registerName("objectWithItemProviderData:typeIdentifier:error:"); +final _objc_msgSend_1pnyuds = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); instancetype _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline( ffi.Pointer block, @@ -82422,8 +79246,13 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> - fromFunction(Dartinstancetype? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>) fn) => + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc + .ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> + fromFunction(Dartinstancetype? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>( objc.newClosureBlock( _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable, @@ -82431,8 +79260,8 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3) => - fn(arg0, objc.NSData.castFromPointer(arg1, retain: true, release: true), objc.NSString.castFromPointer(arg2, retain: true, release: true), arg3)?.ref.retainAndAutorelease() ?? - ffi.nullptr), + fn(arg0, objc.NSData.castFromPointer(arg1, retain: true, release: true), objc.NSString.castFromPointer(arg2, retain: true, release: true), arg3)?.ref.retainAndAutorelease() ?? ffi.nullptr, + keepIsolateAlive), retain: false, release: true); } @@ -82557,16 +79386,20 @@ abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NS /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, objc.NSString)> fromFunction( objc.NSItemProviderRepresentationVisibility Function( ffi.Pointer, objc.NSString) - fn) => + fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock, objc.NSString)>( objc.newClosureBlock( _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true)) - .value), + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true)).value, + keepIsolateAlive), retain: false, release: true); } @@ -82719,17 +79552,21 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock fromFunction( - void Function(objc.NSData?, objc.NSError?) fn) => + void Function(objc.NSData?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock( objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSError_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, - retain: true, release: true), - arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), + : objc.NSData.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true)), + keepIsolateAlive), retain: false, release: true); @@ -82740,10 +79577,11 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock - listener(void Function(objc.NSData?, objc.NSError?) fn) { + listener(void Function(objc.NSData?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable.nativeFunction .cast(), @@ -82757,7 +79595,8 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock( @@ -82772,11 +79611,13 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock - blocking(void Function(objc.NSData?, objc.NSError?) fn) { + blocking(void Function(objc.NSData?, objc.NSError?) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSError_blockingCallable.nativeFunction .cast(), @@ -82790,7 +79631,8 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); + retain: false, release: true)), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_NSData_NSError_blockingListenerCallable .nativeFunction @@ -82805,9 +79647,10 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd, raw, rawListener); + retain: false, release: true)), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock( @@ -82921,18 +79764,21 @@ abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock, objc.NSString, objc.ObjCBlock)> - fromFunction(NSProgress? Function(ffi.Pointer, objc.NSString, objc.ObjCBlock) fn) => + fromFunction(NSProgress? Function(ffi.Pointer, objc.NSString, objc.ObjCBlock) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>( objc.newClosureBlock( _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => - fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true), ObjCBlock_ffiVoid_NSData_NSError.castFromPointer(arg2, retain: true, release: true)) - ?.ref - .retainAndAutorelease() ?? - ffi.nullptr), + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true), ObjCBlock_ffiVoid_NSData_NSError.castFromPointer(arg2, retain: true, release: true))?.ref.retainAndAutorelease() ?? + ffi.nullptr, + keepIsolateAlive), retain: false, release: true); } @@ -82971,6 +79817,10 @@ extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtensi extension NSItemProvider on objc.NSString { /// readableTypeIdentifiersForItemProvider static objc.NSArray getReadableTypeIdentifiersForItemProvider() { + objc.checkOsVersionInternal( + 'NSString.readableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_151sglz( _class_NSString, _sel_readableTypeIdentifiersForItemProvider); return objc.NSArray.castFromPointer(_ret, retain: true, release: true); @@ -82981,6 +79831,10 @@ extension NSItemProvider on objc.NSString { objc.NSData data, objc.NSString typeIdentifier, ffi.Pointer> outError) { + objc.checkOsVersionInternal( + 'NSString.objectWithItemProviderData:typeIdentifier:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_1pnyuds( _class_NSString, _sel_objectWithItemProviderData_typeIdentifier_error_, @@ -82994,13 +79848,21 @@ extension NSItemProvider on objc.NSString { /// writableTypeIdentifiersForItemProvider static objc.NSArray getWritableTypeIdentifiersForItemProvider() { + objc.checkOsVersionInternal( + 'NSString.writableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_151sglz( _class_NSString, _sel_writableTypeIdentifiersForItemProvider); return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } /// writableTypeIdentifiersForItemProvider - objc.NSArray get writableTypeIdentifiersForItemProvider1 { + objc.NSArray get writableTypeIdentifiersForItemProvider$1 { + objc.checkOsVersionInternal( + 'NSString.writableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); if (!objc.respondsToSelector( this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { throw objc.UnimplementedOptionalMethodException( @@ -83015,6 +79877,10 @@ extension NSItemProvider on objc.NSString { static objc.NSItemProviderRepresentationVisibility itemProviderVisibilityForRepresentationWithTypeIdentifier_( objc.NSString typeIdentifier) { + objc.checkOsVersionInternal( + 'NSString.itemProviderVisibilityForRepresentationWithTypeIdentifier:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); if (!objc.respondsToSelector(_class_NSString, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { throw objc.UnimplementedOptionalMethodException('NSString', @@ -83029,8 +79895,12 @@ extension NSItemProvider on objc.NSString { /// itemProviderVisibilityForRepresentationWithTypeIdentifier: objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier_1( + itemProviderVisibilityForRepresentationWithTypeIdentifier_$1( objc.NSString typeIdentifier) { + objc.checkOsVersionInternal( + 'NSString.itemProviderVisibilityForRepresentationWithTypeIdentifier:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); if (!objc.respondsToSelector(this.ref.pointer, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { throw objc.UnimplementedOptionalMethodException('NSString', @@ -83048,6 +79918,10 @@ extension NSItemProvider on objc.NSString { objc.NSString typeIdentifier, objc.ObjCBlock completionHandler) { + objc.checkOsVersionInternal( + 'NSString.loadDataWithTypeIdentifier:forItemProviderCompletionHandler:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, @@ -83062,8 +79936,30 @@ extension NSItemProvider on objc.NSString { late final _class_NSMutableString = objc.getClass("NSMutableString"); late final _sel_insertString_atIndex_ = objc.registerName("insertString:atIndex:"); +final _objc_msgSend_djsa9o = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); late final _sel_deleteCharactersInRange_ = objc.registerName("deleteCharactersInRange:"); +final _objc_msgSend_1e3pm0z = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>(); late final _sel_appendString_ = objc.registerName("appendString:"); late final _sel_appendFormat_ = objc.registerName("appendFormat:"); late final _sel_setString_ = objc.registerName("setString:"); @@ -83163,6 +80059,10 @@ extension NSMutableStringExtensionMethods on objc.NSMutableString { bool reverse, NSRange range, NSRangePointer resultingRange) { + objc.checkOsVersionInternal( + 'NSMutableString.applyTransform:reverse:range:updatedRange:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0))); return _objc_msgSend_zy00wz( this.ref.pointer, _sel_applyTransform_reverse_range_updatedRange_, @@ -83212,6 +80112,14 @@ extension NSExtendedStringPropertyListParsing on objc.NSString { } late final _sel_cString = objc.registerName("cString"); +final _objc_msgSend_1fuqfwb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); late final _sel_lossyCString = objc.registerName("lossyCString"); late final _sel_cStringLength = objc.registerName("cStringLength"); late final _sel_getCString_ = objc.registerName("getCString:"); @@ -83280,7 +80188,26 @@ final _objc_msgSend_1ojrli4 = objc.msgSendPointer bool)>(); late final _sel_initWithCString_length_ = objc.registerName("initWithCString:length:"); +final _objc_msgSend_erqryg = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); late final _sel_initWithCString_ = objc.registerName("initWithCString:"); +final _objc_msgSend_56zxyn = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_stringWithCString_length_ = objc.registerName("stringWithCString:length:"); late final _sel_stringWithCString_ = objc.registerName("stringWithCString:"); @@ -83300,27 +80227,37 @@ final _objc_msgSend_g3kdhc = objc.msgSendPointer extension NSStringDeprecated on objc.NSString { /// cString ffi.Pointer cString() { + objc.checkOsVersionInternal('NSString.cString', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_cString); } /// lossyCString ffi.Pointer lossyCString() { + objc.checkOsVersionInternal('NSString.lossyCString', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_lossyCString); } /// cStringLength DartNSUInteger cStringLength() { + objc.checkOsVersionInternal('NSString.cStringLength', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_cStringLength); } /// getCString: void getCString_(ffi.Pointer bytes) { + objc.checkOsVersionInternal('NSString.getCString:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_1r7ue5f(this.ref.pointer, _sel_getCString_, bytes); } /// getCString:maxLength: void getCString_maxLength_( ffi.Pointer bytes, DartNSUInteger maxLength) { + objc.checkOsVersionInternal('NSString.getCString:maxLength:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_1h3mito( this.ref.pointer, _sel_getCString_maxLength_, bytes, maxLength); } @@ -83328,6 +80265,10 @@ extension NSStringDeprecated on objc.NSString { /// getCString:maxLength:range:remainingRange: void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, DartNSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange) { + objc.checkOsVersionInternal( + 'NSString.getCString:maxLength:range:remainingRange:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); _objc_msgSend_3gpdva( this.ref.pointer, _sel_getCString_maxLength_range_remainingRange_, @@ -83339,18 +80280,24 @@ extension NSStringDeprecated on objc.NSString { /// writeToFile:atomically: bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + objc.checkOsVersionInternal('NSString.writeToFile:atomically:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToFile_atomically_, path.ref.pointer, useAuxiliaryFile); } /// writeToURL:atomically: bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + objc.checkOsVersionInternal('NSString.writeToURL:atomically:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1iyq28l(this.ref.pointer, _sel_writeToURL_atomically_, url.ref.pointer, atomically); } /// initWithContentsOfFile: objc.ObjCObjectBase? initWithContentsOfFile_(objc.NSString path) { + objc.checkOsVersionInternal('NSString.initWithContentsOfFile:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), _sel_initWithContentsOfFile_, path.ref.pointer); return _ret.address == 0 @@ -83360,6 +80307,8 @@ extension NSStringDeprecated on objc.NSString { /// initWithContentsOfURL: objc.ObjCObjectBase? initWithContentsOfURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSString.initWithContentsOfURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_, url.ref.pointer); return _ret.address == 0 @@ -83369,6 +80318,8 @@ extension NSStringDeprecated on objc.NSString { /// stringWithContentsOfFile: static objc.ObjCObjectBase? stringWithContentsOfFile_(objc.NSString path) { + objc.checkOsVersionInternal('NSString.stringWithContentsOfFile:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSString, _sel_stringWithContentsOfFile_, path.ref.pointer); return _ret.address == 0 @@ -83378,6 +80329,8 @@ extension NSStringDeprecated on objc.NSString { /// stringWithContentsOfURL: static objc.ObjCObjectBase? stringWithContentsOfURL_(objc.NSURL url) { + objc.checkOsVersionInternal('NSString.stringWithContentsOfURL:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSString, _sel_stringWithContentsOfURL_, url.ref.pointer); return _ret.address == 0 @@ -83388,6 +80341,10 @@ extension NSStringDeprecated on objc.NSString { /// initWithCStringNoCopy:length:freeWhenDone: objc.ObjCObjectBase? initWithCStringNoCopy_length_freeWhenDone_( ffi.Pointer bytes, DartNSUInteger length, bool freeBuffer) { + objc.checkOsVersionInternal( + 'NSString.initWithCStringNoCopy:length:freeWhenDone:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1ojrli4( this.ref.retainAndReturnPointer(), _sel_initWithCStringNoCopy_length_freeWhenDone_, @@ -83402,6 +80359,8 @@ extension NSStringDeprecated on objc.NSString { /// initWithCString:length: objc.ObjCObjectBase? initWithCString_length_( ffi.Pointer bytes, DartNSUInteger length) { + objc.checkOsVersionInternal('NSString.initWithCString:length:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_erqryg(this.ref.retainAndReturnPointer(), _sel_initWithCString_length_, bytes, length); return _ret.address == 0 @@ -83411,6 +80370,8 @@ extension NSStringDeprecated on objc.NSString { /// initWithCString: objc.ObjCObjectBase? initWithCString_(ffi.Pointer bytes) { + objc.checkOsVersionInternal('NSString.initWithCString:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_56zxyn( this.ref.retainAndReturnPointer(), _sel_initWithCString_, bytes); return _ret.address == 0 @@ -83421,6 +80382,8 @@ extension NSStringDeprecated on objc.NSString { /// stringWithCString:length: static objc.ObjCObjectBase? stringWithCString_length_( ffi.Pointer bytes, DartNSUInteger length) { + objc.checkOsVersionInternal('NSString.stringWithCString:length:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_erqryg( _class_NSString, _sel_stringWithCString_length_, bytes, length); return _ret.address == 0 @@ -83430,6 +80393,8 @@ extension NSStringDeprecated on objc.NSString { /// stringWithCString: static objc.ObjCObjectBase? stringWithCString_(ffi.Pointer bytes) { + objc.checkOsVersionInternal('NSString.stringWithCString:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_56zxyn(_class_NSString, _sel_stringWithCString_, bytes); return _ret.address == 0 @@ -83510,6 +80475,10 @@ extension NSPromisedItems on objc.NSURL { ffi.Pointer> value, DartNSURLResourceKey key, ffi.Pointer> error) { + objc.checkOsVersionInternal( + 'NSURL.getPromisedItemResourceValue:forKey:error:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); return _objc_msgSend_1j9bhml( this.ref.pointer, _sel_getPromisedItemResourceValue_forKey_error_, @@ -83521,6 +80490,10 @@ extension NSPromisedItems on objc.NSURL { /// promisedItemResourceValuesForKeys:error: objc.NSDictionary? promisedItemResourceValuesForKeys_error_( objc.NSArray keys, ffi.Pointer> error) { + objc.checkOsVersionInternal( + 'NSURL.promisedItemResourceValuesForKeys:error:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); final _ret = _objc_msgSend_1lhpu4m(this.ref.pointer, _sel_promisedItemResourceValuesForKeys_error_, keys.ref.pointer, error); return _ret.address == 0 @@ -83531,15 +80504,21 @@ extension NSPromisedItems on objc.NSURL { /// checkPromisedItemIsReachableAndReturnError: bool checkPromisedItemIsReachableAndReturnError_( ffi.Pointer> error) { + objc.checkOsVersionInternal( + 'NSURL.checkPromisedItemIsReachableAndReturnError:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0))); return _objc_msgSend_1dom33q(this.ref.pointer, _sel_checkPromisedItemIsReachableAndReturnError_, error); } } /// NSItemProvider -extension NSItemProvider1 on objc.NSURL { +extension NSItemProvider$1 on objc.NSURL { /// readableTypeIdentifiersForItemProvider static objc.NSArray getReadableTypeIdentifiersForItemProvider() { + objc.checkOsVersionInternal('NSURL.readableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_151sglz( _class_NSURL, _sel_readableTypeIdentifiersForItemProvider); return objc.NSArray.castFromPointer(_ret, retain: true, release: true); @@ -83550,6 +80529,10 @@ extension NSItemProvider1 on objc.NSURL { objc.NSData data, objc.NSString typeIdentifier, ffi.Pointer> outError) { + objc.checkOsVersionInternal( + 'NSURL.objectWithItemProviderData:typeIdentifier:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_1pnyuds( _class_NSURL, _sel_objectWithItemProviderData_typeIdentifier_error_, @@ -83563,13 +80546,17 @@ extension NSItemProvider1 on objc.NSURL { /// writableTypeIdentifiersForItemProvider static objc.NSArray getWritableTypeIdentifiersForItemProvider() { + objc.checkOsVersionInternal('NSURL.writableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_151sglz( _class_NSURL, _sel_writableTypeIdentifiersForItemProvider); return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } /// writableTypeIdentifiersForItemProvider - objc.NSArray get writableTypeIdentifiersForItemProvider1 { + objc.NSArray get writableTypeIdentifiersForItemProvider$1 { + objc.checkOsVersionInternal('NSURL.writableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0))); if (!objc.respondsToSelector( this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { throw objc.UnimplementedOptionalMethodException( @@ -83584,6 +80571,10 @@ extension NSItemProvider1 on objc.NSURL { static objc.NSItemProviderRepresentationVisibility itemProviderVisibilityForRepresentationWithTypeIdentifier_( objc.NSString typeIdentifier) { + objc.checkOsVersionInternal( + 'NSURL.itemProviderVisibilityForRepresentationWithTypeIdentifier:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); if (!objc.respondsToSelector(_class_NSURL, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { throw objc.UnimplementedOptionalMethodException('NSURL', @@ -83598,8 +80589,12 @@ extension NSItemProvider1 on objc.NSURL { /// itemProviderVisibilityForRepresentationWithTypeIdentifier: objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier_1( + itemProviderVisibilityForRepresentationWithTypeIdentifier_$1( objc.NSString typeIdentifier) { + objc.checkOsVersionInternal( + 'NSURL.itemProviderVisibilityForRepresentationWithTypeIdentifier:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); if (!objc.respondsToSelector(this.ref.pointer, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { throw objc.UnimplementedOptionalMethodException('NSURL', @@ -83617,6 +80612,10 @@ extension NSItemProvider1 on objc.NSURL { objc.NSString typeIdentifier, objc.ObjCBlock completionHandler) { + objc.checkOsVersionInternal( + 'NSURL.loadDataWithTypeIdentifier:forItemProviderCompletionHandler:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0))); final _ret = _objc_msgSend_r0bo0s( this.ref.pointer, _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, @@ -83646,6 +80645,8 @@ late final _sel_URLFragmentAllowedCharacterSet = extension NSURLUtilities on objc.NSCharacterSet { /// Returns a character set containing the characters allowed in a URL's user subcomponent. static objc.NSCharacterSet getURLUserAllowedCharacterSet() { + objc.checkOsVersionInternal('NSCharacterSet.URLUserAllowedCharacterSet', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLUserAllowedCharacterSet); return objc.NSCharacterSet.castFromPointer(_ret, @@ -83654,6 +80655,8 @@ extension NSURLUtilities on objc.NSCharacterSet { /// Returns a character set containing the characters allowed in a URL's password subcomponent. static objc.NSCharacterSet getURLPasswordAllowedCharacterSet() { + objc.checkOsVersionInternal('NSCharacterSet.URLPasswordAllowedCharacterSet', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLPasswordAllowedCharacterSet); return objc.NSCharacterSet.castFromPointer(_ret, @@ -83662,6 +80665,8 @@ extension NSURLUtilities on objc.NSCharacterSet { /// Returns a character set containing the characters allowed in a URL's host subcomponent. static objc.NSCharacterSet getURLHostAllowedCharacterSet() { + objc.checkOsVersionInternal('NSCharacterSet.URLHostAllowedCharacterSet', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLHostAllowedCharacterSet); return objc.NSCharacterSet.castFromPointer(_ret, @@ -83670,6 +80675,8 @@ extension NSURLUtilities on objc.NSCharacterSet { /// Returns a character set containing the characters allowed in a URL's path component. ';' is a legal path character, but it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet). static objc.NSCharacterSet getURLPathAllowedCharacterSet() { + objc.checkOsVersionInternal('NSCharacterSet.URLPathAllowedCharacterSet', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLPathAllowedCharacterSet); return objc.NSCharacterSet.castFromPointer(_ret, @@ -83678,6 +80685,8 @@ extension NSURLUtilities on objc.NSCharacterSet { /// Returns a character set containing the characters allowed in a URL's query component. static objc.NSCharacterSet getURLQueryAllowedCharacterSet() { + objc.checkOsVersionInternal('NSCharacterSet.URLQueryAllowedCharacterSet', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLQueryAllowedCharacterSet); return objc.NSCharacterSet.castFromPointer(_ret, @@ -83686,6 +80695,8 @@ extension NSURLUtilities on objc.NSCharacterSet { /// Returns a character set containing the characters allowed in a URL's fragment component. static objc.NSCharacterSet getURLFragmentAllowedCharacterSet() { + objc.checkOsVersionInternal('NSCharacterSet.URLFragmentAllowedCharacterSet', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLFragmentAllowedCharacterSet); return objc.NSCharacterSet.castFromPointer(_ret, @@ -83703,10 +80714,14 @@ late final _sel_stringByReplacingPercentEscapesUsingEncoding_ = objc.registerName("stringByReplacingPercentEscapesUsingEncoding:"); /// NSURLUtilities -extension NSURLUtilities1 on objc.NSString { +extension NSURLUtilities$1 on objc.NSString { /// Returns a new string made from the receiver by replacing all characters not in the allowedCharacters set with percent encoded characters. UTF-8 encoding is used to determine the correct percent encoded characters. Entire URL strings cannot be percent-encoded. This method is intended to percent-encode a URL component or subcomponent string, NOT the entire URL string. Any characters in allowedCharacters outside of the 7-bit ASCII range are ignored. objc.NSString? stringByAddingPercentEncodingWithAllowedCharacters_( objc.NSCharacterSet allowedCharacters) { + objc.checkOsVersionInternal( + 'NSString.stringByAddingPercentEncodingWithAllowedCharacters:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_stringByAddingPercentEncodingWithAllowedCharacters_, @@ -83718,6 +80733,8 @@ extension NSURLUtilities1 on objc.NSString { /// Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters. objc.NSString? get stringByRemovingPercentEncoding { + objc.checkOsVersionInternal('NSString.stringByRemovingPercentEncoding', + iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0))); final _ret = _objc_msgSend_151sglz( this.ref.pointer, _sel_stringByRemovingPercentEncoding); return _ret.address == 0 @@ -83728,6 +80745,10 @@ extension NSURLUtilities1 on objc.NSString { /// stringByAddingPercentEscapesUsingEncoding: objc.NSString? stringByAddingPercentEscapesUsingEncoding_( DartNSUInteger enc) { + objc.checkOsVersionInternal( + 'NSString.stringByAddingPercentEscapesUsingEncoding:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_14hpxwa( this.ref.pointer, _sel_stringByAddingPercentEscapesUsingEncoding_, enc); return _ret.address == 0 @@ -83738,6 +80759,10 @@ extension NSURLUtilities1 on objc.NSString { /// stringByReplacingPercentEscapesUsingEncoding: objc.NSString? stringByReplacingPercentEscapesUsingEncoding_( DartNSUInteger enc) { + objc.checkOsVersionInternal( + 'NSString.stringByReplacingPercentEscapesUsingEncoding:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_14hpxwa(this.ref.pointer, _sel_stringByReplacingPercentEscapesUsingEncoding_, enc); return _ret.address == 0 @@ -83772,6 +80797,8 @@ late final _sel_URLByResolvingSymlinksInPath = extension NSURLPathUtilities on objc.NSURL { /// The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do. static objc.NSURL? fileURLWithPathComponents_(objc.NSArray components) { + objc.checkOsVersionInternal('NSURL.fileURLWithPathComponents:', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_1sotr3r( _class_NSURL, _sel_fileURLWithPathComponents_, components.ref.pointer); return _ret.address == 0 @@ -83781,6 +80808,8 @@ extension NSURLPathUtilities on objc.NSURL { /// pathComponents objc.NSArray? get pathComponents { + objc.checkOsVersionInternal('NSURL.pathComponents', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_pathComponents); return _ret.address == 0 ? null @@ -83789,6 +80818,8 @@ extension NSURLPathUtilities on objc.NSURL { /// lastPathComponent objc.NSString? get lastPathComponent { + objc.checkOsVersionInternal('NSURL.lastPathComponent', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_lastPathComponent); return _ret.address == 0 @@ -83798,6 +80829,8 @@ extension NSURLPathUtilities on objc.NSURL { /// pathExtension objc.NSString? get pathExtension { + objc.checkOsVersionInternal('NSURL.pathExtension', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_pathExtension); return _ret.address == 0 ? null @@ -83806,6 +80839,8 @@ extension NSURLPathUtilities on objc.NSURL { /// URLByAppendingPathComponent: objc.NSURL? URLByAppendingPathComponent_(objc.NSString pathComponent) { + objc.checkOsVersionInternal('NSURL.URLByAppendingPathComponent:', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, _sel_URLByAppendingPathComponent_, pathComponent.ref.pointer); return _ret.address == 0 @@ -83816,6 +80851,10 @@ extension NSURLPathUtilities on objc.NSURL { /// URLByAppendingPathComponent:isDirectory: objc.NSURL? URLByAppendingPathComponent_isDirectory_( objc.NSString pathComponent, bool isDirectory) { + objc.checkOsVersionInternal( + 'NSURL.URLByAppendingPathComponent:isDirectory:', + iOS: (false, (5, 0, 0)), + macOS: (false, (10, 7, 0))); final _ret = _objc_msgSend_17amj0z( this.ref.pointer, _sel_URLByAppendingPathComponent_isDirectory_, @@ -83828,6 +80867,8 @@ extension NSURLPathUtilities on objc.NSURL { /// URLByDeletingLastPathComponent objc.NSURL? get URLByDeletingLastPathComponent { + objc.checkOsVersionInternal('NSURL.URLByDeletingLastPathComponent', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz( this.ref.pointer, _sel_URLByDeletingLastPathComponent); return _ret.address == 0 @@ -83837,6 +80878,8 @@ extension NSURLPathUtilities on objc.NSURL { /// URLByAppendingPathExtension: objc.NSURL? URLByAppendingPathExtension_(objc.NSString pathExtension) { + objc.checkOsVersionInternal('NSURL.URLByAppendingPathExtension:', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_1sotr3r(this.ref.pointer, _sel_URLByAppendingPathExtension_, pathExtension.ref.pointer); return _ret.address == 0 @@ -83846,6 +80889,8 @@ extension NSURLPathUtilities on objc.NSURL { /// URLByDeletingPathExtension objc.NSURL? get URLByDeletingPathExtension { + objc.checkOsVersionInternal('NSURL.URLByDeletingPathExtension', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz( this.ref.pointer, _sel_URLByDeletingPathExtension); return _ret.address == 0 @@ -83856,12 +80901,16 @@ extension NSURLPathUtilities on objc.NSURL { /// Returns whether the URL's resource exists and is reachable. This method synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. For other URL types, NO is returned. Symbol is present in iOS 4, but performs no operation. bool checkResourceIsReachableAndReturnError_( ffi.Pointer> error) { + objc.checkOsVersionInternal('NSURL.checkResourceIsReachableAndReturnError:', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); return _objc_msgSend_1dom33q( this.ref.pointer, _sel_checkResourceIsReachableAndReturnError_, error); } /// URLByStandardizingPath objc.NSURL? get URLByStandardizingPath { + objc.checkOsVersionInternal('NSURL.URLByStandardizingPath', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URLByStandardizingPath); return _ret.address == 0 @@ -83871,6 +80920,8 @@ extension NSURLPathUtilities on objc.NSURL { /// URLByResolvingSymlinksInPath objc.NSURL? get URLByResolvingSymlinksInPath { + objc.checkOsVersionInternal('NSURL.URLByResolvingSymlinksInPath', + iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0))); final _ret = _objc_msgSend_151sglz( this.ref.pointer, _sel_URLByResolvingSymlinksInPath); return _ret.address == 0 @@ -83893,6 +80944,8 @@ extension NSURLClient on objc.NSObject { /// URL:resourceDataDidBecomeAvailable: void URL_resourceDataDidBecomeAvailable_( objc.NSURL sender, objc.NSData newBytes) { + objc.checkOsVersionInternal('NSObject.URL:resourceDataDidBecomeAvailable:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_pfv6jd( this.ref.pointer, _sel_URL_resourceDataDidBecomeAvailable_, @@ -83902,12 +80955,16 @@ extension NSURLClient on objc.NSObject { /// URLResourceDidFinishLoading: void URLResourceDidFinishLoading_(objc.NSURL sender) { + objc.checkOsVersionInternal('NSObject.URLResourceDidFinishLoading:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_URLResourceDidFinishLoading_, sender.ref.pointer); } /// URLResourceDidCancelLoading: void URLResourceDidCancelLoading_(objc.NSURL sender) { + objc.checkOsVersionInternal('NSObject.URLResourceDidCancelLoading:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); _objc_msgSend_xtuoz7(this.ref.pointer, _sel_URLResourceDidCancelLoading_, sender.ref.pointer); } @@ -83915,6 +80972,10 @@ extension NSURLClient on objc.NSObject { /// URL:resourceDidFailLoadingWithReason: void URL_resourceDidFailLoadingWithReason_( objc.NSURL sender, objc.NSString reason) { + objc.checkOsVersionInternal( + 'NSObject.URL:resourceDidFailLoadingWithReason:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); _objc_msgSend_pfv6jd( this.ref.pointer, _sel_URL_resourceDidFailLoadingWithReason_, @@ -83925,6 +80986,14 @@ extension NSURLClient on objc.NSObject { late final _sel_resourceDataUsingCache_ = objc.registerName("resourceDataUsingCache:"); +final _objc_msgSend_1t6aok9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, bool)>(); late final _sel_loadResourceDataNotifyingClient_usingCache_ = objc.registerName("loadResourceDataNotifyingClient:usingCache:"); late final _sel_propertyForKey_ = objc.registerName("propertyForKey:"); @@ -83951,6 +81020,8 @@ late final _sel_URLHandleUsingCache_ = extension NSURLLoading on objc.NSURL { /// Blocks to load the data if necessary. If shouldUseCache is YES, then if an equivalent URL has already been loaded and cached, its resource data will be returned immediately. If shouldUseCache is NO, a new load will be started objc.NSData? resourceDataUsingCache_(bool shouldUseCache) { + objc.checkOsVersionInternal('NSURL.resourceDataUsingCache:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1t6aok9( this.ref.pointer, _sel_resourceDataUsingCache_, shouldUseCache); return _ret.address == 0 @@ -83961,6 +81032,10 @@ extension NSURLLoading on objc.NSURL { /// Starts an asynchronous load of the data, registering delegate to receive notification. Only one such background load can proceed at a time. void loadResourceDataNotifyingClient_usingCache_( objc.ObjCObjectBase client, bool shouldUseCache) { + objc.checkOsVersionInternal( + 'NSURL.loadResourceDataNotifyingClient:usingCache:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); _objc_msgSend_6p7ndb( this.ref.pointer, _sel_loadResourceDataNotifyingClient_usingCache_, @@ -83970,6 +81045,8 @@ extension NSURLLoading on objc.NSURL { /// propertyForKey: objc.ObjCObjectBase? propertyForKey_(objc.NSString propertyKey) { + objc.checkOsVersionInternal('NSURL.propertyForKey:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1sotr3r( this.ref.pointer, _sel_propertyForKey_, propertyKey.ref.pointer); return _ret.address == 0 @@ -83979,6 +81056,8 @@ extension NSURLLoading on objc.NSURL { /// These attempt to write the given arguments for the resource specified by the URL; they return success or failure bool setResourceData_(objc.NSData data) { + objc.checkOsVersionInternal('NSURL.setResourceData:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_19nvye5( this.ref.pointer, _sel_setResourceData_, data.ref.pointer); } @@ -83986,12 +81065,16 @@ extension NSURLLoading on objc.NSURL { /// setProperty:forKey: bool setProperty_forKey_( objc.ObjCObjectBase property, objc.NSString propertyKey) { + objc.checkOsVersionInternal('NSURL.setProperty:forKey:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); return _objc_msgSend_1lsax7n(this.ref.pointer, _sel_setProperty_forKey_, property.ref.pointer, propertyKey.ref.pointer); } /// Sophisticated clients will want to ask for this, then message the handle directly. If shouldUseCache is NO, a newly instantiated handle is returned, even if an equivalent URL has been loaded objc.NSURLHandle? URLHandleUsingCache_(bool shouldUseCache) { + objc.checkOsVersionInternal('NSURL.URLHandleUsingCache:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_1t6aok9( this.ref.pointer, _sel_URLHandleUsingCache_, shouldUseCache); return _ret.address == 0 @@ -84000,6 +81083,25 @@ extension NSURLLoading on objc.NSURL { } } +/// WARNING: NSLocking is a stub. To generate bindings for this class, include +/// NSLocking in your config's objc-protocols list. +/// +/// NSLocking +interface class NSLocking extends objc.ObjCProtocolBase { + NSLocking._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSLocking] that points to the same underlying object as [other]. + NSLocking.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSLocking] that wraps the given raw object pointer. + NSLocking.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + late final _class_NSCondition = objc.getClass("NSCondition"); late final _sel_wait = objc.registerName("wait"); late final _sel_waitUntilDate_ = objc.registerName("waitUntilDate:"); @@ -84101,11 +81203,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> fromFunction( - void Function(ffi.Pointer) fn) => + void Function(ffi.Pointer) fn, + {bool keepIsolateAlive = true}) => objc.ObjCBlock)>( objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), + (ffi.Pointer arg0) => fn(arg0), keepIsolateAlive), retain: false, release: true); @@ -84116,13 +81222,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock)> listener( - void Function(ffi.Pointer) fn) { + void Function(ffi.Pointer) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0)); + (ffi.Pointer arg0) => fn(arg0), + keepIsolateAlive); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ovsamd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock)>(wrapper, @@ -84135,20 +81243,24 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { /// caller until the callback is handled by the Dart isolate that created /// the block. Async functions are not supported. /// - /// This block does not keep the owner isolate alive. If the owner isolate has - /// shut down, and the block is invoked by native code, it may block + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock)> blocking( - void Function(ffi.Pointer) fn) { + void Function(ffi.Pointer) fn, + {bool keepIsolateAlive = true}) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0)); + (ffi.Pointer arg0) => fn(arg0), + keepIsolateAlive); final rawListener = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_blockingListenerCallable.nativeFunction .cast(), - (ffi.Pointer arg0) => fn(arg0)); - final wrapper = objc.wrapBlockingBlock( - _NativeCupertinoHttp_wrapBlockingBlock_ovsamd, raw, rawListener); + (ffi.Pointer arg0) => fn(arg0), + keepIsolateAlive); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( + raw, rawListener, objc.objCContext); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock)>(wrapper, @@ -84172,10 +81284,13 @@ extension ObjCBlock_ffiVoid_ffiVoid_CallExtension late final _sel_unlock = objc.registerName("unlock"); /// NSCondition -class NSCondition extends objc.NSObject { +class NSCondition extends objc.NSObject implements NSLocking { NSCondition._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release) { + objc.checkOsVersionInternal('NSCondition', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); + } /// Constructs a [NSCondition] that points to the same underlying object as [other]. NSCondition.castFrom(objc.ObjCObjectBase other) @@ -84193,28 +81308,38 @@ class NSCondition extends objc.NSObject { } /// wait - void wait1() { + void wait$1() { + objc.checkOsVersionInternal('NSCondition.wait', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_wait); } /// waitUntilDate: bool waitUntilDate_(objc.NSDate limit) { + objc.checkOsVersionInternal('NSCondition.waitUntilDate:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); return _objc_msgSend_19nvye5( this.ref.pointer, _sel_waitUntilDate_, limit.ref.pointer); } /// signal void signal() { + objc.checkOsVersionInternal('NSCondition.signal', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_signal); } /// broadcast void broadcast() { + objc.checkOsVersionInternal('NSCondition.broadcast', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_broadcast); } /// name objc.NSString? get name { + objc.checkOsVersionInternal('NSCondition.name', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_name); return _ret.address == 0 ? null @@ -84223,25 +81348,29 @@ class NSCondition extends objc.NSObject { /// setName: set name(objc.NSString? value) { + objc.checkOsVersionInternal('NSCondition.setName:', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0))); _objc_msgSend_xtuoz7( this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); } /// init NSCondition init() { + objc.checkOsVersionInternal('NSCondition.init', + iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); final _ret = _objc_msgSend_151sglz(this.ref.retainAndReturnPointer(), _sel_init); return NSCondition.castFromPointer(_ret, retain: false, release: true); } /// new - static NSCondition new1() { + static NSCondition new$() { final _ret = _objc_msgSend_151sglz(_class_NSCondition, _sel_new); return NSCondition.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSCondition allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSCondition allocWithZone_(ffi.Pointer zone) { final _ret = _objc_msgSend_1cwp428(_class_NSCondition, _sel_allocWithZone_, zone); return NSCondition.castFromPointer(_ret, retain: false, release: true); @@ -84254,7 +81383,7 @@ class NSCondition extends objc.NSObject { } /// self - NSCondition self() { + NSCondition self$1() { final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); return NSCondition.castFromPointer(_ret, retain: true, release: true); } @@ -84280,26 +81409,30 @@ class NSCondition extends objc.NSObject { void unlock() { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_unlock); } + + /// Returns a new instance of NSCondition constructed with the default `new` method. + factory NSCondition() => new$(); } -typedef NSProgressKind1 = ffi.Pointer; -typedef DartNSProgressKind1 = objc.NSString; -typedef NSProgressUserInfoKey1 = ffi.Pointer; -typedef DartNSProgressUserInfoKey1 = objc.NSString; -typedef NSProgressFileOperationKind1 = ffi.Pointer; -typedef DartNSProgressFileOperationKind1 = objc.NSString; -typedef NSProgressUnpublishingHandler1 = ffi.Pointer; -typedef DartNSProgressUnpublishingHandler1 +typedef NSProgressKind$1 = ffi.Pointer; +typedef DartNSProgressKind$1 = objc.NSString; +typedef NSProgressUserInfoKey$1 = ffi.Pointer; +typedef DartNSProgressUserInfoKey$1 = objc.NSString; +typedef NSProgressFileOperationKind$1 = ffi.Pointer; +typedef DartNSProgressFileOperationKind$1 = objc.NSString; +typedef NSProgressUnpublishingHandler$1 = ffi.Pointer; +typedef DartNSProgressUnpublishingHandler$1 = objc.ObjCBlock; -typedef NSProgressPublishingHandler1 = ffi.Pointer; -typedef DartNSProgressPublishingHandler1 +typedef NSProgressPublishingHandler$1 = ffi.Pointer; +typedef DartNSProgressPublishingHandler$1 = objc.ObjCBlock? Function(NSProgress)>; /// WARNING: NSException is a stub. To generate bindings for this class, include /// NSException in your config's objc-interfaces list. /// /// NSException -class NSException extends objc.NSObject { +class NSException extends objc.NSObject + implements objc.NSCopying, objc.NSSecureCoding { NSException._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); @@ -84328,705 +81461,6 @@ extension NSExceptionRaisingConveniences on NSException { typedef NSUncaughtExceptionHandler = ffi .NativeFunction exception)>; -typedef os_function_tFunction1 = ffi.Void Function(ffi.Pointer); -typedef Dartos_function_tFunction1 = void Function(ffi.Pointer); -typedef os_function_t1 - = ffi.Pointer>; - -/// ! -/// @typedef os_block_t -/// -/// @abstract -/// Generic type for a block taking no arguments and returning no value. -/// -/// @discussion -/// When not building with Objective-C ARC, a block object allocated on or -/// copied to the heap must be released with a -[release] message or the -/// Block_release() function. -/// -/// The declaration of a block literal allocates storage on the stack. -/// Therefore, this is an invalid construct: -/// -/// os_block_t block; -/// if (x) { -/// block = ^{ printf("true\n"); }; -/// } else { -/// block = ^{ printf("false\n"); }; -/// } -/// block(); // unsafe!!! -/// -/// -/// What is happening behind the scenes: -/// -/// if (x) { -/// struct Block __tmp_1 = ...; // setup details -/// block = &__tmp_1; -/// } else { -/// struct Block __tmp_2 = ...; // setup details -/// block = &__tmp_2; -/// } -/// -/// -/// As the example demonstrates, the address of a stack variable is escaping the -/// scope in which it is allocated. That is a classic C bug. -/// -/// Instead, the block literal must be copied to the heap with the Block_copy() -/// function or by sending it a -[copy] message. -typedef os_block_t1 = ffi.Pointer; -typedef Dartos_block_t1 = objc.ObjCBlock; -typedef fsignatures_t1 = fsignatures; -typedef fsupplement_t1 = fsupplement; - -/// DYLD needs to check if the object is allowed to be combined -/// into the main binary. This is done between the code signature -/// is loaded and dyld is doing all the work to process the LOAD commands. -/// -/// While this could be done in F_ADDFILESIGS.* family the hook into -/// the MAC module doesn't say no when LV isn't enabled and then that -/// is cached on the vnode, and the MAC module never gets change once -/// a process that library validation enabled. -typedef fchecklv_t1 = fchecklv; - -/// fgetsigsinfo_t used by F_GETSIGSINFO command -typedef fgetsigsinfo_t1 = fgetsigsinfo; - -/// fstore_t type used by F_PREALLOCATE command -typedef fstore_t1 = fstore; - -/// fpunchhole_t used by F_PUNCHHOLE -typedef fpunchhole_t1 = fpunchhole; - -/// factive_file_trim_t used by F_TRIM_ACTIVE_FILE -typedef ftrimactivefile_t1 = ftrimactivefile; - -/// fspecread_t used by F_SPECULATIVE_READ -typedef fspecread_t1 = fspecread; -typedef fattributiontag_t1 = fattributiontag; -typedef filesec_t1 = ffi.Pointer<_filesec>; -typedef boolean_t1 = ffi.Int; -typedef Dartboolean_t1 = int; - -/// natural_t and integer_t are Mach's legacy types for machine- -/// independent integer types (unsigned, and signed, respectively). -/// Their original purpose was to define other types in a machine/ -/// compiler independent way. -/// -/// They also had an implicit "same size as pointer" characteristic -/// to them (i.e. Mach's traditional types are very ILP32 or ILP64 -/// centric). We will likely support x86 ABIs that do not follow -/// either ofthese models (specifically LP64). Therefore, we had to -/// make a choice between making these types scale with pointers or stay -/// tied to integers. Because their use is predominantly tied to -/// to the size of an integer, we are keeping that association and -/// breaking free from pointer size guarantees. -/// -/// New use of these types is discouraged. -typedef natural_t1 = __darwin_natural_t; -typedef integer_t1 = ffi.Int; -typedef Dartinteger_t1 = int; -typedef vm_offset_t1 = ffi.UintPtr; -typedef Dartvm_offset_t1 = int; -typedef vm_size_t1 = ffi.UintPtr; -typedef Dartvm_size_t1 = int; -typedef mach_vm_address_t1 = ffi.Uint64; -typedef Dartmach_vm_address_t1 = int; -typedef mach_vm_offset_t1 = ffi.Uint64; -typedef Dartmach_vm_offset_t1 = int; -typedef mach_vm_size_t1 = ffi.Uint64; -typedef Dartmach_vm_size_t1 = int; -typedef vm_map_offset_t1 = ffi.Uint64; -typedef Dartvm_map_offset_t1 = int; -typedef vm_map_address_t1 = ffi.Uint64; -typedef Dartvm_map_address_t1 = int; -typedef vm_map_size_t1 = ffi.Uint64; -typedef Dartvm_map_size_t1 = int; -typedef vm32_offset_t1 = ffi.Uint32; -typedef Dartvm32_offset_t1 = int; -typedef vm32_address_t1 = ffi.Uint32; -typedef Dartvm32_address_t1 = int; -typedef vm32_size_t1 = ffi.Uint32; -typedef Dartvm32_size_t1 = int; -typedef mach_port_context_t1 = vm_offset_t1; - -/// mach_port_name_t - the local identity for a Mach port -/// -/// The name is Mach port namespace specific. It is used to -/// identify the rights held for that port by the task whose -/// namespace is implied [or specifically provided]. -/// -/// Use of this type usually implies just a name - no rights. -/// See mach_port_t for a type that implies a "named right." -typedef mach_port_name_t1 = natural_t1; -typedef mach_port_name_array_t1 = ffi.Pointer; -typedef mach_port_t1 = __darwin_mach_port_t; -typedef mach_port_array_t1 = ffi.Pointer; - -/// These are the different rights a task may have for a port. -/// The MACH_PORT_RIGHT_* definitions are used as arguments -/// to mach_port_allocate, mach_port_get_refs, etc, to specify -/// a particular right to act upon. The mach_port_names and -/// mach_port_type calls return bitmasks using the MACH_PORT_TYPE_* -/// definitions. This is because a single name may denote -/// multiple rights. -typedef mach_port_right_t1 = natural_t1; -typedef mach_port_type_t1 = natural_t1; -typedef mach_port_type_array_t1 = ffi.Pointer; - -/// User-references for capabilities. -typedef mach_port_urefs_t1 = natural_t1; -typedef mach_port_delta_t1 = integer_t1; - -/// Attributes of ports. (See mach_port_get_receive_status.) -typedef mach_port_seqno_t1 = natural_t1; -typedef mach_port_mscount_t1 = natural_t1; -typedef mach_port_msgcount_t1 = natural_t1; -typedef mach_port_rights_t1 = natural_t1; -typedef mach_port_srights_t1 = ffi.UnsignedInt; -typedef Dartmach_port_srights_t1 = int; -typedef mach_port_status_t1 = mach_port_status; -typedef mach_port_limits_t1 = mach_port_limits; -typedef mach_port_info_ext_t1 = mach_port_info_ext; -typedef mach_port_guard_info_t1 = mach_port_guard_info; -typedef mach_port_info_t1 = ffi.Pointer; - -/// Flavors for mach_port_get/set/assert_attributes() -typedef mach_port_flavor_t1 = ffi.Int; -typedef Dartmach_port_flavor_t1 = int; - -/// Structure used to pass information about port allocation requests. -/// Must be padded to 64-bits total length. -typedef mach_port_qos_t1 = mach_port_qos; -typedef mach_service_port_info_data_t1 = mach_service_port_info; -typedef mach_service_port_info_t1 = ffi.Pointer; - -/// Structure to define optional attributes for a newly -/// constructed port. -typedef mach_port_options_t1 = mach_port_options; -typedef mach_port_options_ptr_t1 = ffi.Pointer; - -/// ! -/// @typedef os_workgroup_t -/// -/// @abstract -/// A reference counted os object representing a workload that needs to -/// be distinctly recognized and tracked by the system. The workgroup -/// tracks a collection of threads all working cooperatively. An os_workgroup -/// object - when not an instance of a specific os_workgroup_t subclass - -/// represents a generic workload and makes no assumptions about the kind of -/// work done. -/// -/// @discussion -/// Threads can explicitly join an os_workgroup_t to mark themselves as -/// participants in the workload. -typedef os_workgroup_t1 = ffi.Pointer; -typedef Dartos_workgroup_t1 = OS_os_workgroup; - -/// ! -/// @typedef os_workgroup_attr_t -/// -/// @abstract -/// Pointer to an opaque structure for describing attributes that can be -/// configured on a workgroup at creation. -typedef os_workgroup_attr_s1 = os_workgroup_attr_opaque_s; -typedef os_workgroup_attr_t1 = ffi.Pointer; - -/// ! -/// @typedef os_workgroup_join_token, os_workgroup_join_token_t -/// -/// @abstract -/// An opaque join token which the client needs to pass to os_workgroup_join -/// and os_workgroup_leave -typedef os_workgroup_join_token_s1 = os_workgroup_join_token_opaque_s; -typedef os_workgroup_join_token_t1 - = ffi.Pointer; - -/// Working Arena index of a thread in a workgroup -typedef os_workgroup_index1 = ffi.Uint32; -typedef Dartos_workgroup_index1 = int; -typedef os_workgroup_working_arena_destructor_tFunction1 = ffi.Void Function( - ffi.Pointer); -typedef Dartos_workgroup_working_arena_destructor_tFunction1 = void Function( - ffi.Pointer); - -/// Destructor for Working Arena -typedef os_workgroup_working_arena_destructor_t1 = ffi.Pointer< - ffi.NativeFunction>; - -/// ! -/// @typedef os_workgroup_max_parallel_threads_attr_t -/// -/// @abstract -/// A pointer to a structure describing the set of properties of a workgroup to -/// override with the explicitly specified values in the structure. -/// -/// See also os_workgroup_max_parallel_threads. -typedef os_workgroup_mpt_attr_s1 = os_workgroup_max_parallel_threads_attr_s; -typedef os_workgroup_mpt_attr_t1 - = ffi.Pointer; -typedef os_workgroup_interval_t1 = ffi.Pointer; -typedef Dartos_workgroup_interval_t1 = OS_os_workgroup; - -/// @typedef os_workgroup_interval_data, os_workgroup_interval_data_t -/// -/// @abstract -/// An opaque structure containing additional configuration for the workgroup -/// interval. -typedef os_workgroup_interval_data_s1 = os_workgroup_interval_data_opaque_s; -typedef os_workgroup_interval_data_t1 - = ffi.Pointer; -typedef os_workgroup_parallel_t1 = ffi.Pointer; -typedef Dartos_workgroup_parallel_t1 = OS_os_workgroup; -typedef dispatch_function_tFunction1 = ffi.Void Function(ffi.Pointer); -typedef Dartdispatch_function_tFunction1 = void Function(ffi.Pointer); -typedef dispatch_function_t1 - = ffi.Pointer>; -typedef time_value_t1 = time_value; - -/// Type definitions. -typedef alarm_type_t1 = ffi.Int; -typedef Dartalarm_type_t1 = int; -typedef sleep_type_t1 = ffi.Int; -typedef Dartsleep_type_t1 = int; -typedef clock_id_t1 = ffi.Int; -typedef Dartclock_id_t1 = int; -typedef clock_flavor_t1 = ffi.Int; -typedef Dartclock_flavor_t1 = int; -typedef clock_attr_t1 = ffi.Pointer; -typedef clock_res_t1 = ffi.Int; -typedef Dartclock_res_t1 = int; -typedef mach_timespec_t1 = mach_timespec; - -/// ! -/// @typedef dispatch_time_t -/// -/// @abstract -/// A somewhat abstract representation of time; where zero means "now" and -/// DISPATCH_TIME_FOREVER means "infinity" and every value in between is an -/// opaque encoding. -typedef dispatch_time_t1 = ffi.Uint64; -typedef Dartdispatch_time_t1 = int; - -/// By default, dispatch objects are declared as Objective-C types when building -/// with an Objective-C compiler. This allows them to participate in ARC, in RR -/// management by the Blocks runtime and in leaks checking by the static -/// analyzer, and enables them to be added to Cocoa collections. -/// See for details. -typedef dispatch_object_t1 = ffi.Pointer; -typedef Dartdispatch_object_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_block_t -/// -/// @abstract -/// The type of blocks submitted to dispatch queues, which take no arguments -/// and have no return value. -/// -/// @discussion -/// When not building with Objective-C ARC, a block object allocated on or -/// copied to the heap must be released with a -[release] message or the -/// Block_release() function. -/// -/// The declaration of a block literal allocates storage on the stack. -/// Therefore, this is an invalid construct: -/// -/// dispatch_block_t block; -/// if (x) { -/// block = ^{ printf("true\n"); }; -/// } else { -/// block = ^{ printf("false\n"); }; -/// } -/// block(); // unsafe!!! -/// -/// -/// What is happening behind the scenes: -/// -/// if (x) { -/// struct Block __tmp_1 = ...; // setup details -/// block = &__tmp_1; -/// } else { -/// struct Block __tmp_2 = ...; // setup details -/// block = &__tmp_2; -/// } -/// -/// -/// As the example demonstrates, the address of a stack variable is escaping the -/// scope in which it is allocated. That is a classic C bug. -/// -/// Instead, the block literal must be copied to the heap with the Block_copy() -/// function or by sending it a -[copy] message. -typedef dispatch_block_t1 = ffi.Pointer; -typedef Dartdispatch_block_t1 = objc.ObjCBlock; - -/// ! -/// @typedef dispatch_queue_global_t -/// -/// @abstract -/// Dispatch global concurrent queues are an abstraction around the system thread -/// pool which invokes workitems that are submitted to dispatch queues. -/// -/// @discussion -/// Dispatch global concurrent queues provide buckets of priorities on top of the -/// thread pool the system manages. The system will decide how many threads -/// to allocate to this pool depending on demand and system load. In particular, -/// the system tries to maintain a good level of concurrency for this resource, -/// and will create new threads when too many existing worker threads block in -/// system calls. -/// -/// The global concurrent queues are a shared resource and as such it is the -/// responsiblity of every user of this resource to not submit an unbounded -/// amount of work to this pool, especially work that may block, as this can -/// cause the system to spawn very large numbers of threads (aka. thread -/// explosion). -/// -/// Work items submitted to the global concurrent queues have no ordering -/// guarantee with respect to the order of submission, and workitems submitted -/// to these queues may be invoked concurrently. -/// -/// Dispatch global concurrent queues are well-known global objects that are -/// returned by dispatch_get_global_queue(). These objects cannot be modified. -/// Calls to dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., -/// will have no effect when used with queues of this type. -typedef dispatch_queue_global_t1 = ffi.Pointer; -typedef Dartdispatch_queue_global_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_queue_serial_executor_t -/// -/// @abstract -/// An abstract class of dispatch queues which conform to the serial executor -/// protocol. -/// -/// @discussion -/// A serial executor in Swift Concurrency represents a mutual exclusion context. -/// Queues with a singular owner, which invoke only one workItem at a time -/// provide such a mutual exclusion context and are serial executors. -/// -/// Subclasses of this abstract class can be therefore be setup as Custom -/// Executors for Swift Actors. -/// -/// See dispatch_queue_serial_t and dispatch_workloop_t. -typedef dispatch_queue_serial_executor_t1 = ffi.Pointer; -typedef Dartdispatch_queue_serial_executor_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_queue_serial_t -/// -/// @abstract -/// Dispatch serial queues invoke workitems submitted to them serially in FIFO -/// order. -/// -/// @discussion -/// Dispatch serial queues are lightweight objects to which workitems may be -/// submitted to be invoked in FIFO order. A serial queue will only invoke one -/// workitem at a time, but independent serial queues may each invoke their work -/// items concurrently with respect to each other. -/// -/// Serial queues can target each other (See dispatch_set_target_queue()). The -/// serial queue at the bottom of a queue hierarchy provides an exclusion -/// context: at most one workitem submitted to any of the queues in such -/// a hiearchy will run at any given time. -/// -/// Such hierarchies provide a natural construct to organize an application -/// subsystem around. -/// -/// Serial queues are created by passing a dispatch queue attribute derived from -/// DISPATCH_QUEUE_SERIAL to dispatch_queue_create_with_target(). -typedef dispatch_queue_serial_t1 = ffi.Pointer; -typedef Dartdispatch_queue_serial_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_queue_main_t -/// -/// @abstract -/// The type of the default queue that is bound to the main thread. -/// -/// @discussion -/// The main queue is a serial queue (See dispatch_queue_serial_t) which is bound -/// to the main thread of an application. -/// -/// In order to invoke workitems submitted to the main queue, the application -/// must call dispatch_main(), NSApplicationMain(), or use a CFRunLoop on the -/// main thread. -/// -/// The main queue is a well known global object that is made automatically on -/// behalf of the main thread during process initialization and is returned by -/// dispatch_get_main_queue(). This object cannot be modified. Calls to -/// dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., will -/// have no effect when used on the main queue. -typedef dispatch_queue_main_t1 = ffi.Pointer; -typedef Dartdispatch_queue_main_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_queue_concurrent_t -/// -/// @abstract -/// Dispatch concurrent queues invoke workitems submitted to them concurrently, -/// and admit a notion of barrier workitems. -/// -/// @discussion -/// Dispatch concurrent queues are lightweight objects to which regular and -/// barrier workitems may be submited. Barrier workitems are invoked in -/// exclusion of any other kind of workitem in FIFO order. -/// -/// Regular workitems can be invoked concurrently for the same concurrent queue, -/// in any order. However, regular workitems will not be invoked before any -/// barrier workitem submited ahead of them has been invoked. -/// -/// In other words, if a serial queue is equivalent to a mutex in the Dispatch -/// world, a concurrent queue is equivalent to a reader-writer lock, where -/// regular items are readers and barriers are writers. -/// -/// Concurrent queues are created by passing a dispatch queue attribute derived -/// from DISPATCH_QUEUE_CONCURRENT to dispatch_queue_create_with_target(). -/// -/// Caveat: -/// Dispatch concurrent queues at this time do not implement priority inversion -/// avoidance when lower priority regular workitems (readers) are being invoked -/// and are preventing a higher priority barrier (writer) from being invoked. -typedef dispatch_queue_concurrent_t1 = ffi.Pointer; -typedef Dartdispatch_queue_concurrent_t1 = objc.NSObject; -typedef dispatch_queue_priority_t1 = ffi.Long; -typedef Dartdispatch_queue_priority_t1 = int; - -/// ! -/// @typedef dispatch_queue_attr_t -/// -/// @abstract -/// Attribute for dispatch queues. -typedef dispatch_queue_attr_t1 = ffi.Pointer; -typedef Dartdispatch_queue_attr_t1 = objc.NSObject; -typedef kern_return_t1 = ffi.Int; -typedef Dartkern_return_t1 = int; - -/// The timeout mechanism uses mach_msg_timeout_t values, -/// passed by value. The timeout units are milliseconds. -/// It is controlled with the MACH_SEND_TIMEOUT -/// and MACH_RCV_TIMEOUT options. -typedef mach_msg_timeout_t1 = natural_t1; - -/// Every message starts with a message header. -/// Following the message header, if the message is complex, are a count -/// of type descriptors and the type descriptors themselves -/// (mach_msg_descriptor_t). The size of the message must be specified in -/// bytes, and includes the message header, descriptor count, descriptors, -/// and inline data. -/// -/// The msgh_remote_port field specifies the destination of the message. -/// It must specify a valid send or send-once right for a port. -/// -/// The msgh_local_port field specifies a "reply port". Normally, -/// This field carries a send-once right that the receiver will use -/// to reply to the message. It may carry the values MACH_PORT_NULL, -/// MACH_PORT_DEAD, a send-once right, or a send right. -/// -/// The msgh_voucher_port field specifies a Mach voucher port. Only -/// send rights to kernel-implemented Mach Voucher kernel objects in -/// addition to MACH_PORT_NULL or MACH_PORT_DEAD may be passed. -/// -/// The msgh_id field is uninterpreted by the message primitives. -/// It normally carries information specifying the format -/// or meaning of the message. -typedef mach_msg_bits_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_bits_t1 = int; -typedef mach_msg_size_t1 = natural_t1; -typedef mach_msg_id_t1 = integer_t1; -typedef mach_msg_priority_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_priority_t1 = int; -typedef mach_msg_type_name_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_type_name_t1 = int; -typedef mach_msg_copy_options_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_copy_options_t1 = int; -typedef mach_msg_guard_flags_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_guard_flags_t1 = int; - -/// In a complex mach message, the mach_msg_header_t is followed by -/// a descriptor count, then an array of that number of descriptors -/// (mach_msg_*_descriptor_t). The type field of mach_msg_type_descriptor_t -/// (which any descriptor can be cast to) indicates the flavor of the -/// descriptor. -/// -/// Note that in LP64, the various types of descriptors are no longer all -/// the same size as mach_msg_descriptor_t, so the array cannot be indexed -/// as expected. -typedef mach_msg_descriptor_type_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_descriptor_type_t1 = int; -typedef mach_msg_trailer_type_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_trailer_type_t1 = int; -typedef mach_msg_trailer_size_t1 = ffi.UnsignedInt; -typedef Dartmach_msg_trailer_size_t1 = int; -typedef mach_msg_trailer_info_t1 = ffi.Pointer; -typedef mach_msg_filter_id1 = ffi.Int; -typedef Dartmach_msg_filter_id1 = int; - -/// These values can change from release to release - but clearly -/// code cannot request additional trailer elements one was not -/// compiled to understand. Therefore, it is safe to use this -/// constant when the same module specified the receive options. -/// Otherwise, you run the risk that the options requested by -/// another module may exceed the local modules notion of -/// MAX_TRAILER_SIZE. -typedef mach_msg_max_trailer_t1 = mach_msg_mac_trailer_t; - -/// Legacy requirements keep us from ever updating these defines (even -/// when the format_0 trailers gain new option data fields in the future). -/// Therefore, they shouldn't be used going forward. Instead, the sizes -/// should be compared against the specific element size requested using -/// REQUESTED_TRAILER_SIZE. -typedef mach_msg_format_0_trailer_t1 = mach_msg_security_trailer_t; -typedef mach_msg_options_t1 = integer_t1; -typedef mach_msg_type_size_t1 = natural_t1; -typedef mach_msg_type_number_t1 = natural_t1; -typedef mach_msg_option_t1 = integer_t1; - -/// Much code assumes that mach_msg_return_t == kern_return_t. -/// This definition is useful for descriptive purposes. -/// -/// See for the format of error codes. -/// IPC errors are system 4. Send errors are subsystem 0; -/// receive errors are subsystem 1. The code field is always non-zero. -/// The high bits of the code field communicate extra information -/// for some error codes. MACH_MSG_MASK masks off these special bits. -typedef mach_msg_return_t1 = kern_return_t1; - -/// ! -/// @typedef dispatch_source_t -/// -/// @abstract -/// Dispatch sources are used to automatically submit event handler blocks to -/// dispatch queues in response to external events. -typedef dispatch_source_t1 = ffi.Pointer; -typedef Dartdispatch_source_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_source_type_t -/// -/// @abstract -/// Constants of this type represent the class of low-level system object that -/// is being monitored by the dispatch source. Constants of this type are -/// passed as a parameter to dispatch_source_create() and determine how the -/// handle argument is interpreted (i.e. as a file descriptor, mach port, -/// signal number, process identifier, etc.), and how the mask argument is -/// interpreted. -typedef dispatch_source_type_t1 = ffi.Pointer; -typedef dispatch_source_mach_send_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_source_mach_send_flags_t1 = int; - -/// ! -/// @typedef dispatch_source_mach_recv_flags_t -/// Type of dispatch_source_mach_recv flags -typedef dispatch_source_mach_recv_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_source_mach_recv_flags_t1 = int; -typedef dispatch_source_memorypressure_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_source_memorypressure_flags_t1 = int; -typedef dispatch_source_proc_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_source_proc_flags_t1 = int; -typedef dispatch_source_vnode_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_source_vnode_flags_t1 = int; -typedef dispatch_source_timer_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_source_timer_flags_t1 = int; - -/// ! -/// @typedef dispatch_group_t -/// @abstract -/// A group of blocks submitted to queues for asynchronous invocation. -typedef dispatch_group_t1 = ffi.Pointer; -typedef Dartdispatch_group_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_semaphore_t -/// -/// @abstract -/// A counting semaphore. -typedef dispatch_semaphore_t1 = ffi.Pointer; -typedef Dartdispatch_semaphore_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_once_t -/// -/// @abstract -/// A predicate for use with dispatch_once(). It must be initialized to zero. -/// Note: static and global variables default to zero. -typedef dispatch_once_t1 = ffi.IntPtr; -typedef Dartdispatch_once_t1 = int; - -/// ! -/// @typedef dispatch_data_t -/// A dispatch object representing memory regions. -typedef dispatch_data_t1 = ffi.Pointer; -typedef Dartdispatch_data_t1 = objc.NSObject; - -/// ! -/// @typedef dispatch_data_applier_t -/// A block to be invoked for every contiguous memory region in a data object. -/// -/// @param region A data object representing the current region. -/// @param offset The logical offset of the current region to the start -/// of the data object. -/// @param buffer The location of the memory for the current region. -/// @param size The size of the memory for the current region. -/// @result A Boolean indicating whether traversal should continue. -typedef dispatch_data_applier_t1 = ffi.Pointer; -typedef Dartdispatch_data_applier_t1 = objc.ObjCBlock< - ffi.Bool Function( - objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)>; -typedef dispatch_fd_t1 = ffi.Int; -typedef Dartdispatch_fd_t1 = int; - -/// ! -/// @typedef dispatch_io_t -/// A dispatch I/O channel represents the asynchronous I/O policy applied to a -/// file descriptor. I/O channels are first class dispatch objects and may be -/// retained and released, suspended and resumed, etc. -typedef dispatch_io_t1 = ffi.Pointer; -typedef Dartdispatch_io_t1 = objc.NSObject; -typedef dispatch_io_type_t1 = ffi.UnsignedLong; -typedef Dartdispatch_io_type_t1 = int; - -/// ! -/// @typedef dispatch_io_handler_t -/// The prototype of I/O handler blocks for dispatch I/O operations. -/// -/// @param done A flag indicating whether the operation is complete. -/// @param data The data object to be handled. -/// @param error An errno condition for the operation. -typedef dispatch_io_handler_t1 = ffi.Pointer; -typedef Dartdispatch_io_handler_t1 - = objc.ObjCBlock; -typedef dispatch_io_close_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_io_close_flags_t1 = int; -typedef dispatch_io_interval_flags_t1 = ffi.UnsignedLong; -typedef Dartdispatch_io_interval_flags_t1 = int; - -/// ! -/// @typedef dispatch_workloop_t -/// -/// @abstract -/// Dispatch workloops invoke workitems submitted to them in priority order. -/// -/// @discussion -/// A dispatch workloop is a flavor of dispatch_queue_t that is a priority -/// ordered queue (using the QOS class of the submitted workitems as the -/// ordering). Dispatch workloops are an exclusion context and it is guaranteed -/// that only one work item submitted to the dispatch workloop will be invoked at -/// a time. -/// -/// Between each workitem invocation, the workloop will evaluate whether higher -/// priority workitems have since been submitted, either directly to the -/// workloop or to any queues that target the workloop, and execute these first. -/// -/// Serial queues targeting a workloop maintain FIFO execution of their -/// workitems. However, the workloop may reorder workitems submitted to -/// independent serial queues targeting it with respect to each other, -/// based on their priorities, while preserving FIFO execution with respect to -/// each serial queue. -/// -/// A dispatch workloop is a "subclass" of dispatch_queue_t which can be passed -/// to all APIs accepting a dispatch queue, except for functions from the -/// dispatch_sync() family. dispatch_async_and_wait() must be used for workloop -/// objects. Functions from the dispatch_sync() family on queues targeting -/// a workloop are still permitted but discouraged for performance reasons. -typedef dispatch_workloop_t1 = ffi.Pointer; -typedef Dartdispatch_workloop_t1 = objc.NSObject; enum NSOperationQueuePriority { NSOperationQueuePriorityVeryLow(-8), @@ -85045,7 +81479,7 @@ enum NSOperationQueuePriority { 4 => NSOperationQueuePriorityHigh, 8 => NSOperationQueuePriorityVeryHigh, _ => throw ArgumentError( - "Unknown value for NSOperationQueuePriority: $value"), + 'Unknown value for NSOperationQueuePriority: $value'), }; } @@ -85107,6 +81541,10 @@ extension NSErrorRecoveryAttempting on objc.NSObject { objc.ObjCObjectBase? delegate, ffi.Pointer didRecoverSelector, ffi.Pointer contextInfo) { + objc.checkOsVersionInternal( + 'NSObject.attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); _objc_msgSend_10txwc9( this.ref.pointer, _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_, @@ -85120,6 +81558,10 @@ extension NSErrorRecoveryAttempting on objc.NSObject { /// Given that an error alert has been presented applicaton-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and return YES if error recovery was completely successful, NO otherwise. The recovery option index is an index into the error's array of localized recovery options. bool attemptRecoveryFromError_optionIndex_( objc.NSError error, DartNSUInteger recoveryOptionIndex) { + objc.checkOsVersionInternal( + 'NSObject.attemptRecoveryFromError:optionIndex:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0))); return _objc_msgSend_z7gxsm( this.ref.pointer, _sel_attemptRecoveryFromError_optionIndex_, @@ -85164,77 +81606,77 @@ const int NSScannedOption = 1; const int NSCollectorDisabledOption = 2; -const int noErr1 = 0; +const int noErr$1 = 0; -const int kNilOptions1 = 0; +const int kNilOptions$1 = 0; -const int kVariableLengthArray1 = 1; +const int kVariableLengthArray$1 = 1; -const int kUnknownType1 = 1061109567; +const int kUnknownType$1 = 1061109567; -const int normal1 = 0; +const int normal$1 = 0; -const int bold1 = 1; +const int bold$1 = 1; -const int italic1 = 2; +const int italic$1 = 2; -const int underline1 = 4; +const int underline$1 = 4; -const int outline1 = 8; +const int outline$1 = 8; -const int shadow1 = 16; +const int shadow$1 = 16; -const int condense1 = 32; +const int condense$1 = 32; -const int extend1 = 64; +const int extend$1 = 64; -const int developStage1 = 32; +const int developStage$1 = 32; -const int alphaStage1 = 64; +const int alphaStage$1 = 64; -const int betaStage1 = 96; +const int betaStage$1 = 96; -const int finalStage1 = 128; +const int finalStage$1 = 128; -const int NSScannedOption1 = 1; +const int NSScannedOption$1 = 1; -const int NSCollectorDisabledOption1 = 2; +const int NSCollectorDisabledOption$1 = 2; -const int noErr2 = 0; +const int noErr$2 = 0; -const int kNilOptions2 = 0; +const int kNilOptions$2 = 0; -const int kVariableLengthArray2 = 1; +const int kVariableLengthArray$2 = 1; -const int kUnknownType2 = 1061109567; +const int kUnknownType$2 = 1061109567; -const int normal2 = 0; +const int normal$2 = 0; -const int bold2 = 1; +const int bold$2 = 1; -const int italic2 = 2; +const int italic$2 = 2; -const int underline2 = 4; +const int underline$2 = 4; -const int outline2 = 8; +const int outline$2 = 8; -const int shadow2 = 16; +const int shadow$2 = 16; -const int condense2 = 32; +const int condense$2 = 32; -const int extend2 = 64; +const int extend$2 = 64; -const int developStage2 = 32; +const int developStage$2 = 32; -const int alphaStage2 = 64; +const int alphaStage$2 = 64; -const int betaStage2 = 96; +const int betaStage$2 = 96; -const int finalStage2 = 128; +const int finalStage$2 = 128; -const int NSScannedOption2 = 1; +const int NSScannedOption$2 = 1; -const int NSCollectorDisabledOption2 = 2; +const int NSCollectorDisabledOption$2 = 2; const int errSecSuccess = 0; @@ -89856,41 +86298,41 @@ const int SSL_RSA_WITH_3DES_EDE_CBC_MD5 = -125; const int SSL_NO_SUCH_CIPHERSUITE = -1; -const int noErr3 = 0; +const int noErr$3 = 0; -const int kNilOptions3 = 0; +const int kNilOptions$3 = 0; -const int kVariableLengthArray3 = 1; +const int kVariableLengthArray$3 = 1; -const int kUnknownType3 = 1061109567; +const int kUnknownType$3 = 1061109567; -const int normal3 = 0; +const int normal$3 = 0; -const int bold3 = 1; +const int bold$3 = 1; -const int italic3 = 2; +const int italic$3 = 2; -const int underline3 = 4; +const int underline$3 = 4; -const int outline3 = 8; +const int outline$3 = 8; -const int shadow3 = 16; +const int shadow$3 = 16; -const int condense3 = 32; +const int condense$3 = 32; -const int extend3 = 64; +const int extend$3 = 64; -const int developStage3 = 32; +const int developStage$3 = 32; -const int alphaStage3 = 64; +const int alphaStage$3 = 64; -const int betaStage3 = 96; +const int betaStage$3 = 96; -const int finalStage3 = 128; +const int finalStage$3 = 128; -const int NSScannedOption3 = 1; +const int NSScannedOption$3 = 1; -const int NSCollectorDisabledOption3 = 2; +const int NSCollectorDisabledOption$3 = 2; const int NSASCIIStringEncoding = 1; @@ -89942,307 +86384,307 @@ const int NSProprietaryStringEncoding = 65536; const int NSOpenStepUnicodeReservedBase = 62464; -const int noErr4 = 0; +const int noErr$4 = 0; -const int kNilOptions4 = 0; +const int kNilOptions$4 = 0; -const int kVariableLengthArray4 = 1; +const int kVariableLengthArray$4 = 1; -const int kUnknownType4 = 1061109567; +const int kUnknownType$4 = 1061109567; -const int normal4 = 0; +const int normal$4 = 0; -const int bold4 = 1; +const int bold$4 = 1; -const int italic4 = 2; +const int italic$4 = 2; -const int underline4 = 4; +const int underline$4 = 4; -const int outline4 = 8; +const int outline$4 = 8; -const int shadow4 = 16; +const int shadow$4 = 16; -const int condense4 = 32; +const int condense$4 = 32; -const int extend4 = 64; +const int extend$4 = 64; -const int developStage4 = 32; +const int developStage$4 = 32; -const int alphaStage4 = 64; +const int alphaStage$4 = 64; -const int betaStage4 = 96; +const int betaStage$4 = 96; -const int finalStage4 = 128; +const int finalStage$4 = 128; -const int NSScannedOption4 = 1; +const int NSScannedOption$4 = 1; -const int NSCollectorDisabledOption4 = 2; +const int NSCollectorDisabledOption$4 = 2; -const int noErr5 = 0; +const int noErr$5 = 0; -const int kNilOptions5 = 0; +const int kNilOptions$5 = 0; -const int kVariableLengthArray5 = 1; +const int kVariableLengthArray$5 = 1; -const int kUnknownType5 = 1061109567; +const int kUnknownType$5 = 1061109567; -const int normal5 = 0; +const int normal$5 = 0; -const int bold5 = 1; +const int bold$5 = 1; -const int italic5 = 2; +const int italic$5 = 2; -const int underline5 = 4; +const int underline$5 = 4; -const int outline5 = 8; +const int outline$5 = 8; -const int shadow5 = 16; +const int shadow$5 = 16; -const int condense5 = 32; +const int condense$5 = 32; -const int extend5 = 64; +const int extend$5 = 64; -const int developStage5 = 32; +const int developStage$5 = 32; -const int alphaStage5 = 64; +const int alphaStage$5 = 64; -const int betaStage5 = 96; +const int betaStage$5 = 96; -const int finalStage5 = 128; +const int finalStage$5 = 128; -const int NSScannedOption5 = 1; +const int NSScannedOption$5 = 1; -const int NSCollectorDisabledOption5 = 2; +const int NSCollectorDisabledOption$5 = 2; -const int noErr6 = 0; +const int noErr$6 = 0; -const int kNilOptions6 = 0; +const int kNilOptions$6 = 0; -const int kVariableLengthArray6 = 1; +const int kVariableLengthArray$6 = 1; -const int kUnknownType6 = 1061109567; +const int kUnknownType$6 = 1061109567; -const int normal6 = 0; +const int normal$6 = 0; -const int bold6 = 1; +const int bold$6 = 1; -const int italic6 = 2; +const int italic$6 = 2; -const int underline6 = 4; +const int underline$6 = 4; -const int outline6 = 8; +const int outline$6 = 8; -const int shadow6 = 16; +const int shadow$6 = 16; -const int condense6 = 32; +const int condense$6 = 32; -const int extend6 = 64; +const int extend$6 = 64; -const int developStage6 = 32; +const int developStage$6 = 32; -const int alphaStage6 = 64; +const int alphaStage$6 = 64; -const int betaStage6 = 96; +const int betaStage$6 = 96; -const int finalStage6 = 128; +const int finalStage$6 = 128; -const int NSScannedOption6 = 1; +const int NSScannedOption$6 = 1; -const int NSCollectorDisabledOption6 = 2; +const int NSCollectorDisabledOption$6 = 2; -const int noErr7 = 0; +const int noErr$7 = 0; -const int kNilOptions7 = 0; +const int kNilOptions$7 = 0; -const int kVariableLengthArray7 = 1; +const int kVariableLengthArray$7 = 1; -const int kUnknownType7 = 1061109567; +const int kUnknownType$7 = 1061109567; -const int normal7 = 0; +const int normal$7 = 0; -const int bold7 = 1; +const int bold$7 = 1; -const int italic7 = 2; +const int italic$7 = 2; -const int underline7 = 4; +const int underline$7 = 4; -const int outline7 = 8; +const int outline$7 = 8; -const int shadow7 = 16; +const int shadow$7 = 16; -const int condense7 = 32; +const int condense$7 = 32; -const int extend7 = 64; +const int extend$7 = 64; -const int developStage7 = 32; +const int developStage$7 = 32; -const int alphaStage7 = 64; +const int alphaStage$7 = 64; -const int betaStage7 = 96; +const int betaStage$7 = 96; -const int finalStage7 = 128; +const int finalStage$7 = 128; -const int NSScannedOption7 = 1; +const int NSScannedOption$7 = 1; -const int NSCollectorDisabledOption7 = 2; +const int NSCollectorDisabledOption$7 = 2; -const int noErr8 = 0; +const int noErr$8 = 0; -const int kNilOptions8 = 0; +const int kNilOptions$8 = 0; -const int kVariableLengthArray8 = 1; +const int kVariableLengthArray$8 = 1; -const int kUnknownType8 = 1061109567; +const int kUnknownType$8 = 1061109567; -const int normal8 = 0; +const int normal$8 = 0; -const int bold8 = 1; +const int bold$8 = 1; -const int italic8 = 2; +const int italic$8 = 2; -const int underline8 = 4; +const int underline$8 = 4; -const int outline8 = 8; +const int outline$8 = 8; -const int shadow8 = 16; +const int shadow$8 = 16; -const int condense8 = 32; +const int condense$8 = 32; -const int extend8 = 64; +const int extend$8 = 64; -const int developStage8 = 32; +const int developStage$8 = 32; -const int alphaStage8 = 64; +const int alphaStage$8 = 64; -const int betaStage8 = 96; +const int betaStage$8 = 96; -const int finalStage8 = 128; +const int finalStage$8 = 128; -const int NSScannedOption8 = 1; +const int NSScannedOption$8 = 1; -const int NSCollectorDisabledOption8 = 2; +const int NSCollectorDisabledOption$8 = 2; -const int NSASCIIStringEncoding1 = 1; +const int NSASCIIStringEncoding$1 = 1; -const int NSNEXTSTEPStringEncoding1 = 2; +const int NSNEXTSTEPStringEncoding$1 = 2; -const int NSJapaneseEUCStringEncoding1 = 3; +const int NSJapaneseEUCStringEncoding$1 = 3; -const int NSUTF8StringEncoding1 = 4; +const int NSUTF8StringEncoding$1 = 4; -const int NSISOLatin1StringEncoding1 = 5; +const int NSISOLatin1StringEncoding$1 = 5; -const int NSSymbolStringEncoding1 = 6; +const int NSSymbolStringEncoding$1 = 6; -const int NSNonLossyASCIIStringEncoding1 = 7; +const int NSNonLossyASCIIStringEncoding$1 = 7; -const int NSShiftJISStringEncoding1 = 8; +const int NSShiftJISStringEncoding$1 = 8; -const int NSISOLatin2StringEncoding1 = 9; +const int NSISOLatin2StringEncoding$1 = 9; -const int NSUnicodeStringEncoding1 = 10; +const int NSUnicodeStringEncoding$1 = 10; -const int NSWindowsCP1251StringEncoding1 = 11; +const int NSWindowsCP1251StringEncoding$1 = 11; -const int NSWindowsCP1252StringEncoding1 = 12; +const int NSWindowsCP1252StringEncoding$1 = 12; -const int NSWindowsCP1253StringEncoding1 = 13; +const int NSWindowsCP1253StringEncoding$1 = 13; -const int NSWindowsCP1254StringEncoding1 = 14; +const int NSWindowsCP1254StringEncoding$1 = 14; -const int NSWindowsCP1250StringEncoding1 = 15; +const int NSWindowsCP1250StringEncoding$1 = 15; -const int NSISO2022JPStringEncoding1 = 21; +const int NSISO2022JPStringEncoding$1 = 21; -const int NSMacOSRomanStringEncoding1 = 30; +const int NSMacOSRomanStringEncoding$1 = 30; -const int NSUTF16StringEncoding1 = 10; +const int NSUTF16StringEncoding$1 = 10; -const int NSUTF16BigEndianStringEncoding1 = 2415919360; +const int NSUTF16BigEndianStringEncoding$1 = 2415919360; -const int NSUTF16LittleEndianStringEncoding1 = 2483028224; +const int NSUTF16LittleEndianStringEncoding$1 = 2483028224; -const int NSUTF32StringEncoding1 = 2348810496; +const int NSUTF32StringEncoding$1 = 2348810496; -const int NSUTF32BigEndianStringEncoding1 = 2550137088; +const int NSUTF32BigEndianStringEncoding$1 = 2550137088; -const int NSUTF32LittleEndianStringEncoding1 = 2617245952; +const int NSUTF32LittleEndianStringEncoding$1 = 2617245952; -const int NSProprietaryStringEncoding1 = 65536; +const int NSProprietaryStringEncoding$1 = 65536; -const int DISPATCH_WALLTIME_NOW1 = -2; +const int DISPATCH_WALLTIME_NOW$1 = -2; -const int noErr9 = 0; +const int noErr$9 = 0; -const int kNilOptions9 = 0; +const int kNilOptions$9 = 0; -const int kVariableLengthArray9 = 1; +const int kVariableLengthArray$9 = 1; -const int kUnknownType9 = 1061109567; +const int kUnknownType$9 = 1061109567; -const int normal9 = 0; +const int normal$9 = 0; -const int bold9 = 1; +const int bold$9 = 1; -const int italic9 = 2; +const int italic$9 = 2; -const int underline9 = 4; +const int underline$9 = 4; -const int outline9 = 8; +const int outline$9 = 8; -const int shadow9 = 16; +const int shadow$9 = 16; -const int condense9 = 32; +const int condense$9 = 32; -const int extend9 = 64; +const int extend$9 = 64; -const int developStage9 = 32; +const int developStage$9 = 32; -const int alphaStage9 = 64; +const int alphaStage$9 = 64; -const int betaStage9 = 96; +const int betaStage$9 = 96; -const int finalStage9 = 128; +const int finalStage$9 = 128; -const int NSScannedOption9 = 1; +const int NSScannedOption$9 = 1; -const int NSCollectorDisabledOption9 = 2; +const int NSCollectorDisabledOption$9 = 2; -const int noErr10 = 0; +const int noErr$10 = 0; -const int kNilOptions10 = 0; +const int kNilOptions$10 = 0; -const int kVariableLengthArray10 = 1; +const int kVariableLengthArray$10 = 1; -const int kUnknownType10 = 1061109567; +const int kUnknownType$10 = 1061109567; -const int normal10 = 0; +const int normal$10 = 0; -const int bold10 = 1; +const int bold$10 = 1; -const int italic10 = 2; +const int italic$10 = 2; -const int underline10 = 4; +const int underline$10 = 4; -const int outline10 = 8; +const int outline$10 = 8; -const int shadow10 = 16; +const int shadow$10 = 16; -const int condense10 = 32; +const int condense$10 = 32; -const int extend10 = 64; +const int extend$10 = 64; -const int developStage10 = 32; +const int developStage$10 = 32; -const int alphaStage10 = 64; +const int alphaStage$10 = 64; -const int betaStage10 = 96; +const int betaStage$10 = 96; -const int finalStage10 = 128; +const int finalStage$10 = 128; -const int NSScannedOption10 = 1; +const int NSScannedOption$10 = 1; -const int NSCollectorDisabledOption10 = 2; +const int NSCollectorDisabledOption$10 = 2; const int __API_TO_BE_DEPRECATED = 100000; @@ -91636,9 +88078,9 @@ const int FD_SETSIZE = 1024; const int __bool_true_false_are_defined = 1; -const int true1 = 1; +const int true$ = 1; -const int false1 = 0; +const int false$ = 0; const int __DARWIN_CLK_TCK = 100; diff --git a/pkgs/cupertino_http/lib/src/utils.dart b/pkgs/cupertino_http/lib/src/utils.dart index 8712c34dd8..8146756a75 100644 --- a/pkgs/cupertino_http/lib/src/utils.dart +++ b/pkgs/cupertino_http/lib/src/utils.dart @@ -2,26 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:ffi'; -import 'dart:io'; - import 'package:objective_c/objective_c.dart'; -import 'native_cupertino_bindings.dart' as ncb; - -/// Access to symbols that are linked into the process. -/// -/// The "Foundation" framework is linked to Dart so no additional -/// libraries need to be loaded to access those symbols. -final ncb.NativeCupertinoHttp linkedLibs = () { - if (Platform.isMacOS || Platform.isIOS) { - final lib = DynamicLibrary.process(); - return ncb.NativeCupertinoHttp(lib); - } - throw UnsupportedError( - 'Platform ${Platform.operatingSystem} is not supported'); -}(); - /// Converts a NSDictionary containing NSString keys and NSString values into /// an equivalent map. Map stringNSDictionaryToMap(NSDictionary d) { @@ -32,12 +14,12 @@ Map stringNSDictionaryToMap(NSDictionary d) { if (!NSString.isInstance(nsKey)) { throw UnsupportedError('keys must be strings'); } - final key = NSString.castFrom(nsKey).toString(); + final key = NSString.castFrom(nsKey).toDartString(); final nsValue = d.objectForKey_(nsKey); if (nsValue == null || !NSString.isInstance(nsValue)) { throw UnsupportedError('values must be strings'); } - final value = NSString.castFrom(nsValue).toString(); + final value = NSString.castFrom(nsValue).toDartString(); m[key] = value; } @@ -55,4 +37,4 @@ NSArray stringIterableToNSArray(Iterable strings) { } NSURL uriToNSURL(Uri uri) => NSURL.URLWithString_(uri.toString().toNSString())!; -Uri nsurlToUri(NSURL url) => Uri.parse(url.absoluteString!.toString()); +Uri nsurlToUri(NSURL url) => Uri.parse(url.absoluteString!.toDartString()); diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 082bb56f38..968f9002fc 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -16,12 +16,12 @@ dependencies: sdk: flutter http: ^1.2.0 http_profile: ^0.1.0 - objective_c: ^4.1.0 + objective_c: ^7.0.0 web_socket: ^0.1.0 dev_dependencies: dart_flutter_team_lints: ^3.0.0 - ffigen: ^16.1.0 + ffigen: ^18.0.0 flutter: plugin: