diff --git a/FirebaseFirestore.podspec b/FirebaseFirestore.podspec index a75ec66f..cad75e14 100755 --- a/FirebaseFirestore.podspec +++ b/FirebaseFirestore.podspec @@ -1,4 +1,4 @@ -firebase_firestore_version = '10.15.0' +firebase_firestore_version = '10.16.0' Pod::Spec.new do |s| s.name = 'FirebaseFirestore' diff --git a/FirebaseFirestore/BoringSSL-GRPC.xcframework/Info.plist b/FirebaseFirestore/BoringSSL-GRPC.xcframework/Info.plist index 022382c4..c3c04ae0 100644 --- a/FirebaseFirestore/BoringSSL-GRPC.xcframework/Info.plist +++ b/FirebaseFirestore/BoringSSL-GRPC.xcframework/Info.plist @@ -6,7 +6,7 @@ LibraryIdentifier - macos-arm64_x86_64 + tvos-arm64_x86_64-simulator LibraryPath BoringSSL-GRPC.framework SupportedArchitectures @@ -15,11 +15,13 @@ x86_64 SupportedPlatform - macos + tvos + SupportedPlatformVariant + simulator LibraryIdentifier - tvos-arm64 + ios-arm64 LibraryPath BoringSSL-GRPC.framework SupportedArchitectures @@ -27,11 +29,11 @@ arm64 SupportedPlatform - tvos + ios LibraryIdentifier - tvos-arm64_x86_64-simulator + ios-arm64_x86_64-simulator LibraryPath BoringSSL-GRPC.framework SupportedArchitectures @@ -40,13 +42,13 @@ x86_64 SupportedPlatform - tvos + ios SupportedPlatformVariant simulator LibraryIdentifier - ios-arm64_x86_64-maccatalyst + macos-arm64_x86_64 LibraryPath BoringSSL-GRPC.framework SupportedArchitectures @@ -55,36 +57,34 @@ x86_64 SupportedPlatform - ios - SupportedPlatformVariant - maccatalyst + macos LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-maccatalyst LibraryPath BoringSSL-GRPC.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + maccatalyst LibraryIdentifier - ios-arm64_x86_64-simulator + tvos-arm64 LibraryPath BoringSSL-GRPC.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform - ios - SupportedPlatformVariant - simulator + tvos CFBundlePackageType diff --git a/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC b/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC index e66ecf80..30544cda 100644 Binary files a/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC and b/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC differ diff --git a/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-maccatalyst/BoringSSL-GRPC.framework/BoringSSL-GRPC b/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-maccatalyst/BoringSSL-GRPC.framework/BoringSSL-GRPC index f3ab6a49..b71287b5 100644 Binary files a/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-maccatalyst/BoringSSL-GRPC.framework/BoringSSL-GRPC and b/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-maccatalyst/BoringSSL-GRPC.framework/BoringSSL-GRPC differ diff --git a/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC b/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC index 3bead6cb..49c302ed 100644 Binary files a/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC and b/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC differ diff --git a/FirebaseFirestore/BoringSSL-GRPC.xcframework/macos-arm64_x86_64/BoringSSL-GRPC.framework/BoringSSL-GRPC b/FirebaseFirestore/BoringSSL-GRPC.xcframework/macos-arm64_x86_64/BoringSSL-GRPC.framework/BoringSSL-GRPC index 639c2425..8ec4b9df 100644 Binary files a/FirebaseFirestore/BoringSSL-GRPC.xcframework/macos-arm64_x86_64/BoringSSL-GRPC.framework/BoringSSL-GRPC and b/FirebaseFirestore/BoringSSL-GRPC.xcframework/macos-arm64_x86_64/BoringSSL-GRPC.framework/BoringSSL-GRPC differ diff --git a/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC b/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC index 14286e25..5c1056ca 100644 Binary files a/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC and b/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64/BoringSSL-GRPC.framework/BoringSSL-GRPC differ diff --git a/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC b/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC index 3b9a0b77..df1f4a34 100644 Binary files a/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC and b/FirebaseFirestore/BoringSSL-GRPC.xcframework/tvos-arm64_x86_64-simulator/BoringSSL-GRPC.framework/BoringSSL-GRPC differ diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/Info.plist b/FirebaseFirestore/FirebaseCoreExtension.xcframework/Info.plist index 91dcecf3..86819719 100644 --- a/FirebaseFirestore/FirebaseCoreExtension.xcframework/Info.plist +++ b/FirebaseFirestore/FirebaseCoreExtension.xcframework/Info.plist @@ -34,7 +34,7 @@ LibraryIdentifier - tvos-arm64 + ios-arm64 LibraryPath FirebaseCoreExtension.framework SupportedArchitectures @@ -42,23 +42,26 @@ arm64 SupportedPlatform - tvos + ios LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-maccatalyst LibraryPath FirebaseCoreExtension.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + maccatalyst LibraryIdentifier - ios-arm64_x86_64-maccatalyst + tvos-arm64_x86_64-simulator LibraryPath FirebaseCoreExtension.framework SupportedArchitectures @@ -67,24 +70,21 @@ x86_64 SupportedPlatform - ios + tvos SupportedPlatformVariant - maccatalyst + simulator LibraryIdentifier - tvos-arm64_x86_64-simulator + tvos-arm64 LibraryPath FirebaseCoreExtension.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform tvos - SupportedPlatformVariant - simulator CFBundlePackageType diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64/FirebaseCoreExtension.framework/Info.plist b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64/FirebaseCoreExtension.framework/Info.plist index 3193519b..11f5939e 100644 --- a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64/FirebaseCoreExtension.framework/Info.plist +++ b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64/FirebaseCoreExtension.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/FirebaseCoreExtension b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/FirebaseCoreExtension index 2e23c167..a97ee31d 100644 Binary files a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/FirebaseCoreExtension and b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/FirebaseCoreExtension differ diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/Info.plist b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/Info.plist index 3193519b..11f5939e 100644 --- a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/Info.plist +++ b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseCoreExtension.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension index b542ca7c..d2a8ca63 100644 Binary files a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension and b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension differ diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist index 3193519b..11f5939e 100644 --- a/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist +++ b/FirebaseFirestore/FirebaseCoreExtension.xcframework/ios-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/FirebaseCoreExtension b/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/FirebaseCoreExtension index 0b3ab4b6..af529bc1 100644 Binary files a/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/FirebaseCoreExtension and b/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/FirebaseCoreExtension differ diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/Info.plist b/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/Info.plist index 3193519b..11f5939e 100644 --- a/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/Info.plist +++ b/FirebaseFirestore/FirebaseCoreExtension.xcframework/macos-arm64_x86_64/FirebaseCoreExtension.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64/FirebaseCoreExtension.framework/Info.plist b/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64/FirebaseCoreExtension.framework/Info.plist index 3193519b..11f5939e 100644 --- a/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64/FirebaseCoreExtension.framework/Info.plist +++ b/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64/FirebaseCoreExtension.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension b/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension index 01bbb0de..e7d654c9 100644 Binary files a/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension and b/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/FirebaseCoreExtension differ diff --git a/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist b/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist index 3193519b..11f5939e 100644 --- a/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist +++ b/FirebaseFirestore/FirebaseCoreExtension.xcframework/tvos-arm64_x86_64-simulator/FirebaseCoreExtension.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/Info.plist b/FirebaseFirestore/FirebaseFirestore.xcframework/Info.plist index 02fc0984..9f1bc7f1 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/Info.plist @@ -6,7 +6,7 @@ LibraryIdentifier - ios-arm64_x86_64-maccatalyst + tvos-arm64_x86_64-simulator LibraryPath FirebaseFirestore.framework SupportedArchitectures @@ -15,13 +15,13 @@ x86_64 SupportedPlatform - ios + tvos SupportedPlatformVariant - maccatalyst + simulator LibraryIdentifier - ios-arm64 + tvos-arm64 LibraryPath FirebaseFirestore.framework SupportedArchitectures @@ -29,38 +29,38 @@ arm64 SupportedPlatform - ios + tvos LibraryIdentifier - tvos-arm64_x86_64-simulator + ios-arm64 LibraryPath FirebaseFirestore.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform - tvos - SupportedPlatformVariant - simulator + ios LibraryIdentifier - tvos-arm64 + ios-arm64_x86_64-simulator LibraryPath FirebaseFirestore.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform - tvos + ios + SupportedPlatformVariant + simulator LibraryIdentifier - macos-arm64_x86_64 + ios-arm64_x86_64-maccatalyst LibraryPath FirebaseFirestore.framework SupportedArchitectures @@ -69,11 +69,13 @@ x86_64 SupportedPlatform - macos + ios + SupportedPlatformVariant + maccatalyst LibraryIdentifier - ios-arm64_x86_64-simulator + macos-arm64_x86_64 LibraryPath FirebaseFirestore.framework SupportedArchitectures @@ -82,9 +84,7 @@ x86_64 SupportedPlatform - ios - SupportedPlatformVariant - simulator + macos CFBundlePackageType diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/FirebaseFirestore b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/FirebaseFirestore index ae9199b6..05b8e165 100644 Binary files a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/FirebaseFirestore and b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/FirebaseFirestore differ diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Info.plist b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Info.plist index 49a09148..16e8c685 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Modules/module.modulemap b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Modules/module.modulemap index 941ef594..85a64925 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Modules/module.modulemap +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64/FirebaseFirestore.framework/Modules/module.modulemap @@ -2,7 +2,9 @@ framework module FirebaseFirestore { umbrella header "FirebaseFirestore-umbrella.h" export * module * { export * } - link framework "Foundation" + link framework "BoringSSL-GRPC" + link framework "gRPC-Core" + link framework "gRPC-C++" link framework "Foundation" link framework "Security" link framework "SystemConfiguration" link framework "UIKit" diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/FirebaseFirestore b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/FirebaseFirestore index e962f27c..6af080f4 100644 Binary files a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/FirebaseFirestore and b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/FirebaseFirestore differ diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Info.plist b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Info.plist index 49a09148..16e8c685 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Modules/module.modulemap b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Modules/module.modulemap index 941ef594..85a64925 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Modules/module.modulemap +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestore.framework/Modules/module.modulemap @@ -2,7 +2,9 @@ framework module FirebaseFirestore { umbrella header "FirebaseFirestore-umbrella.h" export * module * { export * } - link framework "Foundation" + link framework "BoringSSL-GRPC" + link framework "gRPC-Core" + link framework "gRPC-C++" link framework "Foundation" link framework "Security" link framework "SystemConfiguration" link framework "UIKit" diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore index 7e05f0cb..31f6d740 100644 Binary files a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore and b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore differ diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist index 49a09148..16e8c685 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap index 941ef594..85a64925 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap @@ -2,7 +2,9 @@ framework module FirebaseFirestore { umbrella header "FirebaseFirestore-umbrella.h" export * module * { export * } - link framework "Foundation" + link framework "BoringSSL-GRPC" + link framework "gRPC-Core" + link framework "gRPC-C++" link framework "Foundation" link framework "Security" link framework "SystemConfiguration" link framework "UIKit" diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/FirebaseFirestore b/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/FirebaseFirestore index 57702f1d..e96701fd 100644 Binary files a/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/FirebaseFirestore and b/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/FirebaseFirestore differ diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Info.plist b/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Info.plist index 49a09148..16e8c685 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Modules/module.modulemap b/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Modules/module.modulemap index 2adbeacd..2afb3dac 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Modules/module.modulemap +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/macos-arm64_x86_64/FirebaseFirestore.framework/Modules/module.modulemap @@ -2,7 +2,9 @@ framework module FirebaseFirestore { umbrella header "FirebaseFirestore-umbrella.h" export * module * { export * } - link framework "AppKit" + link framework "BoringSSL-GRPC" + link framework "gRPC-Core" + link framework "gRPC-C++" link framework "AppKit" link framework "Foundation" link framework "Security" link framework "SystemConfiguration" diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/FirebaseFirestore b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/FirebaseFirestore index da2afba8..5c937c5c 100644 Binary files a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/FirebaseFirestore and b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/FirebaseFirestore differ diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Info.plist b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Info.plist index 49a09148..16e8c685 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Modules/module.modulemap b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Modules/module.modulemap index 941ef594..85a64925 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Modules/module.modulemap +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64/FirebaseFirestore.framework/Modules/module.modulemap @@ -2,7 +2,9 @@ framework module FirebaseFirestore { umbrella header "FirebaseFirestore-umbrella.h" export * module * { export * } - link framework "Foundation" + link framework "BoringSSL-GRPC" + link framework "gRPC-Core" + link framework "gRPC-C++" link framework "Foundation" link framework "Security" link framework "SystemConfiguration" link framework "UIKit" diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore index ce648ad7..ab48f238 100644 Binary files a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore and b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/FirebaseFirestore differ diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist index 49a09148..16e8c685 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap index 941ef594..85a64925 100644 --- a/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap +++ b/FirebaseFirestore/FirebaseFirestore.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestore.framework/Modules/module.modulemap @@ -2,7 +2,9 @@ framework module FirebaseFirestore { umbrella header "FirebaseFirestore-umbrella.h" export * module * { export * } - link framework "Foundation" + link framework "BoringSSL-GRPC" + link framework "gRPC-Core" + link framework "gRPC-C++" link framework "Foundation" link framework "Security" link framework "SystemConfiguration" link framework "UIKit" diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/Info.plist b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/Info.plist index 025bbfbf..b79c6e2b 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/Info.plist @@ -6,20 +6,19 @@ LibraryIdentifier - macos-arm64_x86_64 + tvos-arm64 LibraryPath FirebaseFirestoreSwift.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform - macos + tvos LibraryIdentifier - tvos-arm64_x86_64-simulator + macos-arm64_x86_64 LibraryPath FirebaseFirestoreSwift.framework SupportedArchitectures @@ -28,21 +27,22 @@ x86_64 SupportedPlatform - tvos - SupportedPlatformVariant - simulator + macos LibraryIdentifier - tvos-arm64 + ios-arm64_x86_64-maccatalyst LibraryPath FirebaseFirestoreSwift.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform - tvos + ios + SupportedPlatformVariant + maccatalyst LibraryIdentifier @@ -73,7 +73,7 @@ LibraryIdentifier - ios-arm64_x86_64-maccatalyst + tvos-arm64_x86_64-simulator LibraryPath FirebaseFirestoreSwift.framework SupportedArchitectures @@ -82,9 +82,9 @@ x86_64 SupportedPlatform - ios + tvos SupportedPlatformVariant - maccatalyst + simulator CFBundlePackageType diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift index 00b27e63..1ba8e08a 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Info.plist b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Info.plist index 166d3857..2791234e 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo index 058f5089..53a5c769 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios.abi.json index 1a6b973a..77a6abb2 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift index 8b19cbb1..25f5bbcf 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Info.plist b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Info.plist index 166d3857..2791234e 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo index bd7c7309..20be8473 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo index 0b0cd144..63962f45 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-macabi.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-macabi.abi.json index 1a6b973a..77a6abb2 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-macabi.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-macabi.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json index 1a6b973a..77a6abb2 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift index 80a16d44..cdf88ff8 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist index 166d3857..2791234e 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo index 1ac75751..47ad0541 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo index a705f473..a1a10b8d 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-simulator.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-simulator.abi.json index 1a6b973a..77a6abb2 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-simulator.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-ios-simulator.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json index 1a6b973a..77a6abb2 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift index 8c1ef6cd..58654098 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Info.plist b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Info.plist index 166d3857..2791234e 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo index 75b673c4..cb90bbfc 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo index 6e9438e6..7e0214b0 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-macos.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-macos.abi.json index bfcf02a2..ed09c6fc 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-macos.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-macos.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-macos.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-macos.abi.json index bfcf02a2..ed09c6fc 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-macos.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/macos-arm64_x86_64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-macos.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift index 8612860f..7917ded0 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Info.plist b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Info.plist index 166d3857..2791234e 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo index 91d55d75..3c669248 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos.abi.json index c7480271..365ae2b3 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift index 3ffc3cf4..78211245 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist index 166d3857..2791234e 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo index f4f2332e..b6a8b8a9 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo index bd6a2116..2392b7a4 100644 Binary files a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json index c7480271..365ae2b3 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json index c7480271..365ae2b3 100644 --- a/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json +++ b/FirebaseFirestore/FirebaseFirestoreSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseFirestoreSwift.framework/Modules/FirebaseFirestoreSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json @@ -8369,49 +8369,49 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/DocumentID.swift", "kind": "StringLiteral", "offset": 795, "length": 24, "value": "\"DocumentRefUserInfoKey\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 1555, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/Codable\/EncoderDecoder.swift", "kind": "Dictionary", "offset": 3325, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 6200, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQuery.swift", "kind": "Array", "offset": 7283, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/FirestoreQueryObservable.swift", "kind": "BooleanLiteral", "offset": 982, "length": 4, "value": "true" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseFirestoreSwift\/Firestore\/Swift\/Source\/PropertyWrapper\/QueryPredicate.swift", "kind": "BooleanLiteral", "offset": 3040, "length": 5, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/Info.plist b/FirebaseFirestore/FirebaseSharedSwift.xcframework/Info.plist index cf338da1..9982ea0d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/Info.plist +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/Info.plist @@ -6,7 +6,7 @@ LibraryIdentifier - ios-arm64_x86_64-maccatalyst + macos-arm64_x86_64 LibraryPath FirebaseSharedSwift.framework SupportedArchitectures @@ -15,9 +15,7 @@ x86_64 SupportedPlatform - ios - SupportedPlatformVariant - maccatalyst + macos LibraryIdentifier @@ -36,28 +34,30 @@ LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-maccatalyst LibraryPath FirebaseSharedSwift.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + maccatalyst LibraryIdentifier - macos-arm64_x86_64 + ios-arm64 LibraryPath FirebaseSharedSwift.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform - macos + ios LibraryIdentifier diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift index a6bbee75..ff439609 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Info.plist b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Info.plist index 69f5fc3d..8a83502c 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo index de482820..dc3853b4 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios.abi.json index 19fe4749..54da7c9d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/FirebaseSharedSwift b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/FirebaseSharedSwift index 00405d92..74946271 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/FirebaseSharedSwift and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/FirebaseSharedSwift differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Info.plist b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Info.plist index 69f5fc3d..8a83502c 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo index 738540e2..95acf469 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-macabi.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo index e98b8aaa..f94de979 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-macabi.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-macabi.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-macabi.abi.json index 19fe4749..54da7c9d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-macabi.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-macabi.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json index 19fe4749..54da7c9d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-maccatalyst/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-macabi.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift index 715ef83b..576b9ff0 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist index 69f5fc3d..8a83502c 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo index 6d8e9896..7c6a4b3f 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo index a26acde9..c3e993dc 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-simulator.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-simulator.abi.json index 19fe4749..54da7c9d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-simulator.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-ios-simulator.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json index 19fe4749..54da7c9d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/ios-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-ios-simulator.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-ios\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/FirebaseSharedSwift b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/FirebaseSharedSwift index 483a560b..b1e32950 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/FirebaseSharedSwift and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/FirebaseSharedSwift differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Info.plist b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Info.plist index 69f5fc3d..8a83502c 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo index 6013f2f1..96fffb86 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo index 4250ecc6..0145c788 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-macos.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-macos.abi.json index 2ba902eb..d860ac7d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-macos.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-macos.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-macos.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-macos.abi.json index 2ba902eb..d860ac7d 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-macos.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/macos-arm64_x86_64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-macos.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-macos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift index 6c0a39c0..e8bb123e 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/FirebaseSharedSwift differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Info.plist b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Info.plist index 69f5fc3d..8a83502c 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo index 5df9fc25..be84ab51 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos.abi.json index b66401d4..07260701 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift index 13a83423..098f85b4 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/FirebaseSharedSwift differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist index 69f5fc3d..8a83502c 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 10.15.0 + 10.16.0 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo index 3b8bc8ef..9a0dc096 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo index c5362d07..a5e4bd42 100644 Binary files a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo and b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo differ diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json index b66401d4..07260701 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/arm64-apple-tvos-simulator.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json index b66401d4..07260701 100644 --- a/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json +++ b/FirebaseFirestore/FirebaseSharedSwift.xcframework/tvos-arm64_x86_64-simulator/FirebaseSharedSwift.framework/Modules/FirebaseSharedSwift.swiftmodule/x86_64-apple-tvos-simulator.abi.json @@ -3511,56 +3511,56 @@ }, "ConstValues": [ { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 12051, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 14880, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 17954, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 40844, "length": 24, "value": "\"FirebaseSharedSwift.__JSONReferencingEncoder\"" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Dictionary", "offset": 50174, "length": 3, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 53060, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "Array", "offset": 55989, "length": 2, "value": "[]" }, { - "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-09-06T04-05-41\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", + "filePath": "\/var\/folders\/24\/8k48jl6d249_n_qfxwsl6xvm0000gn\/T\/ZipRelease\/2023-10-01T04-05-20\/project-tvos\/Pods\/FirebaseSharedSwift\/FirebaseSharedSwift\/Sources\/third_party\/FirebaseDataEncoder\/FirebaseDataEncoder.swift", "kind": "StringLiteral", "offset": 108915, "length": 7, diff --git a/FirebaseFirestore/Resources/gRPCCertificates-Cpp.bundle/Info.plist b/FirebaseFirestore/Resources/gRPCCertificates-Cpp.bundle/Info.plist index 6be488ce..23fabd17 100644 Binary files a/FirebaseFirestore/Resources/gRPCCertificates-Cpp.bundle/Info.plist and b/FirebaseFirestore/Resources/gRPCCertificates-Cpp.bundle/Info.plist differ diff --git a/FirebaseFirestore/abseil.xcframework/Info.plist b/FirebaseFirestore/abseil.xcframework/Info.plist index 88477114..36c1e384 100644 --- a/FirebaseFirestore/abseil.xcframework/Info.plist +++ b/FirebaseFirestore/abseil.xcframework/Info.plist @@ -6,22 +6,19 @@ LibraryIdentifier - ios-arm64_x86_64-simulator + ios-arm64 LibraryPath abseil.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - simulator LibraryIdentifier - tvos-arm64_x86_64-simulator + macos-arm64_x86_64 LibraryPath abseil.framework SupportedArchitectures @@ -30,25 +27,26 @@ x86_64 SupportedPlatform - tvos - SupportedPlatformVariant - simulator + macos LibraryIdentifier - tvos-arm64 + ios-arm64_x86_64-maccatalyst LibraryPath abseil.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform - tvos + ios + SupportedPlatformVariant + maccatalyst LibraryIdentifier - ios-arm64_x86_64-maccatalyst + ios-arm64_x86_64-simulator LibraryPath abseil.framework SupportedArchitectures @@ -59,11 +57,11 @@ SupportedPlatform ios SupportedPlatformVariant - maccatalyst + simulator LibraryIdentifier - ios-arm64 + tvos-arm64 LibraryPath abseil.framework SupportedArchitectures @@ -71,11 +69,11 @@ arm64 SupportedPlatform - ios + tvos LibraryIdentifier - macos-arm64_x86_64 + tvos-arm64_x86_64-simulator LibraryPath abseil.framework SupportedArchitectures @@ -84,7 +82,9 @@ x86_64 SupportedPlatform - macos + tvos + SupportedPlatformVariant + simulator CFBundlePackageType diff --git a/FirebaseFirestore/abseil.xcframework/ios-arm64/abseil.framework/abseil b/FirebaseFirestore/abseil.xcframework/ios-arm64/abseil.framework/abseil index 3e86a147..3f671605 100644 Binary files a/FirebaseFirestore/abseil.xcframework/ios-arm64/abseil.framework/abseil and b/FirebaseFirestore/abseil.xcframework/ios-arm64/abseil.framework/abseil differ diff --git a/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-maccatalyst/abseil.framework/abseil b/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-maccatalyst/abseil.framework/abseil index a0fd77dd..b89d7c7a 100644 Binary files a/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-maccatalyst/abseil.framework/abseil and b/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-maccatalyst/abseil.framework/abseil differ diff --git a/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-simulator/abseil.framework/abseil b/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-simulator/abseil.framework/abseil index cf2fea4e..a0b6b7bc 100644 Binary files a/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-simulator/abseil.framework/abseil and b/FirebaseFirestore/abseil.xcframework/ios-arm64_x86_64-simulator/abseil.framework/abseil differ diff --git a/FirebaseFirestore/abseil.xcframework/macos-arm64_x86_64/abseil.framework/abseil b/FirebaseFirestore/abseil.xcframework/macos-arm64_x86_64/abseil.framework/abseil index 555eb3a8..5362cebc 100644 Binary files a/FirebaseFirestore/abseil.xcframework/macos-arm64_x86_64/abseil.framework/abseil and b/FirebaseFirestore/abseil.xcframework/macos-arm64_x86_64/abseil.framework/abseil differ diff --git a/FirebaseFirestore/abseil.xcframework/tvos-arm64/abseil.framework/abseil b/FirebaseFirestore/abseil.xcframework/tvos-arm64/abseil.framework/abseil index db4dd3a0..77e0c91b 100644 Binary files a/FirebaseFirestore/abseil.xcframework/tvos-arm64/abseil.framework/abseil and b/FirebaseFirestore/abseil.xcframework/tvos-arm64/abseil.framework/abseil differ diff --git a/FirebaseFirestore/abseil.xcframework/tvos-arm64_x86_64-simulator/abseil.framework/abseil b/FirebaseFirestore/abseil.xcframework/tvos-arm64_x86_64-simulator/abseil.framework/abseil index d4daf905..dcab511e 100644 Binary files a/FirebaseFirestore/abseil.xcframework/tvos-arm64_x86_64-simulator/abseil.framework/abseil and b/FirebaseFirestore/abseil.xcframework/tvos-arm64_x86_64-simulator/abseil.framework/abseil differ diff --git a/FirebaseFirestore/gRPC-C++.xcframework/Info.plist b/FirebaseFirestore/gRPC-C++.xcframework/Info.plist index 51b2cc32..8d2a8490 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/Info.plist +++ b/FirebaseFirestore/gRPC-C++.xcframework/Info.plist @@ -6,7 +6,7 @@ LibraryIdentifier - ios-arm64_x86_64-simulator + macos-arm64_x86_64 LibraryPath gRPC-C++.framework SupportedArchitectures @@ -15,13 +15,11 @@ x86_64 SupportedPlatform - ios - SupportedPlatformVariant - simulator + macos LibraryIdentifier - macos-arm64_x86_64 + tvos-arm64_x86_64-simulator LibraryPath gRPC-C++.framework SupportedArchitectures @@ -30,11 +28,13 @@ x86_64 SupportedPlatform - macos + tvos + SupportedPlatformVariant + simulator LibraryIdentifier - tvos-arm64_x86_64-simulator + ios-arm64_x86_64-maccatalyst LibraryPath gRPC-C++.framework SupportedArchitectures @@ -43,40 +43,40 @@ x86_64 SupportedPlatform - tvos + ios SupportedPlatformVariant - simulator + maccatalyst LibraryIdentifier - ios-arm64_x86_64-maccatalyst + ios-arm64 LibraryPath gRPC-C++.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - maccatalyst LibraryIdentifier - tvos-arm64 + ios-arm64_x86_64-simulator LibraryPath gRPC-C++.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform - tvos + ios + SupportedPlatformVariant + simulator LibraryIdentifier - ios-arm64 + tvos-arm64 LibraryPath gRPC-C++.framework SupportedArchitectures @@ -84,7 +84,7 @@ arm64 SupportedPlatform - ios + tvos CFBundlePackageType diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/channel.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/channel.h index 5681377c..ec8702e4 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/channel.h @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include struct grpc_channel; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/create_channel.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/create_channel.h index df015b98..4b94a08e 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/create_channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/create_channel.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include #include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h index 5081bc5a..6ba0ce26 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h @@ -24,8 +24,6 @@ #import "grpcpp.h" #import "health_check_service_interface.h" #import "impl/call.h" -#import "impl/call_hook.h" -#import "impl/call_op_set_interface.h" #import "impl/channel_argument_option.h" #import "impl/client_unary_call.h" #import "impl/codegen/async_generic_service.h" diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h index 5ff98267..01c79428 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h @@ -19,117 +19,6 @@ #ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H #define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H -#include - -#include -#include -#include -#include - -struct grpc_server; - -namespace grpc { - -typedef ServerAsyncReaderWriter - GenericServerAsyncReaderWriter; -typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; -typedef ServerAsyncReader GenericServerAsyncReader; -typedef ServerAsyncWriter GenericServerAsyncWriter; - -class GenericServerContext final : public ServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class ServerInterface; - - std::string method_; - std::string host_; -}; - -// A generic service at the server side accepts all RPC methods and hosts. It is -// typically used in proxies. The generic service can be registered to a server -// which also has other services. -// Sample usage: -// ServerBuilder builder; -// auto cq = builder.AddCompletionQueue(); -// AsyncGenericService generic_service; -// builder.RegisterAsyncGenericService(&generic_service); -// auto server = builder.BuildAndStart(); -// -// // request a new call -// GenericServerContext context; -// GenericServerAsyncReaderWriter stream; -// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); -// -// When tag is retrieved from cq->Next(), context.method() can be used to look -// at the method and the RPC can be handled accordingly. -class AsyncGenericService final { - public: - AsyncGenericService() : server_(nullptr) {} - - void RequestCall(GenericServerContext* ctx, - GenericServerAsyncReaderWriter* reader_writer, - grpc::CompletionQueue* call_cq, - grpc::ServerCompletionQueue* notification_cq, void* tag); - - private: - friend class grpc::Server; - grpc::Server* server_; -}; - -/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs -/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with -/// ByteBuffer arguments. -using ServerGenericBidiReactor = ServerBidiReactor; - -class GenericCallbackServerContext final : public grpc::CallbackServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class grpc::Server; - - std::string method_; - std::string host_; -}; - -/// \a CallbackGenericService is the base class for generic services implemented -/// using the callback API and registered through the ServerBuilder using -/// RegisterCallbackGenericService. -class CallbackGenericService { - public: - CallbackGenericService() {} - virtual ~CallbackGenericService() {} - - /// The "method handler" for the generic API. This function should be - /// overridden to provide a ServerGenericBidiReactor that implements the - /// application-level interface for this RPC. Unimplemented by default. - virtual ServerGenericBidiReactor* CreateReactor( - GenericCallbackServerContext* /*ctx*/) { - class Reactor : public ServerGenericBidiReactor { - public: - Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } - void OnDone() override { delete this; } - }; - return new Reactor; - } - - private: - friend class grpc::Server; - - internal::CallbackBidiHandler* Handler() { - return new internal::CallbackBidiHandler( - [this](grpc::CallbackServerContext* ctx) { - return CreateReactor(static_cast(ctx)); - }); - } - - grpc::Server* server_{nullptr}; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call.h index 2a119963..97d8fdfc 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call.h @@ -19,76 +19,6 @@ #ifndef GRPCPP_IMPL_CALL_H #define GRPCPP_IMPL_CALL_H -#include -#include - -namespace grpc { -class CompletionQueue; -namespace experimental { -class ClientRpcInfo; -class ServerRpcInfo; -} // namespace experimental -namespace internal { -class CallHook; -class CallOpSetInterface; - -/// Straightforward wrapping of the C call object -class Call final { - public: - Call() - : call_hook_(nullptr), - cq_(nullptr), - call_(nullptr), - max_receive_message_size_(-1) {} - /** call is owned by the caller */ - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - experimental::ClientRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1), - client_rpc_info_(rpc_info) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(max_receive_message_size), - server_rpc_info_(rpc_info) {} - - void PerformOps(CallOpSetInterface* ops) { - call_hook_->PerformOpsOnCall(ops, this); - } - - grpc_call* call() const { return call_; } - grpc::CompletionQueue* cq() const { return cq_; } - - int max_receive_message_size() const { return max_receive_message_size_; } - - experimental::ClientRpcInfo* client_rpc_info() const { - return client_rpc_info_; - } - - experimental::ServerRpcInfo* server_rpc_info() const { - return server_rpc_info_; - } - - private: - CallHook* call_hook_; - grpc::CompletionQueue* cq_; - grpc_call* call_; - int max_receive_message_size_; - experimental::ClientRpcInfo* client_rpc_info_ = nullptr; - experimental::ServerRpcInfo* server_rpc_info_ = nullptr; -}; -} // namespace internal -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_IMPL_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call_hook.h deleted file mode 100644 index 8903b9a0..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call_hook.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_HOOK_H -#define GRPCPP_IMPL_CALL_HOOK_H - -namespace grpc { - -namespace internal { -class CallOpSetInterface; -class Call; - -/// This is an interface that Channel and Server implement to allow them to hook -/// performing ops. -class CallHook { - public: - virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; -}; -} // namespace internal - -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h deleted file mode 100644 index 43ed4ed9..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H -#define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H - -// IWYU pragma: private - -#include - -namespace grpc { -namespace internal { - -class Call; - -/// An abstract collection of call ops, used to generate the -/// grpc_call_op structure to pass down to the lower layers, -/// and as it is-a CompletionQueueTag, also massages the final -/// completion into the correct form for consumption in the C++ -/// API. -class CallOpSetInterface : public CompletionQueueTag { - public: - /// Fills in grpc_op, starting from ops[*nops] and moving - /// upwards. - virtual void FillOps(internal::Call* call) = 0; - - /// Get the tag to be used at the core completion queue. Generally, the - /// value of core_cq_tag will be "this". However, it can be overridden if we - /// want core to process the tag differently (e.g., as a core callback) - virtual void* core_cq_tag() = 0; - - // This will be called while interceptors are run if the RPC is a hijacked - // RPC. This should set hijacking state for each of the ops. - virtual void SetHijackingState() = 0; - - // Should be called after interceptors are done running - virtual void ContinueFillOpsAfterInterception() = 0; - - // Should be called after interceptors are done running on the finalize result - // path - virtual void ContinueFinalizeResultAfterInterception() = 0; -}; -} // namespace internal -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h index 03a096c5..2a000662 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h @@ -19,9 +19,119 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H #define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include + +struct grpc_server; + +namespace grpc { + +typedef ServerAsyncReaderWriter + GenericServerAsyncReaderWriter; +typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; +typedef ServerAsyncReader GenericServerAsyncReader; +typedef ServerAsyncWriter GenericServerAsyncWriter; + +class GenericServerContext final : public ServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class ServerInterface; + + std::string method_; + std::string host_; +}; + +// A generic service at the server side accepts all RPC methods and hosts. It is +// typically used in proxies. The generic service can be registered to a server +// which also has other services. +// Sample usage: +// ServerBuilder builder; +// auto cq = builder.AddCompletionQueue(); +// AsyncGenericService generic_service; +// builder.RegisterAsyncGenericService(&generic_service); +// auto server = builder.BuildAndStart(); +// +// // request a new call +// GenericServerContext context; +// GenericServerAsyncReaderWriter stream; +// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); +// +// When tag is retrieved from cq->Next(), context.method() can be used to look +// at the method and the RPC can be handled accordingly. +class AsyncGenericService final { + public: + AsyncGenericService() : server_(nullptr) {} + + void RequestCall(GenericServerContext* ctx, + GenericServerAsyncReaderWriter* reader_writer, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag); + + private: + friend class grpc::Server; + grpc::Server* server_; +}; + +/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs +/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with +/// ByteBuffer arguments. +using ServerGenericBidiReactor = ServerBidiReactor; + +class GenericCallbackServerContext final : public grpc::CallbackServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class grpc::Server; + + std::string method_; + std::string host_; +}; + +/// \a CallbackGenericService is the base class for generic services implemented +/// using the callback API and registered through the ServerBuilder using +/// RegisterCallbackGenericService. +class CallbackGenericService { + public: + CallbackGenericService() {} + virtual ~CallbackGenericService() {} + + /// The "method handler" for the generic API. This function should be + /// overridden to provide a ServerGenericBidiReactor that implements the + /// application-level interface for this RPC. Unimplemented by default. + virtual ServerGenericBidiReactor* CreateReactor( + GenericCallbackServerContext* /*ctx*/) { + class Reactor : public ServerGenericBidiReactor { + public: + Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } + void OnDone() override { delete this; } + }; + return new Reactor; + } + + private: + friend class grpc::Server; + + internal::CallbackBidiHandler* Handler() { + return new internal::CallbackBidiHandler( + [this](grpc::CallbackServerContext* ctx) { + return CreateReactor(static_cast(ctx)); + }); + } + + grpc::Server* server_{nullptr}; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h index 524f619f..5b63c301 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h @@ -18,9 +18,1115 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +namespace grpc { + +namespace internal { +/// Common interface for all client side asynchronous streaming. +class ClientAsyncStreamingInterface { + public: + virtual ~ClientAsyncStreamingInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall(void* tag) = 0; + + /// Request notification of the reading of the initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a AsyncReaderInterface::Read method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Indicate that the stream is to be finished and request notification for + /// when the call has been ended. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method exactly once when both: + /// * the client side has no more message to send + /// (this can be declared implicitly by calling this method, or + /// explicitly through an earlier call to the WritesDone method + /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or + /// \a ClientAsyncReaderWriterInterface::WritesDone). + /// * there are no more messages to be received from the server (this can + /// be known implicitly by the calling code, or explicitly from an + /// earlier call to \a AsyncReaderInterface::Read that yielded a failed + /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// The tag will be returned when either: + /// - all incoming messages have been read and the server has returned + /// a status. + /// - the server has returned a non-OK status. + /// - the call failed for some reason and the library generated a + /// status. + /// + /// Note that implementations of this method attempt to receive initial + /// metadata from the server if initial metadata hasn't yet been received. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + virtual void Finish(grpc::Status* status, void* tag) = 0; +}; + +/// An interface that yields a sequence of messages of type \a R. +template +class AsyncReaderInterface { + public: + virtual ~AsyncReaderInterface() {} + + /// Read a message of type \a R into \a msg. Completion will be notified by \a + /// tag on the associated completion queue. + /// This is thread-safe with respect to \a Write or \a WritesDone methods. It + /// should not be called concurrently with other streaming APIs + /// on the same stream. It is not meaningful to call it concurrently + /// with another \a AsyncReaderInterface::Read on the same stream since reads + /// on the same stream are delivered in order. + /// + /// \param[out] msg Where to eventually store the read message. + /// \param[in] tag The tag identifying the operation. + /// + /// Side effect: note that this method attempt to receive initial metadata for + /// a stream if it hasn't yet been received. + virtual void Read(R* msg, void* tag) = 0; +}; + +/// An interface that can be fed a sequence of messages of type \a W. +template +class AsyncWriterInterface { + public: + virtual ~AsyncWriterInterface() {} + + /// Request the writing of \a msg with identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, void* tag) = 0; + + /// Request the writing of \a msg using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// WriteOptions \a options is used to set the write options of this message. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with the writing + /// of trailing metadata, using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// For client, WriteLast is equivalent of performing Write and + /// WritesDone in a single step. + /// For server, WriteLast buffers the \a msg. The writing of \a msg is held + /// until Finish is called, where \a msg and trailing metadata are coalesced + /// and write is initiated. Note that WriteLast can only buffer \a msg up to + /// the flow control window size. If \a msg size is larger than the window + /// size, it will be sent on wire without buffering. + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { + Write(msg, options.set_last_message(), tag); + } +}; + +} // namespace internal + +template +class ClientAsyncReaderInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncReaderInterface {}; + +namespace internal { +template +class ClientAsyncReaderFactory { + public: + /// Create a stream object. + /// Write the first request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started and + /// \a request has been written out. If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + template + static ClientAsyncReader* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, + const W& request, bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReader))) + ClientAsyncReader(call, context, request, start, tag); + } +}; +} // namespace internal + +/// Async client-side API for doing server-streaming RPCs, +/// where the incoming message stream coming from the server has +/// messages of type \a R. +template +class ClientAsyncReader final : public ClientAsyncReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata + /// method for semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, + /// the \a ClientContext associated with this call is updated, and the + /// calling code can access the received metadata through the + /// \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderFactory; + template + ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, + const W& request, bool start, void* tag) + : context_(context), call_(call), started_(start) { + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); + init_ops_.ClientSendClose(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + init_ops_.set_output_tag(tag); + call_.PerformOps(&init_ops_); + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + init_ops_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Common interface for client side asynchronous writing. +template +class ClientAsyncWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncWriterFactory { + public: + /// Create a stream object. + /// Start the RPC if \a start is set + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, \a tag must be nullptr and the actual call + /// must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// \a response will be filled in with the single expected response + /// message from the server upon a successful call to the \a Finish + /// method of this instance. + template + static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncWriter))) + ClientAsyncWriter(call, context, response, start, tag); + } +}; +} // namespace internal + +/// Async API on the client side for doing client-streaming RPCs, +/// where the outgoing message stream going to the server contains +/// messages of type \a W. +template +class ClientAsyncWriter final : public ClientAsyncWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for + /// semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// associated with this call is updated, and the calling code can access + /// the received metadata through the \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + /// - attempts to fill in the \a response parameter passed to this class's + /// constructor with the server's response message. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncWriterFactory; + template + ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, + R* response, bool start, void* tag) + : context_(context), call_(call), started_(start) { + finish_ops_.RecvMessage(response); + finish_ops_.AllowNoMessage(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Async client-side interface for bi-directional streaming, +/// where the client-to-server message stream has messages of type \a W, +/// and the server-to-client message stream has messages of type \a R. +template +class ClientAsyncReaderWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncReaderWriterFactory { + public: + /// Create a stream object. + /// Start the RPC request if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent). If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + static ClientAsyncReaderWriter* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReaderWriter))) + ClientAsyncReaderWriter(call, context, start, tag); + } +}; +} // namespace internal + +/// Async client-side interface for bi-directional streaming, +/// where the outgoing message stream going to the server +/// has messages of type \a W, and the incoming message stream coming +/// from the server has messages of type \a R. +template +class ClientAsyncReaderWriter final + : public ClientAsyncReaderWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method + /// for semantics of this method. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// is updated with it, and then the receiving initial metadata can + /// be accessed through this \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// Side effect + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderWriterFactory; + ClientAsyncReaderWriter(grpc::internal::Call call, + grpc::ClientContext* context, bool start, void* tag) + : context_(context), call_(call), started_(start) { + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncReaderInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code + /// and also send out \a msg response to the client. + /// Request notification for when the server has sent the response and the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous + /// \a AsyncReaderInterface::Read operation with a non-ok result, + /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it + /// is safe to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// \param[in] msg To be sent to the client as the response for this call. + virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; + + /// Indicate that the stream is to be finished with a certain + /// non-OK status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// This call is meant to end the call with some error, and can be called at + /// any point that the server would like to "fail" the call (though note + /// this shouldn't be called concurrently with any other "sending" call, like + /// \a AsyncWriterInterface::Write). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), and status, or if some failure occurred + /// when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// - Note: \a status must have a non-OK code. + virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing client-streaming RPCs, +/// where the incoming message stream from the client has messages of type \a R, +/// and the single response message sent from the server is type \a W. +template +class ServerAsyncReader final : public ServerAsyncReaderInterface { + public: + explicit ServerAsyncReader(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// Note: \a msg is not sent if \a status has a non-OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once Finish returns. + void Finish(const W& msg, const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_ops_.SendMessage(msg)); + } else { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + void FinishWithError(const grpc::Status& status, void* tag) override { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation with a non-ok + /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish + /// in a single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing server streaming RPCs, +/// where the outgoing message stream from the server has messages of type \a W. +template +class ServerAsyncWriter final : public ServerAsyncWriterInterface { + public: + explicit ServerAsyncWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of + /// \a status,it may be non-OK + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Server-side interface for asynchronous bi-directional streaming. +template +class ServerAsyncReaderWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation + /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' + /// with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if some + /// failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish in a + /// single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing bidirectional streaming RPCs, +/// where the incoming message stream coming from the client has messages of +/// type \a R, and the outgoing message stream coming from the server has +/// messages of type \a W. +template +class ServerAsyncReaderWriter final + : public ServerAsyncReaderWriterInterface { + public: + explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + EnsureInitialMetadataSent(&write_ops_); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish + /// method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + // + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of \a status, + /// it may be non-OK + // + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class grpc::Server; + + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h index 55227b2e..0034d210 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h @@ -19,9 +19,402 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { + +// Forward declaration for use in Helper class +template +class ClientAsyncResponseReader; + +/// An interface relevant for async client side unary RPCs (which send +/// one request message to a server and receive one response message). +template +class ClientAsyncResponseReaderInterface { + public: + virtual ~ClientAsyncResponseReaderInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall() = 0; + + /// Request notification of the reading of initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a Finish method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Request to receive the server's response \a msg and final \a status for + /// the call, and to notify \a tag on this call's completion queue when + /// finished. + /// + /// This function will return when either: + /// - when the server's response message and status have been received. + /// - when the server has returned a non-OK status (no message expected in + /// this case). + /// - when the call failed for some reason and the library generated a + /// non-OK status. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + /// \param[out] msg To be filled in with the server's response message. + virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; +}; + +namespace internal { + +class ClientAsyncResponseReaderHelper { + public: + /// Start a call and write the request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// + /// Optionally pass in a base class for request and response types so that the + /// internal functions and structs can be templated based on that, allowing + /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors + /// can't have an explicit template parameter, the last argument is an + /// extraneous parameter just to provide the needed type information. + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request) /* __attribute__((noinline)) */ { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + ClientAsyncResponseReader* result = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncResponseReader))) + ClientAsyncResponseReader(call, context); + SetupRequest( + call.call(), &result->single_buf_, &result->read_initial_metadata_, + &result->finish_, static_cast(request)); + + return result; + } + + // Various helper functions to reduce templating use + + template + static void SetupRequest( + grpc_call* call, + grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, + std::function* + read_initial_metadata, + std::function< + void(ClientContext*, internal::Call*, bool initial_metadata_read, + internal::CallOpSendInitialMetadata*, + internal::CallOpSetInterface**, void*, Status*, void*)>* finish, + const W& request) { + using SingleBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + SingleBufType* single_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(SingleBufType))) SingleBufType; + *single_buf_ptr = single_buf; + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); + single_buf->ClientSendClose(); + + // The purpose of the following functions is to type-erase the actual + // templated type of the CallOpSet being used by hiding that type inside the + // function definition rather than specifying it as an argument of the + // function or a member of the class. The type-erased CallOpSet will get + // static_cast'ed back to the real type so that it can be used properly. + *read_initial_metadata = + [](ClientContext* context, internal::Call* call, + internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + call->PerformOps(single_buf); + }; + + // Note that this function goes one step further than the previous one + // because it type-erases the message being written down to a void*. This + // will be static-cast'ed back to the class specified here by hiding that + // class information inside the function definition. Note that this feature + // expects the class being specified here for R to be a base-class of the + // "real" R without any multiple-inheritance (as applies in protbuf wrt + // MessageLite) + *finish = [](ClientContext* context, internal::Call* call, + bool initial_metadata_read, + internal::CallOpSendInitialMetadata* single_buf_view, + internal::CallOpSetInterface** finish_buf_ptr, void* msg, + Status* status, void* tag) { + if (initial_metadata_read) { + using FinishBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + FinishBufType* finish_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call->call(), sizeof(FinishBufType))) FinishBufType; + *finish_buf_ptr = finish_buf; + finish_buf->set_output_tag(tag); + finish_buf->RecvMessage(static_cast(msg)); + finish_buf->AllowNoMessage(); + finish_buf->ClientRecvStatus(context, status); + call->PerformOps(finish_buf); + } else { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + single_buf->RecvMessage(static_cast(msg)); + single_buf->AllowNoMessage(); + single_buf->ClientRecvStatus(context, status); + call->PerformOps(single_buf); + } + }; + } + + static void StartCall(grpc::ClientContext* context, + grpc::internal::CallOpSendInitialMetadata* single_buf) { + single_buf->SendInitialMetadata(&context->send_initial_metadata_, + context->initial_metadata_flags()); + } +}; + +// TODO(vjpai): This templated factory is deprecated and will be replaced by +//. the non-templated helper as soon as possible. +template +class ClientAsyncResponseReaderFactory { + public: + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request, bool start) { + auto* result = ClientAsyncResponseReaderHelper::Create( + channel, cq, method, context, request); + if (start) { + result->StartCall(); + } + return result; + } +}; + +} // namespace internal + +/// Async API for client-side unary RPCs, where the message response +/// received from the server is of type \a R. +template +class ClientAsyncResponseReader final + : public ClientAsyncResponseReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall() override { + GPR_CODEGEN_DEBUG_ASSERT(!started_); + started_ = true; + internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); + } + + /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for + /// semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); + read_initial_metadata_(context_, &call_, single_buf_, tag); + initial_metadata_read_ = true; + } + + /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(R* msg, grpc::Status* status, void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, + static_cast(msg), status, tag); + } + + private: + friend class internal::ClientAsyncResponseReaderHelper; + grpc::ClientContext* const context_; + grpc::internal::Call call_; + bool started_ = false; + bool initial_metadata_read_ = false; + + ClientAsyncResponseReader(grpc::internal::Call call, + grpc::ClientContext* context) + : context_(context), call_(call) {} + + // disable operator new + static void* operator new(std::size_t size); + static void* operator new(std::size_t /*size*/, void* p) { return p; } + + internal::CallOpSendInitialMetadata* single_buf_; + internal::CallOpSetInterface* finish_buf_ = nullptr; + std::function + read_initial_metadata_; + std::function + finish_; +}; + +/// Async server-side API for handling unary calls, where the single +/// response message sent to the client is of type \a W. +template +class ServerAsyncResponseWriter final + : public grpc::internal::ServerAsyncStreamingInterface { + public: + explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Side effect: + /// The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_buf_.set_output_tag(tag); + meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_buf_); + } + + /// Indicate that the stream is to be finished and request notification + /// when the server has sent the appropriate signals to the client to + /// end the call. Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// \param[in] msg Message to be sent to the client. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// Note: if \a status has a non-OK code, then \a msg will not be sent, + /// and the client will receive only the status with possible trailing + /// metadata. + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). + void Finish(const W& msg, const grpc::Status& status, void* tag) { + finish_buf_.set_output_tag(tag); + finish_buf_.set_core_cq_tag(&finish_buf_); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_buf_.SendMessage(msg)); + } else { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_buf_); + } + + /// Indicate that the stream is to be finished with a non-OK status, + /// and request notification for when the server has finished sending the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// - Note: \a status must have a non-OK code. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). + void FinishWithError(const grpc::Status& status, void* tag) { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_buf_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_buf_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_buf_; + grpc::internal::CallOpSet + finish_buf_; +}; + +} // namespace grpc + +namespace std { +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +} // namespace std #endif // GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h index d1969953..a9ba7d16 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h @@ -19,9 +19,221 @@ #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include +#include +#include + +namespace grpc { + +class ServerInterface; +class ByteBuffer; +class ServerInterface; + +namespace internal { +template +class CallbackUnaryHandler; +template +class CallbackServerStreamingHandler; +template +void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); +template +class ServerStreamingHandler; +template +class ErrorMethodHandler; +class CallOpSendMessage; +template +class CallOpRecvMessage; +class CallOpGenericRecvMessage; +class ExternalConnectionAcceptorImpl; +template +class DeserializeFuncType; +class GrpcByteBufferPeer; + +} // namespace internal +/// A sequence of bytes. +class ByteBuffer final { + public: + /// Constuct an empty buffer. + ByteBuffer() : buffer_(nullptr) {} + + /// Construct buffer from \a slices, of which there are \a nslices. + ByteBuffer(const Slice* slices, size_t nslices) { + // The following assertions check that the representation of a grpc::Slice + // is identical to that of a grpc_slice: it has a grpc_slice field, and + // nothing else. + static_assert(std::is_same::value, + "Slice must have same representation as grpc_slice"); + static_assert(sizeof(Slice) == sizeof(grpc_slice), + "Slice must have same representation as grpc_slice"); + // The following assertions check that the representation of a ByteBuffer is + // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, + // and nothing else. + static_assert(std::is_same::value, + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + // The const_cast is legal if grpc_raw_byte_buffer_create() does no more + // than its advertised side effect of increasing the reference count of the + // slices it processes, and such an increase does not affect the semantics + // seen by the caller of this constructor. + buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( + reinterpret_cast(const_cast(slices)), nslices); + } + + /// Constuct a byte buffer by referencing elements of existing buffer + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } + + ~ByteBuffer() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + } + } + + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer& operator=(const ByteBuffer& buf) { + if (this != &buf) { + Clear(); // first remove existing data + } + if (buf.buffer_) { + // then copy + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); + } + return *this; + } + + // If this ByteBuffer's representation is a single flat slice, returns a + // slice referencing that array. + Status TrySingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slics. + Status DumpToSingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slices. + Status Dump(std::vector* slices) const; + + /// Remove all data. + void Clear() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + buffer_ = nullptr; + } + } + + /// Make a duplicate copy of the internals of this byte + /// buffer so that we have our own owned version of it. + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. + void Duplicate() { + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); + } + + /// Forget underlying byte buffer without destroying + /// Use this only for un-owned byte buffers + void Release() { buffer_ = nullptr; } + + /// Buffer size in bytes. + size_t Length() const { + return buffer_ == nullptr + ? 0 + : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); + } + + /// Swap the state of *this and *other. + void Swap(ByteBuffer* other) { + grpc_byte_buffer* tmp = other->buffer_; + other->buffer_ = buffer_; + buffer_ = tmp; + } + + /// Is this ByteBuffer valid? + bool Valid() const { return (buffer_ != nullptr); } + + private: + friend class SerializationTraits; + friend class ServerInterface; + friend class internal::CallOpSendMessage; + template + friend class internal::CallOpRecvMessage; + friend class internal::CallOpGenericRecvMessage; + template + friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, + grpc::Status*, RequestType*); + template + friend class internal::ServerStreamingHandler; + template + friend class internal::CallbackUnaryHandler; + template + friend class internal::CallbackServerStreamingHandler; + template + friend class internal::ErrorMethodHandler; + template + friend class internal::DeserializeFuncType; + friend class ProtoBufferReader; + friend class ProtoBufferWriter; + friend class internal::GrpcByteBufferPeer; + friend class internal::ExternalConnectionAcceptorImpl; + + grpc_byte_buffer* buffer_; + + // takes ownership + void set_buffer(grpc_byte_buffer* buf) { + if (buffer_) { + Clear(); + } + buffer_ = buf; + } + + grpc_byte_buffer* c_buffer() { return buffer_; } + grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } + + class ByteBufferPointer { + public: + /* NOLINTNEXTLINE(google-explicit-constructor) */ + ByteBufferPointer(const ByteBuffer* b) + : bbuf_(const_cast(b)) {} + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator ByteBuffer*() { return bbuf_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer*() { return bbuf_->buffer_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer**() { return &bbuf_->buffer_; } + + private: + ByteBuffer* bbuf_; + }; + ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } +}; + +template <> +class SerializationTraits { + public: + static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { + dest->set_buffer(byte_buffer->buffer_); + return Status::OK; + } + static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, + bool* own_buffer) { + *buffer = source; + *own_buffer = true; + return g_core_codegen_interface->ok(); + } +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h index 71f6cb8e..90d54bc5 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h @@ -18,9 +18,78 @@ #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +namespace grpc { +class CompletionQueue; +namespace experimental { +class ClientRpcInfo; +class ServerRpcInfo; +} // namespace experimental +namespace internal { +class CallHook; +class CallOpSetInterface; + +/// Straightforward wrapping of the C call object +class Call final { + public: + Call() + : call_hook_(nullptr), + cq_(nullptr), + call_(nullptr), + max_receive_message_size_(-1) {} + /** call is owned by the caller */ + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + experimental::ClientRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1), + client_rpc_info_(rpc_info) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(max_receive_message_size), + server_rpc_info_(rpc_info) {} + + void PerformOps(CallOpSetInterface* ops) { + call_hook_->PerformOpsOnCall(ops, this); + } + + grpc_call* call() const { return call_; } + grpc::CompletionQueue* cq() const { return cq_; } + + int max_receive_message_size() const { return max_receive_message_size_; } + + experimental::ClientRpcInfo* client_rpc_info() const { + return client_rpc_info_; + } + + experimental::ServerRpcInfo* server_rpc_info() const { + return server_rpc_info_; + } + + private: + CallHook* call_hook_; + grpc::CompletionQueue* cq_; + grpc_call* call_; + int max_receive_message_size_; + experimental::ClientRpcInfo* client_rpc_info_ = nullptr; + experimental::ServerRpcInfo* server_rpc_info_ = nullptr; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h index db10a0fc..8c4278e7 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h @@ -21,7 +21,21 @@ // IWYU pragma: private -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +namespace grpc { + +namespace internal { +class CallOpSetInterface; +class Call; + +/// This is an interface that Channel and Server implement to allow them to hook +/// performing ops. +class CallHook { + public: + virtual ~CallHook() {} + virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; +}; +} // namespace internal + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h index 62b11680..5b1d4409 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h index ce5f2036..a8eed9f6 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h @@ -21,6 +21,41 @@ // IWYU pragma: private -#include +#include + +namespace grpc { +namespace internal { + +class Call; + +/// An abstract collection of call ops, used to generate the +/// grpc_call_op structure to pass down to the lower layers, +/// and as it is-a CompletionQueueTag, also massages the final +/// completion into the correct form for consumption in the C++ +/// API. +class CallOpSetInterface : public CompletionQueueTag { + public: + /// Fills in grpc_op, starting from ops[*nops] and moving + /// upwards. + virtual void FillOps(internal::Call* call) = 0; + + /// Get the tag to be used at the core completion queue. Generally, the + /// value of core_cq_tag will be "this". However, it can be overridden if we + /// want core to process the tag differently (e.g., as a core callback) + virtual void* core_cq_tag() = 0; + + // This will be called while interceptors are run if the RPC is a hijacked + // RPC. This should set hijacking state for each of the ops. + virtual void SetHijackingState() = 0; + + // Should be called after interceptors are done running + virtual void ContinueFillOpsAfterInterception() = 0; + + // Should be called after interceptors are done running on the finalize result + // path + virtual void ContinueFinalizeResultAfterInterception() = 0; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h index c0f605ac..7c67c928 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h index dde3ae7b..19fef7e2 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h @@ -22,7 +22,7 @@ // IWYU pragma: private #include -#include +#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h index 1c6b8ce5..f3560b5a 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h @@ -19,9 +19,181 @@ #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +#include +#include +#include + +namespace grpc { + +class Channel; +class ClientContext; + +namespace internal { +class InterceptorBatchMethodsImpl; +} + +namespace experimental { +class ClientRpcInfo; + +// A factory interface for creation of client interceptors. A vector of +// factories can be provided at channel creation which will be used to create a +// new vector of client interceptors per RPC. Client interceptor authors should +// create a subclass of ClientInterceptorFactorInterface which creates objects +// of their interceptors. +class ClientInterceptorFactoryInterface { + public: + virtual ~ClientInterceptorFactoryInterface() {} + // Returns a pointer to an Interceptor object on successful creation, nullptr + // otherwise. If nullptr is returned, this server interceptor factory is + // ignored for the purposes of that RPC. + virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; +}; +} // namespace experimental + +namespace internal { +extern experimental::ClientInterceptorFactoryInterface* + g_global_client_interceptor_factory; +} + +/// ClientRpcInfo represents the state of a particular RPC as it +/// appears to an interceptor. It is created and owned by the library and +/// passed to the CreateClientInterceptor method of the application's +/// ClientInterceptorFactoryInterface implementation +namespace experimental { +class ClientRpcInfo { + public: + // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN + // from the list of possible Types. + /// Type categorizes RPCs by unary or streaming type + enum class Type { + UNARY, + CLIENT_STREAMING, + SERVER_STREAMING, + BIDI_STREAMING, + UNKNOWN // UNKNOWN is not API and will be removed later + }; + + ~ClientRpcInfo() {} + + // Delete copy constructor but allow default move constructor + ClientRpcInfo(const ClientRpcInfo&) = delete; + ClientRpcInfo(ClientRpcInfo&&) = default; + + // Getter methods + + /// Return the fully-specified method name + const char* method() const { return method_; } + + /// Return an identifying suffix for the client stub, or nullptr if one wasn't + /// specified. + const char* suffix_for_stats() const { return suffix_for_stats_; } + + /// Return a pointer to the channel on which the RPC is being sent + ChannelInterface* channel() { return channel_; } + + /// Return a pointer to the underlying ClientContext structure associated + /// with the RPC to support features that apply to it + grpc::ClientContext* client_context() { return ctx_; } + + /// Return the type of the RPC (unary or a streaming flavor) + Type type() const { return type_; } + + private: + static_assert(Type::UNARY == + static_cast(internal::RpcMethod::NORMAL_RPC), + "violated expectation about Type enum"); + static_assert(Type::CLIENT_STREAMING == + static_cast(internal::RpcMethod::CLIENT_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::SERVER_STREAMING == + static_cast(internal::RpcMethod::SERVER_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::BIDI_STREAMING == + static_cast(internal::RpcMethod::BIDI_STREAMING), + "violated expectation about Type enum"); + + // Default constructor should only be used by ClientContext + ClientRpcInfo() = default; + + // Constructor will only be called from ClientContext + ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, + const char* method, const char* suffix_for_stats, + grpc::ChannelInterface* channel) + : ctx_(ctx), + type_(static_cast(type)), + method_(method), + suffix_for_stats_(suffix_for_stats), + channel_(channel) {} + + // Move assignment should only be used by ClientContext + // TODO(yashykt): Delete move assignment + ClientRpcInfo& operator=(ClientRpcInfo&&) = default; + + // Runs interceptor at pos \a pos. + void RunInterceptor( + experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { + GPR_CODEGEN_ASSERT(pos < interceptors_.size()); + interceptors_[pos]->Intercept(interceptor_methods); + } + + void RegisterInterceptors( + const std::vector>& creators, + size_t interceptor_pos) { + if (interceptor_pos > creators.size()) { + // No interceptors to register + return; + } + // NOTE: The following is not a range-based for loop because it will only + // iterate over a portion of the creators vector. + for (auto it = creators.begin() + interceptor_pos; it != creators.end(); + ++it) { + auto* interceptor = (*it)->CreateClientInterceptor(this); + if (interceptor != nullptr) { + interceptors_.push_back( + std::unique_ptr(interceptor)); + } + } + if (internal::g_global_client_interceptor_factory != nullptr) { + interceptors_.push_back(std::unique_ptr( + internal::g_global_client_interceptor_factory + ->CreateClientInterceptor(this))); + } + } + + grpc::ClientContext* ctx_ = nullptr; + // TODO(yashykt): make type_ const once move-assignment is deleted + Type type_{Type::UNKNOWN}; + const char* method_ = nullptr; + const char* suffix_for_stats_ = nullptr; + grpc::ChannelInterface* channel_ = nullptr; + std::vector> interceptors_; + bool hijacked_ = false; + size_t hijacked_interceptor_ = 0; + + friend class internal::InterceptorBatchMethodsImpl; + friend class grpc::ClientContext; +}; + +// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL +// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. +// Registers a global client interceptor factory object, which is used for all +// RPCs made in this process. The application is responsible for maintaining the +// life of the object while gRPC operations are in progress. The global +// interceptor factory should only be registered once at the start of the +// process before any gRPC operations have begun. +void RegisterGlobalClientInterceptorFactory( + ClientInterceptorFactoryInterface* factory); + +// For testing purposes only +void TestOnlyResetGlobalClientInterceptorFactory(); + +} // namespace experimental +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h index bcb85746..14450533 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h @@ -26,11 +26,11 @@ #include #include +#include #include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h index 2595938c..b084b7ce 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h index 797e8256..58056314 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h @@ -21,10 +21,10 @@ // IWYU pragma: private, include +#include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h index 2aa7774a..6f6730a1 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h @@ -28,10 +28,10 @@ #include #include +#include #include #include #include -#include namespace grpc { class ServerContextBase; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h index 2f20dade..0deac825 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h index 1235b8de..aca60790 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h @@ -20,7 +20,7 @@ // IWYU pragma: private, include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/security/credentials.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/security/credentials.h index d9b43934..18dce966 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/security/credentials.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/security/credentials.h @@ -25,11 +25,11 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/server.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/server.h index 2264585c..dce87448 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/server.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/server.h @@ -31,13 +31,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_stream.h index 18e84dfc..5f717014 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_stream.h @@ -19,1115 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H #define GRPCPP_SUPPORT_ASYNC_STREAM_H -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -namespace internal { -/// Common interface for all client side asynchronous streaming. -class ClientAsyncStreamingInterface { - public: - virtual ~ClientAsyncStreamingInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall(void* tag) = 0; - - /// Request notification of the reading of the initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a AsyncReaderInterface::Read method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Indicate that the stream is to be finished and request notification for - /// when the call has been ended. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method exactly once when both: - /// * the client side has no more message to send - /// (this can be declared implicitly by calling this method, or - /// explicitly through an earlier call to the WritesDone method - /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or - /// \a ClientAsyncReaderWriterInterface::WritesDone). - /// * there are no more messages to be received from the server (this can - /// be known implicitly by the calling code, or explicitly from an - /// earlier call to \a AsyncReaderInterface::Read that yielded a failed - /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// The tag will be returned when either: - /// - all incoming messages have been read and the server has returned - /// a status. - /// - the server has returned a non-OK status. - /// - the call failed for some reason and the library generated a - /// status. - /// - /// Note that implementations of this method attempt to receive initial - /// metadata from the server if initial metadata hasn't yet been received. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - virtual void Finish(grpc::Status* status, void* tag) = 0; -}; - -/// An interface that yields a sequence of messages of type \a R. -template -class AsyncReaderInterface { - public: - virtual ~AsyncReaderInterface() {} - - /// Read a message of type \a R into \a msg. Completion will be notified by \a - /// tag on the associated completion queue. - /// This is thread-safe with respect to \a Write or \a WritesDone methods. It - /// should not be called concurrently with other streaming APIs - /// on the same stream. It is not meaningful to call it concurrently - /// with another \a AsyncReaderInterface::Read on the same stream since reads - /// on the same stream are delivered in order. - /// - /// \param[out] msg Where to eventually store the read message. - /// \param[in] tag The tag identifying the operation. - /// - /// Side effect: note that this method attempt to receive initial metadata for - /// a stream if it hasn't yet been received. - virtual void Read(R* msg, void* tag) = 0; -}; - -/// An interface that can be fed a sequence of messages of type \a W. -template -class AsyncWriterInterface { - public: - virtual ~AsyncWriterInterface() {} - - /// Request the writing of \a msg with identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, void* tag) = 0; - - /// Request the writing of \a msg using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// WriteOptions \a options is used to set the write options of this message. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with the writing - /// of trailing metadata, using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// For client, WriteLast is equivalent of performing Write and - /// WritesDone in a single step. - /// For server, WriteLast buffers the \a msg. The writing of \a msg is held - /// until Finish is called, where \a msg and trailing metadata are coalesced - /// and write is initiated. Note that WriteLast can only buffer \a msg up to - /// the flow control window size. If \a msg size is larger than the window - /// size, it will be sent on wire without buffering. - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { - Write(msg, options.set_last_message(), tag); - } -}; - -} // namespace internal - -template -class ClientAsyncReaderInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncReaderInterface {}; - -namespace internal { -template -class ClientAsyncReaderFactory { - public: - /// Create a stream object. - /// Write the first request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started and - /// \a request has been written out. If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - template - static ClientAsyncReader* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, - const W& request, bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReader))) - ClientAsyncReader(call, context, request, start, tag); - } -}; -} // namespace internal - -/// Async client-side API for doing server-streaming RPCs, -/// where the incoming message stream coming from the server has -/// messages of type \a R. -template -class ClientAsyncReader final : public ClientAsyncReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata - /// method for semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, - /// the \a ClientContext associated with this call is updated, and the - /// calling code can access the received metadata through the - /// \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderFactory; - template - ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, - const W& request, bool start, void* tag) - : context_(context), call_(call), started_(start) { - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - init_ops_.set_output_tag(tag); - call_.PerformOps(&init_ops_); - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - init_ops_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Common interface for client side asynchronous writing. -template -class ClientAsyncWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncWriterFactory { - public: - /// Create a stream object. - /// Start the RPC if \a start is set - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, \a tag must be nullptr and the actual call - /// must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// \a response will be filled in with the single expected response - /// message from the server upon a successful call to the \a Finish - /// method of this instance. - template - static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, R* response, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncWriter))) - ClientAsyncWriter(call, context, response, start, tag); - } -}; -} // namespace internal - -/// Async API on the client side for doing client-streaming RPCs, -/// where the outgoing message stream going to the server contains -/// messages of type \a W. -template -class ClientAsyncWriter final : public ClientAsyncWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for - /// semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// associated with this call is updated, and the calling code can access - /// the received metadata through the \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - /// - attempts to fill in the \a response parameter passed to this class's - /// constructor with the server's response message. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncWriterFactory; - template - ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, - R* response, bool start, void* tag) - : context_(context), call_(call), started_(start) { - finish_ops_.RecvMessage(response); - finish_ops_.AllowNoMessage(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Async client-side interface for bi-directional streaming, -/// where the client-to-server message stream has messages of type \a W, -/// and the server-to-client message stream has messages of type \a R. -template -class ClientAsyncReaderWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncReaderWriterFactory { - public: - /// Create a stream object. - /// Start the RPC request if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent). If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - static ClientAsyncReaderWriter* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReaderWriter))) - ClientAsyncReaderWriter(call, context, start, tag); - } -}; -} // namespace internal - -/// Async client-side interface for bi-directional streaming, -/// where the outgoing message stream going to the server -/// has messages of type \a W, and the incoming message stream coming -/// from the server has messages of type \a R. -template -class ClientAsyncReaderWriter final - : public ClientAsyncReaderWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method - /// for semantics of this method. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// is updated with it, and then the receiving initial metadata can - /// be accessed through this \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// Side effect - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderWriterFactory; - ClientAsyncReaderWriter(grpc::internal::Call call, - grpc::ClientContext* context, bool start, void* tag) - : context_(context), call_(call), started_(start) { - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncReaderInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code - /// and also send out \a msg response to the client. - /// Request notification for when the server has sent the response and the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous - /// \a AsyncReaderInterface::Read operation with a non-ok result, - /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it - /// is safe to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// \param[in] msg To be sent to the client as the response for this call. - virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; - - /// Indicate that the stream is to be finished with a certain - /// non-OK status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// This call is meant to end the call with some error, and can be called at - /// any point that the server would like to "fail" the call (though note - /// this shouldn't be called concurrently with any other "sending" call, like - /// \a AsyncWriterInterface::Write). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), and status, or if some failure occurred - /// when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// - Note: \a status must have a non-OK code. - virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing client-streaming RPCs, -/// where the incoming message stream from the client has messages of type \a R, -/// and the single response message sent from the server is type \a W. -template -class ServerAsyncReader final : public ServerAsyncReaderInterface { - public: - explicit ServerAsyncReader(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// Note: \a msg is not sent if \a status has a non-OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once Finish returns. - void Finish(const W& msg, const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_ops_.SendMessage(msg)); - } else { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - void FinishWithError(const grpc::Status& status, void* tag) override { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation with a non-ok - /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish - /// in a single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing server streaming RPCs, -/// where the outgoing message stream from the server has messages of type \a W. -template -class ServerAsyncWriter final : public ServerAsyncWriterInterface { - public: - explicit ServerAsyncWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of - /// \a status,it may be non-OK - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Server-side interface for asynchronous bi-directional streaming. -template -class ServerAsyncReaderWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation - /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' - /// with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if some - /// failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish in a - /// single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing bidirectional streaming RPCs, -/// where the incoming message stream coming from the client has messages of -/// type \a R, and the outgoing message stream coming from the server has -/// messages of type \a W. -template -class ServerAsyncReaderWriter final - : public ServerAsyncReaderWriterInterface { - public: - explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - EnsureInitialMetadataSent(&write_ops_); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish - /// method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - // - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of \a status, - /// it may be non-OK - // - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class grpc::Server; - - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h index a9886031..02071e48 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h @@ -19,402 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H #define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -// Forward declaration for use in Helper class -template -class ClientAsyncResponseReader; - -/// An interface relevant for async client side unary RPCs (which send -/// one request message to a server and receive one response message). -template -class ClientAsyncResponseReaderInterface { - public: - virtual ~ClientAsyncResponseReaderInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall() = 0; - - /// Request notification of the reading of initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a Finish method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Request to receive the server's response \a msg and final \a status for - /// the call, and to notify \a tag on this call's completion queue when - /// finished. - /// - /// This function will return when either: - /// - when the server's response message and status have been received. - /// - when the server has returned a non-OK status (no message expected in - /// this case). - /// - when the call failed for some reason and the library generated a - /// non-OK status. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - /// \param[out] msg To be filled in with the server's response message. - virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; -}; - -namespace internal { - -class ClientAsyncResponseReaderHelper { - public: - /// Start a call and write the request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// - /// Optionally pass in a base class for request and response types so that the - /// internal functions and structs can be templated based on that, allowing - /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors - /// can't have an explicit template parameter, the last argument is an - /// extraneous parameter just to provide the needed type information. - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request) /* __attribute__((noinline)) */ { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - ClientAsyncResponseReader* result = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncResponseReader))) - ClientAsyncResponseReader(call, context); - SetupRequest( - call.call(), &result->single_buf_, &result->read_initial_metadata_, - &result->finish_, static_cast(request)); - - return result; - } - - // Various helper functions to reduce templating use - - template - static void SetupRequest( - grpc_call* call, - grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, - std::function* - read_initial_metadata, - std::function< - void(ClientContext*, internal::Call*, bool initial_metadata_read, - internal::CallOpSendInitialMetadata*, - internal::CallOpSetInterface**, void*, Status*, void*)>* finish, - const W& request) { - using SingleBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - SingleBufType* single_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(SingleBufType))) SingleBufType; - *single_buf_ptr = single_buf; - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); - single_buf->ClientSendClose(); - - // The purpose of the following functions is to type-erase the actual - // templated type of the CallOpSet being used by hiding that type inside the - // function definition rather than specifying it as an argument of the - // function or a member of the class. The type-erased CallOpSet will get - // static_cast'ed back to the real type so that it can be used properly. - *read_initial_metadata = - [](ClientContext* context, internal::Call* call, - internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - call->PerformOps(single_buf); - }; - - // Note that this function goes one step further than the previous one - // because it type-erases the message being written down to a void*. This - // will be static-cast'ed back to the class specified here by hiding that - // class information inside the function definition. Note that this feature - // expects the class being specified here for R to be a base-class of the - // "real" R without any multiple-inheritance (as applies in protbuf wrt - // MessageLite) - *finish = [](ClientContext* context, internal::Call* call, - bool initial_metadata_read, - internal::CallOpSendInitialMetadata* single_buf_view, - internal::CallOpSetInterface** finish_buf_ptr, void* msg, - Status* status, void* tag) { - if (initial_metadata_read) { - using FinishBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - FinishBufType* finish_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call->call(), sizeof(FinishBufType))) FinishBufType; - *finish_buf_ptr = finish_buf; - finish_buf->set_output_tag(tag); - finish_buf->RecvMessage(static_cast(msg)); - finish_buf->AllowNoMessage(); - finish_buf->ClientRecvStatus(context, status); - call->PerformOps(finish_buf); - } else { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - single_buf->RecvMessage(static_cast(msg)); - single_buf->AllowNoMessage(); - single_buf->ClientRecvStatus(context, status); - call->PerformOps(single_buf); - } - }; - } - - static void StartCall(grpc::ClientContext* context, - grpc::internal::CallOpSendInitialMetadata* single_buf) { - single_buf->SendInitialMetadata(&context->send_initial_metadata_, - context->initial_metadata_flags()); - } -}; - -// TODO(vjpai): This templated factory is deprecated and will be replaced by -//. the non-templated helper as soon as possible. -template -class ClientAsyncResponseReaderFactory { - public: - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request, bool start) { - auto* result = ClientAsyncResponseReaderHelper::Create( - channel, cq, method, context, request); - if (start) { - result->StartCall(); - } - return result; - } -}; - -} // namespace internal - -/// Async API for client-side unary RPCs, where the message response -/// received from the server is of type \a R. -template -class ClientAsyncResponseReader final - : public ClientAsyncResponseReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall() override { - GPR_CODEGEN_DEBUG_ASSERT(!started_); - started_ = true; - internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); - } - - /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for - /// semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); - read_initial_metadata_(context_, &call_, single_buf_, tag); - initial_metadata_read_ = true; - } - - /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(R* msg, grpc::Status* status, void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, - static_cast(msg), status, tag); - } - - private: - friend class internal::ClientAsyncResponseReaderHelper; - grpc::ClientContext* const context_; - grpc::internal::Call call_; - bool started_ = false; - bool initial_metadata_read_ = false; - - ClientAsyncResponseReader(grpc::internal::Call call, - grpc::ClientContext* context) - : context_(context), call_(call) {} - - // disable operator new - static void* operator new(std::size_t size); - static void* operator new(std::size_t /*size*/, void* p) { return p; } - - internal::CallOpSendInitialMetadata* single_buf_; - internal::CallOpSetInterface* finish_buf_ = nullptr; - std::function - read_initial_metadata_; - std::function - finish_; -}; - -/// Async server-side API for handling unary calls, where the single -/// response message sent to the client is of type \a W. -template -class ServerAsyncResponseWriter final - : public grpc::internal::ServerAsyncStreamingInterface { - public: - explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Side effect: - /// The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_buf_.set_output_tag(tag); - meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_buf_); - } - - /// Indicate that the stream is to be finished and request notification - /// when the server has sent the appropriate signals to the client to - /// end the call. Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// \param[in] msg Message to be sent to the client. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// Note: if \a status has a non-OK code, then \a msg will not be sent, - /// and the client will receive only the status with possible trailing - /// metadata. - /// - /// gRPC doesn't take ownership or a reference to msg and status, so it is - /// safe to deallocate them once the Finish operation is complete (i.e. a - /// result arrives in the completion queue). - void Finish(const W& msg, const grpc::Status& status, void* tag) { - finish_buf_.set_output_tag(tag); - finish_buf_.set_core_cq_tag(&finish_buf_); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_buf_.SendMessage(msg)); - } else { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_buf_); - } - - /// Indicate that the stream is to be finished with a non-OK status, - /// and request notification for when the server has finished sending the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// - Note: \a status must have a non-OK code. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// gRPC doesn't take ownership or a reference to status, so it is safe to - /// deallocate them once the Finish operation is complete (i.e. a result - /// arrives in the completion queue). - void FinishWithError(const grpc::Status& status, void* tag) { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_buf_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_buf_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_buf_; - grpc::internal::CallOpSet - finish_buf_; -}; - -} // namespace grpc - -namespace std { -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -} // namespace std +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h index 7ca7c4b2..6f566e76 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h @@ -19,221 +19,13 @@ #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H #define GRPCPP_SUPPORT_BYTE_BUFFER_H -#include - #include #include #include -#include +#include // IWYU pragma: export #include #include #include #include -namespace grpc { - -class ServerInterface; -class ByteBuffer; -class ServerInterface; - -namespace internal { -template -class CallbackUnaryHandler; -template -class CallbackServerStreamingHandler; -template -void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); -template -class ServerStreamingHandler; -template -class ErrorMethodHandler; -class CallOpSendMessage; -template -class CallOpRecvMessage; -class CallOpGenericRecvMessage; -class ExternalConnectionAcceptorImpl; -template -class DeserializeFuncType; -class GrpcByteBufferPeer; - -} // namespace internal -/// A sequence of bytes. -class ByteBuffer final { - public: - /// Constuct an empty buffer. - ByteBuffer() : buffer_(nullptr) {} - - /// Construct buffer from \a slices, of which there are \a nslices. - ByteBuffer(const Slice* slices, size_t nslices) { - // The following assertions check that the representation of a grpc::Slice - // is identical to that of a grpc_slice: it has a grpc_slice field, and - // nothing else. - static_assert(std::is_same::value, - "Slice must have same representation as grpc_slice"); - static_assert(sizeof(Slice) == sizeof(grpc_slice), - "Slice must have same representation as grpc_slice"); - // The following assertions check that the representation of a ByteBuffer is - // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, - // and nothing else. - static_assert(std::is_same::value, - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - // The const_cast is legal if grpc_raw_byte_buffer_create() does no more - // than its advertised side effect of increasing the reference count of the - // slices it processes, and such an increase does not affect the semantics - // seen by the caller of this constructor. - buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( - reinterpret_cast(const_cast(slices)), nslices); - } - - /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } - - ~ByteBuffer() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - } - } - - /// Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer& operator=(const ByteBuffer& buf) { - if (this != &buf) { - Clear(); // first remove existing data - } - if (buf.buffer_) { - // then copy - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); - } - return *this; - } - - // If this ByteBuffer's representation is a single flat slice, returns a - // slice referencing that array. - Status TrySingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slics. - Status DumpToSingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slices. - Status Dump(std::vector* slices) const; - - /// Remove all data. - void Clear() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - buffer_ = nullptr; - } - } - - /// Make a duplicate copy of the internals of this byte - /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. - /// This is not a deep copy; it is a referencing and its performance - /// is size-independent. - void Duplicate() { - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); - } - - /// Forget underlying byte buffer without destroying - /// Use this only for un-owned byte buffers - void Release() { buffer_ = nullptr; } - - /// Buffer size in bytes. - size_t Length() const { - return buffer_ == nullptr - ? 0 - : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); - } - - /// Swap the state of *this and *other. - void Swap(ByteBuffer* other) { - grpc_byte_buffer* tmp = other->buffer_; - other->buffer_ = buffer_; - buffer_ = tmp; - } - - /// Is this ByteBuffer valid? - bool Valid() const { return (buffer_ != nullptr); } - - private: - friend class SerializationTraits; - friend class ServerInterface; - friend class internal::CallOpSendMessage; - template - friend class internal::CallOpRecvMessage; - friend class internal::CallOpGenericRecvMessage; - template - friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, - grpc::Status*, RequestType*); - template - friend class internal::ServerStreamingHandler; - template - friend class internal::CallbackUnaryHandler; - template - friend class internal::CallbackServerStreamingHandler; - template - friend class internal::ErrorMethodHandler; - template - friend class internal::DeserializeFuncType; - friend class ProtoBufferReader; - friend class ProtoBufferWriter; - friend class internal::GrpcByteBufferPeer; - friend class internal::ExternalConnectionAcceptorImpl; - - grpc_byte_buffer* buffer_; - - // takes ownership - void set_buffer(grpc_byte_buffer* buf) { - if (buffer_) { - Clear(); - } - buffer_ = buf; - } - - grpc_byte_buffer* c_buffer() { return buffer_; } - grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } - - class ByteBufferPointer { - public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ - ByteBufferPointer(const ByteBuffer* b) - : bbuf_(const_cast(b)) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator ByteBuffer*() { return bbuf_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer*() { return bbuf_->buffer_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer**() { return &bbuf_->buffer_; } - - private: - ByteBuffer* bbuf_; - }; - ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } -}; - -template <> -class SerializationTraits { - public: - static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { - dest->set_buffer(byte_buffer->buffer_); - return Status::OK; - } - static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, - bool* own_buffer) { - *buffer = source; - *own_buffer = true; - return g_core_codegen_interface->ok(); - } -}; - -} // namespace grpc - #endif // GRPCPP_SUPPORT_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h index 8e5e1ce6..552cab4c 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h @@ -19,179 +19,6 @@ #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H -#include -#include - -#include -#include -#include - -namespace grpc { - -class Channel; -class ClientContext; - -namespace internal { -class InterceptorBatchMethodsImpl; -} - -namespace experimental { -class ClientRpcInfo; - -// A factory interface for creation of client interceptors. A vector of -// factories can be provided at channel creation which will be used to create a -// new vector of client interceptors per RPC. Client interceptor authors should -// create a subclass of ClientInterceptorFactorInterface which creates objects -// of their interceptors. -class ClientInterceptorFactoryInterface { - public: - virtual ~ClientInterceptorFactoryInterface() {} - // Returns a pointer to an Interceptor object on successful creation, nullptr - // otherwise. If nullptr is returned, this server interceptor factory is - // ignored for the purposes of that RPC. - virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; -}; -} // namespace experimental - -namespace internal { -extern experimental::ClientInterceptorFactoryInterface* - g_global_client_interceptor_factory; -} - -/// ClientRpcInfo represents the state of a particular RPC as it -/// appears to an interceptor. It is created and owned by the library and -/// passed to the CreateClientInterceptor method of the application's -/// ClientInterceptorFactoryInterface implementation -namespace experimental { -class ClientRpcInfo { - public: - // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN - // from the list of possible Types. - /// Type categorizes RPCs by unary or streaming type - enum class Type { - UNARY, - CLIENT_STREAMING, - SERVER_STREAMING, - BIDI_STREAMING, - UNKNOWN // UNKNOWN is not API and will be removed later - }; - - ~ClientRpcInfo() {} - - // Delete copy constructor but allow default move constructor - ClientRpcInfo(const ClientRpcInfo&) = delete; - ClientRpcInfo(ClientRpcInfo&&) = default; - - // Getter methods - - /// Return the fully-specified method name - const char* method() const { return method_; } - - /// Return an identifying suffix for the client stub, or nullptr if one wasn't - /// specified. - const char* suffix_for_stats() const { return suffix_for_stats_; } - - /// Return a pointer to the channel on which the RPC is being sent - ChannelInterface* channel() { return channel_; } - - /// Return a pointer to the underlying ClientContext structure associated - /// with the RPC to support features that apply to it - grpc::ClientContext* client_context() { return ctx_; } - - /// Return the type of the RPC (unary or a streaming flavor) - Type type() const { return type_; } - - private: - static_assert(Type::UNARY == - static_cast(internal::RpcMethod::NORMAL_RPC), - "violated expectation about Type enum"); - static_assert(Type::CLIENT_STREAMING == - static_cast(internal::RpcMethod::CLIENT_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::SERVER_STREAMING == - static_cast(internal::RpcMethod::SERVER_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::BIDI_STREAMING == - static_cast(internal::RpcMethod::BIDI_STREAMING), - "violated expectation about Type enum"); - - // Default constructor should only be used by ClientContext - ClientRpcInfo() = default; - - // Constructor will only be called from ClientContext - ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, - const char* method, const char* suffix_for_stats, - grpc::ChannelInterface* channel) - : ctx_(ctx), - type_(static_cast(type)), - method_(method), - suffix_for_stats_(suffix_for_stats), - channel_(channel) {} - - // Move assignment should only be used by ClientContext - // TODO(yashykt): Delete move assignment - ClientRpcInfo& operator=(ClientRpcInfo&&) = default; - - // Runs interceptor at pos \a pos. - void RunInterceptor( - experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { - GPR_CODEGEN_ASSERT(pos < interceptors_.size()); - interceptors_[pos]->Intercept(interceptor_methods); - } - - void RegisterInterceptors( - const std::vector>& creators, - size_t interceptor_pos) { - if (interceptor_pos > creators.size()) { - // No interceptors to register - return; - } - // NOTE: The following is not a range-based for loop because it will only - // iterate over a portion of the creators vector. - for (auto it = creators.begin() + interceptor_pos; it != creators.end(); - ++it) { - auto* interceptor = (*it)->CreateClientInterceptor(this); - if (interceptor != nullptr) { - interceptors_.push_back( - std::unique_ptr(interceptor)); - } - } - if (internal::g_global_client_interceptor_factory != nullptr) { - interceptors_.push_back(std::unique_ptr( - internal::g_global_client_interceptor_factory - ->CreateClientInterceptor(this))); - } - } - - grpc::ClientContext* ctx_ = nullptr; - // TODO(yashykt): make type_ const once move-assignment is deleted - Type type_{Type::UNKNOWN}; - const char* method_ = nullptr; - const char* suffix_for_stats_ = nullptr; - grpc::ChannelInterface* channel_ = nullptr; - std::vector> interceptors_; - bool hijacked_ = false; - size_t hijacked_interceptor_ = 0; - - friend class internal::InterceptorBatchMethodsImpl; - friend class grpc::ClientContext; -}; - -// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL -// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. -// Registers a global client interceptor factory object, which is used for all -// RPCs made in this process. The application is responsible for maintaining the -// life of the object while gRPC operations are in progress. The global -// interceptor factory should only be registered once at the start of the -// process before any gRPC operations have begun. -void RegisterGlobalClientInterceptorFactory( - ClientInterceptorFactoryInterface* factory); - -// For testing purposes only -void TestOnlyResetGlobalClientInterceptorFactory(); - -} // namespace experimental -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Info.plist b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Info.plist index 3c7e8970..7a2e5e54 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Info.plist +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/gRPC-C++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/gRPC-C++ index ca96ab28..628b4d86 100644 Binary files a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/gRPC-C++ and b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64/gRPC-C++.framework/gRPC-C++ differ diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/channel.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/channel.h index 5681377c..ec8702e4 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/channel.h @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include struct grpc_channel; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/create_channel.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/create_channel.h index df015b98..4b94a08e 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/create_channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/create_channel.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include #include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h index 5081bc5a..6ba0ce26 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h @@ -24,8 +24,6 @@ #import "grpcpp.h" #import "health_check_service_interface.h" #import "impl/call.h" -#import "impl/call_hook.h" -#import "impl/call_op_set_interface.h" #import "impl/channel_argument_option.h" #import "impl/client_unary_call.h" #import "impl/codegen/async_generic_service.h" diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/generic/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/generic/async_generic_service.h index 5ff98267..01c79428 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/generic/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/generic/async_generic_service.h @@ -19,117 +19,6 @@ #ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H #define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H -#include - -#include -#include -#include -#include - -struct grpc_server; - -namespace grpc { - -typedef ServerAsyncReaderWriter - GenericServerAsyncReaderWriter; -typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; -typedef ServerAsyncReader GenericServerAsyncReader; -typedef ServerAsyncWriter GenericServerAsyncWriter; - -class GenericServerContext final : public ServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class ServerInterface; - - std::string method_; - std::string host_; -}; - -// A generic service at the server side accepts all RPC methods and hosts. It is -// typically used in proxies. The generic service can be registered to a server -// which also has other services. -// Sample usage: -// ServerBuilder builder; -// auto cq = builder.AddCompletionQueue(); -// AsyncGenericService generic_service; -// builder.RegisterAsyncGenericService(&generic_service); -// auto server = builder.BuildAndStart(); -// -// // request a new call -// GenericServerContext context; -// GenericServerAsyncReaderWriter stream; -// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); -// -// When tag is retrieved from cq->Next(), context.method() can be used to look -// at the method and the RPC can be handled accordingly. -class AsyncGenericService final { - public: - AsyncGenericService() : server_(nullptr) {} - - void RequestCall(GenericServerContext* ctx, - GenericServerAsyncReaderWriter* reader_writer, - grpc::CompletionQueue* call_cq, - grpc::ServerCompletionQueue* notification_cq, void* tag); - - private: - friend class grpc::Server; - grpc::Server* server_; -}; - -/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs -/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with -/// ByteBuffer arguments. -using ServerGenericBidiReactor = ServerBidiReactor; - -class GenericCallbackServerContext final : public grpc::CallbackServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class grpc::Server; - - std::string method_; - std::string host_; -}; - -/// \a CallbackGenericService is the base class for generic services implemented -/// using the callback API and registered through the ServerBuilder using -/// RegisterCallbackGenericService. -class CallbackGenericService { - public: - CallbackGenericService() {} - virtual ~CallbackGenericService() {} - - /// The "method handler" for the generic API. This function should be - /// overridden to provide a ServerGenericBidiReactor that implements the - /// application-level interface for this RPC. Unimplemented by default. - virtual ServerGenericBidiReactor* CreateReactor( - GenericCallbackServerContext* /*ctx*/) { - class Reactor : public ServerGenericBidiReactor { - public: - Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } - void OnDone() override { delete this; } - }; - return new Reactor; - } - - private: - friend class grpc::Server; - - internal::CallbackBidiHandler* Handler() { - return new internal::CallbackBidiHandler( - [this](grpc::CallbackServerContext* ctx) { - return CreateReactor(static_cast(ctx)); - }); - } - - grpc::Server* server_{nullptr}; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call.h index 2a119963..97d8fdfc 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call.h @@ -19,76 +19,6 @@ #ifndef GRPCPP_IMPL_CALL_H #define GRPCPP_IMPL_CALL_H -#include -#include - -namespace grpc { -class CompletionQueue; -namespace experimental { -class ClientRpcInfo; -class ServerRpcInfo; -} // namespace experimental -namespace internal { -class CallHook; -class CallOpSetInterface; - -/// Straightforward wrapping of the C call object -class Call final { - public: - Call() - : call_hook_(nullptr), - cq_(nullptr), - call_(nullptr), - max_receive_message_size_(-1) {} - /** call is owned by the caller */ - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - experimental::ClientRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1), - client_rpc_info_(rpc_info) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(max_receive_message_size), - server_rpc_info_(rpc_info) {} - - void PerformOps(CallOpSetInterface* ops) { - call_hook_->PerformOpsOnCall(ops, this); - } - - grpc_call* call() const { return call_; } - grpc::CompletionQueue* cq() const { return cq_; } - - int max_receive_message_size() const { return max_receive_message_size_; } - - experimental::ClientRpcInfo* client_rpc_info() const { - return client_rpc_info_; - } - - experimental::ServerRpcInfo* server_rpc_info() const { - return server_rpc_info_; - } - - private: - CallHook* call_hook_; - grpc::CompletionQueue* cq_; - grpc_call* call_; - int max_receive_message_size_; - experimental::ClientRpcInfo* client_rpc_info_ = nullptr; - experimental::ServerRpcInfo* server_rpc_info_ = nullptr; -}; -} // namespace internal -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_IMPL_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call_hook.h deleted file mode 100644 index 8903b9a0..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call_hook.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_HOOK_H -#define GRPCPP_IMPL_CALL_HOOK_H - -namespace grpc { - -namespace internal { -class CallOpSetInterface; -class Call; - -/// This is an interface that Channel and Server implement to allow them to hook -/// performing ops. -class CallHook { - public: - virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; -}; -} // namespace internal - -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call_op_set_interface.h deleted file mode 100644 index 43ed4ed9..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/call_op_set_interface.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H -#define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H - -// IWYU pragma: private - -#include - -namespace grpc { -namespace internal { - -class Call; - -/// An abstract collection of call ops, used to generate the -/// grpc_call_op structure to pass down to the lower layers, -/// and as it is-a CompletionQueueTag, also massages the final -/// completion into the correct form for consumption in the C++ -/// API. -class CallOpSetInterface : public CompletionQueueTag { - public: - /// Fills in grpc_op, starting from ops[*nops] and moving - /// upwards. - virtual void FillOps(internal::Call* call) = 0; - - /// Get the tag to be used at the core completion queue. Generally, the - /// value of core_cq_tag will be "this". However, it can be overridden if we - /// want core to process the tag differently (e.g., as a core callback) - virtual void* core_cq_tag() = 0; - - // This will be called while interceptors are run if the RPC is a hijacked - // RPC. This should set hijacking state for each of the ops. - virtual void SetHijackingState() = 0; - - // Should be called after interceptors are done running - virtual void ContinueFillOpsAfterInterception() = 0; - - // Should be called after interceptors are done running on the finalize result - // path - virtual void ContinueFinalizeResultAfterInterception() = 0; -}; -} // namespace internal -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h index 03a096c5..2a000662 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h @@ -19,9 +19,119 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H #define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include + +struct grpc_server; + +namespace grpc { + +typedef ServerAsyncReaderWriter + GenericServerAsyncReaderWriter; +typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; +typedef ServerAsyncReader GenericServerAsyncReader; +typedef ServerAsyncWriter GenericServerAsyncWriter; + +class GenericServerContext final : public ServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class ServerInterface; + + std::string method_; + std::string host_; +}; + +// A generic service at the server side accepts all RPC methods and hosts. It is +// typically used in proxies. The generic service can be registered to a server +// which also has other services. +// Sample usage: +// ServerBuilder builder; +// auto cq = builder.AddCompletionQueue(); +// AsyncGenericService generic_service; +// builder.RegisterAsyncGenericService(&generic_service); +// auto server = builder.BuildAndStart(); +// +// // request a new call +// GenericServerContext context; +// GenericServerAsyncReaderWriter stream; +// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); +// +// When tag is retrieved from cq->Next(), context.method() can be used to look +// at the method and the RPC can be handled accordingly. +class AsyncGenericService final { + public: + AsyncGenericService() : server_(nullptr) {} + + void RequestCall(GenericServerContext* ctx, + GenericServerAsyncReaderWriter* reader_writer, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag); + + private: + friend class grpc::Server; + grpc::Server* server_; +}; + +/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs +/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with +/// ByteBuffer arguments. +using ServerGenericBidiReactor = ServerBidiReactor; + +class GenericCallbackServerContext final : public grpc::CallbackServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class grpc::Server; + + std::string method_; + std::string host_; +}; + +/// \a CallbackGenericService is the base class for generic services implemented +/// using the callback API and registered through the ServerBuilder using +/// RegisterCallbackGenericService. +class CallbackGenericService { + public: + CallbackGenericService() {} + virtual ~CallbackGenericService() {} + + /// The "method handler" for the generic API. This function should be + /// overridden to provide a ServerGenericBidiReactor that implements the + /// application-level interface for this RPC. Unimplemented by default. + virtual ServerGenericBidiReactor* CreateReactor( + GenericCallbackServerContext* /*ctx*/) { + class Reactor : public ServerGenericBidiReactor { + public: + Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } + void OnDone() override { delete this; } + }; + return new Reactor; + } + + private: + friend class grpc::Server; + + internal::CallbackBidiHandler* Handler() { + return new internal::CallbackBidiHandler( + [this](grpc::CallbackServerContext* ctx) { + return CreateReactor(static_cast(ctx)); + }); + } + + grpc::Server* server_{nullptr}; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_stream.h index 524f619f..5b63c301 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_stream.h @@ -18,9 +18,1115 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +namespace grpc { + +namespace internal { +/// Common interface for all client side asynchronous streaming. +class ClientAsyncStreamingInterface { + public: + virtual ~ClientAsyncStreamingInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall(void* tag) = 0; + + /// Request notification of the reading of the initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a AsyncReaderInterface::Read method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Indicate that the stream is to be finished and request notification for + /// when the call has been ended. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method exactly once when both: + /// * the client side has no more message to send + /// (this can be declared implicitly by calling this method, or + /// explicitly through an earlier call to the WritesDone method + /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or + /// \a ClientAsyncReaderWriterInterface::WritesDone). + /// * there are no more messages to be received from the server (this can + /// be known implicitly by the calling code, or explicitly from an + /// earlier call to \a AsyncReaderInterface::Read that yielded a failed + /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// The tag will be returned when either: + /// - all incoming messages have been read and the server has returned + /// a status. + /// - the server has returned a non-OK status. + /// - the call failed for some reason and the library generated a + /// status. + /// + /// Note that implementations of this method attempt to receive initial + /// metadata from the server if initial metadata hasn't yet been received. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + virtual void Finish(grpc::Status* status, void* tag) = 0; +}; + +/// An interface that yields a sequence of messages of type \a R. +template +class AsyncReaderInterface { + public: + virtual ~AsyncReaderInterface() {} + + /// Read a message of type \a R into \a msg. Completion will be notified by \a + /// tag on the associated completion queue. + /// This is thread-safe with respect to \a Write or \a WritesDone methods. It + /// should not be called concurrently with other streaming APIs + /// on the same stream. It is not meaningful to call it concurrently + /// with another \a AsyncReaderInterface::Read on the same stream since reads + /// on the same stream are delivered in order. + /// + /// \param[out] msg Where to eventually store the read message. + /// \param[in] tag The tag identifying the operation. + /// + /// Side effect: note that this method attempt to receive initial metadata for + /// a stream if it hasn't yet been received. + virtual void Read(R* msg, void* tag) = 0; +}; + +/// An interface that can be fed a sequence of messages of type \a W. +template +class AsyncWriterInterface { + public: + virtual ~AsyncWriterInterface() {} + + /// Request the writing of \a msg with identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, void* tag) = 0; + + /// Request the writing of \a msg using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// WriteOptions \a options is used to set the write options of this message. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with the writing + /// of trailing metadata, using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// For client, WriteLast is equivalent of performing Write and + /// WritesDone in a single step. + /// For server, WriteLast buffers the \a msg. The writing of \a msg is held + /// until Finish is called, where \a msg and trailing metadata are coalesced + /// and write is initiated. Note that WriteLast can only buffer \a msg up to + /// the flow control window size. If \a msg size is larger than the window + /// size, it will be sent on wire without buffering. + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { + Write(msg, options.set_last_message(), tag); + } +}; + +} // namespace internal + +template +class ClientAsyncReaderInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncReaderInterface {}; + +namespace internal { +template +class ClientAsyncReaderFactory { + public: + /// Create a stream object. + /// Write the first request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started and + /// \a request has been written out. If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + template + static ClientAsyncReader* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, + const W& request, bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReader))) + ClientAsyncReader(call, context, request, start, tag); + } +}; +} // namespace internal + +/// Async client-side API for doing server-streaming RPCs, +/// where the incoming message stream coming from the server has +/// messages of type \a R. +template +class ClientAsyncReader final : public ClientAsyncReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata + /// method for semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, + /// the \a ClientContext associated with this call is updated, and the + /// calling code can access the received metadata through the + /// \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderFactory; + template + ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, + const W& request, bool start, void* tag) + : context_(context), call_(call), started_(start) { + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); + init_ops_.ClientSendClose(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + init_ops_.set_output_tag(tag); + call_.PerformOps(&init_ops_); + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + init_ops_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Common interface for client side asynchronous writing. +template +class ClientAsyncWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncWriterFactory { + public: + /// Create a stream object. + /// Start the RPC if \a start is set + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, \a tag must be nullptr and the actual call + /// must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// \a response will be filled in with the single expected response + /// message from the server upon a successful call to the \a Finish + /// method of this instance. + template + static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncWriter))) + ClientAsyncWriter(call, context, response, start, tag); + } +}; +} // namespace internal + +/// Async API on the client side for doing client-streaming RPCs, +/// where the outgoing message stream going to the server contains +/// messages of type \a W. +template +class ClientAsyncWriter final : public ClientAsyncWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for + /// semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// associated with this call is updated, and the calling code can access + /// the received metadata through the \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + /// - attempts to fill in the \a response parameter passed to this class's + /// constructor with the server's response message. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncWriterFactory; + template + ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, + R* response, bool start, void* tag) + : context_(context), call_(call), started_(start) { + finish_ops_.RecvMessage(response); + finish_ops_.AllowNoMessage(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Async client-side interface for bi-directional streaming, +/// where the client-to-server message stream has messages of type \a W, +/// and the server-to-client message stream has messages of type \a R. +template +class ClientAsyncReaderWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncReaderWriterFactory { + public: + /// Create a stream object. + /// Start the RPC request if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent). If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + static ClientAsyncReaderWriter* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReaderWriter))) + ClientAsyncReaderWriter(call, context, start, tag); + } +}; +} // namespace internal + +/// Async client-side interface for bi-directional streaming, +/// where the outgoing message stream going to the server +/// has messages of type \a W, and the incoming message stream coming +/// from the server has messages of type \a R. +template +class ClientAsyncReaderWriter final + : public ClientAsyncReaderWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method + /// for semantics of this method. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// is updated with it, and then the receiving initial metadata can + /// be accessed through this \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// Side effect + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderWriterFactory; + ClientAsyncReaderWriter(grpc::internal::Call call, + grpc::ClientContext* context, bool start, void* tag) + : context_(context), call_(call), started_(start) { + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncReaderInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code + /// and also send out \a msg response to the client. + /// Request notification for when the server has sent the response and the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous + /// \a AsyncReaderInterface::Read operation with a non-ok result, + /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it + /// is safe to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// \param[in] msg To be sent to the client as the response for this call. + virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; + + /// Indicate that the stream is to be finished with a certain + /// non-OK status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// This call is meant to end the call with some error, and can be called at + /// any point that the server would like to "fail" the call (though note + /// this shouldn't be called concurrently with any other "sending" call, like + /// \a AsyncWriterInterface::Write). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), and status, or if some failure occurred + /// when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// - Note: \a status must have a non-OK code. + virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing client-streaming RPCs, +/// where the incoming message stream from the client has messages of type \a R, +/// and the single response message sent from the server is type \a W. +template +class ServerAsyncReader final : public ServerAsyncReaderInterface { + public: + explicit ServerAsyncReader(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// Note: \a msg is not sent if \a status has a non-OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once Finish returns. + void Finish(const W& msg, const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_ops_.SendMessage(msg)); + } else { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + void FinishWithError(const grpc::Status& status, void* tag) override { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation with a non-ok + /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish + /// in a single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing server streaming RPCs, +/// where the outgoing message stream from the server has messages of type \a W. +template +class ServerAsyncWriter final : public ServerAsyncWriterInterface { + public: + explicit ServerAsyncWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of + /// \a status,it may be non-OK + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Server-side interface for asynchronous bi-directional streaming. +template +class ServerAsyncReaderWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation + /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' + /// with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if some + /// failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish in a + /// single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing bidirectional streaming RPCs, +/// where the incoming message stream coming from the client has messages of +/// type \a R, and the outgoing message stream coming from the server has +/// messages of type \a W. +template +class ServerAsyncReaderWriter final + : public ServerAsyncReaderWriterInterface { + public: + explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + EnsureInitialMetadataSent(&write_ops_); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish + /// method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + // + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of \a status, + /// it may be non-OK + // + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class grpc::Server; + + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h index 55227b2e..0034d210 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h @@ -19,9 +19,402 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { + +// Forward declaration for use in Helper class +template +class ClientAsyncResponseReader; + +/// An interface relevant for async client side unary RPCs (which send +/// one request message to a server and receive one response message). +template +class ClientAsyncResponseReaderInterface { + public: + virtual ~ClientAsyncResponseReaderInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall() = 0; + + /// Request notification of the reading of initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a Finish method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Request to receive the server's response \a msg and final \a status for + /// the call, and to notify \a tag on this call's completion queue when + /// finished. + /// + /// This function will return when either: + /// - when the server's response message and status have been received. + /// - when the server has returned a non-OK status (no message expected in + /// this case). + /// - when the call failed for some reason and the library generated a + /// non-OK status. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + /// \param[out] msg To be filled in with the server's response message. + virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; +}; + +namespace internal { + +class ClientAsyncResponseReaderHelper { + public: + /// Start a call and write the request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// + /// Optionally pass in a base class for request and response types so that the + /// internal functions and structs can be templated based on that, allowing + /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors + /// can't have an explicit template parameter, the last argument is an + /// extraneous parameter just to provide the needed type information. + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request) /* __attribute__((noinline)) */ { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + ClientAsyncResponseReader* result = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncResponseReader))) + ClientAsyncResponseReader(call, context); + SetupRequest( + call.call(), &result->single_buf_, &result->read_initial_metadata_, + &result->finish_, static_cast(request)); + + return result; + } + + // Various helper functions to reduce templating use + + template + static void SetupRequest( + grpc_call* call, + grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, + std::function* + read_initial_metadata, + std::function< + void(ClientContext*, internal::Call*, bool initial_metadata_read, + internal::CallOpSendInitialMetadata*, + internal::CallOpSetInterface**, void*, Status*, void*)>* finish, + const W& request) { + using SingleBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + SingleBufType* single_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(SingleBufType))) SingleBufType; + *single_buf_ptr = single_buf; + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); + single_buf->ClientSendClose(); + + // The purpose of the following functions is to type-erase the actual + // templated type of the CallOpSet being used by hiding that type inside the + // function definition rather than specifying it as an argument of the + // function or a member of the class. The type-erased CallOpSet will get + // static_cast'ed back to the real type so that it can be used properly. + *read_initial_metadata = + [](ClientContext* context, internal::Call* call, + internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + call->PerformOps(single_buf); + }; + + // Note that this function goes one step further than the previous one + // because it type-erases the message being written down to a void*. This + // will be static-cast'ed back to the class specified here by hiding that + // class information inside the function definition. Note that this feature + // expects the class being specified here for R to be a base-class of the + // "real" R without any multiple-inheritance (as applies in protbuf wrt + // MessageLite) + *finish = [](ClientContext* context, internal::Call* call, + bool initial_metadata_read, + internal::CallOpSendInitialMetadata* single_buf_view, + internal::CallOpSetInterface** finish_buf_ptr, void* msg, + Status* status, void* tag) { + if (initial_metadata_read) { + using FinishBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + FinishBufType* finish_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call->call(), sizeof(FinishBufType))) FinishBufType; + *finish_buf_ptr = finish_buf; + finish_buf->set_output_tag(tag); + finish_buf->RecvMessage(static_cast(msg)); + finish_buf->AllowNoMessage(); + finish_buf->ClientRecvStatus(context, status); + call->PerformOps(finish_buf); + } else { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + single_buf->RecvMessage(static_cast(msg)); + single_buf->AllowNoMessage(); + single_buf->ClientRecvStatus(context, status); + call->PerformOps(single_buf); + } + }; + } + + static void StartCall(grpc::ClientContext* context, + grpc::internal::CallOpSendInitialMetadata* single_buf) { + single_buf->SendInitialMetadata(&context->send_initial_metadata_, + context->initial_metadata_flags()); + } +}; + +// TODO(vjpai): This templated factory is deprecated and will be replaced by +//. the non-templated helper as soon as possible. +template +class ClientAsyncResponseReaderFactory { + public: + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request, bool start) { + auto* result = ClientAsyncResponseReaderHelper::Create( + channel, cq, method, context, request); + if (start) { + result->StartCall(); + } + return result; + } +}; + +} // namespace internal + +/// Async API for client-side unary RPCs, where the message response +/// received from the server is of type \a R. +template +class ClientAsyncResponseReader final + : public ClientAsyncResponseReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall() override { + GPR_CODEGEN_DEBUG_ASSERT(!started_); + started_ = true; + internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); + } + + /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for + /// semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); + read_initial_metadata_(context_, &call_, single_buf_, tag); + initial_metadata_read_ = true; + } + + /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(R* msg, grpc::Status* status, void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, + static_cast(msg), status, tag); + } + + private: + friend class internal::ClientAsyncResponseReaderHelper; + grpc::ClientContext* const context_; + grpc::internal::Call call_; + bool started_ = false; + bool initial_metadata_read_ = false; + + ClientAsyncResponseReader(grpc::internal::Call call, + grpc::ClientContext* context) + : context_(context), call_(call) {} + + // disable operator new + static void* operator new(std::size_t size); + static void* operator new(std::size_t /*size*/, void* p) { return p; } + + internal::CallOpSendInitialMetadata* single_buf_; + internal::CallOpSetInterface* finish_buf_ = nullptr; + std::function + read_initial_metadata_; + std::function + finish_; +}; + +/// Async server-side API for handling unary calls, where the single +/// response message sent to the client is of type \a W. +template +class ServerAsyncResponseWriter final + : public grpc::internal::ServerAsyncStreamingInterface { + public: + explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Side effect: + /// The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_buf_.set_output_tag(tag); + meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_buf_); + } + + /// Indicate that the stream is to be finished and request notification + /// when the server has sent the appropriate signals to the client to + /// end the call. Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// \param[in] msg Message to be sent to the client. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// Note: if \a status has a non-OK code, then \a msg will not be sent, + /// and the client will receive only the status with possible trailing + /// metadata. + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). + void Finish(const W& msg, const grpc::Status& status, void* tag) { + finish_buf_.set_output_tag(tag); + finish_buf_.set_core_cq_tag(&finish_buf_); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_buf_.SendMessage(msg)); + } else { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_buf_); + } + + /// Indicate that the stream is to be finished with a non-OK status, + /// and request notification for when the server has finished sending the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// - Note: \a status must have a non-OK code. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). + void FinishWithError(const grpc::Status& status, void* tag) { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_buf_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_buf_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_buf_; + grpc::internal::CallOpSet + finish_buf_; +}; + +} // namespace grpc + +namespace std { +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +} // namespace std #endif // GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h index d1969953..a9ba7d16 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h @@ -19,9 +19,221 @@ #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include +#include +#include + +namespace grpc { + +class ServerInterface; +class ByteBuffer; +class ServerInterface; + +namespace internal { +template +class CallbackUnaryHandler; +template +class CallbackServerStreamingHandler; +template +void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); +template +class ServerStreamingHandler; +template +class ErrorMethodHandler; +class CallOpSendMessage; +template +class CallOpRecvMessage; +class CallOpGenericRecvMessage; +class ExternalConnectionAcceptorImpl; +template +class DeserializeFuncType; +class GrpcByteBufferPeer; + +} // namespace internal +/// A sequence of bytes. +class ByteBuffer final { + public: + /// Constuct an empty buffer. + ByteBuffer() : buffer_(nullptr) {} + + /// Construct buffer from \a slices, of which there are \a nslices. + ByteBuffer(const Slice* slices, size_t nslices) { + // The following assertions check that the representation of a grpc::Slice + // is identical to that of a grpc_slice: it has a grpc_slice field, and + // nothing else. + static_assert(std::is_same::value, + "Slice must have same representation as grpc_slice"); + static_assert(sizeof(Slice) == sizeof(grpc_slice), + "Slice must have same representation as grpc_slice"); + // The following assertions check that the representation of a ByteBuffer is + // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, + // and nothing else. + static_assert(std::is_same::value, + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + // The const_cast is legal if grpc_raw_byte_buffer_create() does no more + // than its advertised side effect of increasing the reference count of the + // slices it processes, and such an increase does not affect the semantics + // seen by the caller of this constructor. + buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( + reinterpret_cast(const_cast(slices)), nslices); + } + + /// Constuct a byte buffer by referencing elements of existing buffer + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } + + ~ByteBuffer() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + } + } + + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer& operator=(const ByteBuffer& buf) { + if (this != &buf) { + Clear(); // first remove existing data + } + if (buf.buffer_) { + // then copy + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); + } + return *this; + } + + // If this ByteBuffer's representation is a single flat slice, returns a + // slice referencing that array. + Status TrySingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slics. + Status DumpToSingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slices. + Status Dump(std::vector* slices) const; + + /// Remove all data. + void Clear() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + buffer_ = nullptr; + } + } + + /// Make a duplicate copy of the internals of this byte + /// buffer so that we have our own owned version of it. + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. + void Duplicate() { + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); + } + + /// Forget underlying byte buffer without destroying + /// Use this only for un-owned byte buffers + void Release() { buffer_ = nullptr; } + + /// Buffer size in bytes. + size_t Length() const { + return buffer_ == nullptr + ? 0 + : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); + } + + /// Swap the state of *this and *other. + void Swap(ByteBuffer* other) { + grpc_byte_buffer* tmp = other->buffer_; + other->buffer_ = buffer_; + buffer_ = tmp; + } + + /// Is this ByteBuffer valid? + bool Valid() const { return (buffer_ != nullptr); } + + private: + friend class SerializationTraits; + friend class ServerInterface; + friend class internal::CallOpSendMessage; + template + friend class internal::CallOpRecvMessage; + friend class internal::CallOpGenericRecvMessage; + template + friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, + grpc::Status*, RequestType*); + template + friend class internal::ServerStreamingHandler; + template + friend class internal::CallbackUnaryHandler; + template + friend class internal::CallbackServerStreamingHandler; + template + friend class internal::ErrorMethodHandler; + template + friend class internal::DeserializeFuncType; + friend class ProtoBufferReader; + friend class ProtoBufferWriter; + friend class internal::GrpcByteBufferPeer; + friend class internal::ExternalConnectionAcceptorImpl; + + grpc_byte_buffer* buffer_; + + // takes ownership + void set_buffer(grpc_byte_buffer* buf) { + if (buffer_) { + Clear(); + } + buffer_ = buf; + } + + grpc_byte_buffer* c_buffer() { return buffer_; } + grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } + + class ByteBufferPointer { + public: + /* NOLINTNEXTLINE(google-explicit-constructor) */ + ByteBufferPointer(const ByteBuffer* b) + : bbuf_(const_cast(b)) {} + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator ByteBuffer*() { return bbuf_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer*() { return bbuf_->buffer_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer**() { return &bbuf_->buffer_; } + + private: + ByteBuffer* bbuf_; + }; + ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } +}; + +template <> +class SerializationTraits { + public: + static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { + dest->set_buffer(byte_buffer->buffer_); + return Status::OK; + } + static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, + bool* own_buffer) { + *buffer = source; + *own_buffer = true; + return g_core_codegen_interface->ok(); + } +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call.h index 71f6cb8e..90d54bc5 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call.h @@ -18,9 +18,78 @@ #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +namespace grpc { +class CompletionQueue; +namespace experimental { +class ClientRpcInfo; +class ServerRpcInfo; +} // namespace experimental +namespace internal { +class CallHook; +class CallOpSetInterface; + +/// Straightforward wrapping of the C call object +class Call final { + public: + Call() + : call_hook_(nullptr), + cq_(nullptr), + call_(nullptr), + max_receive_message_size_(-1) {} + /** call is owned by the caller */ + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + experimental::ClientRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1), + client_rpc_info_(rpc_info) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(max_receive_message_size), + server_rpc_info_(rpc_info) {} + + void PerformOps(CallOpSetInterface* ops) { + call_hook_->PerformOpsOnCall(ops, this); + } + + grpc_call* call() const { return call_; } + grpc::CompletionQueue* cq() const { return cq_; } + + int max_receive_message_size() const { return max_receive_message_size_; } + + experimental::ClientRpcInfo* client_rpc_info() const { + return client_rpc_info_; + } + + experimental::ServerRpcInfo* server_rpc_info() const { + return server_rpc_info_; + } + + private: + CallHook* call_hook_; + grpc::CompletionQueue* cq_; + grpc_call* call_; + int max_receive_message_size_; + experimental::ClientRpcInfo* client_rpc_info_ = nullptr; + experimental::ServerRpcInfo* server_rpc_info_ = nullptr; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_hook.h index db10a0fc..8c4278e7 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_hook.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_hook.h @@ -21,7 +21,21 @@ // IWYU pragma: private -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +namespace grpc { + +namespace internal { +class CallOpSetInterface; +class Call; + +/// This is an interface that Channel and Server implement to allow them to hook +/// performing ops. +class CallHook { + public: + virtual ~CallHook() {} + virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; +}; +} // namespace internal + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h index 62b11680..5b1d4409 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h index ce5f2036..a8eed9f6 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h @@ -21,6 +21,41 @@ // IWYU pragma: private -#include +#include + +namespace grpc { +namespace internal { + +class Call; + +/// An abstract collection of call ops, used to generate the +/// grpc_call_op structure to pass down to the lower layers, +/// and as it is-a CompletionQueueTag, also massages the final +/// completion into the correct form for consumption in the C++ +/// API. +class CallOpSetInterface : public CompletionQueueTag { + public: + /// Fills in grpc_op, starting from ops[*nops] and moving + /// upwards. + virtual void FillOps(internal::Call* call) = 0; + + /// Get the tag to be used at the core completion queue. Generally, the + /// value of core_cq_tag will be "this". However, it can be overridden if we + /// want core to process the tag differently (e.g., as a core callback) + virtual void* core_cq_tag() = 0; + + // This will be called while interceptors are run if the RPC is a hijacked + // RPC. This should set hijacking state for each of the ops. + virtual void SetHijackingState() = 0; + + // Should be called after interceptors are done running + virtual void ContinueFillOpsAfterInterception() = 0; + + // Should be called after interceptors are done running on the finalize result + // path + virtual void ContinueFinalizeResultAfterInterception() = 0; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/callback_common.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/callback_common.h index c0f605ac..7c67c928 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/callback_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/callback_common.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h index dde3ae7b..19fef7e2 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h @@ -22,7 +22,7 @@ // IWYU pragma: private #include -#include +#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h index 1c6b8ce5..f3560b5a 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h @@ -19,9 +19,181 @@ #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +#include +#include +#include + +namespace grpc { + +class Channel; +class ClientContext; + +namespace internal { +class InterceptorBatchMethodsImpl; +} + +namespace experimental { +class ClientRpcInfo; + +// A factory interface for creation of client interceptors. A vector of +// factories can be provided at channel creation which will be used to create a +// new vector of client interceptors per RPC. Client interceptor authors should +// create a subclass of ClientInterceptorFactorInterface which creates objects +// of their interceptors. +class ClientInterceptorFactoryInterface { + public: + virtual ~ClientInterceptorFactoryInterface() {} + // Returns a pointer to an Interceptor object on successful creation, nullptr + // otherwise. If nullptr is returned, this server interceptor factory is + // ignored for the purposes of that RPC. + virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; +}; +} // namespace experimental + +namespace internal { +extern experimental::ClientInterceptorFactoryInterface* + g_global_client_interceptor_factory; +} + +/// ClientRpcInfo represents the state of a particular RPC as it +/// appears to an interceptor. It is created and owned by the library and +/// passed to the CreateClientInterceptor method of the application's +/// ClientInterceptorFactoryInterface implementation +namespace experimental { +class ClientRpcInfo { + public: + // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN + // from the list of possible Types. + /// Type categorizes RPCs by unary or streaming type + enum class Type { + UNARY, + CLIENT_STREAMING, + SERVER_STREAMING, + BIDI_STREAMING, + UNKNOWN // UNKNOWN is not API and will be removed later + }; + + ~ClientRpcInfo() {} + + // Delete copy constructor but allow default move constructor + ClientRpcInfo(const ClientRpcInfo&) = delete; + ClientRpcInfo(ClientRpcInfo&&) = default; + + // Getter methods + + /// Return the fully-specified method name + const char* method() const { return method_; } + + /// Return an identifying suffix for the client stub, or nullptr if one wasn't + /// specified. + const char* suffix_for_stats() const { return suffix_for_stats_; } + + /// Return a pointer to the channel on which the RPC is being sent + ChannelInterface* channel() { return channel_; } + + /// Return a pointer to the underlying ClientContext structure associated + /// with the RPC to support features that apply to it + grpc::ClientContext* client_context() { return ctx_; } + + /// Return the type of the RPC (unary or a streaming flavor) + Type type() const { return type_; } + + private: + static_assert(Type::UNARY == + static_cast(internal::RpcMethod::NORMAL_RPC), + "violated expectation about Type enum"); + static_assert(Type::CLIENT_STREAMING == + static_cast(internal::RpcMethod::CLIENT_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::SERVER_STREAMING == + static_cast(internal::RpcMethod::SERVER_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::BIDI_STREAMING == + static_cast(internal::RpcMethod::BIDI_STREAMING), + "violated expectation about Type enum"); + + // Default constructor should only be used by ClientContext + ClientRpcInfo() = default; + + // Constructor will only be called from ClientContext + ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, + const char* method, const char* suffix_for_stats, + grpc::ChannelInterface* channel) + : ctx_(ctx), + type_(static_cast(type)), + method_(method), + suffix_for_stats_(suffix_for_stats), + channel_(channel) {} + + // Move assignment should only be used by ClientContext + // TODO(yashykt): Delete move assignment + ClientRpcInfo& operator=(ClientRpcInfo&&) = default; + + // Runs interceptor at pos \a pos. + void RunInterceptor( + experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { + GPR_CODEGEN_ASSERT(pos < interceptors_.size()); + interceptors_[pos]->Intercept(interceptor_methods); + } + + void RegisterInterceptors( + const std::vector>& creators, + size_t interceptor_pos) { + if (interceptor_pos > creators.size()) { + // No interceptors to register + return; + } + // NOTE: The following is not a range-based for loop because it will only + // iterate over a portion of the creators vector. + for (auto it = creators.begin() + interceptor_pos; it != creators.end(); + ++it) { + auto* interceptor = (*it)->CreateClientInterceptor(this); + if (interceptor != nullptr) { + interceptors_.push_back( + std::unique_ptr(interceptor)); + } + } + if (internal::g_global_client_interceptor_factory != nullptr) { + interceptors_.push_back(std::unique_ptr( + internal::g_global_client_interceptor_factory + ->CreateClientInterceptor(this))); + } + } + + grpc::ClientContext* ctx_ = nullptr; + // TODO(yashykt): make type_ const once move-assignment is deleted + Type type_{Type::UNKNOWN}; + const char* method_ = nullptr; + const char* suffix_for_stats_ = nullptr; + grpc::ChannelInterface* channel_ = nullptr; + std::vector> interceptors_; + bool hijacked_ = false; + size_t hijacked_interceptor_ = 0; + + friend class internal::InterceptorBatchMethodsImpl; + friend class grpc::ClientContext; +}; + +// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL +// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. +// Registers a global client interceptor factory object, which is used for all +// RPCs made in this process. The application is responsible for maintaining the +// life of the object while gRPC operations are in progress. The global +// interceptor factory should only be registered once at the start of the +// process before any gRPC operations have begun. +void RegisterGlobalClientInterceptorFactory( + ClientInterceptorFactoryInterface* factory); + +// For testing purposes only +void TestOnlyResetGlobalClientInterceptorFactory(); + +} // namespace experimental +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor.h index bcb85746..14450533 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor.h @@ -26,11 +26,11 @@ #include #include +#include #include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h index 2595938c..b084b7ce 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/method_handler.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/method_handler.h index 797e8256..58056314 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/method_handler.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/method_handler.h @@ -21,10 +21,10 @@ // IWYU pragma: private, include +#include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h index 2aa7774a..6f6730a1 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h @@ -28,10 +28,10 @@ #include #include +#include #include #include #include -#include namespace grpc { class ServerContextBase; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/server_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/server_interface.h index 2f20dade..0deac825 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/server_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/server_interface.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h index 1235b8de..aca60790 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h @@ -20,7 +20,7 @@ // IWYU pragma: private, include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/security/credentials.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/security/credentials.h index d9b43934..18dce966 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/security/credentials.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/security/credentials.h @@ -25,11 +25,11 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/server.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/server.h index 2264585c..dce87448 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/server.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/server.h @@ -31,13 +31,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_stream.h index 18e84dfc..5f717014 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_stream.h @@ -19,1115 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H #define GRPCPP_SUPPORT_ASYNC_STREAM_H -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -namespace internal { -/// Common interface for all client side asynchronous streaming. -class ClientAsyncStreamingInterface { - public: - virtual ~ClientAsyncStreamingInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall(void* tag) = 0; - - /// Request notification of the reading of the initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a AsyncReaderInterface::Read method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Indicate that the stream is to be finished and request notification for - /// when the call has been ended. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method exactly once when both: - /// * the client side has no more message to send - /// (this can be declared implicitly by calling this method, or - /// explicitly through an earlier call to the WritesDone method - /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or - /// \a ClientAsyncReaderWriterInterface::WritesDone). - /// * there are no more messages to be received from the server (this can - /// be known implicitly by the calling code, or explicitly from an - /// earlier call to \a AsyncReaderInterface::Read that yielded a failed - /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// The tag will be returned when either: - /// - all incoming messages have been read and the server has returned - /// a status. - /// - the server has returned a non-OK status. - /// - the call failed for some reason and the library generated a - /// status. - /// - /// Note that implementations of this method attempt to receive initial - /// metadata from the server if initial metadata hasn't yet been received. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - virtual void Finish(grpc::Status* status, void* tag) = 0; -}; - -/// An interface that yields a sequence of messages of type \a R. -template -class AsyncReaderInterface { - public: - virtual ~AsyncReaderInterface() {} - - /// Read a message of type \a R into \a msg. Completion will be notified by \a - /// tag on the associated completion queue. - /// This is thread-safe with respect to \a Write or \a WritesDone methods. It - /// should not be called concurrently with other streaming APIs - /// on the same stream. It is not meaningful to call it concurrently - /// with another \a AsyncReaderInterface::Read on the same stream since reads - /// on the same stream are delivered in order. - /// - /// \param[out] msg Where to eventually store the read message. - /// \param[in] tag The tag identifying the operation. - /// - /// Side effect: note that this method attempt to receive initial metadata for - /// a stream if it hasn't yet been received. - virtual void Read(R* msg, void* tag) = 0; -}; - -/// An interface that can be fed a sequence of messages of type \a W. -template -class AsyncWriterInterface { - public: - virtual ~AsyncWriterInterface() {} - - /// Request the writing of \a msg with identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, void* tag) = 0; - - /// Request the writing of \a msg using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// WriteOptions \a options is used to set the write options of this message. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with the writing - /// of trailing metadata, using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// For client, WriteLast is equivalent of performing Write and - /// WritesDone in a single step. - /// For server, WriteLast buffers the \a msg. The writing of \a msg is held - /// until Finish is called, where \a msg and trailing metadata are coalesced - /// and write is initiated. Note that WriteLast can only buffer \a msg up to - /// the flow control window size. If \a msg size is larger than the window - /// size, it will be sent on wire without buffering. - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { - Write(msg, options.set_last_message(), tag); - } -}; - -} // namespace internal - -template -class ClientAsyncReaderInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncReaderInterface {}; - -namespace internal { -template -class ClientAsyncReaderFactory { - public: - /// Create a stream object. - /// Write the first request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started and - /// \a request has been written out. If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - template - static ClientAsyncReader* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, - const W& request, bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReader))) - ClientAsyncReader(call, context, request, start, tag); - } -}; -} // namespace internal - -/// Async client-side API for doing server-streaming RPCs, -/// where the incoming message stream coming from the server has -/// messages of type \a R. -template -class ClientAsyncReader final : public ClientAsyncReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata - /// method for semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, - /// the \a ClientContext associated with this call is updated, and the - /// calling code can access the received metadata through the - /// \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderFactory; - template - ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, - const W& request, bool start, void* tag) - : context_(context), call_(call), started_(start) { - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - init_ops_.set_output_tag(tag); - call_.PerformOps(&init_ops_); - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - init_ops_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Common interface for client side asynchronous writing. -template -class ClientAsyncWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncWriterFactory { - public: - /// Create a stream object. - /// Start the RPC if \a start is set - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, \a tag must be nullptr and the actual call - /// must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// \a response will be filled in with the single expected response - /// message from the server upon a successful call to the \a Finish - /// method of this instance. - template - static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, R* response, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncWriter))) - ClientAsyncWriter(call, context, response, start, tag); - } -}; -} // namespace internal - -/// Async API on the client side for doing client-streaming RPCs, -/// where the outgoing message stream going to the server contains -/// messages of type \a W. -template -class ClientAsyncWriter final : public ClientAsyncWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for - /// semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// associated with this call is updated, and the calling code can access - /// the received metadata through the \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - /// - attempts to fill in the \a response parameter passed to this class's - /// constructor with the server's response message. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncWriterFactory; - template - ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, - R* response, bool start, void* tag) - : context_(context), call_(call), started_(start) { - finish_ops_.RecvMessage(response); - finish_ops_.AllowNoMessage(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Async client-side interface for bi-directional streaming, -/// where the client-to-server message stream has messages of type \a W, -/// and the server-to-client message stream has messages of type \a R. -template -class ClientAsyncReaderWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncReaderWriterFactory { - public: - /// Create a stream object. - /// Start the RPC request if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent). If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - static ClientAsyncReaderWriter* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReaderWriter))) - ClientAsyncReaderWriter(call, context, start, tag); - } -}; -} // namespace internal - -/// Async client-side interface for bi-directional streaming, -/// where the outgoing message stream going to the server -/// has messages of type \a W, and the incoming message stream coming -/// from the server has messages of type \a R. -template -class ClientAsyncReaderWriter final - : public ClientAsyncReaderWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method - /// for semantics of this method. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// is updated with it, and then the receiving initial metadata can - /// be accessed through this \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// Side effect - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderWriterFactory; - ClientAsyncReaderWriter(grpc::internal::Call call, - grpc::ClientContext* context, bool start, void* tag) - : context_(context), call_(call), started_(start) { - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncReaderInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code - /// and also send out \a msg response to the client. - /// Request notification for when the server has sent the response and the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous - /// \a AsyncReaderInterface::Read operation with a non-ok result, - /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it - /// is safe to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// \param[in] msg To be sent to the client as the response for this call. - virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; - - /// Indicate that the stream is to be finished with a certain - /// non-OK status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// This call is meant to end the call with some error, and can be called at - /// any point that the server would like to "fail" the call (though note - /// this shouldn't be called concurrently with any other "sending" call, like - /// \a AsyncWriterInterface::Write). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), and status, or if some failure occurred - /// when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// - Note: \a status must have a non-OK code. - virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing client-streaming RPCs, -/// where the incoming message stream from the client has messages of type \a R, -/// and the single response message sent from the server is type \a W. -template -class ServerAsyncReader final : public ServerAsyncReaderInterface { - public: - explicit ServerAsyncReader(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// Note: \a msg is not sent if \a status has a non-OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once Finish returns. - void Finish(const W& msg, const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_ops_.SendMessage(msg)); - } else { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - void FinishWithError(const grpc::Status& status, void* tag) override { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation with a non-ok - /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish - /// in a single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing server streaming RPCs, -/// where the outgoing message stream from the server has messages of type \a W. -template -class ServerAsyncWriter final : public ServerAsyncWriterInterface { - public: - explicit ServerAsyncWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of - /// \a status,it may be non-OK - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Server-side interface for asynchronous bi-directional streaming. -template -class ServerAsyncReaderWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation - /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' - /// with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if some - /// failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish in a - /// single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing bidirectional streaming RPCs, -/// where the incoming message stream coming from the client has messages of -/// type \a R, and the outgoing message stream coming from the server has -/// messages of type \a W. -template -class ServerAsyncReaderWriter final - : public ServerAsyncReaderWriterInterface { - public: - explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - EnsureInitialMetadataSent(&write_ops_); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish - /// method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - // - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of \a status, - /// it may be non-OK - // - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class grpc::Server; - - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_unary_call.h index a9886031..02071e48 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/async_unary_call.h @@ -19,402 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H #define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -// Forward declaration for use in Helper class -template -class ClientAsyncResponseReader; - -/// An interface relevant for async client side unary RPCs (which send -/// one request message to a server and receive one response message). -template -class ClientAsyncResponseReaderInterface { - public: - virtual ~ClientAsyncResponseReaderInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall() = 0; - - /// Request notification of the reading of initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a Finish method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Request to receive the server's response \a msg and final \a status for - /// the call, and to notify \a tag on this call's completion queue when - /// finished. - /// - /// This function will return when either: - /// - when the server's response message and status have been received. - /// - when the server has returned a non-OK status (no message expected in - /// this case). - /// - when the call failed for some reason and the library generated a - /// non-OK status. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - /// \param[out] msg To be filled in with the server's response message. - virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; -}; - -namespace internal { - -class ClientAsyncResponseReaderHelper { - public: - /// Start a call and write the request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// - /// Optionally pass in a base class for request and response types so that the - /// internal functions and structs can be templated based on that, allowing - /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors - /// can't have an explicit template parameter, the last argument is an - /// extraneous parameter just to provide the needed type information. - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request) /* __attribute__((noinline)) */ { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - ClientAsyncResponseReader* result = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncResponseReader))) - ClientAsyncResponseReader(call, context); - SetupRequest( - call.call(), &result->single_buf_, &result->read_initial_metadata_, - &result->finish_, static_cast(request)); - - return result; - } - - // Various helper functions to reduce templating use - - template - static void SetupRequest( - grpc_call* call, - grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, - std::function* - read_initial_metadata, - std::function< - void(ClientContext*, internal::Call*, bool initial_metadata_read, - internal::CallOpSendInitialMetadata*, - internal::CallOpSetInterface**, void*, Status*, void*)>* finish, - const W& request) { - using SingleBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - SingleBufType* single_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(SingleBufType))) SingleBufType; - *single_buf_ptr = single_buf; - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); - single_buf->ClientSendClose(); - - // The purpose of the following functions is to type-erase the actual - // templated type of the CallOpSet being used by hiding that type inside the - // function definition rather than specifying it as an argument of the - // function or a member of the class. The type-erased CallOpSet will get - // static_cast'ed back to the real type so that it can be used properly. - *read_initial_metadata = - [](ClientContext* context, internal::Call* call, - internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - call->PerformOps(single_buf); - }; - - // Note that this function goes one step further than the previous one - // because it type-erases the message being written down to a void*. This - // will be static-cast'ed back to the class specified here by hiding that - // class information inside the function definition. Note that this feature - // expects the class being specified here for R to be a base-class of the - // "real" R without any multiple-inheritance (as applies in protbuf wrt - // MessageLite) - *finish = [](ClientContext* context, internal::Call* call, - bool initial_metadata_read, - internal::CallOpSendInitialMetadata* single_buf_view, - internal::CallOpSetInterface** finish_buf_ptr, void* msg, - Status* status, void* tag) { - if (initial_metadata_read) { - using FinishBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - FinishBufType* finish_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call->call(), sizeof(FinishBufType))) FinishBufType; - *finish_buf_ptr = finish_buf; - finish_buf->set_output_tag(tag); - finish_buf->RecvMessage(static_cast(msg)); - finish_buf->AllowNoMessage(); - finish_buf->ClientRecvStatus(context, status); - call->PerformOps(finish_buf); - } else { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - single_buf->RecvMessage(static_cast(msg)); - single_buf->AllowNoMessage(); - single_buf->ClientRecvStatus(context, status); - call->PerformOps(single_buf); - } - }; - } - - static void StartCall(grpc::ClientContext* context, - grpc::internal::CallOpSendInitialMetadata* single_buf) { - single_buf->SendInitialMetadata(&context->send_initial_metadata_, - context->initial_metadata_flags()); - } -}; - -// TODO(vjpai): This templated factory is deprecated and will be replaced by -//. the non-templated helper as soon as possible. -template -class ClientAsyncResponseReaderFactory { - public: - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request, bool start) { - auto* result = ClientAsyncResponseReaderHelper::Create( - channel, cq, method, context, request); - if (start) { - result->StartCall(); - } - return result; - } -}; - -} // namespace internal - -/// Async API for client-side unary RPCs, where the message response -/// received from the server is of type \a R. -template -class ClientAsyncResponseReader final - : public ClientAsyncResponseReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall() override { - GPR_CODEGEN_DEBUG_ASSERT(!started_); - started_ = true; - internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); - } - - /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for - /// semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); - read_initial_metadata_(context_, &call_, single_buf_, tag); - initial_metadata_read_ = true; - } - - /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(R* msg, grpc::Status* status, void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, - static_cast(msg), status, tag); - } - - private: - friend class internal::ClientAsyncResponseReaderHelper; - grpc::ClientContext* const context_; - grpc::internal::Call call_; - bool started_ = false; - bool initial_metadata_read_ = false; - - ClientAsyncResponseReader(grpc::internal::Call call, - grpc::ClientContext* context) - : context_(context), call_(call) {} - - // disable operator new - static void* operator new(std::size_t size); - static void* operator new(std::size_t /*size*/, void* p) { return p; } - - internal::CallOpSendInitialMetadata* single_buf_; - internal::CallOpSetInterface* finish_buf_ = nullptr; - std::function - read_initial_metadata_; - std::function - finish_; -}; - -/// Async server-side API for handling unary calls, where the single -/// response message sent to the client is of type \a W. -template -class ServerAsyncResponseWriter final - : public grpc::internal::ServerAsyncStreamingInterface { - public: - explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Side effect: - /// The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_buf_.set_output_tag(tag); - meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_buf_); - } - - /// Indicate that the stream is to be finished and request notification - /// when the server has sent the appropriate signals to the client to - /// end the call. Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// \param[in] msg Message to be sent to the client. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// Note: if \a status has a non-OK code, then \a msg will not be sent, - /// and the client will receive only the status with possible trailing - /// metadata. - /// - /// gRPC doesn't take ownership or a reference to msg and status, so it is - /// safe to deallocate them once the Finish operation is complete (i.e. a - /// result arrives in the completion queue). - void Finish(const W& msg, const grpc::Status& status, void* tag) { - finish_buf_.set_output_tag(tag); - finish_buf_.set_core_cq_tag(&finish_buf_); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_buf_.SendMessage(msg)); - } else { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_buf_); - } - - /// Indicate that the stream is to be finished with a non-OK status, - /// and request notification for when the server has finished sending the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// - Note: \a status must have a non-OK code. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// gRPC doesn't take ownership or a reference to status, so it is safe to - /// deallocate them once the Finish operation is complete (i.e. a result - /// arrives in the completion queue). - void FinishWithError(const grpc::Status& status, void* tag) { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_buf_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_buf_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_buf_; - grpc::internal::CallOpSet - finish_buf_; -}; - -} // namespace grpc - -namespace std { -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -} // namespace std +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/byte_buffer.h index 7ca7c4b2..6f566e76 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/byte_buffer.h @@ -19,221 +19,13 @@ #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H #define GRPCPP_SUPPORT_BYTE_BUFFER_H -#include - #include #include #include -#include +#include // IWYU pragma: export #include #include #include #include -namespace grpc { - -class ServerInterface; -class ByteBuffer; -class ServerInterface; - -namespace internal { -template -class CallbackUnaryHandler; -template -class CallbackServerStreamingHandler; -template -void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); -template -class ServerStreamingHandler; -template -class ErrorMethodHandler; -class CallOpSendMessage; -template -class CallOpRecvMessage; -class CallOpGenericRecvMessage; -class ExternalConnectionAcceptorImpl; -template -class DeserializeFuncType; -class GrpcByteBufferPeer; - -} // namespace internal -/// A sequence of bytes. -class ByteBuffer final { - public: - /// Constuct an empty buffer. - ByteBuffer() : buffer_(nullptr) {} - - /// Construct buffer from \a slices, of which there are \a nslices. - ByteBuffer(const Slice* slices, size_t nslices) { - // The following assertions check that the representation of a grpc::Slice - // is identical to that of a grpc_slice: it has a grpc_slice field, and - // nothing else. - static_assert(std::is_same::value, - "Slice must have same representation as grpc_slice"); - static_assert(sizeof(Slice) == sizeof(grpc_slice), - "Slice must have same representation as grpc_slice"); - // The following assertions check that the representation of a ByteBuffer is - // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, - // and nothing else. - static_assert(std::is_same::value, - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - // The const_cast is legal if grpc_raw_byte_buffer_create() does no more - // than its advertised side effect of increasing the reference count of the - // slices it processes, and such an increase does not affect the semantics - // seen by the caller of this constructor. - buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( - reinterpret_cast(const_cast(slices)), nslices); - } - - /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } - - ~ByteBuffer() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - } - } - - /// Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer& operator=(const ByteBuffer& buf) { - if (this != &buf) { - Clear(); // first remove existing data - } - if (buf.buffer_) { - // then copy - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); - } - return *this; - } - - // If this ByteBuffer's representation is a single flat slice, returns a - // slice referencing that array. - Status TrySingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slics. - Status DumpToSingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slices. - Status Dump(std::vector* slices) const; - - /// Remove all data. - void Clear() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - buffer_ = nullptr; - } - } - - /// Make a duplicate copy of the internals of this byte - /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. - /// This is not a deep copy; it is a referencing and its performance - /// is size-independent. - void Duplicate() { - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); - } - - /// Forget underlying byte buffer without destroying - /// Use this only for un-owned byte buffers - void Release() { buffer_ = nullptr; } - - /// Buffer size in bytes. - size_t Length() const { - return buffer_ == nullptr - ? 0 - : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); - } - - /// Swap the state of *this and *other. - void Swap(ByteBuffer* other) { - grpc_byte_buffer* tmp = other->buffer_; - other->buffer_ = buffer_; - buffer_ = tmp; - } - - /// Is this ByteBuffer valid? - bool Valid() const { return (buffer_ != nullptr); } - - private: - friend class SerializationTraits; - friend class ServerInterface; - friend class internal::CallOpSendMessage; - template - friend class internal::CallOpRecvMessage; - friend class internal::CallOpGenericRecvMessage; - template - friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, - grpc::Status*, RequestType*); - template - friend class internal::ServerStreamingHandler; - template - friend class internal::CallbackUnaryHandler; - template - friend class internal::CallbackServerStreamingHandler; - template - friend class internal::ErrorMethodHandler; - template - friend class internal::DeserializeFuncType; - friend class ProtoBufferReader; - friend class ProtoBufferWriter; - friend class internal::GrpcByteBufferPeer; - friend class internal::ExternalConnectionAcceptorImpl; - - grpc_byte_buffer* buffer_; - - // takes ownership - void set_buffer(grpc_byte_buffer* buf) { - if (buffer_) { - Clear(); - } - buffer_ = buf; - } - - grpc_byte_buffer* c_buffer() { return buffer_; } - grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } - - class ByteBufferPointer { - public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ - ByteBufferPointer(const ByteBuffer* b) - : bbuf_(const_cast(b)) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator ByteBuffer*() { return bbuf_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer*() { return bbuf_->buffer_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer**() { return &bbuf_->buffer_; } - - private: - ByteBuffer* bbuf_; - }; - ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } -}; - -template <> -class SerializationTraits { - public: - static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { - dest->set_buffer(byte_buffer->buffer_); - return Status::OK; - } - static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, - bool* own_buffer) { - *buffer = source; - *own_buffer = true; - return g_core_codegen_interface->ok(); - } -}; - -} // namespace grpc - #endif // GRPCPP_SUPPORT_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/client_interceptor.h index 8e5e1ce6..552cab4c 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Headers/support/client_interceptor.h @@ -19,179 +19,6 @@ #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H -#include -#include - -#include -#include -#include - -namespace grpc { - -class Channel; -class ClientContext; - -namespace internal { -class InterceptorBatchMethodsImpl; -} - -namespace experimental { -class ClientRpcInfo; - -// A factory interface for creation of client interceptors. A vector of -// factories can be provided at channel creation which will be used to create a -// new vector of client interceptors per RPC. Client interceptor authors should -// create a subclass of ClientInterceptorFactorInterface which creates objects -// of their interceptors. -class ClientInterceptorFactoryInterface { - public: - virtual ~ClientInterceptorFactoryInterface() {} - // Returns a pointer to an Interceptor object on successful creation, nullptr - // otherwise. If nullptr is returned, this server interceptor factory is - // ignored for the purposes of that RPC. - virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; -}; -} // namespace experimental - -namespace internal { -extern experimental::ClientInterceptorFactoryInterface* - g_global_client_interceptor_factory; -} - -/// ClientRpcInfo represents the state of a particular RPC as it -/// appears to an interceptor. It is created and owned by the library and -/// passed to the CreateClientInterceptor method of the application's -/// ClientInterceptorFactoryInterface implementation -namespace experimental { -class ClientRpcInfo { - public: - // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN - // from the list of possible Types. - /// Type categorizes RPCs by unary or streaming type - enum class Type { - UNARY, - CLIENT_STREAMING, - SERVER_STREAMING, - BIDI_STREAMING, - UNKNOWN // UNKNOWN is not API and will be removed later - }; - - ~ClientRpcInfo() {} - - // Delete copy constructor but allow default move constructor - ClientRpcInfo(const ClientRpcInfo&) = delete; - ClientRpcInfo(ClientRpcInfo&&) = default; - - // Getter methods - - /// Return the fully-specified method name - const char* method() const { return method_; } - - /// Return an identifying suffix for the client stub, or nullptr if one wasn't - /// specified. - const char* suffix_for_stats() const { return suffix_for_stats_; } - - /// Return a pointer to the channel on which the RPC is being sent - ChannelInterface* channel() { return channel_; } - - /// Return a pointer to the underlying ClientContext structure associated - /// with the RPC to support features that apply to it - grpc::ClientContext* client_context() { return ctx_; } - - /// Return the type of the RPC (unary or a streaming flavor) - Type type() const { return type_; } - - private: - static_assert(Type::UNARY == - static_cast(internal::RpcMethod::NORMAL_RPC), - "violated expectation about Type enum"); - static_assert(Type::CLIENT_STREAMING == - static_cast(internal::RpcMethod::CLIENT_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::SERVER_STREAMING == - static_cast(internal::RpcMethod::SERVER_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::BIDI_STREAMING == - static_cast(internal::RpcMethod::BIDI_STREAMING), - "violated expectation about Type enum"); - - // Default constructor should only be used by ClientContext - ClientRpcInfo() = default; - - // Constructor will only be called from ClientContext - ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, - const char* method, const char* suffix_for_stats, - grpc::ChannelInterface* channel) - : ctx_(ctx), - type_(static_cast(type)), - method_(method), - suffix_for_stats_(suffix_for_stats), - channel_(channel) {} - - // Move assignment should only be used by ClientContext - // TODO(yashykt): Delete move assignment - ClientRpcInfo& operator=(ClientRpcInfo&&) = default; - - // Runs interceptor at pos \a pos. - void RunInterceptor( - experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { - GPR_CODEGEN_ASSERT(pos < interceptors_.size()); - interceptors_[pos]->Intercept(interceptor_methods); - } - - void RegisterInterceptors( - const std::vector>& creators, - size_t interceptor_pos) { - if (interceptor_pos > creators.size()) { - // No interceptors to register - return; - } - // NOTE: The following is not a range-based for loop because it will only - // iterate over a portion of the creators vector. - for (auto it = creators.begin() + interceptor_pos; it != creators.end(); - ++it) { - auto* interceptor = (*it)->CreateClientInterceptor(this); - if (interceptor != nullptr) { - interceptors_.push_back( - std::unique_ptr(interceptor)); - } - } - if (internal::g_global_client_interceptor_factory != nullptr) { - interceptors_.push_back(std::unique_ptr( - internal::g_global_client_interceptor_factory - ->CreateClientInterceptor(this))); - } - } - - grpc::ClientContext* ctx_ = nullptr; - // TODO(yashykt): make type_ const once move-assignment is deleted - Type type_{Type::UNKNOWN}; - const char* method_ = nullptr; - const char* suffix_for_stats_ = nullptr; - grpc::ChannelInterface* channel_ = nullptr; - std::vector> interceptors_; - bool hijacked_ = false; - size_t hijacked_interceptor_ = 0; - - friend class internal::InterceptorBatchMethodsImpl; - friend class grpc::ClientContext; -}; - -// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL -// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. -// Registers a global client interceptor factory object, which is used for all -// RPCs made in this process. The application is responsible for maintaining the -// life of the object while gRPC operations are in progress. The global -// interceptor factory should only be registered once at the start of the -// process before any gRPC operations have begun. -void RegisterGlobalClientInterceptorFactory( - ClientInterceptorFactoryInterface* factory); - -// For testing purposes only -void TestOnlyResetGlobalClientInterceptorFactory(); - -} // namespace experimental -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Info.plist b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Info.plist index 3c7e8970..7a2e5e54 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Info.plist +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/gRPC-C++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/gRPC-C++ index 3226b88d..30bf77c2 100644 Binary files a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/gRPC-C++ and b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-C++.framework/gRPC-C++ differ diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h index 5681377c..ec8702e4 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include struct grpc_channel; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h index df015b98..4b94a08e 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include #include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h index 5081bc5a..6ba0ce26 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h @@ -24,8 +24,6 @@ #import "grpcpp.h" #import "health_check_service_interface.h" #import "impl/call.h" -#import "impl/call_hook.h" -#import "impl/call_op_set_interface.h" #import "impl/channel_argument_option.h" #import "impl/client_unary_call.h" #import "impl/codegen/async_generic_service.h" diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h index 5ff98267..01c79428 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h @@ -19,117 +19,6 @@ #ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H #define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H -#include - -#include -#include -#include -#include - -struct grpc_server; - -namespace grpc { - -typedef ServerAsyncReaderWriter - GenericServerAsyncReaderWriter; -typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; -typedef ServerAsyncReader GenericServerAsyncReader; -typedef ServerAsyncWriter GenericServerAsyncWriter; - -class GenericServerContext final : public ServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class ServerInterface; - - std::string method_; - std::string host_; -}; - -// A generic service at the server side accepts all RPC methods and hosts. It is -// typically used in proxies. The generic service can be registered to a server -// which also has other services. -// Sample usage: -// ServerBuilder builder; -// auto cq = builder.AddCompletionQueue(); -// AsyncGenericService generic_service; -// builder.RegisterAsyncGenericService(&generic_service); -// auto server = builder.BuildAndStart(); -// -// // request a new call -// GenericServerContext context; -// GenericServerAsyncReaderWriter stream; -// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); -// -// When tag is retrieved from cq->Next(), context.method() can be used to look -// at the method and the RPC can be handled accordingly. -class AsyncGenericService final { - public: - AsyncGenericService() : server_(nullptr) {} - - void RequestCall(GenericServerContext* ctx, - GenericServerAsyncReaderWriter* reader_writer, - grpc::CompletionQueue* call_cq, - grpc::ServerCompletionQueue* notification_cq, void* tag); - - private: - friend class grpc::Server; - grpc::Server* server_; -}; - -/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs -/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with -/// ByteBuffer arguments. -using ServerGenericBidiReactor = ServerBidiReactor; - -class GenericCallbackServerContext final : public grpc::CallbackServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class grpc::Server; - - std::string method_; - std::string host_; -}; - -/// \a CallbackGenericService is the base class for generic services implemented -/// using the callback API and registered through the ServerBuilder using -/// RegisterCallbackGenericService. -class CallbackGenericService { - public: - CallbackGenericService() {} - virtual ~CallbackGenericService() {} - - /// The "method handler" for the generic API. This function should be - /// overridden to provide a ServerGenericBidiReactor that implements the - /// application-level interface for this RPC. Unimplemented by default. - virtual ServerGenericBidiReactor* CreateReactor( - GenericCallbackServerContext* /*ctx*/) { - class Reactor : public ServerGenericBidiReactor { - public: - Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } - void OnDone() override { delete this; } - }; - return new Reactor; - } - - private: - friend class grpc::Server; - - internal::CallbackBidiHandler* Handler() { - return new internal::CallbackBidiHandler( - [this](grpc::CallbackServerContext* ctx) { - return CreateReactor(static_cast(ctx)); - }); - } - - grpc::Server* server_{nullptr}; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h index 2a119963..97d8fdfc 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h @@ -19,76 +19,6 @@ #ifndef GRPCPP_IMPL_CALL_H #define GRPCPP_IMPL_CALL_H -#include -#include - -namespace grpc { -class CompletionQueue; -namespace experimental { -class ClientRpcInfo; -class ServerRpcInfo; -} // namespace experimental -namespace internal { -class CallHook; -class CallOpSetInterface; - -/// Straightforward wrapping of the C call object -class Call final { - public: - Call() - : call_hook_(nullptr), - cq_(nullptr), - call_(nullptr), - max_receive_message_size_(-1) {} - /** call is owned by the caller */ - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - experimental::ClientRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1), - client_rpc_info_(rpc_info) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(max_receive_message_size), - server_rpc_info_(rpc_info) {} - - void PerformOps(CallOpSetInterface* ops) { - call_hook_->PerformOpsOnCall(ops, this); - } - - grpc_call* call() const { return call_; } - grpc::CompletionQueue* cq() const { return cq_; } - - int max_receive_message_size() const { return max_receive_message_size_; } - - experimental::ClientRpcInfo* client_rpc_info() const { - return client_rpc_info_; - } - - experimental::ServerRpcInfo* server_rpc_info() const { - return server_rpc_info_; - } - - private: - CallHook* call_hook_; - grpc::CompletionQueue* cq_; - grpc_call* call_; - int max_receive_message_size_; - experimental::ClientRpcInfo* client_rpc_info_ = nullptr; - experimental::ServerRpcInfo* server_rpc_info_ = nullptr; -}; -} // namespace internal -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_IMPL_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_hook.h deleted file mode 100644 index 8903b9a0..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_hook.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_HOOK_H -#define GRPCPP_IMPL_CALL_HOOK_H - -namespace grpc { - -namespace internal { -class CallOpSetInterface; -class Call; - -/// This is an interface that Channel and Server implement to allow them to hook -/// performing ops. -class CallHook { - public: - virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; -}; -} // namespace internal - -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_op_set_interface.h deleted file mode 100644 index 43ed4ed9..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_op_set_interface.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H -#define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H - -// IWYU pragma: private - -#include - -namespace grpc { -namespace internal { - -class Call; - -/// An abstract collection of call ops, used to generate the -/// grpc_call_op structure to pass down to the lower layers, -/// and as it is-a CompletionQueueTag, also massages the final -/// completion into the correct form for consumption in the C++ -/// API. -class CallOpSetInterface : public CompletionQueueTag { - public: - /// Fills in grpc_op, starting from ops[*nops] and moving - /// upwards. - virtual void FillOps(internal::Call* call) = 0; - - /// Get the tag to be used at the core completion queue. Generally, the - /// value of core_cq_tag will be "this". However, it can be overridden if we - /// want core to process the tag differently (e.g., as a core callback) - virtual void* core_cq_tag() = 0; - - // This will be called while interceptors are run if the RPC is a hijacked - // RPC. This should set hijacking state for each of the ops. - virtual void SetHijackingState() = 0; - - // Should be called after interceptors are done running - virtual void ContinueFillOpsAfterInterception() = 0; - - // Should be called after interceptors are done running on the finalize result - // path - virtual void ContinueFinalizeResultAfterInterception() = 0; -}; -} // namespace internal -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h index 03a096c5..2a000662 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h @@ -19,9 +19,119 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H #define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include + +struct grpc_server; + +namespace grpc { + +typedef ServerAsyncReaderWriter + GenericServerAsyncReaderWriter; +typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; +typedef ServerAsyncReader GenericServerAsyncReader; +typedef ServerAsyncWriter GenericServerAsyncWriter; + +class GenericServerContext final : public ServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class ServerInterface; + + std::string method_; + std::string host_; +}; + +// A generic service at the server side accepts all RPC methods and hosts. It is +// typically used in proxies. The generic service can be registered to a server +// which also has other services. +// Sample usage: +// ServerBuilder builder; +// auto cq = builder.AddCompletionQueue(); +// AsyncGenericService generic_service; +// builder.RegisterAsyncGenericService(&generic_service); +// auto server = builder.BuildAndStart(); +// +// // request a new call +// GenericServerContext context; +// GenericServerAsyncReaderWriter stream; +// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); +// +// When tag is retrieved from cq->Next(), context.method() can be used to look +// at the method and the RPC can be handled accordingly. +class AsyncGenericService final { + public: + AsyncGenericService() : server_(nullptr) {} + + void RequestCall(GenericServerContext* ctx, + GenericServerAsyncReaderWriter* reader_writer, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag); + + private: + friend class grpc::Server; + grpc::Server* server_; +}; + +/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs +/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with +/// ByteBuffer arguments. +using ServerGenericBidiReactor = ServerBidiReactor; + +class GenericCallbackServerContext final : public grpc::CallbackServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class grpc::Server; + + std::string method_; + std::string host_; +}; + +/// \a CallbackGenericService is the base class for generic services implemented +/// using the callback API and registered through the ServerBuilder using +/// RegisterCallbackGenericService. +class CallbackGenericService { + public: + CallbackGenericService() {} + virtual ~CallbackGenericService() {} + + /// The "method handler" for the generic API. This function should be + /// overridden to provide a ServerGenericBidiReactor that implements the + /// application-level interface for this RPC. Unimplemented by default. + virtual ServerGenericBidiReactor* CreateReactor( + GenericCallbackServerContext* /*ctx*/) { + class Reactor : public ServerGenericBidiReactor { + public: + Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } + void OnDone() override { delete this; } + }; + return new Reactor; + } + + private: + friend class grpc::Server; + + internal::CallbackBidiHandler* Handler() { + return new internal::CallbackBidiHandler( + [this](grpc::CallbackServerContext* ctx) { + return CreateReactor(static_cast(ctx)); + }); + } + + grpc::Server* server_{nullptr}; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h index 524f619f..5b63c301 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h @@ -18,9 +18,1115 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +namespace grpc { + +namespace internal { +/// Common interface for all client side asynchronous streaming. +class ClientAsyncStreamingInterface { + public: + virtual ~ClientAsyncStreamingInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall(void* tag) = 0; + + /// Request notification of the reading of the initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a AsyncReaderInterface::Read method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Indicate that the stream is to be finished and request notification for + /// when the call has been ended. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method exactly once when both: + /// * the client side has no more message to send + /// (this can be declared implicitly by calling this method, or + /// explicitly through an earlier call to the WritesDone method + /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or + /// \a ClientAsyncReaderWriterInterface::WritesDone). + /// * there are no more messages to be received from the server (this can + /// be known implicitly by the calling code, or explicitly from an + /// earlier call to \a AsyncReaderInterface::Read that yielded a failed + /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// The tag will be returned when either: + /// - all incoming messages have been read and the server has returned + /// a status. + /// - the server has returned a non-OK status. + /// - the call failed for some reason and the library generated a + /// status. + /// + /// Note that implementations of this method attempt to receive initial + /// metadata from the server if initial metadata hasn't yet been received. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + virtual void Finish(grpc::Status* status, void* tag) = 0; +}; + +/// An interface that yields a sequence of messages of type \a R. +template +class AsyncReaderInterface { + public: + virtual ~AsyncReaderInterface() {} + + /// Read a message of type \a R into \a msg. Completion will be notified by \a + /// tag on the associated completion queue. + /// This is thread-safe with respect to \a Write or \a WritesDone methods. It + /// should not be called concurrently with other streaming APIs + /// on the same stream. It is not meaningful to call it concurrently + /// with another \a AsyncReaderInterface::Read on the same stream since reads + /// on the same stream are delivered in order. + /// + /// \param[out] msg Where to eventually store the read message. + /// \param[in] tag The tag identifying the operation. + /// + /// Side effect: note that this method attempt to receive initial metadata for + /// a stream if it hasn't yet been received. + virtual void Read(R* msg, void* tag) = 0; +}; + +/// An interface that can be fed a sequence of messages of type \a W. +template +class AsyncWriterInterface { + public: + virtual ~AsyncWriterInterface() {} + + /// Request the writing of \a msg with identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, void* tag) = 0; + + /// Request the writing of \a msg using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// WriteOptions \a options is used to set the write options of this message. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with the writing + /// of trailing metadata, using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// For client, WriteLast is equivalent of performing Write and + /// WritesDone in a single step. + /// For server, WriteLast buffers the \a msg. The writing of \a msg is held + /// until Finish is called, where \a msg and trailing metadata are coalesced + /// and write is initiated. Note that WriteLast can only buffer \a msg up to + /// the flow control window size. If \a msg size is larger than the window + /// size, it will be sent on wire without buffering. + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { + Write(msg, options.set_last_message(), tag); + } +}; + +} // namespace internal + +template +class ClientAsyncReaderInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncReaderInterface {}; + +namespace internal { +template +class ClientAsyncReaderFactory { + public: + /// Create a stream object. + /// Write the first request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started and + /// \a request has been written out. If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + template + static ClientAsyncReader* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, + const W& request, bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReader))) + ClientAsyncReader(call, context, request, start, tag); + } +}; +} // namespace internal + +/// Async client-side API for doing server-streaming RPCs, +/// where the incoming message stream coming from the server has +/// messages of type \a R. +template +class ClientAsyncReader final : public ClientAsyncReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata + /// method for semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, + /// the \a ClientContext associated with this call is updated, and the + /// calling code can access the received metadata through the + /// \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderFactory; + template + ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, + const W& request, bool start, void* tag) + : context_(context), call_(call), started_(start) { + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); + init_ops_.ClientSendClose(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + init_ops_.set_output_tag(tag); + call_.PerformOps(&init_ops_); + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + init_ops_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Common interface for client side asynchronous writing. +template +class ClientAsyncWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncWriterFactory { + public: + /// Create a stream object. + /// Start the RPC if \a start is set + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, \a tag must be nullptr and the actual call + /// must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// \a response will be filled in with the single expected response + /// message from the server upon a successful call to the \a Finish + /// method of this instance. + template + static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncWriter))) + ClientAsyncWriter(call, context, response, start, tag); + } +}; +} // namespace internal + +/// Async API on the client side for doing client-streaming RPCs, +/// where the outgoing message stream going to the server contains +/// messages of type \a W. +template +class ClientAsyncWriter final : public ClientAsyncWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for + /// semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// associated with this call is updated, and the calling code can access + /// the received metadata through the \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + /// - attempts to fill in the \a response parameter passed to this class's + /// constructor with the server's response message. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncWriterFactory; + template + ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, + R* response, bool start, void* tag) + : context_(context), call_(call), started_(start) { + finish_ops_.RecvMessage(response); + finish_ops_.AllowNoMessage(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Async client-side interface for bi-directional streaming, +/// where the client-to-server message stream has messages of type \a W, +/// and the server-to-client message stream has messages of type \a R. +template +class ClientAsyncReaderWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncReaderWriterFactory { + public: + /// Create a stream object. + /// Start the RPC request if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent). If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + static ClientAsyncReaderWriter* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReaderWriter))) + ClientAsyncReaderWriter(call, context, start, tag); + } +}; +} // namespace internal + +/// Async client-side interface for bi-directional streaming, +/// where the outgoing message stream going to the server +/// has messages of type \a W, and the incoming message stream coming +/// from the server has messages of type \a R. +template +class ClientAsyncReaderWriter final + : public ClientAsyncReaderWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method + /// for semantics of this method. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// is updated with it, and then the receiving initial metadata can + /// be accessed through this \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// Side effect + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderWriterFactory; + ClientAsyncReaderWriter(grpc::internal::Call call, + grpc::ClientContext* context, bool start, void* tag) + : context_(context), call_(call), started_(start) { + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncReaderInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code + /// and also send out \a msg response to the client. + /// Request notification for when the server has sent the response and the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous + /// \a AsyncReaderInterface::Read operation with a non-ok result, + /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it + /// is safe to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// \param[in] msg To be sent to the client as the response for this call. + virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; + + /// Indicate that the stream is to be finished with a certain + /// non-OK status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// This call is meant to end the call with some error, and can be called at + /// any point that the server would like to "fail" the call (though note + /// this shouldn't be called concurrently with any other "sending" call, like + /// \a AsyncWriterInterface::Write). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), and status, or if some failure occurred + /// when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// - Note: \a status must have a non-OK code. + virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing client-streaming RPCs, +/// where the incoming message stream from the client has messages of type \a R, +/// and the single response message sent from the server is type \a W. +template +class ServerAsyncReader final : public ServerAsyncReaderInterface { + public: + explicit ServerAsyncReader(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// Note: \a msg is not sent if \a status has a non-OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once Finish returns. + void Finish(const W& msg, const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_ops_.SendMessage(msg)); + } else { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + void FinishWithError(const grpc::Status& status, void* tag) override { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation with a non-ok + /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish + /// in a single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing server streaming RPCs, +/// where the outgoing message stream from the server has messages of type \a W. +template +class ServerAsyncWriter final : public ServerAsyncWriterInterface { + public: + explicit ServerAsyncWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of + /// \a status,it may be non-OK + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Server-side interface for asynchronous bi-directional streaming. +template +class ServerAsyncReaderWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation + /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' + /// with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if some + /// failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish in a + /// single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing bidirectional streaming RPCs, +/// where the incoming message stream coming from the client has messages of +/// type \a R, and the outgoing message stream coming from the server has +/// messages of type \a W. +template +class ServerAsyncReaderWriter final + : public ServerAsyncReaderWriterInterface { + public: + explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + EnsureInitialMetadataSent(&write_ops_); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish + /// method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + // + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of \a status, + /// it may be non-OK + // + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class grpc::Server; + + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h index 55227b2e..0034d210 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h @@ -19,9 +19,402 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { + +// Forward declaration for use in Helper class +template +class ClientAsyncResponseReader; + +/// An interface relevant for async client side unary RPCs (which send +/// one request message to a server and receive one response message). +template +class ClientAsyncResponseReaderInterface { + public: + virtual ~ClientAsyncResponseReaderInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall() = 0; + + /// Request notification of the reading of initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a Finish method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Request to receive the server's response \a msg and final \a status for + /// the call, and to notify \a tag on this call's completion queue when + /// finished. + /// + /// This function will return when either: + /// - when the server's response message and status have been received. + /// - when the server has returned a non-OK status (no message expected in + /// this case). + /// - when the call failed for some reason and the library generated a + /// non-OK status. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + /// \param[out] msg To be filled in with the server's response message. + virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; +}; + +namespace internal { + +class ClientAsyncResponseReaderHelper { + public: + /// Start a call and write the request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// + /// Optionally pass in a base class for request and response types so that the + /// internal functions and structs can be templated based on that, allowing + /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors + /// can't have an explicit template parameter, the last argument is an + /// extraneous parameter just to provide the needed type information. + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request) /* __attribute__((noinline)) */ { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + ClientAsyncResponseReader* result = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncResponseReader))) + ClientAsyncResponseReader(call, context); + SetupRequest( + call.call(), &result->single_buf_, &result->read_initial_metadata_, + &result->finish_, static_cast(request)); + + return result; + } + + // Various helper functions to reduce templating use + + template + static void SetupRequest( + grpc_call* call, + grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, + std::function* + read_initial_metadata, + std::function< + void(ClientContext*, internal::Call*, bool initial_metadata_read, + internal::CallOpSendInitialMetadata*, + internal::CallOpSetInterface**, void*, Status*, void*)>* finish, + const W& request) { + using SingleBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + SingleBufType* single_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(SingleBufType))) SingleBufType; + *single_buf_ptr = single_buf; + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); + single_buf->ClientSendClose(); + + // The purpose of the following functions is to type-erase the actual + // templated type of the CallOpSet being used by hiding that type inside the + // function definition rather than specifying it as an argument of the + // function or a member of the class. The type-erased CallOpSet will get + // static_cast'ed back to the real type so that it can be used properly. + *read_initial_metadata = + [](ClientContext* context, internal::Call* call, + internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + call->PerformOps(single_buf); + }; + + // Note that this function goes one step further than the previous one + // because it type-erases the message being written down to a void*. This + // will be static-cast'ed back to the class specified here by hiding that + // class information inside the function definition. Note that this feature + // expects the class being specified here for R to be a base-class of the + // "real" R without any multiple-inheritance (as applies in protbuf wrt + // MessageLite) + *finish = [](ClientContext* context, internal::Call* call, + bool initial_metadata_read, + internal::CallOpSendInitialMetadata* single_buf_view, + internal::CallOpSetInterface** finish_buf_ptr, void* msg, + Status* status, void* tag) { + if (initial_metadata_read) { + using FinishBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + FinishBufType* finish_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call->call(), sizeof(FinishBufType))) FinishBufType; + *finish_buf_ptr = finish_buf; + finish_buf->set_output_tag(tag); + finish_buf->RecvMessage(static_cast(msg)); + finish_buf->AllowNoMessage(); + finish_buf->ClientRecvStatus(context, status); + call->PerformOps(finish_buf); + } else { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + single_buf->RecvMessage(static_cast(msg)); + single_buf->AllowNoMessage(); + single_buf->ClientRecvStatus(context, status); + call->PerformOps(single_buf); + } + }; + } + + static void StartCall(grpc::ClientContext* context, + grpc::internal::CallOpSendInitialMetadata* single_buf) { + single_buf->SendInitialMetadata(&context->send_initial_metadata_, + context->initial_metadata_flags()); + } +}; + +// TODO(vjpai): This templated factory is deprecated and will be replaced by +//. the non-templated helper as soon as possible. +template +class ClientAsyncResponseReaderFactory { + public: + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request, bool start) { + auto* result = ClientAsyncResponseReaderHelper::Create( + channel, cq, method, context, request); + if (start) { + result->StartCall(); + } + return result; + } +}; + +} // namespace internal + +/// Async API for client-side unary RPCs, where the message response +/// received from the server is of type \a R. +template +class ClientAsyncResponseReader final + : public ClientAsyncResponseReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall() override { + GPR_CODEGEN_DEBUG_ASSERT(!started_); + started_ = true; + internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); + } + + /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for + /// semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); + read_initial_metadata_(context_, &call_, single_buf_, tag); + initial_metadata_read_ = true; + } + + /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(R* msg, grpc::Status* status, void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, + static_cast(msg), status, tag); + } + + private: + friend class internal::ClientAsyncResponseReaderHelper; + grpc::ClientContext* const context_; + grpc::internal::Call call_; + bool started_ = false; + bool initial_metadata_read_ = false; + + ClientAsyncResponseReader(grpc::internal::Call call, + grpc::ClientContext* context) + : context_(context), call_(call) {} + + // disable operator new + static void* operator new(std::size_t size); + static void* operator new(std::size_t /*size*/, void* p) { return p; } + + internal::CallOpSendInitialMetadata* single_buf_; + internal::CallOpSetInterface* finish_buf_ = nullptr; + std::function + read_initial_metadata_; + std::function + finish_; +}; + +/// Async server-side API for handling unary calls, where the single +/// response message sent to the client is of type \a W. +template +class ServerAsyncResponseWriter final + : public grpc::internal::ServerAsyncStreamingInterface { + public: + explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Side effect: + /// The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_buf_.set_output_tag(tag); + meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_buf_); + } + + /// Indicate that the stream is to be finished and request notification + /// when the server has sent the appropriate signals to the client to + /// end the call. Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// \param[in] msg Message to be sent to the client. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// Note: if \a status has a non-OK code, then \a msg will not be sent, + /// and the client will receive only the status with possible trailing + /// metadata. + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). + void Finish(const W& msg, const grpc::Status& status, void* tag) { + finish_buf_.set_output_tag(tag); + finish_buf_.set_core_cq_tag(&finish_buf_); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_buf_.SendMessage(msg)); + } else { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_buf_); + } + + /// Indicate that the stream is to be finished with a non-OK status, + /// and request notification for when the server has finished sending the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// - Note: \a status must have a non-OK code. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). + void FinishWithError(const grpc::Status& status, void* tag) { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_buf_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_buf_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_buf_; + grpc::internal::CallOpSet + finish_buf_; +}; + +} // namespace grpc + +namespace std { +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +} // namespace std #endif // GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h index d1969953..a9ba7d16 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h @@ -19,9 +19,221 @@ #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include +#include +#include + +namespace grpc { + +class ServerInterface; +class ByteBuffer; +class ServerInterface; + +namespace internal { +template +class CallbackUnaryHandler; +template +class CallbackServerStreamingHandler; +template +void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); +template +class ServerStreamingHandler; +template +class ErrorMethodHandler; +class CallOpSendMessage; +template +class CallOpRecvMessage; +class CallOpGenericRecvMessage; +class ExternalConnectionAcceptorImpl; +template +class DeserializeFuncType; +class GrpcByteBufferPeer; + +} // namespace internal +/// A sequence of bytes. +class ByteBuffer final { + public: + /// Constuct an empty buffer. + ByteBuffer() : buffer_(nullptr) {} + + /// Construct buffer from \a slices, of which there are \a nslices. + ByteBuffer(const Slice* slices, size_t nslices) { + // The following assertions check that the representation of a grpc::Slice + // is identical to that of a grpc_slice: it has a grpc_slice field, and + // nothing else. + static_assert(std::is_same::value, + "Slice must have same representation as grpc_slice"); + static_assert(sizeof(Slice) == sizeof(grpc_slice), + "Slice must have same representation as grpc_slice"); + // The following assertions check that the representation of a ByteBuffer is + // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, + // and nothing else. + static_assert(std::is_same::value, + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + // The const_cast is legal if grpc_raw_byte_buffer_create() does no more + // than its advertised side effect of increasing the reference count of the + // slices it processes, and such an increase does not affect the semantics + // seen by the caller of this constructor. + buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( + reinterpret_cast(const_cast(slices)), nslices); + } + + /// Constuct a byte buffer by referencing elements of existing buffer + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } + + ~ByteBuffer() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + } + } + + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer& operator=(const ByteBuffer& buf) { + if (this != &buf) { + Clear(); // first remove existing data + } + if (buf.buffer_) { + // then copy + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); + } + return *this; + } + + // If this ByteBuffer's representation is a single flat slice, returns a + // slice referencing that array. + Status TrySingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slics. + Status DumpToSingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slices. + Status Dump(std::vector* slices) const; + + /// Remove all data. + void Clear() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + buffer_ = nullptr; + } + } + + /// Make a duplicate copy of the internals of this byte + /// buffer so that we have our own owned version of it. + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. + void Duplicate() { + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); + } + + /// Forget underlying byte buffer without destroying + /// Use this only for un-owned byte buffers + void Release() { buffer_ = nullptr; } + + /// Buffer size in bytes. + size_t Length() const { + return buffer_ == nullptr + ? 0 + : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); + } + + /// Swap the state of *this and *other. + void Swap(ByteBuffer* other) { + grpc_byte_buffer* tmp = other->buffer_; + other->buffer_ = buffer_; + buffer_ = tmp; + } + + /// Is this ByteBuffer valid? + bool Valid() const { return (buffer_ != nullptr); } + + private: + friend class SerializationTraits; + friend class ServerInterface; + friend class internal::CallOpSendMessage; + template + friend class internal::CallOpRecvMessage; + friend class internal::CallOpGenericRecvMessage; + template + friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, + grpc::Status*, RequestType*); + template + friend class internal::ServerStreamingHandler; + template + friend class internal::CallbackUnaryHandler; + template + friend class internal::CallbackServerStreamingHandler; + template + friend class internal::ErrorMethodHandler; + template + friend class internal::DeserializeFuncType; + friend class ProtoBufferReader; + friend class ProtoBufferWriter; + friend class internal::GrpcByteBufferPeer; + friend class internal::ExternalConnectionAcceptorImpl; + + grpc_byte_buffer* buffer_; + + // takes ownership + void set_buffer(grpc_byte_buffer* buf) { + if (buffer_) { + Clear(); + } + buffer_ = buf; + } + + grpc_byte_buffer* c_buffer() { return buffer_; } + grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } + + class ByteBufferPointer { + public: + /* NOLINTNEXTLINE(google-explicit-constructor) */ + ByteBufferPointer(const ByteBuffer* b) + : bbuf_(const_cast(b)) {} + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator ByteBuffer*() { return bbuf_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer*() { return bbuf_->buffer_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer**() { return &bbuf_->buffer_; } + + private: + ByteBuffer* bbuf_; + }; + ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } +}; + +template <> +class SerializationTraits { + public: + static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { + dest->set_buffer(byte_buffer->buffer_); + return Status::OK; + } + static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, + bool* own_buffer) { + *buffer = source; + *own_buffer = true; + return g_core_codegen_interface->ok(); + } +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h index 71f6cb8e..90d54bc5 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h @@ -18,9 +18,78 @@ #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +namespace grpc { +class CompletionQueue; +namespace experimental { +class ClientRpcInfo; +class ServerRpcInfo; +} // namespace experimental +namespace internal { +class CallHook; +class CallOpSetInterface; + +/// Straightforward wrapping of the C call object +class Call final { + public: + Call() + : call_hook_(nullptr), + cq_(nullptr), + call_(nullptr), + max_receive_message_size_(-1) {} + /** call is owned by the caller */ + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + experimental::ClientRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1), + client_rpc_info_(rpc_info) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(max_receive_message_size), + server_rpc_info_(rpc_info) {} + + void PerformOps(CallOpSetInterface* ops) { + call_hook_->PerformOpsOnCall(ops, this); + } + + grpc_call* call() const { return call_; } + grpc::CompletionQueue* cq() const { return cq_; } + + int max_receive_message_size() const { return max_receive_message_size_; } + + experimental::ClientRpcInfo* client_rpc_info() const { + return client_rpc_info_; + } + + experimental::ServerRpcInfo* server_rpc_info() const { + return server_rpc_info_; + } + + private: + CallHook* call_hook_; + grpc::CompletionQueue* cq_; + grpc_call* call_; + int max_receive_message_size_; + experimental::ClientRpcInfo* client_rpc_info_ = nullptr; + experimental::ServerRpcInfo* server_rpc_info_ = nullptr; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h index db10a0fc..8c4278e7 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h @@ -21,7 +21,21 @@ // IWYU pragma: private -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +namespace grpc { + +namespace internal { +class CallOpSetInterface; +class Call; + +/// This is an interface that Channel and Server implement to allow them to hook +/// performing ops. +class CallHook { + public: + virtual ~CallHook() {} + virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; +}; +} // namespace internal + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h index 62b11680..5b1d4409 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h index ce5f2036..a8eed9f6 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h @@ -21,6 +21,41 @@ // IWYU pragma: private -#include +#include + +namespace grpc { +namespace internal { + +class Call; + +/// An abstract collection of call ops, used to generate the +/// grpc_call_op structure to pass down to the lower layers, +/// and as it is-a CompletionQueueTag, also massages the final +/// completion into the correct form for consumption in the C++ +/// API. +class CallOpSetInterface : public CompletionQueueTag { + public: + /// Fills in grpc_op, starting from ops[*nops] and moving + /// upwards. + virtual void FillOps(internal::Call* call) = 0; + + /// Get the tag to be used at the core completion queue. Generally, the + /// value of core_cq_tag will be "this". However, it can be overridden if we + /// want core to process the tag differently (e.g., as a core callback) + virtual void* core_cq_tag() = 0; + + // This will be called while interceptors are run if the RPC is a hijacked + // RPC. This should set hijacking state for each of the ops. + virtual void SetHijackingState() = 0; + + // Should be called after interceptors are done running + virtual void ContinueFillOpsAfterInterception() = 0; + + // Should be called after interceptors are done running on the finalize result + // path + virtual void ContinueFinalizeResultAfterInterception() = 0; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h index c0f605ac..7c67c928 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h index dde3ae7b..19fef7e2 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h @@ -22,7 +22,7 @@ // IWYU pragma: private #include -#include +#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h index 1c6b8ce5..f3560b5a 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h @@ -19,9 +19,181 @@ #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +#include +#include +#include + +namespace grpc { + +class Channel; +class ClientContext; + +namespace internal { +class InterceptorBatchMethodsImpl; +} + +namespace experimental { +class ClientRpcInfo; + +// A factory interface for creation of client interceptors. A vector of +// factories can be provided at channel creation which will be used to create a +// new vector of client interceptors per RPC. Client interceptor authors should +// create a subclass of ClientInterceptorFactorInterface which creates objects +// of their interceptors. +class ClientInterceptorFactoryInterface { + public: + virtual ~ClientInterceptorFactoryInterface() {} + // Returns a pointer to an Interceptor object on successful creation, nullptr + // otherwise. If nullptr is returned, this server interceptor factory is + // ignored for the purposes of that RPC. + virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; +}; +} // namespace experimental + +namespace internal { +extern experimental::ClientInterceptorFactoryInterface* + g_global_client_interceptor_factory; +} + +/// ClientRpcInfo represents the state of a particular RPC as it +/// appears to an interceptor. It is created and owned by the library and +/// passed to the CreateClientInterceptor method of the application's +/// ClientInterceptorFactoryInterface implementation +namespace experimental { +class ClientRpcInfo { + public: + // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN + // from the list of possible Types. + /// Type categorizes RPCs by unary or streaming type + enum class Type { + UNARY, + CLIENT_STREAMING, + SERVER_STREAMING, + BIDI_STREAMING, + UNKNOWN // UNKNOWN is not API and will be removed later + }; + + ~ClientRpcInfo() {} + + // Delete copy constructor but allow default move constructor + ClientRpcInfo(const ClientRpcInfo&) = delete; + ClientRpcInfo(ClientRpcInfo&&) = default; + + // Getter methods + + /// Return the fully-specified method name + const char* method() const { return method_; } + + /// Return an identifying suffix for the client stub, or nullptr if one wasn't + /// specified. + const char* suffix_for_stats() const { return suffix_for_stats_; } + + /// Return a pointer to the channel on which the RPC is being sent + ChannelInterface* channel() { return channel_; } + + /// Return a pointer to the underlying ClientContext structure associated + /// with the RPC to support features that apply to it + grpc::ClientContext* client_context() { return ctx_; } + + /// Return the type of the RPC (unary or a streaming flavor) + Type type() const { return type_; } + + private: + static_assert(Type::UNARY == + static_cast(internal::RpcMethod::NORMAL_RPC), + "violated expectation about Type enum"); + static_assert(Type::CLIENT_STREAMING == + static_cast(internal::RpcMethod::CLIENT_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::SERVER_STREAMING == + static_cast(internal::RpcMethod::SERVER_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::BIDI_STREAMING == + static_cast(internal::RpcMethod::BIDI_STREAMING), + "violated expectation about Type enum"); + + // Default constructor should only be used by ClientContext + ClientRpcInfo() = default; + + // Constructor will only be called from ClientContext + ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, + const char* method, const char* suffix_for_stats, + grpc::ChannelInterface* channel) + : ctx_(ctx), + type_(static_cast(type)), + method_(method), + suffix_for_stats_(suffix_for_stats), + channel_(channel) {} + + // Move assignment should only be used by ClientContext + // TODO(yashykt): Delete move assignment + ClientRpcInfo& operator=(ClientRpcInfo&&) = default; + + // Runs interceptor at pos \a pos. + void RunInterceptor( + experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { + GPR_CODEGEN_ASSERT(pos < interceptors_.size()); + interceptors_[pos]->Intercept(interceptor_methods); + } + + void RegisterInterceptors( + const std::vector>& creators, + size_t interceptor_pos) { + if (interceptor_pos > creators.size()) { + // No interceptors to register + return; + } + // NOTE: The following is not a range-based for loop because it will only + // iterate over a portion of the creators vector. + for (auto it = creators.begin() + interceptor_pos; it != creators.end(); + ++it) { + auto* interceptor = (*it)->CreateClientInterceptor(this); + if (interceptor != nullptr) { + interceptors_.push_back( + std::unique_ptr(interceptor)); + } + } + if (internal::g_global_client_interceptor_factory != nullptr) { + interceptors_.push_back(std::unique_ptr( + internal::g_global_client_interceptor_factory + ->CreateClientInterceptor(this))); + } + } + + grpc::ClientContext* ctx_ = nullptr; + // TODO(yashykt): make type_ const once move-assignment is deleted + Type type_{Type::UNKNOWN}; + const char* method_ = nullptr; + const char* suffix_for_stats_ = nullptr; + grpc::ChannelInterface* channel_ = nullptr; + std::vector> interceptors_; + bool hijacked_ = false; + size_t hijacked_interceptor_ = 0; + + friend class internal::InterceptorBatchMethodsImpl; + friend class grpc::ClientContext; +}; + +// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL +// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. +// Registers a global client interceptor factory object, which is used for all +// RPCs made in this process. The application is responsible for maintaining the +// life of the object while gRPC operations are in progress. The global +// interceptor factory should only be registered once at the start of the +// process before any gRPC operations have begun. +void RegisterGlobalClientInterceptorFactory( + ClientInterceptorFactoryInterface* factory); + +// For testing purposes only +void TestOnlyResetGlobalClientInterceptorFactory(); + +} // namespace experimental +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h index bcb85746..14450533 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h @@ -26,11 +26,11 @@ #include #include +#include #include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h index 2595938c..b084b7ce 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h index 797e8256..58056314 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h @@ -21,10 +21,10 @@ // IWYU pragma: private, include +#include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h index 2aa7774a..6f6730a1 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h @@ -28,10 +28,10 @@ #include #include +#include #include #include #include -#include namespace grpc { class ServerContextBase; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h index 2f20dade..0deac825 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h index 1235b8de..aca60790 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h @@ -20,7 +20,7 @@ // IWYU pragma: private, include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h index d9b43934..18dce966 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h @@ -25,11 +25,11 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h index 2264585c..dce87448 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h @@ -31,13 +31,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h index 18e84dfc..5f717014 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h @@ -19,1115 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H #define GRPCPP_SUPPORT_ASYNC_STREAM_H -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -namespace internal { -/// Common interface for all client side asynchronous streaming. -class ClientAsyncStreamingInterface { - public: - virtual ~ClientAsyncStreamingInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall(void* tag) = 0; - - /// Request notification of the reading of the initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a AsyncReaderInterface::Read method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Indicate that the stream is to be finished and request notification for - /// when the call has been ended. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method exactly once when both: - /// * the client side has no more message to send - /// (this can be declared implicitly by calling this method, or - /// explicitly through an earlier call to the WritesDone method - /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or - /// \a ClientAsyncReaderWriterInterface::WritesDone). - /// * there are no more messages to be received from the server (this can - /// be known implicitly by the calling code, or explicitly from an - /// earlier call to \a AsyncReaderInterface::Read that yielded a failed - /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// The tag will be returned when either: - /// - all incoming messages have been read and the server has returned - /// a status. - /// - the server has returned a non-OK status. - /// - the call failed for some reason and the library generated a - /// status. - /// - /// Note that implementations of this method attempt to receive initial - /// metadata from the server if initial metadata hasn't yet been received. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - virtual void Finish(grpc::Status* status, void* tag) = 0; -}; - -/// An interface that yields a sequence of messages of type \a R. -template -class AsyncReaderInterface { - public: - virtual ~AsyncReaderInterface() {} - - /// Read a message of type \a R into \a msg. Completion will be notified by \a - /// tag on the associated completion queue. - /// This is thread-safe with respect to \a Write or \a WritesDone methods. It - /// should not be called concurrently with other streaming APIs - /// on the same stream. It is not meaningful to call it concurrently - /// with another \a AsyncReaderInterface::Read on the same stream since reads - /// on the same stream are delivered in order. - /// - /// \param[out] msg Where to eventually store the read message. - /// \param[in] tag The tag identifying the operation. - /// - /// Side effect: note that this method attempt to receive initial metadata for - /// a stream if it hasn't yet been received. - virtual void Read(R* msg, void* tag) = 0; -}; - -/// An interface that can be fed a sequence of messages of type \a W. -template -class AsyncWriterInterface { - public: - virtual ~AsyncWriterInterface() {} - - /// Request the writing of \a msg with identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, void* tag) = 0; - - /// Request the writing of \a msg using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// WriteOptions \a options is used to set the write options of this message. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with the writing - /// of trailing metadata, using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// For client, WriteLast is equivalent of performing Write and - /// WritesDone in a single step. - /// For server, WriteLast buffers the \a msg. The writing of \a msg is held - /// until Finish is called, where \a msg and trailing metadata are coalesced - /// and write is initiated. Note that WriteLast can only buffer \a msg up to - /// the flow control window size. If \a msg size is larger than the window - /// size, it will be sent on wire without buffering. - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { - Write(msg, options.set_last_message(), tag); - } -}; - -} // namespace internal - -template -class ClientAsyncReaderInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncReaderInterface {}; - -namespace internal { -template -class ClientAsyncReaderFactory { - public: - /// Create a stream object. - /// Write the first request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started and - /// \a request has been written out. If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - template - static ClientAsyncReader* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, - const W& request, bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReader))) - ClientAsyncReader(call, context, request, start, tag); - } -}; -} // namespace internal - -/// Async client-side API for doing server-streaming RPCs, -/// where the incoming message stream coming from the server has -/// messages of type \a R. -template -class ClientAsyncReader final : public ClientAsyncReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata - /// method for semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, - /// the \a ClientContext associated with this call is updated, and the - /// calling code can access the received metadata through the - /// \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderFactory; - template - ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, - const W& request, bool start, void* tag) - : context_(context), call_(call), started_(start) { - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - init_ops_.set_output_tag(tag); - call_.PerformOps(&init_ops_); - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - init_ops_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Common interface for client side asynchronous writing. -template -class ClientAsyncWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncWriterFactory { - public: - /// Create a stream object. - /// Start the RPC if \a start is set - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, \a tag must be nullptr and the actual call - /// must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// \a response will be filled in with the single expected response - /// message from the server upon a successful call to the \a Finish - /// method of this instance. - template - static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, R* response, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncWriter))) - ClientAsyncWriter(call, context, response, start, tag); - } -}; -} // namespace internal - -/// Async API on the client side for doing client-streaming RPCs, -/// where the outgoing message stream going to the server contains -/// messages of type \a W. -template -class ClientAsyncWriter final : public ClientAsyncWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for - /// semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// associated with this call is updated, and the calling code can access - /// the received metadata through the \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - /// - attempts to fill in the \a response parameter passed to this class's - /// constructor with the server's response message. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncWriterFactory; - template - ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, - R* response, bool start, void* tag) - : context_(context), call_(call), started_(start) { - finish_ops_.RecvMessage(response); - finish_ops_.AllowNoMessage(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Async client-side interface for bi-directional streaming, -/// where the client-to-server message stream has messages of type \a W, -/// and the server-to-client message stream has messages of type \a R. -template -class ClientAsyncReaderWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncReaderWriterFactory { - public: - /// Create a stream object. - /// Start the RPC request if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent). If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - static ClientAsyncReaderWriter* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReaderWriter))) - ClientAsyncReaderWriter(call, context, start, tag); - } -}; -} // namespace internal - -/// Async client-side interface for bi-directional streaming, -/// where the outgoing message stream going to the server -/// has messages of type \a W, and the incoming message stream coming -/// from the server has messages of type \a R. -template -class ClientAsyncReaderWriter final - : public ClientAsyncReaderWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method - /// for semantics of this method. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// is updated with it, and then the receiving initial metadata can - /// be accessed through this \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// Side effect - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderWriterFactory; - ClientAsyncReaderWriter(grpc::internal::Call call, - grpc::ClientContext* context, bool start, void* tag) - : context_(context), call_(call), started_(start) { - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncReaderInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code - /// and also send out \a msg response to the client. - /// Request notification for when the server has sent the response and the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous - /// \a AsyncReaderInterface::Read operation with a non-ok result, - /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it - /// is safe to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// \param[in] msg To be sent to the client as the response for this call. - virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; - - /// Indicate that the stream is to be finished with a certain - /// non-OK status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// This call is meant to end the call with some error, and can be called at - /// any point that the server would like to "fail" the call (though note - /// this shouldn't be called concurrently with any other "sending" call, like - /// \a AsyncWriterInterface::Write). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), and status, or if some failure occurred - /// when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// - Note: \a status must have a non-OK code. - virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing client-streaming RPCs, -/// where the incoming message stream from the client has messages of type \a R, -/// and the single response message sent from the server is type \a W. -template -class ServerAsyncReader final : public ServerAsyncReaderInterface { - public: - explicit ServerAsyncReader(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// Note: \a msg is not sent if \a status has a non-OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once Finish returns. - void Finish(const W& msg, const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_ops_.SendMessage(msg)); - } else { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - void FinishWithError(const grpc::Status& status, void* tag) override { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation with a non-ok - /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish - /// in a single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing server streaming RPCs, -/// where the outgoing message stream from the server has messages of type \a W. -template -class ServerAsyncWriter final : public ServerAsyncWriterInterface { - public: - explicit ServerAsyncWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of - /// \a status,it may be non-OK - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Server-side interface for asynchronous bi-directional streaming. -template -class ServerAsyncReaderWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation - /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' - /// with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if some - /// failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish in a - /// single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing bidirectional streaming RPCs, -/// where the incoming message stream coming from the client has messages of -/// type \a R, and the outgoing message stream coming from the server has -/// messages of type \a W. -template -class ServerAsyncReaderWriter final - : public ServerAsyncReaderWriterInterface { - public: - explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - EnsureInitialMetadataSent(&write_ops_); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish - /// method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - // - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of \a status, - /// it may be non-OK - // - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class grpc::Server; - - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h index a9886031..02071e48 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h @@ -19,402 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H #define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -// Forward declaration for use in Helper class -template -class ClientAsyncResponseReader; - -/// An interface relevant for async client side unary RPCs (which send -/// one request message to a server and receive one response message). -template -class ClientAsyncResponseReaderInterface { - public: - virtual ~ClientAsyncResponseReaderInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall() = 0; - - /// Request notification of the reading of initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a Finish method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Request to receive the server's response \a msg and final \a status for - /// the call, and to notify \a tag on this call's completion queue when - /// finished. - /// - /// This function will return when either: - /// - when the server's response message and status have been received. - /// - when the server has returned a non-OK status (no message expected in - /// this case). - /// - when the call failed for some reason and the library generated a - /// non-OK status. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - /// \param[out] msg To be filled in with the server's response message. - virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; -}; - -namespace internal { - -class ClientAsyncResponseReaderHelper { - public: - /// Start a call and write the request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// - /// Optionally pass in a base class for request and response types so that the - /// internal functions and structs can be templated based on that, allowing - /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors - /// can't have an explicit template parameter, the last argument is an - /// extraneous parameter just to provide the needed type information. - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request) /* __attribute__((noinline)) */ { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - ClientAsyncResponseReader* result = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncResponseReader))) - ClientAsyncResponseReader(call, context); - SetupRequest( - call.call(), &result->single_buf_, &result->read_initial_metadata_, - &result->finish_, static_cast(request)); - - return result; - } - - // Various helper functions to reduce templating use - - template - static void SetupRequest( - grpc_call* call, - grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, - std::function* - read_initial_metadata, - std::function< - void(ClientContext*, internal::Call*, bool initial_metadata_read, - internal::CallOpSendInitialMetadata*, - internal::CallOpSetInterface**, void*, Status*, void*)>* finish, - const W& request) { - using SingleBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - SingleBufType* single_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(SingleBufType))) SingleBufType; - *single_buf_ptr = single_buf; - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); - single_buf->ClientSendClose(); - - // The purpose of the following functions is to type-erase the actual - // templated type of the CallOpSet being used by hiding that type inside the - // function definition rather than specifying it as an argument of the - // function or a member of the class. The type-erased CallOpSet will get - // static_cast'ed back to the real type so that it can be used properly. - *read_initial_metadata = - [](ClientContext* context, internal::Call* call, - internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - call->PerformOps(single_buf); - }; - - // Note that this function goes one step further than the previous one - // because it type-erases the message being written down to a void*. This - // will be static-cast'ed back to the class specified here by hiding that - // class information inside the function definition. Note that this feature - // expects the class being specified here for R to be a base-class of the - // "real" R without any multiple-inheritance (as applies in protbuf wrt - // MessageLite) - *finish = [](ClientContext* context, internal::Call* call, - bool initial_metadata_read, - internal::CallOpSendInitialMetadata* single_buf_view, - internal::CallOpSetInterface** finish_buf_ptr, void* msg, - Status* status, void* tag) { - if (initial_metadata_read) { - using FinishBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - FinishBufType* finish_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call->call(), sizeof(FinishBufType))) FinishBufType; - *finish_buf_ptr = finish_buf; - finish_buf->set_output_tag(tag); - finish_buf->RecvMessage(static_cast(msg)); - finish_buf->AllowNoMessage(); - finish_buf->ClientRecvStatus(context, status); - call->PerformOps(finish_buf); - } else { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - single_buf->RecvMessage(static_cast(msg)); - single_buf->AllowNoMessage(); - single_buf->ClientRecvStatus(context, status); - call->PerformOps(single_buf); - } - }; - } - - static void StartCall(grpc::ClientContext* context, - grpc::internal::CallOpSendInitialMetadata* single_buf) { - single_buf->SendInitialMetadata(&context->send_initial_metadata_, - context->initial_metadata_flags()); - } -}; - -// TODO(vjpai): This templated factory is deprecated and will be replaced by -//. the non-templated helper as soon as possible. -template -class ClientAsyncResponseReaderFactory { - public: - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request, bool start) { - auto* result = ClientAsyncResponseReaderHelper::Create( - channel, cq, method, context, request); - if (start) { - result->StartCall(); - } - return result; - } -}; - -} // namespace internal - -/// Async API for client-side unary RPCs, where the message response -/// received from the server is of type \a R. -template -class ClientAsyncResponseReader final - : public ClientAsyncResponseReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall() override { - GPR_CODEGEN_DEBUG_ASSERT(!started_); - started_ = true; - internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); - } - - /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for - /// semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); - read_initial_metadata_(context_, &call_, single_buf_, tag); - initial_metadata_read_ = true; - } - - /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(R* msg, grpc::Status* status, void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, - static_cast(msg), status, tag); - } - - private: - friend class internal::ClientAsyncResponseReaderHelper; - grpc::ClientContext* const context_; - grpc::internal::Call call_; - bool started_ = false; - bool initial_metadata_read_ = false; - - ClientAsyncResponseReader(grpc::internal::Call call, - grpc::ClientContext* context) - : context_(context), call_(call) {} - - // disable operator new - static void* operator new(std::size_t size); - static void* operator new(std::size_t /*size*/, void* p) { return p; } - - internal::CallOpSendInitialMetadata* single_buf_; - internal::CallOpSetInterface* finish_buf_ = nullptr; - std::function - read_initial_metadata_; - std::function - finish_; -}; - -/// Async server-side API for handling unary calls, where the single -/// response message sent to the client is of type \a W. -template -class ServerAsyncResponseWriter final - : public grpc::internal::ServerAsyncStreamingInterface { - public: - explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Side effect: - /// The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_buf_.set_output_tag(tag); - meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_buf_); - } - - /// Indicate that the stream is to be finished and request notification - /// when the server has sent the appropriate signals to the client to - /// end the call. Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// \param[in] msg Message to be sent to the client. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// Note: if \a status has a non-OK code, then \a msg will not be sent, - /// and the client will receive only the status with possible trailing - /// metadata. - /// - /// gRPC doesn't take ownership or a reference to msg and status, so it is - /// safe to deallocate them once the Finish operation is complete (i.e. a - /// result arrives in the completion queue). - void Finish(const W& msg, const grpc::Status& status, void* tag) { - finish_buf_.set_output_tag(tag); - finish_buf_.set_core_cq_tag(&finish_buf_); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_buf_.SendMessage(msg)); - } else { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_buf_); - } - - /// Indicate that the stream is to be finished with a non-OK status, - /// and request notification for when the server has finished sending the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// - Note: \a status must have a non-OK code. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// gRPC doesn't take ownership or a reference to status, so it is safe to - /// deallocate them once the Finish operation is complete (i.e. a result - /// arrives in the completion queue). - void FinishWithError(const grpc::Status& status, void* tag) { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_buf_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_buf_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_buf_; - grpc::internal::CallOpSet - finish_buf_; -}; - -} // namespace grpc - -namespace std { -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -} // namespace std +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h index 7ca7c4b2..6f566e76 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h @@ -19,221 +19,13 @@ #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H #define GRPCPP_SUPPORT_BYTE_BUFFER_H -#include - #include #include #include -#include +#include // IWYU pragma: export #include #include #include #include -namespace grpc { - -class ServerInterface; -class ByteBuffer; -class ServerInterface; - -namespace internal { -template -class CallbackUnaryHandler; -template -class CallbackServerStreamingHandler; -template -void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); -template -class ServerStreamingHandler; -template -class ErrorMethodHandler; -class CallOpSendMessage; -template -class CallOpRecvMessage; -class CallOpGenericRecvMessage; -class ExternalConnectionAcceptorImpl; -template -class DeserializeFuncType; -class GrpcByteBufferPeer; - -} // namespace internal -/// A sequence of bytes. -class ByteBuffer final { - public: - /// Constuct an empty buffer. - ByteBuffer() : buffer_(nullptr) {} - - /// Construct buffer from \a slices, of which there are \a nslices. - ByteBuffer(const Slice* slices, size_t nslices) { - // The following assertions check that the representation of a grpc::Slice - // is identical to that of a grpc_slice: it has a grpc_slice field, and - // nothing else. - static_assert(std::is_same::value, - "Slice must have same representation as grpc_slice"); - static_assert(sizeof(Slice) == sizeof(grpc_slice), - "Slice must have same representation as grpc_slice"); - // The following assertions check that the representation of a ByteBuffer is - // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, - // and nothing else. - static_assert(std::is_same::value, - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - // The const_cast is legal if grpc_raw_byte_buffer_create() does no more - // than its advertised side effect of increasing the reference count of the - // slices it processes, and such an increase does not affect the semantics - // seen by the caller of this constructor. - buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( - reinterpret_cast(const_cast(slices)), nslices); - } - - /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } - - ~ByteBuffer() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - } - } - - /// Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer& operator=(const ByteBuffer& buf) { - if (this != &buf) { - Clear(); // first remove existing data - } - if (buf.buffer_) { - // then copy - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); - } - return *this; - } - - // If this ByteBuffer's representation is a single flat slice, returns a - // slice referencing that array. - Status TrySingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slics. - Status DumpToSingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slices. - Status Dump(std::vector* slices) const; - - /// Remove all data. - void Clear() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - buffer_ = nullptr; - } - } - - /// Make a duplicate copy of the internals of this byte - /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. - /// This is not a deep copy; it is a referencing and its performance - /// is size-independent. - void Duplicate() { - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); - } - - /// Forget underlying byte buffer without destroying - /// Use this only for un-owned byte buffers - void Release() { buffer_ = nullptr; } - - /// Buffer size in bytes. - size_t Length() const { - return buffer_ == nullptr - ? 0 - : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); - } - - /// Swap the state of *this and *other. - void Swap(ByteBuffer* other) { - grpc_byte_buffer* tmp = other->buffer_; - other->buffer_ = buffer_; - buffer_ = tmp; - } - - /// Is this ByteBuffer valid? - bool Valid() const { return (buffer_ != nullptr); } - - private: - friend class SerializationTraits; - friend class ServerInterface; - friend class internal::CallOpSendMessage; - template - friend class internal::CallOpRecvMessage; - friend class internal::CallOpGenericRecvMessage; - template - friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, - grpc::Status*, RequestType*); - template - friend class internal::ServerStreamingHandler; - template - friend class internal::CallbackUnaryHandler; - template - friend class internal::CallbackServerStreamingHandler; - template - friend class internal::ErrorMethodHandler; - template - friend class internal::DeserializeFuncType; - friend class ProtoBufferReader; - friend class ProtoBufferWriter; - friend class internal::GrpcByteBufferPeer; - friend class internal::ExternalConnectionAcceptorImpl; - - grpc_byte_buffer* buffer_; - - // takes ownership - void set_buffer(grpc_byte_buffer* buf) { - if (buffer_) { - Clear(); - } - buffer_ = buf; - } - - grpc_byte_buffer* c_buffer() { return buffer_; } - grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } - - class ByteBufferPointer { - public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ - ByteBufferPointer(const ByteBuffer* b) - : bbuf_(const_cast(b)) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator ByteBuffer*() { return bbuf_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer*() { return bbuf_->buffer_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer**() { return &bbuf_->buffer_; } - - private: - ByteBuffer* bbuf_; - }; - ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } -}; - -template <> -class SerializationTraits { - public: - static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { - dest->set_buffer(byte_buffer->buffer_); - return Status::OK; - } - static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, - bool* own_buffer) { - *buffer = source; - *own_buffer = true; - return g_core_codegen_interface->ok(); - } -}; - -} // namespace grpc - #endif // GRPCPP_SUPPORT_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h index 8e5e1ce6..552cab4c 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h @@ -19,179 +19,6 @@ #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H -#include -#include - -#include -#include -#include - -namespace grpc { - -class Channel; -class ClientContext; - -namespace internal { -class InterceptorBatchMethodsImpl; -} - -namespace experimental { -class ClientRpcInfo; - -// A factory interface for creation of client interceptors. A vector of -// factories can be provided at channel creation which will be used to create a -// new vector of client interceptors per RPC. Client interceptor authors should -// create a subclass of ClientInterceptorFactorInterface which creates objects -// of their interceptors. -class ClientInterceptorFactoryInterface { - public: - virtual ~ClientInterceptorFactoryInterface() {} - // Returns a pointer to an Interceptor object on successful creation, nullptr - // otherwise. If nullptr is returned, this server interceptor factory is - // ignored for the purposes of that RPC. - virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; -}; -} // namespace experimental - -namespace internal { -extern experimental::ClientInterceptorFactoryInterface* - g_global_client_interceptor_factory; -} - -/// ClientRpcInfo represents the state of a particular RPC as it -/// appears to an interceptor. It is created and owned by the library and -/// passed to the CreateClientInterceptor method of the application's -/// ClientInterceptorFactoryInterface implementation -namespace experimental { -class ClientRpcInfo { - public: - // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN - // from the list of possible Types. - /// Type categorizes RPCs by unary or streaming type - enum class Type { - UNARY, - CLIENT_STREAMING, - SERVER_STREAMING, - BIDI_STREAMING, - UNKNOWN // UNKNOWN is not API and will be removed later - }; - - ~ClientRpcInfo() {} - - // Delete copy constructor but allow default move constructor - ClientRpcInfo(const ClientRpcInfo&) = delete; - ClientRpcInfo(ClientRpcInfo&&) = default; - - // Getter methods - - /// Return the fully-specified method name - const char* method() const { return method_; } - - /// Return an identifying suffix for the client stub, or nullptr if one wasn't - /// specified. - const char* suffix_for_stats() const { return suffix_for_stats_; } - - /// Return a pointer to the channel on which the RPC is being sent - ChannelInterface* channel() { return channel_; } - - /// Return a pointer to the underlying ClientContext structure associated - /// with the RPC to support features that apply to it - grpc::ClientContext* client_context() { return ctx_; } - - /// Return the type of the RPC (unary or a streaming flavor) - Type type() const { return type_; } - - private: - static_assert(Type::UNARY == - static_cast(internal::RpcMethod::NORMAL_RPC), - "violated expectation about Type enum"); - static_assert(Type::CLIENT_STREAMING == - static_cast(internal::RpcMethod::CLIENT_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::SERVER_STREAMING == - static_cast(internal::RpcMethod::SERVER_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::BIDI_STREAMING == - static_cast(internal::RpcMethod::BIDI_STREAMING), - "violated expectation about Type enum"); - - // Default constructor should only be used by ClientContext - ClientRpcInfo() = default; - - // Constructor will only be called from ClientContext - ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, - const char* method, const char* suffix_for_stats, - grpc::ChannelInterface* channel) - : ctx_(ctx), - type_(static_cast(type)), - method_(method), - suffix_for_stats_(suffix_for_stats), - channel_(channel) {} - - // Move assignment should only be used by ClientContext - // TODO(yashykt): Delete move assignment - ClientRpcInfo& operator=(ClientRpcInfo&&) = default; - - // Runs interceptor at pos \a pos. - void RunInterceptor( - experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { - GPR_CODEGEN_ASSERT(pos < interceptors_.size()); - interceptors_[pos]->Intercept(interceptor_methods); - } - - void RegisterInterceptors( - const std::vector>& creators, - size_t interceptor_pos) { - if (interceptor_pos > creators.size()) { - // No interceptors to register - return; - } - // NOTE: The following is not a range-based for loop because it will only - // iterate over a portion of the creators vector. - for (auto it = creators.begin() + interceptor_pos; it != creators.end(); - ++it) { - auto* interceptor = (*it)->CreateClientInterceptor(this); - if (interceptor != nullptr) { - interceptors_.push_back( - std::unique_ptr(interceptor)); - } - } - if (internal::g_global_client_interceptor_factory != nullptr) { - interceptors_.push_back(std::unique_ptr( - internal::g_global_client_interceptor_factory - ->CreateClientInterceptor(this))); - } - } - - grpc::ClientContext* ctx_ = nullptr; - // TODO(yashykt): make type_ const once move-assignment is deleted - Type type_{Type::UNKNOWN}; - const char* method_ = nullptr; - const char* suffix_for_stats_ = nullptr; - grpc::ChannelInterface* channel_ = nullptr; - std::vector> interceptors_; - bool hijacked_ = false; - size_t hijacked_interceptor_ = 0; - - friend class internal::InterceptorBatchMethodsImpl; - friend class grpc::ClientContext; -}; - -// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL -// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. -// Registers a global client interceptor factory object, which is used for all -// RPCs made in this process. The application is responsible for maintaining the -// life of the object while gRPC operations are in progress. The global -// interceptor factory should only be registered once at the start of the -// process before any gRPC operations have begun. -void RegisterGlobalClientInterceptorFactory( - ClientInterceptorFactoryInterface* factory); - -// For testing purposes only -void TestOnlyResetGlobalClientInterceptorFactory(); - -} // namespace experimental -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist index 3c7e8970..7a2e5e54 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist +++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ index 112f729a..140f10b4 100644 Binary files a/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ and b/FirebaseFirestore/gRPC-C++.xcframework/ios-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ differ diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/channel.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/channel.h index 5681377c..ec8702e4 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/channel.h @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include struct grpc_channel; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/create_channel.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/create_channel.h index df015b98..4b94a08e 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/create_channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/create_channel.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include #include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h index e16affa7..b42d2e22 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h @@ -24,8 +24,6 @@ #import "grpcpp.h" #import "health_check_service_interface.h" #import "impl/call.h" -#import "impl/call_hook.h" -#import "impl/call_op_set_interface.h" #import "impl/channel_argument_option.h" #import "impl/client_unary_call.h" #import "impl/codegen/async_generic_service.h" diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/generic/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/generic/async_generic_service.h index 5ff98267..01c79428 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/generic/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/generic/async_generic_service.h @@ -19,117 +19,6 @@ #ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H #define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H -#include - -#include -#include -#include -#include - -struct grpc_server; - -namespace grpc { - -typedef ServerAsyncReaderWriter - GenericServerAsyncReaderWriter; -typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; -typedef ServerAsyncReader GenericServerAsyncReader; -typedef ServerAsyncWriter GenericServerAsyncWriter; - -class GenericServerContext final : public ServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class ServerInterface; - - std::string method_; - std::string host_; -}; - -// A generic service at the server side accepts all RPC methods and hosts. It is -// typically used in proxies. The generic service can be registered to a server -// which also has other services. -// Sample usage: -// ServerBuilder builder; -// auto cq = builder.AddCompletionQueue(); -// AsyncGenericService generic_service; -// builder.RegisterAsyncGenericService(&generic_service); -// auto server = builder.BuildAndStart(); -// -// // request a new call -// GenericServerContext context; -// GenericServerAsyncReaderWriter stream; -// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); -// -// When tag is retrieved from cq->Next(), context.method() can be used to look -// at the method and the RPC can be handled accordingly. -class AsyncGenericService final { - public: - AsyncGenericService() : server_(nullptr) {} - - void RequestCall(GenericServerContext* ctx, - GenericServerAsyncReaderWriter* reader_writer, - grpc::CompletionQueue* call_cq, - grpc::ServerCompletionQueue* notification_cq, void* tag); - - private: - friend class grpc::Server; - grpc::Server* server_; -}; - -/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs -/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with -/// ByteBuffer arguments. -using ServerGenericBidiReactor = ServerBidiReactor; - -class GenericCallbackServerContext final : public grpc::CallbackServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class grpc::Server; - - std::string method_; - std::string host_; -}; - -/// \a CallbackGenericService is the base class for generic services implemented -/// using the callback API and registered through the ServerBuilder using -/// RegisterCallbackGenericService. -class CallbackGenericService { - public: - CallbackGenericService() {} - virtual ~CallbackGenericService() {} - - /// The "method handler" for the generic API. This function should be - /// overridden to provide a ServerGenericBidiReactor that implements the - /// application-level interface for this RPC. Unimplemented by default. - virtual ServerGenericBidiReactor* CreateReactor( - GenericCallbackServerContext* /*ctx*/) { - class Reactor : public ServerGenericBidiReactor { - public: - Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } - void OnDone() override { delete this; } - }; - return new Reactor; - } - - private: - friend class grpc::Server; - - internal::CallbackBidiHandler* Handler() { - return new internal::CallbackBidiHandler( - [this](grpc::CallbackServerContext* ctx) { - return CreateReactor(static_cast(ctx)); - }); - } - - grpc::Server* server_{nullptr}; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call.h index 2a119963..97d8fdfc 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call.h @@ -19,76 +19,6 @@ #ifndef GRPCPP_IMPL_CALL_H #define GRPCPP_IMPL_CALL_H -#include -#include - -namespace grpc { -class CompletionQueue; -namespace experimental { -class ClientRpcInfo; -class ServerRpcInfo; -} // namespace experimental -namespace internal { -class CallHook; -class CallOpSetInterface; - -/// Straightforward wrapping of the C call object -class Call final { - public: - Call() - : call_hook_(nullptr), - cq_(nullptr), - call_(nullptr), - max_receive_message_size_(-1) {} - /** call is owned by the caller */ - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - experimental::ClientRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1), - client_rpc_info_(rpc_info) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(max_receive_message_size), - server_rpc_info_(rpc_info) {} - - void PerformOps(CallOpSetInterface* ops) { - call_hook_->PerformOpsOnCall(ops, this); - } - - grpc_call* call() const { return call_; } - grpc::CompletionQueue* cq() const { return cq_; } - - int max_receive_message_size() const { return max_receive_message_size_; } - - experimental::ClientRpcInfo* client_rpc_info() const { - return client_rpc_info_; - } - - experimental::ServerRpcInfo* server_rpc_info() const { - return server_rpc_info_; - } - - private: - CallHook* call_hook_; - grpc::CompletionQueue* cq_; - grpc_call* call_; - int max_receive_message_size_; - experimental::ClientRpcInfo* client_rpc_info_ = nullptr; - experimental::ServerRpcInfo* server_rpc_info_ = nullptr; -}; -} // namespace internal -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_IMPL_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call_hook.h deleted file mode 100644 index 8903b9a0..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call_hook.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_HOOK_H -#define GRPCPP_IMPL_CALL_HOOK_H - -namespace grpc { - -namespace internal { -class CallOpSetInterface; -class Call; - -/// This is an interface that Channel and Server implement to allow them to hook -/// performing ops. -class CallHook { - public: - virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; -}; -} // namespace internal - -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h deleted file mode 100644 index 43ed4ed9..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H -#define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H - -// IWYU pragma: private - -#include - -namespace grpc { -namespace internal { - -class Call; - -/// An abstract collection of call ops, used to generate the -/// grpc_call_op structure to pass down to the lower layers, -/// and as it is-a CompletionQueueTag, also massages the final -/// completion into the correct form for consumption in the C++ -/// API. -class CallOpSetInterface : public CompletionQueueTag { - public: - /// Fills in grpc_op, starting from ops[*nops] and moving - /// upwards. - virtual void FillOps(internal::Call* call) = 0; - - /// Get the tag to be used at the core completion queue. Generally, the - /// value of core_cq_tag will be "this". However, it can be overridden if we - /// want core to process the tag differently (e.g., as a core callback) - virtual void* core_cq_tag() = 0; - - // This will be called while interceptors are run if the RPC is a hijacked - // RPC. This should set hijacking state for each of the ops. - virtual void SetHijackingState() = 0; - - // Should be called after interceptors are done running - virtual void ContinueFillOpsAfterInterception() = 0; - - // Should be called after interceptors are done running on the finalize result - // path - virtual void ContinueFinalizeResultAfterInterception() = 0; -}; -} // namespace internal -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h index 03a096c5..2a000662 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h @@ -19,9 +19,119 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H #define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include + +struct grpc_server; + +namespace grpc { + +typedef ServerAsyncReaderWriter + GenericServerAsyncReaderWriter; +typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; +typedef ServerAsyncReader GenericServerAsyncReader; +typedef ServerAsyncWriter GenericServerAsyncWriter; + +class GenericServerContext final : public ServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class ServerInterface; + + std::string method_; + std::string host_; +}; + +// A generic service at the server side accepts all RPC methods and hosts. It is +// typically used in proxies. The generic service can be registered to a server +// which also has other services. +// Sample usage: +// ServerBuilder builder; +// auto cq = builder.AddCompletionQueue(); +// AsyncGenericService generic_service; +// builder.RegisterAsyncGenericService(&generic_service); +// auto server = builder.BuildAndStart(); +// +// // request a new call +// GenericServerContext context; +// GenericServerAsyncReaderWriter stream; +// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); +// +// When tag is retrieved from cq->Next(), context.method() can be used to look +// at the method and the RPC can be handled accordingly. +class AsyncGenericService final { + public: + AsyncGenericService() : server_(nullptr) {} + + void RequestCall(GenericServerContext* ctx, + GenericServerAsyncReaderWriter* reader_writer, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag); + + private: + friend class grpc::Server; + grpc::Server* server_; +}; + +/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs +/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with +/// ByteBuffer arguments. +using ServerGenericBidiReactor = ServerBidiReactor; + +class GenericCallbackServerContext final : public grpc::CallbackServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class grpc::Server; + + std::string method_; + std::string host_; +}; + +/// \a CallbackGenericService is the base class for generic services implemented +/// using the callback API and registered through the ServerBuilder using +/// RegisterCallbackGenericService. +class CallbackGenericService { + public: + CallbackGenericService() {} + virtual ~CallbackGenericService() {} + + /// The "method handler" for the generic API. This function should be + /// overridden to provide a ServerGenericBidiReactor that implements the + /// application-level interface for this RPC. Unimplemented by default. + virtual ServerGenericBidiReactor* CreateReactor( + GenericCallbackServerContext* /*ctx*/) { + class Reactor : public ServerGenericBidiReactor { + public: + Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } + void OnDone() override { delete this; } + }; + return new Reactor; + } + + private: + friend class grpc::Server; + + internal::CallbackBidiHandler* Handler() { + return new internal::CallbackBidiHandler( + [this](grpc::CallbackServerContext* ctx) { + return CreateReactor(static_cast(ctx)); + }); + } + + grpc::Server* server_{nullptr}; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h index 524f619f..5b63c301 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h @@ -18,9 +18,1115 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +namespace grpc { + +namespace internal { +/// Common interface for all client side asynchronous streaming. +class ClientAsyncStreamingInterface { + public: + virtual ~ClientAsyncStreamingInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall(void* tag) = 0; + + /// Request notification of the reading of the initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a AsyncReaderInterface::Read method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Indicate that the stream is to be finished and request notification for + /// when the call has been ended. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method exactly once when both: + /// * the client side has no more message to send + /// (this can be declared implicitly by calling this method, or + /// explicitly through an earlier call to the WritesDone method + /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or + /// \a ClientAsyncReaderWriterInterface::WritesDone). + /// * there are no more messages to be received from the server (this can + /// be known implicitly by the calling code, or explicitly from an + /// earlier call to \a AsyncReaderInterface::Read that yielded a failed + /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// The tag will be returned when either: + /// - all incoming messages have been read and the server has returned + /// a status. + /// - the server has returned a non-OK status. + /// - the call failed for some reason and the library generated a + /// status. + /// + /// Note that implementations of this method attempt to receive initial + /// metadata from the server if initial metadata hasn't yet been received. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + virtual void Finish(grpc::Status* status, void* tag) = 0; +}; + +/// An interface that yields a sequence of messages of type \a R. +template +class AsyncReaderInterface { + public: + virtual ~AsyncReaderInterface() {} + + /// Read a message of type \a R into \a msg. Completion will be notified by \a + /// tag on the associated completion queue. + /// This is thread-safe with respect to \a Write or \a WritesDone methods. It + /// should not be called concurrently with other streaming APIs + /// on the same stream. It is not meaningful to call it concurrently + /// with another \a AsyncReaderInterface::Read on the same stream since reads + /// on the same stream are delivered in order. + /// + /// \param[out] msg Where to eventually store the read message. + /// \param[in] tag The tag identifying the operation. + /// + /// Side effect: note that this method attempt to receive initial metadata for + /// a stream if it hasn't yet been received. + virtual void Read(R* msg, void* tag) = 0; +}; + +/// An interface that can be fed a sequence of messages of type \a W. +template +class AsyncWriterInterface { + public: + virtual ~AsyncWriterInterface() {} + + /// Request the writing of \a msg with identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, void* tag) = 0; + + /// Request the writing of \a msg using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// WriteOptions \a options is used to set the write options of this message. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with the writing + /// of trailing metadata, using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// For client, WriteLast is equivalent of performing Write and + /// WritesDone in a single step. + /// For server, WriteLast buffers the \a msg. The writing of \a msg is held + /// until Finish is called, where \a msg and trailing metadata are coalesced + /// and write is initiated. Note that WriteLast can only buffer \a msg up to + /// the flow control window size. If \a msg size is larger than the window + /// size, it will be sent on wire without buffering. + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { + Write(msg, options.set_last_message(), tag); + } +}; + +} // namespace internal + +template +class ClientAsyncReaderInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncReaderInterface {}; + +namespace internal { +template +class ClientAsyncReaderFactory { + public: + /// Create a stream object. + /// Write the first request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started and + /// \a request has been written out. If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + template + static ClientAsyncReader* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, + const W& request, bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReader))) + ClientAsyncReader(call, context, request, start, tag); + } +}; +} // namespace internal + +/// Async client-side API for doing server-streaming RPCs, +/// where the incoming message stream coming from the server has +/// messages of type \a R. +template +class ClientAsyncReader final : public ClientAsyncReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata + /// method for semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, + /// the \a ClientContext associated with this call is updated, and the + /// calling code can access the received metadata through the + /// \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderFactory; + template + ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, + const W& request, bool start, void* tag) + : context_(context), call_(call), started_(start) { + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); + init_ops_.ClientSendClose(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + init_ops_.set_output_tag(tag); + call_.PerformOps(&init_ops_); + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + init_ops_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Common interface for client side asynchronous writing. +template +class ClientAsyncWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncWriterFactory { + public: + /// Create a stream object. + /// Start the RPC if \a start is set + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, \a tag must be nullptr and the actual call + /// must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// \a response will be filled in with the single expected response + /// message from the server upon a successful call to the \a Finish + /// method of this instance. + template + static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncWriter))) + ClientAsyncWriter(call, context, response, start, tag); + } +}; +} // namespace internal + +/// Async API on the client side for doing client-streaming RPCs, +/// where the outgoing message stream going to the server contains +/// messages of type \a W. +template +class ClientAsyncWriter final : public ClientAsyncWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for + /// semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// associated with this call is updated, and the calling code can access + /// the received metadata through the \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + /// - attempts to fill in the \a response parameter passed to this class's + /// constructor with the server's response message. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncWriterFactory; + template + ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, + R* response, bool start, void* tag) + : context_(context), call_(call), started_(start) { + finish_ops_.RecvMessage(response); + finish_ops_.AllowNoMessage(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Async client-side interface for bi-directional streaming, +/// where the client-to-server message stream has messages of type \a W, +/// and the server-to-client message stream has messages of type \a R. +template +class ClientAsyncReaderWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncReaderWriterFactory { + public: + /// Create a stream object. + /// Start the RPC request if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent). If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + static ClientAsyncReaderWriter* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReaderWriter))) + ClientAsyncReaderWriter(call, context, start, tag); + } +}; +} // namespace internal + +/// Async client-side interface for bi-directional streaming, +/// where the outgoing message stream going to the server +/// has messages of type \a W, and the incoming message stream coming +/// from the server has messages of type \a R. +template +class ClientAsyncReaderWriter final + : public ClientAsyncReaderWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method + /// for semantics of this method. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// is updated with it, and then the receiving initial metadata can + /// be accessed through this \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// Side effect + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderWriterFactory; + ClientAsyncReaderWriter(grpc::internal::Call call, + grpc::ClientContext* context, bool start, void* tag) + : context_(context), call_(call), started_(start) { + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncReaderInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code + /// and also send out \a msg response to the client. + /// Request notification for when the server has sent the response and the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous + /// \a AsyncReaderInterface::Read operation with a non-ok result, + /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it + /// is safe to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// \param[in] msg To be sent to the client as the response for this call. + virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; + + /// Indicate that the stream is to be finished with a certain + /// non-OK status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// This call is meant to end the call with some error, and can be called at + /// any point that the server would like to "fail" the call (though note + /// this shouldn't be called concurrently with any other "sending" call, like + /// \a AsyncWriterInterface::Write). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), and status, or if some failure occurred + /// when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// - Note: \a status must have a non-OK code. + virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing client-streaming RPCs, +/// where the incoming message stream from the client has messages of type \a R, +/// and the single response message sent from the server is type \a W. +template +class ServerAsyncReader final : public ServerAsyncReaderInterface { + public: + explicit ServerAsyncReader(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// Note: \a msg is not sent if \a status has a non-OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once Finish returns. + void Finish(const W& msg, const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_ops_.SendMessage(msg)); + } else { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + void FinishWithError(const grpc::Status& status, void* tag) override { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation with a non-ok + /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish + /// in a single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing server streaming RPCs, +/// where the outgoing message stream from the server has messages of type \a W. +template +class ServerAsyncWriter final : public ServerAsyncWriterInterface { + public: + explicit ServerAsyncWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of + /// \a status,it may be non-OK + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Server-side interface for asynchronous bi-directional streaming. +template +class ServerAsyncReaderWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation + /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' + /// with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if some + /// failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish in a + /// single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing bidirectional streaming RPCs, +/// where the incoming message stream coming from the client has messages of +/// type \a R, and the outgoing message stream coming from the server has +/// messages of type \a W. +template +class ServerAsyncReaderWriter final + : public ServerAsyncReaderWriterInterface { + public: + explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + EnsureInitialMetadataSent(&write_ops_); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish + /// method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + // + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of \a status, + /// it may be non-OK + // + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class grpc::Server; + + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h index 55227b2e..0034d210 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h @@ -19,9 +19,402 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { + +// Forward declaration for use in Helper class +template +class ClientAsyncResponseReader; + +/// An interface relevant for async client side unary RPCs (which send +/// one request message to a server and receive one response message). +template +class ClientAsyncResponseReaderInterface { + public: + virtual ~ClientAsyncResponseReaderInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall() = 0; + + /// Request notification of the reading of initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a Finish method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Request to receive the server's response \a msg and final \a status for + /// the call, and to notify \a tag on this call's completion queue when + /// finished. + /// + /// This function will return when either: + /// - when the server's response message and status have been received. + /// - when the server has returned a non-OK status (no message expected in + /// this case). + /// - when the call failed for some reason and the library generated a + /// non-OK status. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + /// \param[out] msg To be filled in with the server's response message. + virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; +}; + +namespace internal { + +class ClientAsyncResponseReaderHelper { + public: + /// Start a call and write the request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// + /// Optionally pass in a base class for request and response types so that the + /// internal functions and structs can be templated based on that, allowing + /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors + /// can't have an explicit template parameter, the last argument is an + /// extraneous parameter just to provide the needed type information. + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request) /* __attribute__((noinline)) */ { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + ClientAsyncResponseReader* result = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncResponseReader))) + ClientAsyncResponseReader(call, context); + SetupRequest( + call.call(), &result->single_buf_, &result->read_initial_metadata_, + &result->finish_, static_cast(request)); + + return result; + } + + // Various helper functions to reduce templating use + + template + static void SetupRequest( + grpc_call* call, + grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, + std::function* + read_initial_metadata, + std::function< + void(ClientContext*, internal::Call*, bool initial_metadata_read, + internal::CallOpSendInitialMetadata*, + internal::CallOpSetInterface**, void*, Status*, void*)>* finish, + const W& request) { + using SingleBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + SingleBufType* single_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(SingleBufType))) SingleBufType; + *single_buf_ptr = single_buf; + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); + single_buf->ClientSendClose(); + + // The purpose of the following functions is to type-erase the actual + // templated type of the CallOpSet being used by hiding that type inside the + // function definition rather than specifying it as an argument of the + // function or a member of the class. The type-erased CallOpSet will get + // static_cast'ed back to the real type so that it can be used properly. + *read_initial_metadata = + [](ClientContext* context, internal::Call* call, + internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + call->PerformOps(single_buf); + }; + + // Note that this function goes one step further than the previous one + // because it type-erases the message being written down to a void*. This + // will be static-cast'ed back to the class specified here by hiding that + // class information inside the function definition. Note that this feature + // expects the class being specified here for R to be a base-class of the + // "real" R without any multiple-inheritance (as applies in protbuf wrt + // MessageLite) + *finish = [](ClientContext* context, internal::Call* call, + bool initial_metadata_read, + internal::CallOpSendInitialMetadata* single_buf_view, + internal::CallOpSetInterface** finish_buf_ptr, void* msg, + Status* status, void* tag) { + if (initial_metadata_read) { + using FinishBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + FinishBufType* finish_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call->call(), sizeof(FinishBufType))) FinishBufType; + *finish_buf_ptr = finish_buf; + finish_buf->set_output_tag(tag); + finish_buf->RecvMessage(static_cast(msg)); + finish_buf->AllowNoMessage(); + finish_buf->ClientRecvStatus(context, status); + call->PerformOps(finish_buf); + } else { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + single_buf->RecvMessage(static_cast(msg)); + single_buf->AllowNoMessage(); + single_buf->ClientRecvStatus(context, status); + call->PerformOps(single_buf); + } + }; + } + + static void StartCall(grpc::ClientContext* context, + grpc::internal::CallOpSendInitialMetadata* single_buf) { + single_buf->SendInitialMetadata(&context->send_initial_metadata_, + context->initial_metadata_flags()); + } +}; + +// TODO(vjpai): This templated factory is deprecated and will be replaced by +//. the non-templated helper as soon as possible. +template +class ClientAsyncResponseReaderFactory { + public: + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request, bool start) { + auto* result = ClientAsyncResponseReaderHelper::Create( + channel, cq, method, context, request); + if (start) { + result->StartCall(); + } + return result; + } +}; + +} // namespace internal + +/// Async API for client-side unary RPCs, where the message response +/// received from the server is of type \a R. +template +class ClientAsyncResponseReader final + : public ClientAsyncResponseReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall() override { + GPR_CODEGEN_DEBUG_ASSERT(!started_); + started_ = true; + internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); + } + + /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for + /// semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); + read_initial_metadata_(context_, &call_, single_buf_, tag); + initial_metadata_read_ = true; + } + + /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(R* msg, grpc::Status* status, void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, + static_cast(msg), status, tag); + } + + private: + friend class internal::ClientAsyncResponseReaderHelper; + grpc::ClientContext* const context_; + grpc::internal::Call call_; + bool started_ = false; + bool initial_metadata_read_ = false; + + ClientAsyncResponseReader(grpc::internal::Call call, + grpc::ClientContext* context) + : context_(context), call_(call) {} + + // disable operator new + static void* operator new(std::size_t size); + static void* operator new(std::size_t /*size*/, void* p) { return p; } + + internal::CallOpSendInitialMetadata* single_buf_; + internal::CallOpSetInterface* finish_buf_ = nullptr; + std::function + read_initial_metadata_; + std::function + finish_; +}; + +/// Async server-side API for handling unary calls, where the single +/// response message sent to the client is of type \a W. +template +class ServerAsyncResponseWriter final + : public grpc::internal::ServerAsyncStreamingInterface { + public: + explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Side effect: + /// The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_buf_.set_output_tag(tag); + meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_buf_); + } + + /// Indicate that the stream is to be finished and request notification + /// when the server has sent the appropriate signals to the client to + /// end the call. Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// \param[in] msg Message to be sent to the client. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// Note: if \a status has a non-OK code, then \a msg will not be sent, + /// and the client will receive only the status with possible trailing + /// metadata. + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). + void Finish(const W& msg, const grpc::Status& status, void* tag) { + finish_buf_.set_output_tag(tag); + finish_buf_.set_core_cq_tag(&finish_buf_); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_buf_.SendMessage(msg)); + } else { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_buf_); + } + + /// Indicate that the stream is to be finished with a non-OK status, + /// and request notification for when the server has finished sending the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// - Note: \a status must have a non-OK code. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). + void FinishWithError(const grpc::Status& status, void* tag) { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_buf_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_buf_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_buf_; + grpc::internal::CallOpSet + finish_buf_; +}; + +} // namespace grpc + +namespace std { +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +} // namespace std #endif // GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h index d1969953..a9ba7d16 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h @@ -19,9 +19,221 @@ #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include +#include +#include + +namespace grpc { + +class ServerInterface; +class ByteBuffer; +class ServerInterface; + +namespace internal { +template +class CallbackUnaryHandler; +template +class CallbackServerStreamingHandler; +template +void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); +template +class ServerStreamingHandler; +template +class ErrorMethodHandler; +class CallOpSendMessage; +template +class CallOpRecvMessage; +class CallOpGenericRecvMessage; +class ExternalConnectionAcceptorImpl; +template +class DeserializeFuncType; +class GrpcByteBufferPeer; + +} // namespace internal +/// A sequence of bytes. +class ByteBuffer final { + public: + /// Constuct an empty buffer. + ByteBuffer() : buffer_(nullptr) {} + + /// Construct buffer from \a slices, of which there are \a nslices. + ByteBuffer(const Slice* slices, size_t nslices) { + // The following assertions check that the representation of a grpc::Slice + // is identical to that of a grpc_slice: it has a grpc_slice field, and + // nothing else. + static_assert(std::is_same::value, + "Slice must have same representation as grpc_slice"); + static_assert(sizeof(Slice) == sizeof(grpc_slice), + "Slice must have same representation as grpc_slice"); + // The following assertions check that the representation of a ByteBuffer is + // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, + // and nothing else. + static_assert(std::is_same::value, + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + // The const_cast is legal if grpc_raw_byte_buffer_create() does no more + // than its advertised side effect of increasing the reference count of the + // slices it processes, and such an increase does not affect the semantics + // seen by the caller of this constructor. + buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( + reinterpret_cast(const_cast(slices)), nslices); + } + + /// Constuct a byte buffer by referencing elements of existing buffer + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } + + ~ByteBuffer() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + } + } + + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer& operator=(const ByteBuffer& buf) { + if (this != &buf) { + Clear(); // first remove existing data + } + if (buf.buffer_) { + // then copy + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); + } + return *this; + } + + // If this ByteBuffer's representation is a single flat slice, returns a + // slice referencing that array. + Status TrySingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slics. + Status DumpToSingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slices. + Status Dump(std::vector* slices) const; + + /// Remove all data. + void Clear() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + buffer_ = nullptr; + } + } + + /// Make a duplicate copy of the internals of this byte + /// buffer so that we have our own owned version of it. + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. + void Duplicate() { + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); + } + + /// Forget underlying byte buffer without destroying + /// Use this only for un-owned byte buffers + void Release() { buffer_ = nullptr; } + + /// Buffer size in bytes. + size_t Length() const { + return buffer_ == nullptr + ? 0 + : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); + } + + /// Swap the state of *this and *other. + void Swap(ByteBuffer* other) { + grpc_byte_buffer* tmp = other->buffer_; + other->buffer_ = buffer_; + buffer_ = tmp; + } + + /// Is this ByteBuffer valid? + bool Valid() const { return (buffer_ != nullptr); } + + private: + friend class SerializationTraits; + friend class ServerInterface; + friend class internal::CallOpSendMessage; + template + friend class internal::CallOpRecvMessage; + friend class internal::CallOpGenericRecvMessage; + template + friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, + grpc::Status*, RequestType*); + template + friend class internal::ServerStreamingHandler; + template + friend class internal::CallbackUnaryHandler; + template + friend class internal::CallbackServerStreamingHandler; + template + friend class internal::ErrorMethodHandler; + template + friend class internal::DeserializeFuncType; + friend class ProtoBufferReader; + friend class ProtoBufferWriter; + friend class internal::GrpcByteBufferPeer; + friend class internal::ExternalConnectionAcceptorImpl; + + grpc_byte_buffer* buffer_; + + // takes ownership + void set_buffer(grpc_byte_buffer* buf) { + if (buffer_) { + Clear(); + } + buffer_ = buf; + } + + grpc_byte_buffer* c_buffer() { return buffer_; } + grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } + + class ByteBufferPointer { + public: + /* NOLINTNEXTLINE(google-explicit-constructor) */ + ByteBufferPointer(const ByteBuffer* b) + : bbuf_(const_cast(b)) {} + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator ByteBuffer*() { return bbuf_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer*() { return bbuf_->buffer_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer**() { return &bbuf_->buffer_; } + + private: + ByteBuffer* bbuf_; + }; + ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } +}; + +template <> +class SerializationTraits { + public: + static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { + dest->set_buffer(byte_buffer->buffer_); + return Status::OK; + } + static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, + bool* own_buffer) { + *buffer = source; + *own_buffer = true; + return g_core_codegen_interface->ok(); + } +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call.h index 71f6cb8e..90d54bc5 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call.h @@ -18,9 +18,78 @@ #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +namespace grpc { +class CompletionQueue; +namespace experimental { +class ClientRpcInfo; +class ServerRpcInfo; +} // namespace experimental +namespace internal { +class CallHook; +class CallOpSetInterface; + +/// Straightforward wrapping of the C call object +class Call final { + public: + Call() + : call_hook_(nullptr), + cq_(nullptr), + call_(nullptr), + max_receive_message_size_(-1) {} + /** call is owned by the caller */ + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + experimental::ClientRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1), + client_rpc_info_(rpc_info) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(max_receive_message_size), + server_rpc_info_(rpc_info) {} + + void PerformOps(CallOpSetInterface* ops) { + call_hook_->PerformOpsOnCall(ops, this); + } + + grpc_call* call() const { return call_; } + grpc::CompletionQueue* cq() const { return cq_; } + + int max_receive_message_size() const { return max_receive_message_size_; } + + experimental::ClientRpcInfo* client_rpc_info() const { + return client_rpc_info_; + } + + experimental::ServerRpcInfo* server_rpc_info() const { + return server_rpc_info_; + } + + private: + CallHook* call_hook_; + grpc::CompletionQueue* cq_; + grpc_call* call_; + int max_receive_message_size_; + experimental::ClientRpcInfo* client_rpc_info_ = nullptr; + experimental::ServerRpcInfo* server_rpc_info_ = nullptr; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h index db10a0fc..8c4278e7 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h @@ -21,7 +21,21 @@ // IWYU pragma: private -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +namespace grpc { + +namespace internal { +class CallOpSetInterface; +class Call; + +/// This is an interface that Channel and Server implement to allow them to hook +/// performing ops. +class CallHook { + public: + virtual ~CallHook() {} + virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; +}; +} // namespace internal + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h index 62b11680..5b1d4409 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h index ce5f2036..a8eed9f6 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h @@ -21,6 +21,41 @@ // IWYU pragma: private -#include +#include + +namespace grpc { +namespace internal { + +class Call; + +/// An abstract collection of call ops, used to generate the +/// grpc_call_op structure to pass down to the lower layers, +/// and as it is-a CompletionQueueTag, also massages the final +/// completion into the correct form for consumption in the C++ +/// API. +class CallOpSetInterface : public CompletionQueueTag { + public: + /// Fills in grpc_op, starting from ops[*nops] and moving + /// upwards. + virtual void FillOps(internal::Call* call) = 0; + + /// Get the tag to be used at the core completion queue. Generally, the + /// value of core_cq_tag will be "this". However, it can be overridden if we + /// want core to process the tag differently (e.g., as a core callback) + virtual void* core_cq_tag() = 0; + + // This will be called while interceptors are run if the RPC is a hijacked + // RPC. This should set hijacking state for each of the ops. + virtual void SetHijackingState() = 0; + + // Should be called after interceptors are done running + virtual void ContinueFillOpsAfterInterception() = 0; + + // Should be called after interceptors are done running on the finalize result + // path + virtual void ContinueFinalizeResultAfterInterception() = 0; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h index c0f605ac..7c67c928 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h index dde3ae7b..19fef7e2 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h @@ -22,7 +22,7 @@ // IWYU pragma: private #include -#include +#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h index 1c6b8ce5..f3560b5a 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h @@ -19,9 +19,181 @@ #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +#include +#include +#include + +namespace grpc { + +class Channel; +class ClientContext; + +namespace internal { +class InterceptorBatchMethodsImpl; +} + +namespace experimental { +class ClientRpcInfo; + +// A factory interface for creation of client interceptors. A vector of +// factories can be provided at channel creation which will be used to create a +// new vector of client interceptors per RPC. Client interceptor authors should +// create a subclass of ClientInterceptorFactorInterface which creates objects +// of their interceptors. +class ClientInterceptorFactoryInterface { + public: + virtual ~ClientInterceptorFactoryInterface() {} + // Returns a pointer to an Interceptor object on successful creation, nullptr + // otherwise. If nullptr is returned, this server interceptor factory is + // ignored for the purposes of that RPC. + virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; +}; +} // namespace experimental + +namespace internal { +extern experimental::ClientInterceptorFactoryInterface* + g_global_client_interceptor_factory; +} + +/// ClientRpcInfo represents the state of a particular RPC as it +/// appears to an interceptor. It is created and owned by the library and +/// passed to the CreateClientInterceptor method of the application's +/// ClientInterceptorFactoryInterface implementation +namespace experimental { +class ClientRpcInfo { + public: + // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN + // from the list of possible Types. + /// Type categorizes RPCs by unary or streaming type + enum class Type { + UNARY, + CLIENT_STREAMING, + SERVER_STREAMING, + BIDI_STREAMING, + UNKNOWN // UNKNOWN is not API and will be removed later + }; + + ~ClientRpcInfo() {} + + // Delete copy constructor but allow default move constructor + ClientRpcInfo(const ClientRpcInfo&) = delete; + ClientRpcInfo(ClientRpcInfo&&) = default; + + // Getter methods + + /// Return the fully-specified method name + const char* method() const { return method_; } + + /// Return an identifying suffix for the client stub, or nullptr if one wasn't + /// specified. + const char* suffix_for_stats() const { return suffix_for_stats_; } + + /// Return a pointer to the channel on which the RPC is being sent + ChannelInterface* channel() { return channel_; } + + /// Return a pointer to the underlying ClientContext structure associated + /// with the RPC to support features that apply to it + grpc::ClientContext* client_context() { return ctx_; } + + /// Return the type of the RPC (unary or a streaming flavor) + Type type() const { return type_; } + + private: + static_assert(Type::UNARY == + static_cast(internal::RpcMethod::NORMAL_RPC), + "violated expectation about Type enum"); + static_assert(Type::CLIENT_STREAMING == + static_cast(internal::RpcMethod::CLIENT_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::SERVER_STREAMING == + static_cast(internal::RpcMethod::SERVER_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::BIDI_STREAMING == + static_cast(internal::RpcMethod::BIDI_STREAMING), + "violated expectation about Type enum"); + + // Default constructor should only be used by ClientContext + ClientRpcInfo() = default; + + // Constructor will only be called from ClientContext + ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, + const char* method, const char* suffix_for_stats, + grpc::ChannelInterface* channel) + : ctx_(ctx), + type_(static_cast(type)), + method_(method), + suffix_for_stats_(suffix_for_stats), + channel_(channel) {} + + // Move assignment should only be used by ClientContext + // TODO(yashykt): Delete move assignment + ClientRpcInfo& operator=(ClientRpcInfo&&) = default; + + // Runs interceptor at pos \a pos. + void RunInterceptor( + experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { + GPR_CODEGEN_ASSERT(pos < interceptors_.size()); + interceptors_[pos]->Intercept(interceptor_methods); + } + + void RegisterInterceptors( + const std::vector>& creators, + size_t interceptor_pos) { + if (interceptor_pos > creators.size()) { + // No interceptors to register + return; + } + // NOTE: The following is not a range-based for loop because it will only + // iterate over a portion of the creators vector. + for (auto it = creators.begin() + interceptor_pos; it != creators.end(); + ++it) { + auto* interceptor = (*it)->CreateClientInterceptor(this); + if (interceptor != nullptr) { + interceptors_.push_back( + std::unique_ptr(interceptor)); + } + } + if (internal::g_global_client_interceptor_factory != nullptr) { + interceptors_.push_back(std::unique_ptr( + internal::g_global_client_interceptor_factory + ->CreateClientInterceptor(this))); + } + } + + grpc::ClientContext* ctx_ = nullptr; + // TODO(yashykt): make type_ const once move-assignment is deleted + Type type_{Type::UNKNOWN}; + const char* method_ = nullptr; + const char* suffix_for_stats_ = nullptr; + grpc::ChannelInterface* channel_ = nullptr; + std::vector> interceptors_; + bool hijacked_ = false; + size_t hijacked_interceptor_ = 0; + + friend class internal::InterceptorBatchMethodsImpl; + friend class grpc::ClientContext; +}; + +// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL +// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. +// Registers a global client interceptor factory object, which is used for all +// RPCs made in this process. The application is responsible for maintaining the +// life of the object while gRPC operations are in progress. The global +// interceptor factory should only be registered once at the start of the +// process before any gRPC operations have begun. +void RegisterGlobalClientInterceptorFactory( + ClientInterceptorFactoryInterface* factory); + +// For testing purposes only +void TestOnlyResetGlobalClientInterceptorFactory(); + +} // namespace experimental +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h index bcb85746..14450533 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h @@ -26,11 +26,11 @@ #include #include +#include #include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h index 2595938c..b084b7ce 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h index 797e8256..58056314 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h @@ -21,10 +21,10 @@ // IWYU pragma: private, include +#include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h index 2aa7774a..6f6730a1 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h @@ -28,10 +28,10 @@ #include #include +#include #include #include #include -#include namespace grpc { class ServerContextBase; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h index 2f20dade..0deac825 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h index 1235b8de..aca60790 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h @@ -20,7 +20,7 @@ // IWYU pragma: private, include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/security/credentials.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/security/credentials.h index d9b43934..18dce966 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/security/credentials.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/security/credentials.h @@ -25,11 +25,11 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/server.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/server.h index 2264585c..dce87448 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/server.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/server.h @@ -31,13 +31,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_stream.h index 18e84dfc..5f717014 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_stream.h @@ -19,1115 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H #define GRPCPP_SUPPORT_ASYNC_STREAM_H -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -namespace internal { -/// Common interface for all client side asynchronous streaming. -class ClientAsyncStreamingInterface { - public: - virtual ~ClientAsyncStreamingInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall(void* tag) = 0; - - /// Request notification of the reading of the initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a AsyncReaderInterface::Read method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Indicate that the stream is to be finished and request notification for - /// when the call has been ended. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method exactly once when both: - /// * the client side has no more message to send - /// (this can be declared implicitly by calling this method, or - /// explicitly through an earlier call to the WritesDone method - /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or - /// \a ClientAsyncReaderWriterInterface::WritesDone). - /// * there are no more messages to be received from the server (this can - /// be known implicitly by the calling code, or explicitly from an - /// earlier call to \a AsyncReaderInterface::Read that yielded a failed - /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// The tag will be returned when either: - /// - all incoming messages have been read and the server has returned - /// a status. - /// - the server has returned a non-OK status. - /// - the call failed for some reason and the library generated a - /// status. - /// - /// Note that implementations of this method attempt to receive initial - /// metadata from the server if initial metadata hasn't yet been received. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - virtual void Finish(grpc::Status* status, void* tag) = 0; -}; - -/// An interface that yields a sequence of messages of type \a R. -template -class AsyncReaderInterface { - public: - virtual ~AsyncReaderInterface() {} - - /// Read a message of type \a R into \a msg. Completion will be notified by \a - /// tag on the associated completion queue. - /// This is thread-safe with respect to \a Write or \a WritesDone methods. It - /// should not be called concurrently with other streaming APIs - /// on the same stream. It is not meaningful to call it concurrently - /// with another \a AsyncReaderInterface::Read on the same stream since reads - /// on the same stream are delivered in order. - /// - /// \param[out] msg Where to eventually store the read message. - /// \param[in] tag The tag identifying the operation. - /// - /// Side effect: note that this method attempt to receive initial metadata for - /// a stream if it hasn't yet been received. - virtual void Read(R* msg, void* tag) = 0; -}; - -/// An interface that can be fed a sequence of messages of type \a W. -template -class AsyncWriterInterface { - public: - virtual ~AsyncWriterInterface() {} - - /// Request the writing of \a msg with identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, void* tag) = 0; - - /// Request the writing of \a msg using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// WriteOptions \a options is used to set the write options of this message. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with the writing - /// of trailing metadata, using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// For client, WriteLast is equivalent of performing Write and - /// WritesDone in a single step. - /// For server, WriteLast buffers the \a msg. The writing of \a msg is held - /// until Finish is called, where \a msg and trailing metadata are coalesced - /// and write is initiated. Note that WriteLast can only buffer \a msg up to - /// the flow control window size. If \a msg size is larger than the window - /// size, it will be sent on wire without buffering. - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { - Write(msg, options.set_last_message(), tag); - } -}; - -} // namespace internal - -template -class ClientAsyncReaderInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncReaderInterface {}; - -namespace internal { -template -class ClientAsyncReaderFactory { - public: - /// Create a stream object. - /// Write the first request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started and - /// \a request has been written out. If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - template - static ClientAsyncReader* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, - const W& request, bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReader))) - ClientAsyncReader(call, context, request, start, tag); - } -}; -} // namespace internal - -/// Async client-side API for doing server-streaming RPCs, -/// where the incoming message stream coming from the server has -/// messages of type \a R. -template -class ClientAsyncReader final : public ClientAsyncReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata - /// method for semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, - /// the \a ClientContext associated with this call is updated, and the - /// calling code can access the received metadata through the - /// \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderFactory; - template - ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, - const W& request, bool start, void* tag) - : context_(context), call_(call), started_(start) { - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - init_ops_.set_output_tag(tag); - call_.PerformOps(&init_ops_); - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - init_ops_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Common interface for client side asynchronous writing. -template -class ClientAsyncWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncWriterFactory { - public: - /// Create a stream object. - /// Start the RPC if \a start is set - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, \a tag must be nullptr and the actual call - /// must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// \a response will be filled in with the single expected response - /// message from the server upon a successful call to the \a Finish - /// method of this instance. - template - static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, R* response, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncWriter))) - ClientAsyncWriter(call, context, response, start, tag); - } -}; -} // namespace internal - -/// Async API on the client side for doing client-streaming RPCs, -/// where the outgoing message stream going to the server contains -/// messages of type \a W. -template -class ClientAsyncWriter final : public ClientAsyncWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for - /// semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// associated with this call is updated, and the calling code can access - /// the received metadata through the \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - /// - attempts to fill in the \a response parameter passed to this class's - /// constructor with the server's response message. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncWriterFactory; - template - ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, - R* response, bool start, void* tag) - : context_(context), call_(call), started_(start) { - finish_ops_.RecvMessage(response); - finish_ops_.AllowNoMessage(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Async client-side interface for bi-directional streaming, -/// where the client-to-server message stream has messages of type \a W, -/// and the server-to-client message stream has messages of type \a R. -template -class ClientAsyncReaderWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncReaderWriterFactory { - public: - /// Create a stream object. - /// Start the RPC request if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent). If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - static ClientAsyncReaderWriter* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReaderWriter))) - ClientAsyncReaderWriter(call, context, start, tag); - } -}; -} // namespace internal - -/// Async client-side interface for bi-directional streaming, -/// where the outgoing message stream going to the server -/// has messages of type \a W, and the incoming message stream coming -/// from the server has messages of type \a R. -template -class ClientAsyncReaderWriter final - : public ClientAsyncReaderWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method - /// for semantics of this method. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// is updated with it, and then the receiving initial metadata can - /// be accessed through this \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// Side effect - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderWriterFactory; - ClientAsyncReaderWriter(grpc::internal::Call call, - grpc::ClientContext* context, bool start, void* tag) - : context_(context), call_(call), started_(start) { - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncReaderInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code - /// and also send out \a msg response to the client. - /// Request notification for when the server has sent the response and the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous - /// \a AsyncReaderInterface::Read operation with a non-ok result, - /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it - /// is safe to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// \param[in] msg To be sent to the client as the response for this call. - virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; - - /// Indicate that the stream is to be finished with a certain - /// non-OK status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// This call is meant to end the call with some error, and can be called at - /// any point that the server would like to "fail" the call (though note - /// this shouldn't be called concurrently with any other "sending" call, like - /// \a AsyncWriterInterface::Write). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), and status, or if some failure occurred - /// when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// - Note: \a status must have a non-OK code. - virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing client-streaming RPCs, -/// where the incoming message stream from the client has messages of type \a R, -/// and the single response message sent from the server is type \a W. -template -class ServerAsyncReader final : public ServerAsyncReaderInterface { - public: - explicit ServerAsyncReader(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// Note: \a msg is not sent if \a status has a non-OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once Finish returns. - void Finish(const W& msg, const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_ops_.SendMessage(msg)); - } else { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - void FinishWithError(const grpc::Status& status, void* tag) override { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation with a non-ok - /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish - /// in a single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing server streaming RPCs, -/// where the outgoing message stream from the server has messages of type \a W. -template -class ServerAsyncWriter final : public ServerAsyncWriterInterface { - public: - explicit ServerAsyncWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of - /// \a status,it may be non-OK - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Server-side interface for asynchronous bi-directional streaming. -template -class ServerAsyncReaderWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation - /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' - /// with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if some - /// failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish in a - /// single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing bidirectional streaming RPCs, -/// where the incoming message stream coming from the client has messages of -/// type \a R, and the outgoing message stream coming from the server has -/// messages of type \a W. -template -class ServerAsyncReaderWriter final - : public ServerAsyncReaderWriterInterface { - public: - explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - EnsureInitialMetadataSent(&write_ops_); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish - /// method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - // - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of \a status, - /// it may be non-OK - // - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class grpc::Server; - - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_unary_call.h index a9886031..02071e48 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/async_unary_call.h @@ -19,402 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H #define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -// Forward declaration for use in Helper class -template -class ClientAsyncResponseReader; - -/// An interface relevant for async client side unary RPCs (which send -/// one request message to a server and receive one response message). -template -class ClientAsyncResponseReaderInterface { - public: - virtual ~ClientAsyncResponseReaderInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall() = 0; - - /// Request notification of the reading of initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a Finish method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Request to receive the server's response \a msg and final \a status for - /// the call, and to notify \a tag on this call's completion queue when - /// finished. - /// - /// This function will return when either: - /// - when the server's response message and status have been received. - /// - when the server has returned a non-OK status (no message expected in - /// this case). - /// - when the call failed for some reason and the library generated a - /// non-OK status. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - /// \param[out] msg To be filled in with the server's response message. - virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; -}; - -namespace internal { - -class ClientAsyncResponseReaderHelper { - public: - /// Start a call and write the request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// - /// Optionally pass in a base class for request and response types so that the - /// internal functions and structs can be templated based on that, allowing - /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors - /// can't have an explicit template parameter, the last argument is an - /// extraneous parameter just to provide the needed type information. - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request) /* __attribute__((noinline)) */ { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - ClientAsyncResponseReader* result = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncResponseReader))) - ClientAsyncResponseReader(call, context); - SetupRequest( - call.call(), &result->single_buf_, &result->read_initial_metadata_, - &result->finish_, static_cast(request)); - - return result; - } - - // Various helper functions to reduce templating use - - template - static void SetupRequest( - grpc_call* call, - grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, - std::function* - read_initial_metadata, - std::function< - void(ClientContext*, internal::Call*, bool initial_metadata_read, - internal::CallOpSendInitialMetadata*, - internal::CallOpSetInterface**, void*, Status*, void*)>* finish, - const W& request) { - using SingleBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - SingleBufType* single_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(SingleBufType))) SingleBufType; - *single_buf_ptr = single_buf; - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); - single_buf->ClientSendClose(); - - // The purpose of the following functions is to type-erase the actual - // templated type of the CallOpSet being used by hiding that type inside the - // function definition rather than specifying it as an argument of the - // function or a member of the class. The type-erased CallOpSet will get - // static_cast'ed back to the real type so that it can be used properly. - *read_initial_metadata = - [](ClientContext* context, internal::Call* call, - internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - call->PerformOps(single_buf); - }; - - // Note that this function goes one step further than the previous one - // because it type-erases the message being written down to a void*. This - // will be static-cast'ed back to the class specified here by hiding that - // class information inside the function definition. Note that this feature - // expects the class being specified here for R to be a base-class of the - // "real" R without any multiple-inheritance (as applies in protbuf wrt - // MessageLite) - *finish = [](ClientContext* context, internal::Call* call, - bool initial_metadata_read, - internal::CallOpSendInitialMetadata* single_buf_view, - internal::CallOpSetInterface** finish_buf_ptr, void* msg, - Status* status, void* tag) { - if (initial_metadata_read) { - using FinishBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - FinishBufType* finish_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call->call(), sizeof(FinishBufType))) FinishBufType; - *finish_buf_ptr = finish_buf; - finish_buf->set_output_tag(tag); - finish_buf->RecvMessage(static_cast(msg)); - finish_buf->AllowNoMessage(); - finish_buf->ClientRecvStatus(context, status); - call->PerformOps(finish_buf); - } else { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - single_buf->RecvMessage(static_cast(msg)); - single_buf->AllowNoMessage(); - single_buf->ClientRecvStatus(context, status); - call->PerformOps(single_buf); - } - }; - } - - static void StartCall(grpc::ClientContext* context, - grpc::internal::CallOpSendInitialMetadata* single_buf) { - single_buf->SendInitialMetadata(&context->send_initial_metadata_, - context->initial_metadata_flags()); - } -}; - -// TODO(vjpai): This templated factory is deprecated and will be replaced by -//. the non-templated helper as soon as possible. -template -class ClientAsyncResponseReaderFactory { - public: - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request, bool start) { - auto* result = ClientAsyncResponseReaderHelper::Create( - channel, cq, method, context, request); - if (start) { - result->StartCall(); - } - return result; - } -}; - -} // namespace internal - -/// Async API for client-side unary RPCs, where the message response -/// received from the server is of type \a R. -template -class ClientAsyncResponseReader final - : public ClientAsyncResponseReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall() override { - GPR_CODEGEN_DEBUG_ASSERT(!started_); - started_ = true; - internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); - } - - /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for - /// semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); - read_initial_metadata_(context_, &call_, single_buf_, tag); - initial_metadata_read_ = true; - } - - /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(R* msg, grpc::Status* status, void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, - static_cast(msg), status, tag); - } - - private: - friend class internal::ClientAsyncResponseReaderHelper; - grpc::ClientContext* const context_; - grpc::internal::Call call_; - bool started_ = false; - bool initial_metadata_read_ = false; - - ClientAsyncResponseReader(grpc::internal::Call call, - grpc::ClientContext* context) - : context_(context), call_(call) {} - - // disable operator new - static void* operator new(std::size_t size); - static void* operator new(std::size_t /*size*/, void* p) { return p; } - - internal::CallOpSendInitialMetadata* single_buf_; - internal::CallOpSetInterface* finish_buf_ = nullptr; - std::function - read_initial_metadata_; - std::function - finish_; -}; - -/// Async server-side API for handling unary calls, where the single -/// response message sent to the client is of type \a W. -template -class ServerAsyncResponseWriter final - : public grpc::internal::ServerAsyncStreamingInterface { - public: - explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Side effect: - /// The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_buf_.set_output_tag(tag); - meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_buf_); - } - - /// Indicate that the stream is to be finished and request notification - /// when the server has sent the appropriate signals to the client to - /// end the call. Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// \param[in] msg Message to be sent to the client. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// Note: if \a status has a non-OK code, then \a msg will not be sent, - /// and the client will receive only the status with possible trailing - /// metadata. - /// - /// gRPC doesn't take ownership or a reference to msg and status, so it is - /// safe to deallocate them once the Finish operation is complete (i.e. a - /// result arrives in the completion queue). - void Finish(const W& msg, const grpc::Status& status, void* tag) { - finish_buf_.set_output_tag(tag); - finish_buf_.set_core_cq_tag(&finish_buf_); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_buf_.SendMessage(msg)); - } else { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_buf_); - } - - /// Indicate that the stream is to be finished with a non-OK status, - /// and request notification for when the server has finished sending the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// - Note: \a status must have a non-OK code. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// gRPC doesn't take ownership or a reference to status, so it is safe to - /// deallocate them once the Finish operation is complete (i.e. a result - /// arrives in the completion queue). - void FinishWithError(const grpc::Status& status, void* tag) { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_buf_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_buf_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_buf_; - grpc::internal::CallOpSet - finish_buf_; -}; - -} // namespace grpc - -namespace std { -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -} // namespace std +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/byte_buffer.h index 7ca7c4b2..6f566e76 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/byte_buffer.h @@ -19,221 +19,13 @@ #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H #define GRPCPP_SUPPORT_BYTE_BUFFER_H -#include - #include #include #include -#include +#include // IWYU pragma: export #include #include #include #include -namespace grpc { - -class ServerInterface; -class ByteBuffer; -class ServerInterface; - -namespace internal { -template -class CallbackUnaryHandler; -template -class CallbackServerStreamingHandler; -template -void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); -template -class ServerStreamingHandler; -template -class ErrorMethodHandler; -class CallOpSendMessage; -template -class CallOpRecvMessage; -class CallOpGenericRecvMessage; -class ExternalConnectionAcceptorImpl; -template -class DeserializeFuncType; -class GrpcByteBufferPeer; - -} // namespace internal -/// A sequence of bytes. -class ByteBuffer final { - public: - /// Constuct an empty buffer. - ByteBuffer() : buffer_(nullptr) {} - - /// Construct buffer from \a slices, of which there are \a nslices. - ByteBuffer(const Slice* slices, size_t nslices) { - // The following assertions check that the representation of a grpc::Slice - // is identical to that of a grpc_slice: it has a grpc_slice field, and - // nothing else. - static_assert(std::is_same::value, - "Slice must have same representation as grpc_slice"); - static_assert(sizeof(Slice) == sizeof(grpc_slice), - "Slice must have same representation as grpc_slice"); - // The following assertions check that the representation of a ByteBuffer is - // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, - // and nothing else. - static_assert(std::is_same::value, - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - // The const_cast is legal if grpc_raw_byte_buffer_create() does no more - // than its advertised side effect of increasing the reference count of the - // slices it processes, and such an increase does not affect the semantics - // seen by the caller of this constructor. - buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( - reinterpret_cast(const_cast(slices)), nslices); - } - - /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } - - ~ByteBuffer() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - } - } - - /// Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer& operator=(const ByteBuffer& buf) { - if (this != &buf) { - Clear(); // first remove existing data - } - if (buf.buffer_) { - // then copy - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); - } - return *this; - } - - // If this ByteBuffer's representation is a single flat slice, returns a - // slice referencing that array. - Status TrySingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slics. - Status DumpToSingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slices. - Status Dump(std::vector* slices) const; - - /// Remove all data. - void Clear() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - buffer_ = nullptr; - } - } - - /// Make a duplicate copy of the internals of this byte - /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. - /// This is not a deep copy; it is a referencing and its performance - /// is size-independent. - void Duplicate() { - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); - } - - /// Forget underlying byte buffer without destroying - /// Use this only for un-owned byte buffers - void Release() { buffer_ = nullptr; } - - /// Buffer size in bytes. - size_t Length() const { - return buffer_ == nullptr - ? 0 - : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); - } - - /// Swap the state of *this and *other. - void Swap(ByteBuffer* other) { - grpc_byte_buffer* tmp = other->buffer_; - other->buffer_ = buffer_; - buffer_ = tmp; - } - - /// Is this ByteBuffer valid? - bool Valid() const { return (buffer_ != nullptr); } - - private: - friend class SerializationTraits; - friend class ServerInterface; - friend class internal::CallOpSendMessage; - template - friend class internal::CallOpRecvMessage; - friend class internal::CallOpGenericRecvMessage; - template - friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, - grpc::Status*, RequestType*); - template - friend class internal::ServerStreamingHandler; - template - friend class internal::CallbackUnaryHandler; - template - friend class internal::CallbackServerStreamingHandler; - template - friend class internal::ErrorMethodHandler; - template - friend class internal::DeserializeFuncType; - friend class ProtoBufferReader; - friend class ProtoBufferWriter; - friend class internal::GrpcByteBufferPeer; - friend class internal::ExternalConnectionAcceptorImpl; - - grpc_byte_buffer* buffer_; - - // takes ownership - void set_buffer(grpc_byte_buffer* buf) { - if (buffer_) { - Clear(); - } - buffer_ = buf; - } - - grpc_byte_buffer* c_buffer() { return buffer_; } - grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } - - class ByteBufferPointer { - public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ - ByteBufferPointer(const ByteBuffer* b) - : bbuf_(const_cast(b)) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator ByteBuffer*() { return bbuf_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer*() { return bbuf_->buffer_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer**() { return &bbuf_->buffer_; } - - private: - ByteBuffer* bbuf_; - }; - ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } -}; - -template <> -class SerializationTraits { - public: - static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { - dest->set_buffer(byte_buffer->buffer_); - return Status::OK; - } - static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, - bool* own_buffer) { - *buffer = source; - *own_buffer = true; - return g_core_codegen_interface->ok(); - } -}; - -} // namespace grpc - #endif // GRPCPP_SUPPORT_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/client_interceptor.h index 8e5e1ce6..552cab4c 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Headers/support/client_interceptor.h @@ -19,179 +19,6 @@ #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H -#include -#include - -#include -#include -#include - -namespace grpc { - -class Channel; -class ClientContext; - -namespace internal { -class InterceptorBatchMethodsImpl; -} - -namespace experimental { -class ClientRpcInfo; - -// A factory interface for creation of client interceptors. A vector of -// factories can be provided at channel creation which will be used to create a -// new vector of client interceptors per RPC. Client interceptor authors should -// create a subclass of ClientInterceptorFactorInterface which creates objects -// of their interceptors. -class ClientInterceptorFactoryInterface { - public: - virtual ~ClientInterceptorFactoryInterface() {} - // Returns a pointer to an Interceptor object on successful creation, nullptr - // otherwise. If nullptr is returned, this server interceptor factory is - // ignored for the purposes of that RPC. - virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; -}; -} // namespace experimental - -namespace internal { -extern experimental::ClientInterceptorFactoryInterface* - g_global_client_interceptor_factory; -} - -/// ClientRpcInfo represents the state of a particular RPC as it -/// appears to an interceptor. It is created and owned by the library and -/// passed to the CreateClientInterceptor method of the application's -/// ClientInterceptorFactoryInterface implementation -namespace experimental { -class ClientRpcInfo { - public: - // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN - // from the list of possible Types. - /// Type categorizes RPCs by unary or streaming type - enum class Type { - UNARY, - CLIENT_STREAMING, - SERVER_STREAMING, - BIDI_STREAMING, - UNKNOWN // UNKNOWN is not API and will be removed later - }; - - ~ClientRpcInfo() {} - - // Delete copy constructor but allow default move constructor - ClientRpcInfo(const ClientRpcInfo&) = delete; - ClientRpcInfo(ClientRpcInfo&&) = default; - - // Getter methods - - /// Return the fully-specified method name - const char* method() const { return method_; } - - /// Return an identifying suffix for the client stub, or nullptr if one wasn't - /// specified. - const char* suffix_for_stats() const { return suffix_for_stats_; } - - /// Return a pointer to the channel on which the RPC is being sent - ChannelInterface* channel() { return channel_; } - - /// Return a pointer to the underlying ClientContext structure associated - /// with the RPC to support features that apply to it - grpc::ClientContext* client_context() { return ctx_; } - - /// Return the type of the RPC (unary or a streaming flavor) - Type type() const { return type_; } - - private: - static_assert(Type::UNARY == - static_cast(internal::RpcMethod::NORMAL_RPC), - "violated expectation about Type enum"); - static_assert(Type::CLIENT_STREAMING == - static_cast(internal::RpcMethod::CLIENT_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::SERVER_STREAMING == - static_cast(internal::RpcMethod::SERVER_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::BIDI_STREAMING == - static_cast(internal::RpcMethod::BIDI_STREAMING), - "violated expectation about Type enum"); - - // Default constructor should only be used by ClientContext - ClientRpcInfo() = default; - - // Constructor will only be called from ClientContext - ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, - const char* method, const char* suffix_for_stats, - grpc::ChannelInterface* channel) - : ctx_(ctx), - type_(static_cast(type)), - method_(method), - suffix_for_stats_(suffix_for_stats), - channel_(channel) {} - - // Move assignment should only be used by ClientContext - // TODO(yashykt): Delete move assignment - ClientRpcInfo& operator=(ClientRpcInfo&&) = default; - - // Runs interceptor at pos \a pos. - void RunInterceptor( - experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { - GPR_CODEGEN_ASSERT(pos < interceptors_.size()); - interceptors_[pos]->Intercept(interceptor_methods); - } - - void RegisterInterceptors( - const std::vector>& creators, - size_t interceptor_pos) { - if (interceptor_pos > creators.size()) { - // No interceptors to register - return; - } - // NOTE: The following is not a range-based for loop because it will only - // iterate over a portion of the creators vector. - for (auto it = creators.begin() + interceptor_pos; it != creators.end(); - ++it) { - auto* interceptor = (*it)->CreateClientInterceptor(this); - if (interceptor != nullptr) { - interceptors_.push_back( - std::unique_ptr(interceptor)); - } - } - if (internal::g_global_client_interceptor_factory != nullptr) { - interceptors_.push_back(std::unique_ptr( - internal::g_global_client_interceptor_factory - ->CreateClientInterceptor(this))); - } - } - - grpc::ClientContext* ctx_ = nullptr; - // TODO(yashykt): make type_ const once move-assignment is deleted - Type type_{Type::UNKNOWN}; - const char* method_ = nullptr; - const char* suffix_for_stats_ = nullptr; - grpc::ChannelInterface* channel_ = nullptr; - std::vector> interceptors_; - bool hijacked_ = false; - size_t hijacked_interceptor_ = 0; - - friend class internal::InterceptorBatchMethodsImpl; - friend class grpc::ClientContext; -}; - -// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL -// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. -// Registers a global client interceptor factory object, which is used for all -// RPCs made in this process. The application is responsible for maintaining the -// life of the object while gRPC operations are in progress. The global -// interceptor factory should only be registered once at the start of the -// process before any gRPC operations have begun. -void RegisterGlobalClientInterceptorFactory( - ClientInterceptorFactoryInterface* factory); - -// For testing purposes only -void TestOnlyResetGlobalClientInterceptorFactory(); - -} // namespace experimental -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Info.plist b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Info.plist index 3c7e8970..7a2e5e54 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Info.plist +++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/gRPC-C++ b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/gRPC-C++ index 9862f9cb..5e1826dd 100644 Binary files a/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/gRPC-C++ and b/FirebaseFirestore/gRPC-C++.xcframework/macos-arm64_x86_64/gRPC-C++.framework/gRPC-C++ differ diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/channel.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/channel.h index 5681377c..ec8702e4 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/channel.h @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include struct grpc_channel; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/create_channel.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/create_channel.h index df015b98..4b94a08e 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/create_channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/create_channel.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include #include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h index 5081bc5a..6ba0ce26 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h @@ -24,8 +24,6 @@ #import "grpcpp.h" #import "health_check_service_interface.h" #import "impl/call.h" -#import "impl/call_hook.h" -#import "impl/call_op_set_interface.h" #import "impl/channel_argument_option.h" #import "impl/client_unary_call.h" #import "impl/codegen/async_generic_service.h" diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h index 5ff98267..01c79428 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/generic/async_generic_service.h @@ -19,117 +19,6 @@ #ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H #define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H -#include - -#include -#include -#include -#include - -struct grpc_server; - -namespace grpc { - -typedef ServerAsyncReaderWriter - GenericServerAsyncReaderWriter; -typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; -typedef ServerAsyncReader GenericServerAsyncReader; -typedef ServerAsyncWriter GenericServerAsyncWriter; - -class GenericServerContext final : public ServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class ServerInterface; - - std::string method_; - std::string host_; -}; - -// A generic service at the server side accepts all RPC methods and hosts. It is -// typically used in proxies. The generic service can be registered to a server -// which also has other services. -// Sample usage: -// ServerBuilder builder; -// auto cq = builder.AddCompletionQueue(); -// AsyncGenericService generic_service; -// builder.RegisterAsyncGenericService(&generic_service); -// auto server = builder.BuildAndStart(); -// -// // request a new call -// GenericServerContext context; -// GenericServerAsyncReaderWriter stream; -// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); -// -// When tag is retrieved from cq->Next(), context.method() can be used to look -// at the method and the RPC can be handled accordingly. -class AsyncGenericService final { - public: - AsyncGenericService() : server_(nullptr) {} - - void RequestCall(GenericServerContext* ctx, - GenericServerAsyncReaderWriter* reader_writer, - grpc::CompletionQueue* call_cq, - grpc::ServerCompletionQueue* notification_cq, void* tag); - - private: - friend class grpc::Server; - grpc::Server* server_; -}; - -/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs -/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with -/// ByteBuffer arguments. -using ServerGenericBidiReactor = ServerBidiReactor; - -class GenericCallbackServerContext final : public grpc::CallbackServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class grpc::Server; - - std::string method_; - std::string host_; -}; - -/// \a CallbackGenericService is the base class for generic services implemented -/// using the callback API and registered through the ServerBuilder using -/// RegisterCallbackGenericService. -class CallbackGenericService { - public: - CallbackGenericService() {} - virtual ~CallbackGenericService() {} - - /// The "method handler" for the generic API. This function should be - /// overridden to provide a ServerGenericBidiReactor that implements the - /// application-level interface for this RPC. Unimplemented by default. - virtual ServerGenericBidiReactor* CreateReactor( - GenericCallbackServerContext* /*ctx*/) { - class Reactor : public ServerGenericBidiReactor { - public: - Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } - void OnDone() override { delete this; } - }; - return new Reactor; - } - - private: - friend class grpc::Server; - - internal::CallbackBidiHandler* Handler() { - return new internal::CallbackBidiHandler( - [this](grpc::CallbackServerContext* ctx) { - return CreateReactor(static_cast(ctx)); - }); - } - - grpc::Server* server_{nullptr}; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call.h index 2a119963..97d8fdfc 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call.h @@ -19,76 +19,6 @@ #ifndef GRPCPP_IMPL_CALL_H #define GRPCPP_IMPL_CALL_H -#include -#include - -namespace grpc { -class CompletionQueue; -namespace experimental { -class ClientRpcInfo; -class ServerRpcInfo; -} // namespace experimental -namespace internal { -class CallHook; -class CallOpSetInterface; - -/// Straightforward wrapping of the C call object -class Call final { - public: - Call() - : call_hook_(nullptr), - cq_(nullptr), - call_(nullptr), - max_receive_message_size_(-1) {} - /** call is owned by the caller */ - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - experimental::ClientRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1), - client_rpc_info_(rpc_info) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(max_receive_message_size), - server_rpc_info_(rpc_info) {} - - void PerformOps(CallOpSetInterface* ops) { - call_hook_->PerformOpsOnCall(ops, this); - } - - grpc_call* call() const { return call_; } - grpc::CompletionQueue* cq() const { return cq_; } - - int max_receive_message_size() const { return max_receive_message_size_; } - - experimental::ClientRpcInfo* client_rpc_info() const { - return client_rpc_info_; - } - - experimental::ServerRpcInfo* server_rpc_info() const { - return server_rpc_info_; - } - - private: - CallHook* call_hook_; - grpc::CompletionQueue* cq_; - grpc_call* call_; - int max_receive_message_size_; - experimental::ClientRpcInfo* client_rpc_info_ = nullptr; - experimental::ServerRpcInfo* server_rpc_info_ = nullptr; -}; -} // namespace internal -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_IMPL_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call_hook.h deleted file mode 100644 index 8903b9a0..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call_hook.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_HOOK_H -#define GRPCPP_IMPL_CALL_HOOK_H - -namespace grpc { - -namespace internal { -class CallOpSetInterface; -class Call; - -/// This is an interface that Channel and Server implement to allow them to hook -/// performing ops. -class CallHook { - public: - virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; -}; -} // namespace internal - -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h deleted file mode 100644 index 43ed4ed9..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/call_op_set_interface.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H -#define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H - -// IWYU pragma: private - -#include - -namespace grpc { -namespace internal { - -class Call; - -/// An abstract collection of call ops, used to generate the -/// grpc_call_op structure to pass down to the lower layers, -/// and as it is-a CompletionQueueTag, also massages the final -/// completion into the correct form for consumption in the C++ -/// API. -class CallOpSetInterface : public CompletionQueueTag { - public: - /// Fills in grpc_op, starting from ops[*nops] and moving - /// upwards. - virtual void FillOps(internal::Call* call) = 0; - - /// Get the tag to be used at the core completion queue. Generally, the - /// value of core_cq_tag will be "this". However, it can be overridden if we - /// want core to process the tag differently (e.g., as a core callback) - virtual void* core_cq_tag() = 0; - - // This will be called while interceptors are run if the RPC is a hijacked - // RPC. This should set hijacking state for each of the ops. - virtual void SetHijackingState() = 0; - - // Should be called after interceptors are done running - virtual void ContinueFillOpsAfterInterception() = 0; - - // Should be called after interceptors are done running on the finalize result - // path - virtual void ContinueFinalizeResultAfterInterception() = 0; -}; -} // namespace internal -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h index 03a096c5..2a000662 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h @@ -19,9 +19,119 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H #define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include + +struct grpc_server; + +namespace grpc { + +typedef ServerAsyncReaderWriter + GenericServerAsyncReaderWriter; +typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; +typedef ServerAsyncReader GenericServerAsyncReader; +typedef ServerAsyncWriter GenericServerAsyncWriter; + +class GenericServerContext final : public ServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class ServerInterface; + + std::string method_; + std::string host_; +}; + +// A generic service at the server side accepts all RPC methods and hosts. It is +// typically used in proxies. The generic service can be registered to a server +// which also has other services. +// Sample usage: +// ServerBuilder builder; +// auto cq = builder.AddCompletionQueue(); +// AsyncGenericService generic_service; +// builder.RegisterAsyncGenericService(&generic_service); +// auto server = builder.BuildAndStart(); +// +// // request a new call +// GenericServerContext context; +// GenericServerAsyncReaderWriter stream; +// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); +// +// When tag is retrieved from cq->Next(), context.method() can be used to look +// at the method and the RPC can be handled accordingly. +class AsyncGenericService final { + public: + AsyncGenericService() : server_(nullptr) {} + + void RequestCall(GenericServerContext* ctx, + GenericServerAsyncReaderWriter* reader_writer, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag); + + private: + friend class grpc::Server; + grpc::Server* server_; +}; + +/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs +/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with +/// ByteBuffer arguments. +using ServerGenericBidiReactor = ServerBidiReactor; + +class GenericCallbackServerContext final : public grpc::CallbackServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class grpc::Server; + + std::string method_; + std::string host_; +}; + +/// \a CallbackGenericService is the base class for generic services implemented +/// using the callback API and registered through the ServerBuilder using +/// RegisterCallbackGenericService. +class CallbackGenericService { + public: + CallbackGenericService() {} + virtual ~CallbackGenericService() {} + + /// The "method handler" for the generic API. This function should be + /// overridden to provide a ServerGenericBidiReactor that implements the + /// application-level interface for this RPC. Unimplemented by default. + virtual ServerGenericBidiReactor* CreateReactor( + GenericCallbackServerContext* /*ctx*/) { + class Reactor : public ServerGenericBidiReactor { + public: + Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } + void OnDone() override { delete this; } + }; + return new Reactor; + } + + private: + friend class grpc::Server; + + internal::CallbackBidiHandler* Handler() { + return new internal::CallbackBidiHandler( + [this](grpc::CallbackServerContext* ctx) { + return CreateReactor(static_cast(ctx)); + }); + } + + grpc::Server* server_{nullptr}; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h index 524f619f..5b63c301 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_stream.h @@ -18,9 +18,1115 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +namespace grpc { + +namespace internal { +/// Common interface for all client side asynchronous streaming. +class ClientAsyncStreamingInterface { + public: + virtual ~ClientAsyncStreamingInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall(void* tag) = 0; + + /// Request notification of the reading of the initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a AsyncReaderInterface::Read method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Indicate that the stream is to be finished and request notification for + /// when the call has been ended. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method exactly once when both: + /// * the client side has no more message to send + /// (this can be declared implicitly by calling this method, or + /// explicitly through an earlier call to the WritesDone method + /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or + /// \a ClientAsyncReaderWriterInterface::WritesDone). + /// * there are no more messages to be received from the server (this can + /// be known implicitly by the calling code, or explicitly from an + /// earlier call to \a AsyncReaderInterface::Read that yielded a failed + /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// The tag will be returned when either: + /// - all incoming messages have been read and the server has returned + /// a status. + /// - the server has returned a non-OK status. + /// - the call failed for some reason and the library generated a + /// status. + /// + /// Note that implementations of this method attempt to receive initial + /// metadata from the server if initial metadata hasn't yet been received. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + virtual void Finish(grpc::Status* status, void* tag) = 0; +}; + +/// An interface that yields a sequence of messages of type \a R. +template +class AsyncReaderInterface { + public: + virtual ~AsyncReaderInterface() {} + + /// Read a message of type \a R into \a msg. Completion will be notified by \a + /// tag on the associated completion queue. + /// This is thread-safe with respect to \a Write or \a WritesDone methods. It + /// should not be called concurrently with other streaming APIs + /// on the same stream. It is not meaningful to call it concurrently + /// with another \a AsyncReaderInterface::Read on the same stream since reads + /// on the same stream are delivered in order. + /// + /// \param[out] msg Where to eventually store the read message. + /// \param[in] tag The tag identifying the operation. + /// + /// Side effect: note that this method attempt to receive initial metadata for + /// a stream if it hasn't yet been received. + virtual void Read(R* msg, void* tag) = 0; +}; + +/// An interface that can be fed a sequence of messages of type \a W. +template +class AsyncWriterInterface { + public: + virtual ~AsyncWriterInterface() {} + + /// Request the writing of \a msg with identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, void* tag) = 0; + + /// Request the writing of \a msg using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// WriteOptions \a options is used to set the write options of this message. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with the writing + /// of trailing metadata, using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// For client, WriteLast is equivalent of performing Write and + /// WritesDone in a single step. + /// For server, WriteLast buffers the \a msg. The writing of \a msg is held + /// until Finish is called, where \a msg and trailing metadata are coalesced + /// and write is initiated. Note that WriteLast can only buffer \a msg up to + /// the flow control window size. If \a msg size is larger than the window + /// size, it will be sent on wire without buffering. + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { + Write(msg, options.set_last_message(), tag); + } +}; + +} // namespace internal + +template +class ClientAsyncReaderInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncReaderInterface {}; + +namespace internal { +template +class ClientAsyncReaderFactory { + public: + /// Create a stream object. + /// Write the first request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started and + /// \a request has been written out. If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + template + static ClientAsyncReader* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, + const W& request, bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReader))) + ClientAsyncReader(call, context, request, start, tag); + } +}; +} // namespace internal + +/// Async client-side API for doing server-streaming RPCs, +/// where the incoming message stream coming from the server has +/// messages of type \a R. +template +class ClientAsyncReader final : public ClientAsyncReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata + /// method for semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, + /// the \a ClientContext associated with this call is updated, and the + /// calling code can access the received metadata through the + /// \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderFactory; + template + ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, + const W& request, bool start, void* tag) + : context_(context), call_(call), started_(start) { + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); + init_ops_.ClientSendClose(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + init_ops_.set_output_tag(tag); + call_.PerformOps(&init_ops_); + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + init_ops_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Common interface for client side asynchronous writing. +template +class ClientAsyncWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncWriterFactory { + public: + /// Create a stream object. + /// Start the RPC if \a start is set + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, \a tag must be nullptr and the actual call + /// must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// \a response will be filled in with the single expected response + /// message from the server upon a successful call to the \a Finish + /// method of this instance. + template + static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncWriter))) + ClientAsyncWriter(call, context, response, start, tag); + } +}; +} // namespace internal + +/// Async API on the client side for doing client-streaming RPCs, +/// where the outgoing message stream going to the server contains +/// messages of type \a W. +template +class ClientAsyncWriter final : public ClientAsyncWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for + /// semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// associated with this call is updated, and the calling code can access + /// the received metadata through the \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + /// - attempts to fill in the \a response parameter passed to this class's + /// constructor with the server's response message. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncWriterFactory; + template + ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, + R* response, bool start, void* tag) + : context_(context), call_(call), started_(start) { + finish_ops_.RecvMessage(response); + finish_ops_.AllowNoMessage(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Async client-side interface for bi-directional streaming, +/// where the client-to-server message stream has messages of type \a W, +/// and the server-to-client message stream has messages of type \a R. +template +class ClientAsyncReaderWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncReaderWriterFactory { + public: + /// Create a stream object. + /// Start the RPC request if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent). If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + static ClientAsyncReaderWriter* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReaderWriter))) + ClientAsyncReaderWriter(call, context, start, tag); + } +}; +} // namespace internal + +/// Async client-side interface for bi-directional streaming, +/// where the outgoing message stream going to the server +/// has messages of type \a W, and the incoming message stream coming +/// from the server has messages of type \a R. +template +class ClientAsyncReaderWriter final + : public ClientAsyncReaderWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method + /// for semantics of this method. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// is updated with it, and then the receiving initial metadata can + /// be accessed through this \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// Side effect + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderWriterFactory; + ClientAsyncReaderWriter(grpc::internal::Call call, + grpc::ClientContext* context, bool start, void* tag) + : context_(context), call_(call), started_(start) { + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncReaderInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code + /// and also send out \a msg response to the client. + /// Request notification for when the server has sent the response and the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous + /// \a AsyncReaderInterface::Read operation with a non-ok result, + /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it + /// is safe to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// \param[in] msg To be sent to the client as the response for this call. + virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; + + /// Indicate that the stream is to be finished with a certain + /// non-OK status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// This call is meant to end the call with some error, and can be called at + /// any point that the server would like to "fail" the call (though note + /// this shouldn't be called concurrently with any other "sending" call, like + /// \a AsyncWriterInterface::Write). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), and status, or if some failure occurred + /// when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// - Note: \a status must have a non-OK code. + virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing client-streaming RPCs, +/// where the incoming message stream from the client has messages of type \a R, +/// and the single response message sent from the server is type \a W. +template +class ServerAsyncReader final : public ServerAsyncReaderInterface { + public: + explicit ServerAsyncReader(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// Note: \a msg is not sent if \a status has a non-OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once Finish returns. + void Finish(const W& msg, const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_ops_.SendMessage(msg)); + } else { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + void FinishWithError(const grpc::Status& status, void* tag) override { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation with a non-ok + /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish + /// in a single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing server streaming RPCs, +/// where the outgoing message stream from the server has messages of type \a W. +template +class ServerAsyncWriter final : public ServerAsyncWriterInterface { + public: + explicit ServerAsyncWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of + /// \a status,it may be non-OK + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Server-side interface for asynchronous bi-directional streaming. +template +class ServerAsyncReaderWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation + /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' + /// with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if some + /// failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish in a + /// single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing bidirectional streaming RPCs, +/// where the incoming message stream coming from the client has messages of +/// type \a R, and the outgoing message stream coming from the server has +/// messages of type \a W. +template +class ServerAsyncReaderWriter final + : public ServerAsyncReaderWriterInterface { + public: + explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + EnsureInitialMetadataSent(&write_ops_); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish + /// method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + // + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of \a status, + /// it may be non-OK + // + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class grpc::Server; + + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h index 55227b2e..0034d210 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h @@ -19,9 +19,402 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { + +// Forward declaration for use in Helper class +template +class ClientAsyncResponseReader; + +/// An interface relevant for async client side unary RPCs (which send +/// one request message to a server and receive one response message). +template +class ClientAsyncResponseReaderInterface { + public: + virtual ~ClientAsyncResponseReaderInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall() = 0; + + /// Request notification of the reading of initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a Finish method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Request to receive the server's response \a msg and final \a status for + /// the call, and to notify \a tag on this call's completion queue when + /// finished. + /// + /// This function will return when either: + /// - when the server's response message and status have been received. + /// - when the server has returned a non-OK status (no message expected in + /// this case). + /// - when the call failed for some reason and the library generated a + /// non-OK status. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + /// \param[out] msg To be filled in with the server's response message. + virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; +}; + +namespace internal { + +class ClientAsyncResponseReaderHelper { + public: + /// Start a call and write the request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// + /// Optionally pass in a base class for request and response types so that the + /// internal functions and structs can be templated based on that, allowing + /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors + /// can't have an explicit template parameter, the last argument is an + /// extraneous parameter just to provide the needed type information. + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request) /* __attribute__((noinline)) */ { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + ClientAsyncResponseReader* result = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncResponseReader))) + ClientAsyncResponseReader(call, context); + SetupRequest( + call.call(), &result->single_buf_, &result->read_initial_metadata_, + &result->finish_, static_cast(request)); + + return result; + } + + // Various helper functions to reduce templating use + + template + static void SetupRequest( + grpc_call* call, + grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, + std::function* + read_initial_metadata, + std::function< + void(ClientContext*, internal::Call*, bool initial_metadata_read, + internal::CallOpSendInitialMetadata*, + internal::CallOpSetInterface**, void*, Status*, void*)>* finish, + const W& request) { + using SingleBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + SingleBufType* single_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(SingleBufType))) SingleBufType; + *single_buf_ptr = single_buf; + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); + single_buf->ClientSendClose(); + + // The purpose of the following functions is to type-erase the actual + // templated type of the CallOpSet being used by hiding that type inside the + // function definition rather than specifying it as an argument of the + // function or a member of the class. The type-erased CallOpSet will get + // static_cast'ed back to the real type so that it can be used properly. + *read_initial_metadata = + [](ClientContext* context, internal::Call* call, + internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + call->PerformOps(single_buf); + }; + + // Note that this function goes one step further than the previous one + // because it type-erases the message being written down to a void*. This + // will be static-cast'ed back to the class specified here by hiding that + // class information inside the function definition. Note that this feature + // expects the class being specified here for R to be a base-class of the + // "real" R without any multiple-inheritance (as applies in protbuf wrt + // MessageLite) + *finish = [](ClientContext* context, internal::Call* call, + bool initial_metadata_read, + internal::CallOpSendInitialMetadata* single_buf_view, + internal::CallOpSetInterface** finish_buf_ptr, void* msg, + Status* status, void* tag) { + if (initial_metadata_read) { + using FinishBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + FinishBufType* finish_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call->call(), sizeof(FinishBufType))) FinishBufType; + *finish_buf_ptr = finish_buf; + finish_buf->set_output_tag(tag); + finish_buf->RecvMessage(static_cast(msg)); + finish_buf->AllowNoMessage(); + finish_buf->ClientRecvStatus(context, status); + call->PerformOps(finish_buf); + } else { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + single_buf->RecvMessage(static_cast(msg)); + single_buf->AllowNoMessage(); + single_buf->ClientRecvStatus(context, status); + call->PerformOps(single_buf); + } + }; + } + + static void StartCall(grpc::ClientContext* context, + grpc::internal::CallOpSendInitialMetadata* single_buf) { + single_buf->SendInitialMetadata(&context->send_initial_metadata_, + context->initial_metadata_flags()); + } +}; + +// TODO(vjpai): This templated factory is deprecated and will be replaced by +//. the non-templated helper as soon as possible. +template +class ClientAsyncResponseReaderFactory { + public: + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request, bool start) { + auto* result = ClientAsyncResponseReaderHelper::Create( + channel, cq, method, context, request); + if (start) { + result->StartCall(); + } + return result; + } +}; + +} // namespace internal + +/// Async API for client-side unary RPCs, where the message response +/// received from the server is of type \a R. +template +class ClientAsyncResponseReader final + : public ClientAsyncResponseReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall() override { + GPR_CODEGEN_DEBUG_ASSERT(!started_); + started_ = true; + internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); + } + + /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for + /// semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); + read_initial_metadata_(context_, &call_, single_buf_, tag); + initial_metadata_read_ = true; + } + + /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(R* msg, grpc::Status* status, void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, + static_cast(msg), status, tag); + } + + private: + friend class internal::ClientAsyncResponseReaderHelper; + grpc::ClientContext* const context_; + grpc::internal::Call call_; + bool started_ = false; + bool initial_metadata_read_ = false; + + ClientAsyncResponseReader(grpc::internal::Call call, + grpc::ClientContext* context) + : context_(context), call_(call) {} + + // disable operator new + static void* operator new(std::size_t size); + static void* operator new(std::size_t /*size*/, void* p) { return p; } + + internal::CallOpSendInitialMetadata* single_buf_; + internal::CallOpSetInterface* finish_buf_ = nullptr; + std::function + read_initial_metadata_; + std::function + finish_; +}; + +/// Async server-side API for handling unary calls, where the single +/// response message sent to the client is of type \a W. +template +class ServerAsyncResponseWriter final + : public grpc::internal::ServerAsyncStreamingInterface { + public: + explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Side effect: + /// The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_buf_.set_output_tag(tag); + meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_buf_); + } + + /// Indicate that the stream is to be finished and request notification + /// when the server has sent the appropriate signals to the client to + /// end the call. Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// \param[in] msg Message to be sent to the client. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// Note: if \a status has a non-OK code, then \a msg will not be sent, + /// and the client will receive only the status with possible trailing + /// metadata. + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). + void Finish(const W& msg, const grpc::Status& status, void* tag) { + finish_buf_.set_output_tag(tag); + finish_buf_.set_core_cq_tag(&finish_buf_); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_buf_.SendMessage(msg)); + } else { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_buf_); + } + + /// Indicate that the stream is to be finished with a non-OK status, + /// and request notification for when the server has finished sending the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// - Note: \a status must have a non-OK code. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). + void FinishWithError(const grpc::Status& status, void* tag) { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_buf_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_buf_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_buf_; + grpc::internal::CallOpSet + finish_buf_; +}; + +} // namespace grpc + +namespace std { +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +} // namespace std #endif // GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h index d1969953..a9ba7d16 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h @@ -19,9 +19,221 @@ #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include +#include +#include + +namespace grpc { + +class ServerInterface; +class ByteBuffer; +class ServerInterface; + +namespace internal { +template +class CallbackUnaryHandler; +template +class CallbackServerStreamingHandler; +template +void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); +template +class ServerStreamingHandler; +template +class ErrorMethodHandler; +class CallOpSendMessage; +template +class CallOpRecvMessage; +class CallOpGenericRecvMessage; +class ExternalConnectionAcceptorImpl; +template +class DeserializeFuncType; +class GrpcByteBufferPeer; + +} // namespace internal +/// A sequence of bytes. +class ByteBuffer final { + public: + /// Constuct an empty buffer. + ByteBuffer() : buffer_(nullptr) {} + + /// Construct buffer from \a slices, of which there are \a nslices. + ByteBuffer(const Slice* slices, size_t nslices) { + // The following assertions check that the representation of a grpc::Slice + // is identical to that of a grpc_slice: it has a grpc_slice field, and + // nothing else. + static_assert(std::is_same::value, + "Slice must have same representation as grpc_slice"); + static_assert(sizeof(Slice) == sizeof(grpc_slice), + "Slice must have same representation as grpc_slice"); + // The following assertions check that the representation of a ByteBuffer is + // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, + // and nothing else. + static_assert(std::is_same::value, + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + // The const_cast is legal if grpc_raw_byte_buffer_create() does no more + // than its advertised side effect of increasing the reference count of the + // slices it processes, and such an increase does not affect the semantics + // seen by the caller of this constructor. + buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( + reinterpret_cast(const_cast(slices)), nslices); + } + + /// Constuct a byte buffer by referencing elements of existing buffer + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } + + ~ByteBuffer() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + } + } + + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer& operator=(const ByteBuffer& buf) { + if (this != &buf) { + Clear(); // first remove existing data + } + if (buf.buffer_) { + // then copy + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); + } + return *this; + } + + // If this ByteBuffer's representation is a single flat slice, returns a + // slice referencing that array. + Status TrySingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slics. + Status DumpToSingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slices. + Status Dump(std::vector* slices) const; + + /// Remove all data. + void Clear() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + buffer_ = nullptr; + } + } + + /// Make a duplicate copy of the internals of this byte + /// buffer so that we have our own owned version of it. + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. + void Duplicate() { + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); + } + + /// Forget underlying byte buffer without destroying + /// Use this only for un-owned byte buffers + void Release() { buffer_ = nullptr; } + + /// Buffer size in bytes. + size_t Length() const { + return buffer_ == nullptr + ? 0 + : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); + } + + /// Swap the state of *this and *other. + void Swap(ByteBuffer* other) { + grpc_byte_buffer* tmp = other->buffer_; + other->buffer_ = buffer_; + buffer_ = tmp; + } + + /// Is this ByteBuffer valid? + bool Valid() const { return (buffer_ != nullptr); } + + private: + friend class SerializationTraits; + friend class ServerInterface; + friend class internal::CallOpSendMessage; + template + friend class internal::CallOpRecvMessage; + friend class internal::CallOpGenericRecvMessage; + template + friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, + grpc::Status*, RequestType*); + template + friend class internal::ServerStreamingHandler; + template + friend class internal::CallbackUnaryHandler; + template + friend class internal::CallbackServerStreamingHandler; + template + friend class internal::ErrorMethodHandler; + template + friend class internal::DeserializeFuncType; + friend class ProtoBufferReader; + friend class ProtoBufferWriter; + friend class internal::GrpcByteBufferPeer; + friend class internal::ExternalConnectionAcceptorImpl; + + grpc_byte_buffer* buffer_; + + // takes ownership + void set_buffer(grpc_byte_buffer* buf) { + if (buffer_) { + Clear(); + } + buffer_ = buf; + } + + grpc_byte_buffer* c_buffer() { return buffer_; } + grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } + + class ByteBufferPointer { + public: + /* NOLINTNEXTLINE(google-explicit-constructor) */ + ByteBufferPointer(const ByteBuffer* b) + : bbuf_(const_cast(b)) {} + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator ByteBuffer*() { return bbuf_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer*() { return bbuf_->buffer_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer**() { return &bbuf_->buffer_; } + + private: + ByteBuffer* bbuf_; + }; + ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } +}; + +template <> +class SerializationTraits { + public: + static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { + dest->set_buffer(byte_buffer->buffer_); + return Status::OK; + } + static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, + bool* own_buffer) { + *buffer = source; + *own_buffer = true; + return g_core_codegen_interface->ok(); + } +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h index 71f6cb8e..90d54bc5 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call.h @@ -18,9 +18,78 @@ #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +namespace grpc { +class CompletionQueue; +namespace experimental { +class ClientRpcInfo; +class ServerRpcInfo; +} // namespace experimental +namespace internal { +class CallHook; +class CallOpSetInterface; + +/// Straightforward wrapping of the C call object +class Call final { + public: + Call() + : call_hook_(nullptr), + cq_(nullptr), + call_(nullptr), + max_receive_message_size_(-1) {} + /** call is owned by the caller */ + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + experimental::ClientRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1), + client_rpc_info_(rpc_info) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(max_receive_message_size), + server_rpc_info_(rpc_info) {} + + void PerformOps(CallOpSetInterface* ops) { + call_hook_->PerformOpsOnCall(ops, this); + } + + grpc_call* call() const { return call_; } + grpc::CompletionQueue* cq() const { return cq_; } + + int max_receive_message_size() const { return max_receive_message_size_; } + + experimental::ClientRpcInfo* client_rpc_info() const { + return client_rpc_info_; + } + + experimental::ServerRpcInfo* server_rpc_info() const { + return server_rpc_info_; + } + + private: + CallHook* call_hook_; + grpc::CompletionQueue* cq_; + grpc_call* call_; + int max_receive_message_size_; + experimental::ClientRpcInfo* client_rpc_info_ = nullptr; + experimental::ServerRpcInfo* server_rpc_info_ = nullptr; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h index db10a0fc..8c4278e7 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_hook.h @@ -21,7 +21,21 @@ // IWYU pragma: private -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +namespace grpc { + +namespace internal { +class CallOpSetInterface; +class Call; + +/// This is an interface that Channel and Server implement to allow them to hook +/// performing ops. +class CallHook { + public: + virtual ~CallHook() {} + virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; +}; +} // namespace internal + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h index 62b11680..5b1d4409 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h index ce5f2036..a8eed9f6 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h @@ -21,6 +21,41 @@ // IWYU pragma: private -#include +#include + +namespace grpc { +namespace internal { + +class Call; + +/// An abstract collection of call ops, used to generate the +/// grpc_call_op structure to pass down to the lower layers, +/// and as it is-a CompletionQueueTag, also massages the final +/// completion into the correct form for consumption in the C++ +/// API. +class CallOpSetInterface : public CompletionQueueTag { + public: + /// Fills in grpc_op, starting from ops[*nops] and moving + /// upwards. + virtual void FillOps(internal::Call* call) = 0; + + /// Get the tag to be used at the core completion queue. Generally, the + /// value of core_cq_tag will be "this". However, it can be overridden if we + /// want core to process the tag differently (e.g., as a core callback) + virtual void* core_cq_tag() = 0; + + // This will be called while interceptors are run if the RPC is a hijacked + // RPC. This should set hijacking state for each of the ops. + virtual void SetHijackingState() = 0; + + // Should be called after interceptors are done running + virtual void ContinueFillOpsAfterInterception() = 0; + + // Should be called after interceptors are done running on the finalize result + // path + virtual void ContinueFinalizeResultAfterInterception() = 0; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h index c0f605ac..7c67c928 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/callback_common.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h index dde3ae7b..19fef7e2 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h @@ -22,7 +22,7 @@ // IWYU pragma: private #include -#include +#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h index 1c6b8ce5..f3560b5a 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h @@ -19,9 +19,181 @@ #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +#include +#include +#include + +namespace grpc { + +class Channel; +class ClientContext; + +namespace internal { +class InterceptorBatchMethodsImpl; +} + +namespace experimental { +class ClientRpcInfo; + +// A factory interface for creation of client interceptors. A vector of +// factories can be provided at channel creation which will be used to create a +// new vector of client interceptors per RPC. Client interceptor authors should +// create a subclass of ClientInterceptorFactorInterface which creates objects +// of their interceptors. +class ClientInterceptorFactoryInterface { + public: + virtual ~ClientInterceptorFactoryInterface() {} + // Returns a pointer to an Interceptor object on successful creation, nullptr + // otherwise. If nullptr is returned, this server interceptor factory is + // ignored for the purposes of that RPC. + virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; +}; +} // namespace experimental + +namespace internal { +extern experimental::ClientInterceptorFactoryInterface* + g_global_client_interceptor_factory; +} + +/// ClientRpcInfo represents the state of a particular RPC as it +/// appears to an interceptor. It is created and owned by the library and +/// passed to the CreateClientInterceptor method of the application's +/// ClientInterceptorFactoryInterface implementation +namespace experimental { +class ClientRpcInfo { + public: + // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN + // from the list of possible Types. + /// Type categorizes RPCs by unary or streaming type + enum class Type { + UNARY, + CLIENT_STREAMING, + SERVER_STREAMING, + BIDI_STREAMING, + UNKNOWN // UNKNOWN is not API and will be removed later + }; + + ~ClientRpcInfo() {} + + // Delete copy constructor but allow default move constructor + ClientRpcInfo(const ClientRpcInfo&) = delete; + ClientRpcInfo(ClientRpcInfo&&) = default; + + // Getter methods + + /// Return the fully-specified method name + const char* method() const { return method_; } + + /// Return an identifying suffix for the client stub, or nullptr if one wasn't + /// specified. + const char* suffix_for_stats() const { return suffix_for_stats_; } + + /// Return a pointer to the channel on which the RPC is being sent + ChannelInterface* channel() { return channel_; } + + /// Return a pointer to the underlying ClientContext structure associated + /// with the RPC to support features that apply to it + grpc::ClientContext* client_context() { return ctx_; } + + /// Return the type of the RPC (unary or a streaming flavor) + Type type() const { return type_; } + + private: + static_assert(Type::UNARY == + static_cast(internal::RpcMethod::NORMAL_RPC), + "violated expectation about Type enum"); + static_assert(Type::CLIENT_STREAMING == + static_cast(internal::RpcMethod::CLIENT_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::SERVER_STREAMING == + static_cast(internal::RpcMethod::SERVER_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::BIDI_STREAMING == + static_cast(internal::RpcMethod::BIDI_STREAMING), + "violated expectation about Type enum"); + + // Default constructor should only be used by ClientContext + ClientRpcInfo() = default; + + // Constructor will only be called from ClientContext + ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, + const char* method, const char* suffix_for_stats, + grpc::ChannelInterface* channel) + : ctx_(ctx), + type_(static_cast(type)), + method_(method), + suffix_for_stats_(suffix_for_stats), + channel_(channel) {} + + // Move assignment should only be used by ClientContext + // TODO(yashykt): Delete move assignment + ClientRpcInfo& operator=(ClientRpcInfo&&) = default; + + // Runs interceptor at pos \a pos. + void RunInterceptor( + experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { + GPR_CODEGEN_ASSERT(pos < interceptors_.size()); + interceptors_[pos]->Intercept(interceptor_methods); + } + + void RegisterInterceptors( + const std::vector>& creators, + size_t interceptor_pos) { + if (interceptor_pos > creators.size()) { + // No interceptors to register + return; + } + // NOTE: The following is not a range-based for loop because it will only + // iterate over a portion of the creators vector. + for (auto it = creators.begin() + interceptor_pos; it != creators.end(); + ++it) { + auto* interceptor = (*it)->CreateClientInterceptor(this); + if (interceptor != nullptr) { + interceptors_.push_back( + std::unique_ptr(interceptor)); + } + } + if (internal::g_global_client_interceptor_factory != nullptr) { + interceptors_.push_back(std::unique_ptr( + internal::g_global_client_interceptor_factory + ->CreateClientInterceptor(this))); + } + } + + grpc::ClientContext* ctx_ = nullptr; + // TODO(yashykt): make type_ const once move-assignment is deleted + Type type_{Type::UNKNOWN}; + const char* method_ = nullptr; + const char* suffix_for_stats_ = nullptr; + grpc::ChannelInterface* channel_ = nullptr; + std::vector> interceptors_; + bool hijacked_ = false; + size_t hijacked_interceptor_ = 0; + + friend class internal::InterceptorBatchMethodsImpl; + friend class grpc::ClientContext; +}; + +// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL +// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. +// Registers a global client interceptor factory object, which is used for all +// RPCs made in this process. The application is responsible for maintaining the +// life of the object while gRPC operations are in progress. The global +// interceptor factory should only be registered once at the start of the +// process before any gRPC operations have begun. +void RegisterGlobalClientInterceptorFactory( + ClientInterceptorFactoryInterface* factory); + +// For testing purposes only +void TestOnlyResetGlobalClientInterceptorFactory(); + +} // namespace experimental +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h index bcb85746..14450533 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor.h @@ -26,11 +26,11 @@ #include #include +#include #include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h index 2595938c..b084b7ce 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h index 797e8256..58056314 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/method_handler.h @@ -21,10 +21,10 @@ // IWYU pragma: private, include +#include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h index 2aa7774a..6f6730a1 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h @@ -28,10 +28,10 @@ #include #include +#include #include #include #include -#include namespace grpc { class ServerContextBase; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h index 2f20dade..0deac825 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/server_interface.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h index 1235b8de..aca60790 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h @@ -20,7 +20,7 @@ // IWYU pragma: private, include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/security/credentials.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/security/credentials.h index d9b43934..18dce966 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/security/credentials.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/security/credentials.h @@ -25,11 +25,11 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/server.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/server.h index 2264585c..dce87448 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/server.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/server.h @@ -31,13 +31,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_stream.h index 18e84dfc..5f717014 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_stream.h @@ -19,1115 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H #define GRPCPP_SUPPORT_ASYNC_STREAM_H -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -namespace internal { -/// Common interface for all client side asynchronous streaming. -class ClientAsyncStreamingInterface { - public: - virtual ~ClientAsyncStreamingInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall(void* tag) = 0; - - /// Request notification of the reading of the initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a AsyncReaderInterface::Read method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Indicate that the stream is to be finished and request notification for - /// when the call has been ended. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method exactly once when both: - /// * the client side has no more message to send - /// (this can be declared implicitly by calling this method, or - /// explicitly through an earlier call to the WritesDone method - /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or - /// \a ClientAsyncReaderWriterInterface::WritesDone). - /// * there are no more messages to be received from the server (this can - /// be known implicitly by the calling code, or explicitly from an - /// earlier call to \a AsyncReaderInterface::Read that yielded a failed - /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// The tag will be returned when either: - /// - all incoming messages have been read and the server has returned - /// a status. - /// - the server has returned a non-OK status. - /// - the call failed for some reason and the library generated a - /// status. - /// - /// Note that implementations of this method attempt to receive initial - /// metadata from the server if initial metadata hasn't yet been received. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - virtual void Finish(grpc::Status* status, void* tag) = 0; -}; - -/// An interface that yields a sequence of messages of type \a R. -template -class AsyncReaderInterface { - public: - virtual ~AsyncReaderInterface() {} - - /// Read a message of type \a R into \a msg. Completion will be notified by \a - /// tag on the associated completion queue. - /// This is thread-safe with respect to \a Write or \a WritesDone methods. It - /// should not be called concurrently with other streaming APIs - /// on the same stream. It is not meaningful to call it concurrently - /// with another \a AsyncReaderInterface::Read on the same stream since reads - /// on the same stream are delivered in order. - /// - /// \param[out] msg Where to eventually store the read message. - /// \param[in] tag The tag identifying the operation. - /// - /// Side effect: note that this method attempt to receive initial metadata for - /// a stream if it hasn't yet been received. - virtual void Read(R* msg, void* tag) = 0; -}; - -/// An interface that can be fed a sequence of messages of type \a W. -template -class AsyncWriterInterface { - public: - virtual ~AsyncWriterInterface() {} - - /// Request the writing of \a msg with identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, void* tag) = 0; - - /// Request the writing of \a msg using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// WriteOptions \a options is used to set the write options of this message. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with the writing - /// of trailing metadata, using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// For client, WriteLast is equivalent of performing Write and - /// WritesDone in a single step. - /// For server, WriteLast buffers the \a msg. The writing of \a msg is held - /// until Finish is called, where \a msg and trailing metadata are coalesced - /// and write is initiated. Note that WriteLast can only buffer \a msg up to - /// the flow control window size. If \a msg size is larger than the window - /// size, it will be sent on wire without buffering. - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { - Write(msg, options.set_last_message(), tag); - } -}; - -} // namespace internal - -template -class ClientAsyncReaderInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncReaderInterface {}; - -namespace internal { -template -class ClientAsyncReaderFactory { - public: - /// Create a stream object. - /// Write the first request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started and - /// \a request has been written out. If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - template - static ClientAsyncReader* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, - const W& request, bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReader))) - ClientAsyncReader(call, context, request, start, tag); - } -}; -} // namespace internal - -/// Async client-side API for doing server-streaming RPCs, -/// where the incoming message stream coming from the server has -/// messages of type \a R. -template -class ClientAsyncReader final : public ClientAsyncReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata - /// method for semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, - /// the \a ClientContext associated with this call is updated, and the - /// calling code can access the received metadata through the - /// \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderFactory; - template - ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, - const W& request, bool start, void* tag) - : context_(context), call_(call), started_(start) { - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - init_ops_.set_output_tag(tag); - call_.PerformOps(&init_ops_); - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - init_ops_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Common interface for client side asynchronous writing. -template -class ClientAsyncWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncWriterFactory { - public: - /// Create a stream object. - /// Start the RPC if \a start is set - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, \a tag must be nullptr and the actual call - /// must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// \a response will be filled in with the single expected response - /// message from the server upon a successful call to the \a Finish - /// method of this instance. - template - static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, R* response, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncWriter))) - ClientAsyncWriter(call, context, response, start, tag); - } -}; -} // namespace internal - -/// Async API on the client side for doing client-streaming RPCs, -/// where the outgoing message stream going to the server contains -/// messages of type \a W. -template -class ClientAsyncWriter final : public ClientAsyncWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for - /// semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// associated with this call is updated, and the calling code can access - /// the received metadata through the \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - /// - attempts to fill in the \a response parameter passed to this class's - /// constructor with the server's response message. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncWriterFactory; - template - ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, - R* response, bool start, void* tag) - : context_(context), call_(call), started_(start) { - finish_ops_.RecvMessage(response); - finish_ops_.AllowNoMessage(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Async client-side interface for bi-directional streaming, -/// where the client-to-server message stream has messages of type \a W, -/// and the server-to-client message stream has messages of type \a R. -template -class ClientAsyncReaderWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncReaderWriterFactory { - public: - /// Create a stream object. - /// Start the RPC request if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent). If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - static ClientAsyncReaderWriter* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReaderWriter))) - ClientAsyncReaderWriter(call, context, start, tag); - } -}; -} // namespace internal - -/// Async client-side interface for bi-directional streaming, -/// where the outgoing message stream going to the server -/// has messages of type \a W, and the incoming message stream coming -/// from the server has messages of type \a R. -template -class ClientAsyncReaderWriter final - : public ClientAsyncReaderWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method - /// for semantics of this method. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// is updated with it, and then the receiving initial metadata can - /// be accessed through this \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// Side effect - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderWriterFactory; - ClientAsyncReaderWriter(grpc::internal::Call call, - grpc::ClientContext* context, bool start, void* tag) - : context_(context), call_(call), started_(start) { - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncReaderInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code - /// and also send out \a msg response to the client. - /// Request notification for when the server has sent the response and the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous - /// \a AsyncReaderInterface::Read operation with a non-ok result, - /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it - /// is safe to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// \param[in] msg To be sent to the client as the response for this call. - virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; - - /// Indicate that the stream is to be finished with a certain - /// non-OK status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// This call is meant to end the call with some error, and can be called at - /// any point that the server would like to "fail" the call (though note - /// this shouldn't be called concurrently with any other "sending" call, like - /// \a AsyncWriterInterface::Write). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), and status, or if some failure occurred - /// when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// - Note: \a status must have a non-OK code. - virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing client-streaming RPCs, -/// where the incoming message stream from the client has messages of type \a R, -/// and the single response message sent from the server is type \a W. -template -class ServerAsyncReader final : public ServerAsyncReaderInterface { - public: - explicit ServerAsyncReader(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// Note: \a msg is not sent if \a status has a non-OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once Finish returns. - void Finish(const W& msg, const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_ops_.SendMessage(msg)); - } else { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - void FinishWithError(const grpc::Status& status, void* tag) override { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation with a non-ok - /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish - /// in a single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing server streaming RPCs, -/// where the outgoing message stream from the server has messages of type \a W. -template -class ServerAsyncWriter final : public ServerAsyncWriterInterface { - public: - explicit ServerAsyncWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of - /// \a status,it may be non-OK - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Server-side interface for asynchronous bi-directional streaming. -template -class ServerAsyncReaderWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation - /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' - /// with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if some - /// failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish in a - /// single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing bidirectional streaming RPCs, -/// where the incoming message stream coming from the client has messages of -/// type \a R, and the outgoing message stream coming from the server has -/// messages of type \a W. -template -class ServerAsyncReaderWriter final - : public ServerAsyncReaderWriterInterface { - public: - explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - EnsureInitialMetadataSent(&write_ops_); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish - /// method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - // - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of \a status, - /// it may be non-OK - // - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class grpc::Server; - - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h index a9886031..02071e48 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/async_unary_call.h @@ -19,402 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H #define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -// Forward declaration for use in Helper class -template -class ClientAsyncResponseReader; - -/// An interface relevant for async client side unary RPCs (which send -/// one request message to a server and receive one response message). -template -class ClientAsyncResponseReaderInterface { - public: - virtual ~ClientAsyncResponseReaderInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall() = 0; - - /// Request notification of the reading of initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a Finish method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Request to receive the server's response \a msg and final \a status for - /// the call, and to notify \a tag on this call's completion queue when - /// finished. - /// - /// This function will return when either: - /// - when the server's response message and status have been received. - /// - when the server has returned a non-OK status (no message expected in - /// this case). - /// - when the call failed for some reason and the library generated a - /// non-OK status. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - /// \param[out] msg To be filled in with the server's response message. - virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; -}; - -namespace internal { - -class ClientAsyncResponseReaderHelper { - public: - /// Start a call and write the request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// - /// Optionally pass in a base class for request and response types so that the - /// internal functions and structs can be templated based on that, allowing - /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors - /// can't have an explicit template parameter, the last argument is an - /// extraneous parameter just to provide the needed type information. - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request) /* __attribute__((noinline)) */ { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - ClientAsyncResponseReader* result = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncResponseReader))) - ClientAsyncResponseReader(call, context); - SetupRequest( - call.call(), &result->single_buf_, &result->read_initial_metadata_, - &result->finish_, static_cast(request)); - - return result; - } - - // Various helper functions to reduce templating use - - template - static void SetupRequest( - grpc_call* call, - grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, - std::function* - read_initial_metadata, - std::function< - void(ClientContext*, internal::Call*, bool initial_metadata_read, - internal::CallOpSendInitialMetadata*, - internal::CallOpSetInterface**, void*, Status*, void*)>* finish, - const W& request) { - using SingleBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - SingleBufType* single_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(SingleBufType))) SingleBufType; - *single_buf_ptr = single_buf; - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); - single_buf->ClientSendClose(); - - // The purpose of the following functions is to type-erase the actual - // templated type of the CallOpSet being used by hiding that type inside the - // function definition rather than specifying it as an argument of the - // function or a member of the class. The type-erased CallOpSet will get - // static_cast'ed back to the real type so that it can be used properly. - *read_initial_metadata = - [](ClientContext* context, internal::Call* call, - internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - call->PerformOps(single_buf); - }; - - // Note that this function goes one step further than the previous one - // because it type-erases the message being written down to a void*. This - // will be static-cast'ed back to the class specified here by hiding that - // class information inside the function definition. Note that this feature - // expects the class being specified here for R to be a base-class of the - // "real" R without any multiple-inheritance (as applies in protbuf wrt - // MessageLite) - *finish = [](ClientContext* context, internal::Call* call, - bool initial_metadata_read, - internal::CallOpSendInitialMetadata* single_buf_view, - internal::CallOpSetInterface** finish_buf_ptr, void* msg, - Status* status, void* tag) { - if (initial_metadata_read) { - using FinishBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - FinishBufType* finish_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call->call(), sizeof(FinishBufType))) FinishBufType; - *finish_buf_ptr = finish_buf; - finish_buf->set_output_tag(tag); - finish_buf->RecvMessage(static_cast(msg)); - finish_buf->AllowNoMessage(); - finish_buf->ClientRecvStatus(context, status); - call->PerformOps(finish_buf); - } else { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - single_buf->RecvMessage(static_cast(msg)); - single_buf->AllowNoMessage(); - single_buf->ClientRecvStatus(context, status); - call->PerformOps(single_buf); - } - }; - } - - static void StartCall(grpc::ClientContext* context, - grpc::internal::CallOpSendInitialMetadata* single_buf) { - single_buf->SendInitialMetadata(&context->send_initial_metadata_, - context->initial_metadata_flags()); - } -}; - -// TODO(vjpai): This templated factory is deprecated and will be replaced by -//. the non-templated helper as soon as possible. -template -class ClientAsyncResponseReaderFactory { - public: - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request, bool start) { - auto* result = ClientAsyncResponseReaderHelper::Create( - channel, cq, method, context, request); - if (start) { - result->StartCall(); - } - return result; - } -}; - -} // namespace internal - -/// Async API for client-side unary RPCs, where the message response -/// received from the server is of type \a R. -template -class ClientAsyncResponseReader final - : public ClientAsyncResponseReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall() override { - GPR_CODEGEN_DEBUG_ASSERT(!started_); - started_ = true; - internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); - } - - /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for - /// semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); - read_initial_metadata_(context_, &call_, single_buf_, tag); - initial_metadata_read_ = true; - } - - /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(R* msg, grpc::Status* status, void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, - static_cast(msg), status, tag); - } - - private: - friend class internal::ClientAsyncResponseReaderHelper; - grpc::ClientContext* const context_; - grpc::internal::Call call_; - bool started_ = false; - bool initial_metadata_read_ = false; - - ClientAsyncResponseReader(grpc::internal::Call call, - grpc::ClientContext* context) - : context_(context), call_(call) {} - - // disable operator new - static void* operator new(std::size_t size); - static void* operator new(std::size_t /*size*/, void* p) { return p; } - - internal::CallOpSendInitialMetadata* single_buf_; - internal::CallOpSetInterface* finish_buf_ = nullptr; - std::function - read_initial_metadata_; - std::function - finish_; -}; - -/// Async server-side API for handling unary calls, where the single -/// response message sent to the client is of type \a W. -template -class ServerAsyncResponseWriter final - : public grpc::internal::ServerAsyncStreamingInterface { - public: - explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Side effect: - /// The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_buf_.set_output_tag(tag); - meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_buf_); - } - - /// Indicate that the stream is to be finished and request notification - /// when the server has sent the appropriate signals to the client to - /// end the call. Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// \param[in] msg Message to be sent to the client. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// Note: if \a status has a non-OK code, then \a msg will not be sent, - /// and the client will receive only the status with possible trailing - /// metadata. - /// - /// gRPC doesn't take ownership or a reference to msg and status, so it is - /// safe to deallocate them once the Finish operation is complete (i.e. a - /// result arrives in the completion queue). - void Finish(const W& msg, const grpc::Status& status, void* tag) { - finish_buf_.set_output_tag(tag); - finish_buf_.set_core_cq_tag(&finish_buf_); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_buf_.SendMessage(msg)); - } else { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_buf_); - } - - /// Indicate that the stream is to be finished with a non-OK status, - /// and request notification for when the server has finished sending the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// - Note: \a status must have a non-OK code. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// gRPC doesn't take ownership or a reference to status, so it is safe to - /// deallocate them once the Finish operation is complete (i.e. a result - /// arrives in the completion queue). - void FinishWithError(const grpc::Status& status, void* tag) { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_buf_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_buf_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_buf_; - grpc::internal::CallOpSet - finish_buf_; -}; - -} // namespace grpc - -namespace std { -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -} // namespace std +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h index 7ca7c4b2..6f566e76 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/byte_buffer.h @@ -19,221 +19,13 @@ #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H #define GRPCPP_SUPPORT_BYTE_BUFFER_H -#include - #include #include #include -#include +#include // IWYU pragma: export #include #include #include #include -namespace grpc { - -class ServerInterface; -class ByteBuffer; -class ServerInterface; - -namespace internal { -template -class CallbackUnaryHandler; -template -class CallbackServerStreamingHandler; -template -void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); -template -class ServerStreamingHandler; -template -class ErrorMethodHandler; -class CallOpSendMessage; -template -class CallOpRecvMessage; -class CallOpGenericRecvMessage; -class ExternalConnectionAcceptorImpl; -template -class DeserializeFuncType; -class GrpcByteBufferPeer; - -} // namespace internal -/// A sequence of bytes. -class ByteBuffer final { - public: - /// Constuct an empty buffer. - ByteBuffer() : buffer_(nullptr) {} - - /// Construct buffer from \a slices, of which there are \a nslices. - ByteBuffer(const Slice* slices, size_t nslices) { - // The following assertions check that the representation of a grpc::Slice - // is identical to that of a grpc_slice: it has a grpc_slice field, and - // nothing else. - static_assert(std::is_same::value, - "Slice must have same representation as grpc_slice"); - static_assert(sizeof(Slice) == sizeof(grpc_slice), - "Slice must have same representation as grpc_slice"); - // The following assertions check that the representation of a ByteBuffer is - // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, - // and nothing else. - static_assert(std::is_same::value, - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - // The const_cast is legal if grpc_raw_byte_buffer_create() does no more - // than its advertised side effect of increasing the reference count of the - // slices it processes, and such an increase does not affect the semantics - // seen by the caller of this constructor. - buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( - reinterpret_cast(const_cast(slices)), nslices); - } - - /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } - - ~ByteBuffer() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - } - } - - /// Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer& operator=(const ByteBuffer& buf) { - if (this != &buf) { - Clear(); // first remove existing data - } - if (buf.buffer_) { - // then copy - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); - } - return *this; - } - - // If this ByteBuffer's representation is a single flat slice, returns a - // slice referencing that array. - Status TrySingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slics. - Status DumpToSingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slices. - Status Dump(std::vector* slices) const; - - /// Remove all data. - void Clear() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - buffer_ = nullptr; - } - } - - /// Make a duplicate copy of the internals of this byte - /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. - /// This is not a deep copy; it is a referencing and its performance - /// is size-independent. - void Duplicate() { - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); - } - - /// Forget underlying byte buffer without destroying - /// Use this only for un-owned byte buffers - void Release() { buffer_ = nullptr; } - - /// Buffer size in bytes. - size_t Length() const { - return buffer_ == nullptr - ? 0 - : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); - } - - /// Swap the state of *this and *other. - void Swap(ByteBuffer* other) { - grpc_byte_buffer* tmp = other->buffer_; - other->buffer_ = buffer_; - buffer_ = tmp; - } - - /// Is this ByteBuffer valid? - bool Valid() const { return (buffer_ != nullptr); } - - private: - friend class SerializationTraits; - friend class ServerInterface; - friend class internal::CallOpSendMessage; - template - friend class internal::CallOpRecvMessage; - friend class internal::CallOpGenericRecvMessage; - template - friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, - grpc::Status*, RequestType*); - template - friend class internal::ServerStreamingHandler; - template - friend class internal::CallbackUnaryHandler; - template - friend class internal::CallbackServerStreamingHandler; - template - friend class internal::ErrorMethodHandler; - template - friend class internal::DeserializeFuncType; - friend class ProtoBufferReader; - friend class ProtoBufferWriter; - friend class internal::GrpcByteBufferPeer; - friend class internal::ExternalConnectionAcceptorImpl; - - grpc_byte_buffer* buffer_; - - // takes ownership - void set_buffer(grpc_byte_buffer* buf) { - if (buffer_) { - Clear(); - } - buffer_ = buf; - } - - grpc_byte_buffer* c_buffer() { return buffer_; } - grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } - - class ByteBufferPointer { - public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ - ByteBufferPointer(const ByteBuffer* b) - : bbuf_(const_cast(b)) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator ByteBuffer*() { return bbuf_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer*() { return bbuf_->buffer_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer**() { return &bbuf_->buffer_; } - - private: - ByteBuffer* bbuf_; - }; - ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } -}; - -template <> -class SerializationTraits { - public: - static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { - dest->set_buffer(byte_buffer->buffer_); - return Status::OK; - } - static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, - bool* own_buffer) { - *buffer = source; - *own_buffer = true; - return g_core_codegen_interface->ok(); - } -}; - -} // namespace grpc - #endif // GRPCPP_SUPPORT_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h index 8e5e1ce6..552cab4c 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Headers/support/client_interceptor.h @@ -19,179 +19,6 @@ #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H -#include -#include - -#include -#include -#include - -namespace grpc { - -class Channel; -class ClientContext; - -namespace internal { -class InterceptorBatchMethodsImpl; -} - -namespace experimental { -class ClientRpcInfo; - -// A factory interface for creation of client interceptors. A vector of -// factories can be provided at channel creation which will be used to create a -// new vector of client interceptors per RPC. Client interceptor authors should -// create a subclass of ClientInterceptorFactorInterface which creates objects -// of their interceptors. -class ClientInterceptorFactoryInterface { - public: - virtual ~ClientInterceptorFactoryInterface() {} - // Returns a pointer to an Interceptor object on successful creation, nullptr - // otherwise. If nullptr is returned, this server interceptor factory is - // ignored for the purposes of that RPC. - virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; -}; -} // namespace experimental - -namespace internal { -extern experimental::ClientInterceptorFactoryInterface* - g_global_client_interceptor_factory; -} - -/// ClientRpcInfo represents the state of a particular RPC as it -/// appears to an interceptor. It is created and owned by the library and -/// passed to the CreateClientInterceptor method of the application's -/// ClientInterceptorFactoryInterface implementation -namespace experimental { -class ClientRpcInfo { - public: - // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN - // from the list of possible Types. - /// Type categorizes RPCs by unary or streaming type - enum class Type { - UNARY, - CLIENT_STREAMING, - SERVER_STREAMING, - BIDI_STREAMING, - UNKNOWN // UNKNOWN is not API and will be removed later - }; - - ~ClientRpcInfo() {} - - // Delete copy constructor but allow default move constructor - ClientRpcInfo(const ClientRpcInfo&) = delete; - ClientRpcInfo(ClientRpcInfo&&) = default; - - // Getter methods - - /// Return the fully-specified method name - const char* method() const { return method_; } - - /// Return an identifying suffix for the client stub, or nullptr if one wasn't - /// specified. - const char* suffix_for_stats() const { return suffix_for_stats_; } - - /// Return a pointer to the channel on which the RPC is being sent - ChannelInterface* channel() { return channel_; } - - /// Return a pointer to the underlying ClientContext structure associated - /// with the RPC to support features that apply to it - grpc::ClientContext* client_context() { return ctx_; } - - /// Return the type of the RPC (unary or a streaming flavor) - Type type() const { return type_; } - - private: - static_assert(Type::UNARY == - static_cast(internal::RpcMethod::NORMAL_RPC), - "violated expectation about Type enum"); - static_assert(Type::CLIENT_STREAMING == - static_cast(internal::RpcMethod::CLIENT_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::SERVER_STREAMING == - static_cast(internal::RpcMethod::SERVER_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::BIDI_STREAMING == - static_cast(internal::RpcMethod::BIDI_STREAMING), - "violated expectation about Type enum"); - - // Default constructor should only be used by ClientContext - ClientRpcInfo() = default; - - // Constructor will only be called from ClientContext - ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, - const char* method, const char* suffix_for_stats, - grpc::ChannelInterface* channel) - : ctx_(ctx), - type_(static_cast(type)), - method_(method), - suffix_for_stats_(suffix_for_stats), - channel_(channel) {} - - // Move assignment should only be used by ClientContext - // TODO(yashykt): Delete move assignment - ClientRpcInfo& operator=(ClientRpcInfo&&) = default; - - // Runs interceptor at pos \a pos. - void RunInterceptor( - experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { - GPR_CODEGEN_ASSERT(pos < interceptors_.size()); - interceptors_[pos]->Intercept(interceptor_methods); - } - - void RegisterInterceptors( - const std::vector>& creators, - size_t interceptor_pos) { - if (interceptor_pos > creators.size()) { - // No interceptors to register - return; - } - // NOTE: The following is not a range-based for loop because it will only - // iterate over a portion of the creators vector. - for (auto it = creators.begin() + interceptor_pos; it != creators.end(); - ++it) { - auto* interceptor = (*it)->CreateClientInterceptor(this); - if (interceptor != nullptr) { - interceptors_.push_back( - std::unique_ptr(interceptor)); - } - } - if (internal::g_global_client_interceptor_factory != nullptr) { - interceptors_.push_back(std::unique_ptr( - internal::g_global_client_interceptor_factory - ->CreateClientInterceptor(this))); - } - } - - grpc::ClientContext* ctx_ = nullptr; - // TODO(yashykt): make type_ const once move-assignment is deleted - Type type_{Type::UNKNOWN}; - const char* method_ = nullptr; - const char* suffix_for_stats_ = nullptr; - grpc::ChannelInterface* channel_ = nullptr; - std::vector> interceptors_; - bool hijacked_ = false; - size_t hijacked_interceptor_ = 0; - - friend class internal::InterceptorBatchMethodsImpl; - friend class grpc::ClientContext; -}; - -// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL -// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. -// Registers a global client interceptor factory object, which is used for all -// RPCs made in this process. The application is responsible for maintaining the -// life of the object while gRPC operations are in progress. The global -// interceptor factory should only be registered once at the start of the -// process before any gRPC operations have begun. -void RegisterGlobalClientInterceptorFactory( - ClientInterceptorFactoryInterface* factory); - -// For testing purposes only -void TestOnlyResetGlobalClientInterceptorFactory(); - -} // namespace experimental -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Info.plist b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Info.plist index 3c7e8970..7a2e5e54 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Info.plist +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/gRPC-C++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/gRPC-C++ index afde1cac..2f6a692f 100644 Binary files a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/gRPC-C++ and b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64/gRPC-C++.framework/gRPC-C++ differ diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h index 5681377c..ec8702e4 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/channel.h @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include struct grpc_channel; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h index df015b98..4b94a08e 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/create_channel.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include #include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h index 5081bc5a..6ba0ce26 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/gRPC-C++-umbrella.h @@ -24,8 +24,6 @@ #import "grpcpp.h" #import "health_check_service_interface.h" #import "impl/call.h" -#import "impl/call_hook.h" -#import "impl/call_op_set_interface.h" #import "impl/channel_argument_option.h" #import "impl/client_unary_call.h" #import "impl/codegen/async_generic_service.h" diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h index 5ff98267..01c79428 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/generic/async_generic_service.h @@ -19,117 +19,6 @@ #ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H #define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H -#include - -#include -#include -#include -#include - -struct grpc_server; - -namespace grpc { - -typedef ServerAsyncReaderWriter - GenericServerAsyncReaderWriter; -typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; -typedef ServerAsyncReader GenericServerAsyncReader; -typedef ServerAsyncWriter GenericServerAsyncWriter; - -class GenericServerContext final : public ServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class ServerInterface; - - std::string method_; - std::string host_; -}; - -// A generic service at the server side accepts all RPC methods and hosts. It is -// typically used in proxies. The generic service can be registered to a server -// which also has other services. -// Sample usage: -// ServerBuilder builder; -// auto cq = builder.AddCompletionQueue(); -// AsyncGenericService generic_service; -// builder.RegisterAsyncGenericService(&generic_service); -// auto server = builder.BuildAndStart(); -// -// // request a new call -// GenericServerContext context; -// GenericServerAsyncReaderWriter stream; -// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); -// -// When tag is retrieved from cq->Next(), context.method() can be used to look -// at the method and the RPC can be handled accordingly. -class AsyncGenericService final { - public: - AsyncGenericService() : server_(nullptr) {} - - void RequestCall(GenericServerContext* ctx, - GenericServerAsyncReaderWriter* reader_writer, - grpc::CompletionQueue* call_cq, - grpc::ServerCompletionQueue* notification_cq, void* tag); - - private: - friend class grpc::Server; - grpc::Server* server_; -}; - -/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs -/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with -/// ByteBuffer arguments. -using ServerGenericBidiReactor = ServerBidiReactor; - -class GenericCallbackServerContext final : public grpc::CallbackServerContext { - public: - const std::string& method() const { return method_; } - const std::string& host() const { return host_; } - - private: - friend class grpc::Server; - - std::string method_; - std::string host_; -}; - -/// \a CallbackGenericService is the base class for generic services implemented -/// using the callback API and registered through the ServerBuilder using -/// RegisterCallbackGenericService. -class CallbackGenericService { - public: - CallbackGenericService() {} - virtual ~CallbackGenericService() {} - - /// The "method handler" for the generic API. This function should be - /// overridden to provide a ServerGenericBidiReactor that implements the - /// application-level interface for this RPC. Unimplemented by default. - virtual ServerGenericBidiReactor* CreateReactor( - GenericCallbackServerContext* /*ctx*/) { - class Reactor : public ServerGenericBidiReactor { - public: - Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } - void OnDone() override { delete this; } - }; - return new Reactor; - } - - private: - friend class grpc::Server; - - internal::CallbackBidiHandler* Handler() { - return new internal::CallbackBidiHandler( - [this](grpc::CallbackServerContext* ctx) { - return CreateReactor(static_cast(ctx)); - }); - } - - grpc::Server* server_{nullptr}; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h index 2a119963..97d8fdfc 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call.h @@ -19,76 +19,6 @@ #ifndef GRPCPP_IMPL_CALL_H #define GRPCPP_IMPL_CALL_H -#include -#include - -namespace grpc { -class CompletionQueue; -namespace experimental { -class ClientRpcInfo; -class ServerRpcInfo; -} // namespace experimental -namespace internal { -class CallHook; -class CallOpSetInterface; - -/// Straightforward wrapping of the C call object -class Call final { - public: - Call() - : call_hook_(nullptr), - cq_(nullptr), - call_(nullptr), - max_receive_message_size_(-1) {} - /** call is owned by the caller */ - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - experimental::ClientRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(-1), - client_rpc_info_(rpc_info) {} - - Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, - int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) - : call_hook_(call_hook), - cq_(cq), - call_(call), - max_receive_message_size_(max_receive_message_size), - server_rpc_info_(rpc_info) {} - - void PerformOps(CallOpSetInterface* ops) { - call_hook_->PerformOpsOnCall(ops, this); - } - - grpc_call* call() const { return call_; } - grpc::CompletionQueue* cq() const { return cq_; } - - int max_receive_message_size() const { return max_receive_message_size_; } - - experimental::ClientRpcInfo* client_rpc_info() const { - return client_rpc_info_; - } - - experimental::ServerRpcInfo* server_rpc_info() const { - return server_rpc_info_; - } - - private: - CallHook* call_hook_; - grpc::CompletionQueue* cq_; - grpc_call* call_; - int max_receive_message_size_; - experimental::ClientRpcInfo* client_rpc_info_ = nullptr; - experimental::ServerRpcInfo* server_rpc_info_ = nullptr; -}; -} // namespace internal -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_IMPL_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_hook.h deleted file mode 100644 index 8903b9a0..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_hook.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_HOOK_H -#define GRPCPP_IMPL_CALL_HOOK_H - -namespace grpc { - -namespace internal { -class CallOpSetInterface; -class Call; - -/// This is an interface that Channel and Server implement to allow them to hook -/// performing ops. -class CallHook { - public: - virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; -}; -} // namespace internal - -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_op_set_interface.h deleted file mode 100644 index 43ed4ed9..00000000 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/call_op_set_interface.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H -#define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H - -// IWYU pragma: private - -#include - -namespace grpc { -namespace internal { - -class Call; - -/// An abstract collection of call ops, used to generate the -/// grpc_call_op structure to pass down to the lower layers, -/// and as it is-a CompletionQueueTag, also massages the final -/// completion into the correct form for consumption in the C++ -/// API. -class CallOpSetInterface : public CompletionQueueTag { - public: - /// Fills in grpc_op, starting from ops[*nops] and moving - /// upwards. - virtual void FillOps(internal::Call* call) = 0; - - /// Get the tag to be used at the core completion queue. Generally, the - /// value of core_cq_tag will be "this". However, it can be overridden if we - /// want core to process the tag differently (e.g., as a core callback) - virtual void* core_cq_tag() = 0; - - // This will be called while interceptors are run if the RPC is a hijacked - // RPC. This should set hijacking state for each of the ops. - virtual void SetHijackingState() = 0; - - // Should be called after interceptors are done running - virtual void ContinueFillOpsAfterInterception() = 0; - - // Should be called after interceptors are done running on the finalize result - // path - virtual void ContinueFinalizeResultAfterInterception() = 0; -}; -} // namespace internal -} // namespace grpc - -#endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h index 03a096c5..2a000662 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_generic_service.h @@ -19,9 +19,119 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H #define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include + +struct grpc_server; + +namespace grpc { + +typedef ServerAsyncReaderWriter + GenericServerAsyncReaderWriter; +typedef ServerAsyncResponseWriter GenericServerAsyncResponseWriter; +typedef ServerAsyncReader GenericServerAsyncReader; +typedef ServerAsyncWriter GenericServerAsyncWriter; + +class GenericServerContext final : public ServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class ServerInterface; + + std::string method_; + std::string host_; +}; + +// A generic service at the server side accepts all RPC methods and hosts. It is +// typically used in proxies. The generic service can be registered to a server +// which also has other services. +// Sample usage: +// ServerBuilder builder; +// auto cq = builder.AddCompletionQueue(); +// AsyncGenericService generic_service; +// builder.RegisterAsyncGenericService(&generic_service); +// auto server = builder.BuildAndStart(); +// +// // request a new call +// GenericServerContext context; +// GenericServerAsyncReaderWriter stream; +// generic_service.RequestCall(&context, &stream, cq.get(), cq.get(), tag); +// +// When tag is retrieved from cq->Next(), context.method() can be used to look +// at the method and the RPC can be handled accordingly. +class AsyncGenericService final { + public: + AsyncGenericService() : server_(nullptr) {} + + void RequestCall(GenericServerContext* ctx, + GenericServerAsyncReaderWriter* reader_writer, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag); + + private: + friend class grpc::Server; + grpc::Server* server_; +}; + +/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs +/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with +/// ByteBuffer arguments. +using ServerGenericBidiReactor = ServerBidiReactor; + +class GenericCallbackServerContext final : public grpc::CallbackServerContext { + public: + const std::string& method() const { return method_; } + const std::string& host() const { return host_; } + + private: + friend class grpc::Server; + + std::string method_; + std::string host_; +}; + +/// \a CallbackGenericService is the base class for generic services implemented +/// using the callback API and registered through the ServerBuilder using +/// RegisterCallbackGenericService. +class CallbackGenericService { + public: + CallbackGenericService() {} + virtual ~CallbackGenericService() {} + + /// The "method handler" for the generic API. This function should be + /// overridden to provide a ServerGenericBidiReactor that implements the + /// application-level interface for this RPC. Unimplemented by default. + virtual ServerGenericBidiReactor* CreateReactor( + GenericCallbackServerContext* /*ctx*/) { + class Reactor : public ServerGenericBidiReactor { + public: + Reactor() { this->Finish(Status(StatusCode::UNIMPLEMENTED, "")); } + void OnDone() override { delete this; } + }; + return new Reactor; + } + + private: + friend class grpc::Server; + + internal::CallbackBidiHandler* Handler() { + return new internal::CallbackBidiHandler( + [this](grpc::CallbackServerContext* ctx) { + return CreateReactor(static_cast(ctx)); + }); + } + + grpc::Server* server_{nullptr}; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h index 524f619f..5b63c301 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_stream.h @@ -18,9 +18,1115 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +namespace grpc { + +namespace internal { +/// Common interface for all client side asynchronous streaming. +class ClientAsyncStreamingInterface { + public: + virtual ~ClientAsyncStreamingInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall(void* tag) = 0; + + /// Request notification of the reading of the initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a AsyncReaderInterface::Read method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Indicate that the stream is to be finished and request notification for + /// when the call has been ended. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method exactly once when both: + /// * the client side has no more message to send + /// (this can be declared implicitly by calling this method, or + /// explicitly through an earlier call to the WritesDone method + /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or + /// \a ClientAsyncReaderWriterInterface::WritesDone). + /// * there are no more messages to be received from the server (this can + /// be known implicitly by the calling code, or explicitly from an + /// earlier call to \a AsyncReaderInterface::Read that yielded a failed + /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// The tag will be returned when either: + /// - all incoming messages have been read and the server has returned + /// a status. + /// - the server has returned a non-OK status. + /// - the call failed for some reason and the library generated a + /// status. + /// + /// Note that implementations of this method attempt to receive initial + /// metadata from the server if initial metadata hasn't yet been received. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + virtual void Finish(grpc::Status* status, void* tag) = 0; +}; + +/// An interface that yields a sequence of messages of type \a R. +template +class AsyncReaderInterface { + public: + virtual ~AsyncReaderInterface() {} + + /// Read a message of type \a R into \a msg. Completion will be notified by \a + /// tag on the associated completion queue. + /// This is thread-safe with respect to \a Write or \a WritesDone methods. It + /// should not be called concurrently with other streaming APIs + /// on the same stream. It is not meaningful to call it concurrently + /// with another \a AsyncReaderInterface::Read on the same stream since reads + /// on the same stream are delivered in order. + /// + /// \param[out] msg Where to eventually store the read message. + /// \param[in] tag The tag identifying the operation. + /// + /// Side effect: note that this method attempt to receive initial metadata for + /// a stream if it hasn't yet been received. + virtual void Read(R* msg, void* tag) = 0; +}; + +/// An interface that can be fed a sequence of messages of type \a W. +template +class AsyncWriterInterface { + public: + virtual ~AsyncWriterInterface() {} + + /// Request the writing of \a msg with identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, void* tag) = 0; + + /// Request the writing of \a msg using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// WriteOptions \a options is used to set the write options of this message. + /// This is thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with the writing + /// of trailing metadata, using WriteOptions \a options with + /// identifying tag \a tag. + /// + /// For client, WriteLast is equivalent of performing Write and + /// WritesDone in a single step. + /// For server, WriteLast buffers the \a msg. The writing of \a msg is held + /// until Finish is called, where \a msg and trailing metadata are coalesced + /// and write is initiated. Note that WriteLast can only buffer \a msg up to + /// the flow control window size. If \a msg size is larger than the window + /// size, it will be sent on wire without buffering. + /// + /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to + /// to deallocate once Write returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] tag The tag identifying the operation. + void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { + Write(msg, options.set_last_message(), tag); + } +}; + +} // namespace internal + +template +class ClientAsyncReaderInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncReaderInterface {}; + +namespace internal { +template +class ClientAsyncReaderFactory { + public: + /// Create a stream object. + /// Write the first request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started and + /// \a request has been written out. If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + template + static ClientAsyncReader* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, + const W& request, bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReader))) + ClientAsyncReader(call, context, request, start, tag); + } +}; +} // namespace internal + +/// Async client-side API for doing server-streaming RPCs, +/// where the incoming message stream coming from the server has +/// messages of type \a R. +template +class ClientAsyncReader final : public ClientAsyncReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata + /// method for semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, + /// the \a ClientContext associated with this call is updated, and the + /// calling code can access the received metadata through the + /// \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderFactory; + template + ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, + const W& request, bool start, void* tag) + : context_(context), call_(call), started_(start) { + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); + init_ops_.ClientSendClose(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + init_ops_.set_output_tag(tag); + call_.PerformOps(&init_ops_); + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + init_ops_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Common interface for client side asynchronous writing. +template +class ClientAsyncWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncWriterFactory { + public: + /// Create a stream object. + /// Start the RPC if \a start is set + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, \a tag must be nullptr and the actual call + /// must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// \a response will be filled in with the single expected response + /// message from the server upon a successful call to the \a Finish + /// method of this instance. + template + static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncWriter))) + ClientAsyncWriter(call, context, response, start, tag); + } +}; +} // namespace internal + +/// Async API on the client side for doing client-streaming RPCs, +/// where the outgoing message stream going to the server contains +/// messages of type \a W. +template +class ClientAsyncWriter final : public ClientAsyncWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for + /// semantics. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// associated with this call is updated, and the calling code can access + /// the received metadata through the \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata received from the server. + /// - attempts to fill in the \a response parameter passed to this class's + /// constructor with the server's response message. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncWriterFactory; + template + ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, + R* response, bool start, void* tag) + : context_(context), call_(call), started_(start) { + finish_ops_.RecvMessage(response); + finish_ops_.AllowNoMessage(); + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Async client-side interface for bi-directional streaming, +/// where the client-to-server message stream has messages of type \a W, +/// and the server-to-client message stream has messages of type \a R. +template +class ClientAsyncReaderWriterInterface + : public internal::ClientAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Signal the client is done with the writes (half-close the client stream). + /// Thread-safe with respect to \a AsyncReaderInterface::Read + /// + /// \param[in] tag The tag identifying the operation. + virtual void WritesDone(void* tag) = 0; +}; + +namespace internal { +template +class ClientAsyncReaderWriterFactory { + public: + /// Create a stream object. + /// Start the RPC request if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent). If \a start is not set, \a tag must be + /// nullptr and the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + static ClientAsyncReaderWriter* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncReaderWriter))) + ClientAsyncReaderWriter(call, context, start, tag); + } +}; +} // namespace internal + +/// Async client-side interface for bi-directional streaming, +/// where the outgoing message stream going to the server +/// has messages of type \a W, and the incoming message stream coming +/// from the server has messages of type \a R. +template +class ClientAsyncReaderWriter final + : public ClientAsyncReaderWriterInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall(void* tag) override { + GPR_CODEGEN_ASSERT(!started_); + started_ = true; + StartCallInternal(tag); + } + + /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method + /// for semantics of this method. + /// + /// Side effect: + /// - upon receiving initial metadata from the server, the \a ClientContext + /// is updated with it, and then the receiving initial metadata can + /// be accessed through this \a ClientContext. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); + + meta_ops_.set_output_tag(tag); + meta_ops_.RecvInitialMetadata(context_); + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + read_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + read_ops_.RecvInitialMetadata(context_); + } + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + write_ops_.ClientSendClose(); + } + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + void WritesDone(void* tag) override { + GPR_CODEGEN_ASSERT(started_); + write_ops_.set_output_tag(tag); + write_ops_.ClientSendClose(); + call_.PerformOps(&write_ops_); + } + + /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. + /// Side effect + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(grpc::Status* status, void* tag) override { + GPR_CODEGEN_ASSERT(started_); + finish_ops_.set_output_tag(tag); + if (!context_->initial_metadata_received_) { + finish_ops_.RecvInitialMetadata(context_); + } + finish_ops_.ClientRecvStatus(context_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class internal::ClientAsyncReaderWriterFactory; + ClientAsyncReaderWriter(grpc::internal::Call call, + grpc::ClientContext* context, bool start, void* tag) + : context_(context), call_(call), started_(start) { + if (start) { + StartCallInternal(tag); + } else { + GPR_CODEGEN_ASSERT(tag == nullptr); + } + } + + void StartCallInternal(void* tag) { + write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, + context_->initial_metadata_flags()); + // if corked bit is set in context, we just keep the initial metadata + // buffered up to coalesce with later message send. No op is performed. + if (!context_->initial_metadata_corked_) { + write_ops_.set_output_tag(tag); + call_.PerformOps(&write_ops_); + } + } + + grpc::ClientContext* context_; + grpc::internal::Call call_; + bool started_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> + read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncReaderInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code + /// and also send out \a msg response to the client. + /// Request notification for when the server has sent the response and the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous + /// \a AsyncReaderInterface::Read operation with a non-ok result, + /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it + /// is safe to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// \param[in] msg To be sent to the client as the response for this call. + virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; + + /// Indicate that the stream is to be finished with a certain + /// non-OK status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// This call is meant to end the call with some error, and can be called at + /// any point that the server would like to "fail" the call (though note + /// this shouldn't be called concurrently with any other "sending" call, like + /// \a AsyncWriterInterface::Write). + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), and status, or if some failure occurred + /// when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + /// - Note: \a status must have a non-OK code. + virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing client-streaming RPCs, +/// where the incoming message stream from the client has messages of type \a R, +/// and the single response message sent from the server is type \a W. +template +class ServerAsyncReader final : public ServerAsyncReaderInterface { + public: + explicit ServerAsyncReader(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// Note: \a msg is not sent if \a status has a non-OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once Finish returns. + void Finish(const W& msg, const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_ops_.SendMessage(msg)); + } else { + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_ops_); + } + + /// See the \a ServerAsyncReaderInterface.Read method for semantics + /// + /// Side effect: + /// - also sends initial metadata if not alreay sent. + /// - uses the \a ServerContext associated with this call to send possible + /// initial and trailing metadata. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once FinishWithError returns. + void FinishWithError(const grpc::Status& status, void* tag) override { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_ops_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +template +class ServerAsyncWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation with a non-ok + /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if + /// some failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish + /// in a single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing server streaming RPCs, +/// where the outgoing message stream from the server has messages of type \a W. +template +class ServerAsyncWriter final : public ServerAsyncWriterInterface { + public: + explicit ServerAsyncWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of + /// \a status,it may be non-OK + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +/// Server-side interface for asynchronous bi-directional streaming. +template +class ServerAsyncReaderWriterInterface + : public grpc::internal::ServerAsyncStreamingInterface, + public internal::AsyncWriterInterface, + public internal::AsyncReaderInterface { + public: + /// Indicate that the stream is to be finished with a certain status code. + /// Request notification for when the server has sent the appropriate + /// signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// It is appropriate to call this method when either: + /// * all messages from the client have been received (either known + /// implictly, or explicitly because a previous \a + /// AsyncReaderInterface::Read operation + /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' + /// with 'false'. + /// * it is desired to end the call early with some non-OK status code. + /// + /// This operation will end when the server has finished sending out initial + /// metadata (if not sent already), response message, and status, or if some + /// failure occurred when trying to do so. + /// + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of this call. + virtual void Finish(const grpc::Status& status, void* tag) = 0; + + /// Request the writing of \a msg and coalesce it with trailing metadata which + /// contains \a status, using WriteOptions options with + /// identifying tag \a tag. + /// + /// WriteAndFinish is equivalent of performing WriteLast and Finish in a + /// single step. + /// + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + /// + /// \param[in] msg The message to be written. + /// \param[in] options The WriteOptions to be used to write this message. + /// \param[in] status The Status that server returns to client. + /// \param[in] tag The tag identifying the operation. + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; +}; + +/// Async server-side API for doing bidirectional streaming RPCs, +/// where the incoming message stream coming from the client has messages of +/// type \a R, and the outgoing message stream coming from the server has +/// messages of type \a W. +template +class ServerAsyncReaderWriter final + : public ServerAsyncReaderWriterInterface { + public: + explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Implicit input parameter: + /// - The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_ops_.set_output_tag(tag); + meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_ops_); + } + + void Read(R* msg, void* tag) override { + read_ops_.set_output_tag(tag); + read_ops_.RecvMessage(msg); + call_.PerformOps(&read_ops_); + } + + void Write(const W& msg, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); + call_.PerformOps(&write_ops_); + } + + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { + write_ops_.set_output_tag(tag); + if (options.is_last_message()) { + options.set_buffer_hint(); + } + EnsureInitialMetadataSent(&write_ops_); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish + /// method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used + /// for sending trailing (and initial) metadata to the client. + /// + /// Note: \a status must have an OK code. + // + /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it + /// is safe to deallocate once WriteAndFinish returns. + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { + write_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&write_ops_); + options.set_buffer_hint(); + GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); + write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&write_ops_); + } + + /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. + /// + /// Implicit input parameter: + /// - the \a ServerContext associated with this call is used for sending + /// trailing (and initial if not already sent) metadata to the client. + /// + /// Note: there are no restrictions are the code of \a status, + /// it may be non-OK + // + /// gRPC doesn't take ownership or a reference to \a status, so it is safe to + /// to deallocate once Finish returns. + void Finish(const grpc::Status& status, void* tag) override { + finish_ops_.set_output_tag(tag); + EnsureInitialMetadataSent(&finish_ops_); + + finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_ops_); + } + + private: + friend class grpc::Server; + + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + template + void EnsureInitialMetadataSent(T* ops) { + if (!ctx_->sent_initial_metadata_) { + ops->SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops->set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_ops_; + grpc::internal::CallOpSet> read_ops_; + grpc::internal::CallOpSet + write_ops_; + grpc::internal::CallOpSet + finish_ops_; +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h index 55227b2e..0034d210 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/async_unary_call.h @@ -19,9 +19,402 @@ #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { + +// Forward declaration for use in Helper class +template +class ClientAsyncResponseReader; + +/// An interface relevant for async client side unary RPCs (which send +/// one request message to a server and receive one response message). +template +class ClientAsyncResponseReaderInterface { + public: + virtual ~ClientAsyncResponseReaderInterface() {} + + /// Start the call that was set up by the constructor, but only if the + /// constructor was invoked through the "Prepare" API which doesn't actually + /// start the call + virtual void StartCall() = 0; + + /// Request notification of the reading of initial metadata. Completion + /// will be notified by \a tag on the associated completion queue. + /// This call is optional, but if it is used, it cannot be used concurrently + /// with or after the \a Finish method. + /// + /// \param[in] tag Tag identifying this request. + virtual void ReadInitialMetadata(void* tag) = 0; + + /// Request to receive the server's response \a msg and final \a status for + /// the call, and to notify \a tag on this call's completion queue when + /// finished. + /// + /// This function will return when either: + /// - when the server's response message and status have been received. + /// - when the server has returned a non-OK status (no message expected in + /// this case). + /// - when the call failed for some reason and the library generated a + /// non-OK status. + /// + /// \param[in] tag Tag identifying this request. + /// \param[out] status To be updated with the operation status. + /// \param[out] msg To be filled in with the server's response message. + virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; +}; + +namespace internal { + +class ClientAsyncResponseReaderHelper { + public: + /// Start a call and write the request out if \a start is set. + /// \a tag will be notified on \a cq when the call has been started (i.e. + /// intitial metadata sent) and \a request has been written out. + /// If \a start is not set, the actual call must be initiated by StartCall + /// Note that \a context will be used to fill in custom initial metadata + /// used to send to the server when starting the call. + /// + /// Optionally pass in a base class for request and response types so that the + /// internal functions and structs can be templated based on that, allowing + /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors + /// can't have an explicit template parameter, the last argument is an + /// extraneous parameter just to provide the needed type information. + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request) /* __attribute__((noinline)) */ { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + ClientAsyncResponseReader* result = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call.call(), sizeof(ClientAsyncResponseReader))) + ClientAsyncResponseReader(call, context); + SetupRequest( + call.call(), &result->single_buf_, &result->read_initial_metadata_, + &result->finish_, static_cast(request)); + + return result; + } + + // Various helper functions to reduce templating use + + template + static void SetupRequest( + grpc_call* call, + grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, + std::function* + read_initial_metadata, + std::function< + void(ClientContext*, internal::Call*, bool initial_metadata_read, + internal::CallOpSendInitialMetadata*, + internal::CallOpSetInterface**, void*, Status*, void*)>* finish, + const W& request) { + using SingleBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + SingleBufType* single_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(SingleBufType))) SingleBufType; + *single_buf_ptr = single_buf; + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); + single_buf->ClientSendClose(); + + // The purpose of the following functions is to type-erase the actual + // templated type of the CallOpSet being used by hiding that type inside the + // function definition rather than specifying it as an argument of the + // function or a member of the class. The type-erased CallOpSet will get + // static_cast'ed back to the real type so that it can be used properly. + *read_initial_metadata = + [](ClientContext* context, internal::Call* call, + internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + call->PerformOps(single_buf); + }; + + // Note that this function goes one step further than the previous one + // because it type-erases the message being written down to a void*. This + // will be static-cast'ed back to the class specified here by hiding that + // class information inside the function definition. Note that this feature + // expects the class being specified here for R to be a base-class of the + // "real" R without any multiple-inheritance (as applies in protbuf wrt + // MessageLite) + *finish = [](ClientContext* context, internal::Call* call, + bool initial_metadata_read, + internal::CallOpSendInitialMetadata* single_buf_view, + internal::CallOpSetInterface** finish_buf_ptr, void* msg, + Status* status, void* tag) { + if (initial_metadata_read) { + using FinishBufType = + grpc::internal::CallOpSet, + grpc::internal::CallOpClientRecvStatus>; + FinishBufType* finish_buf = + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call->call(), sizeof(FinishBufType))) FinishBufType; + *finish_buf_ptr = finish_buf; + finish_buf->set_output_tag(tag); + finish_buf->RecvMessage(static_cast(msg)); + finish_buf->AllowNoMessage(); + finish_buf->ClientRecvStatus(context, status); + call->PerformOps(finish_buf); + } else { + auto* single_buf = static_cast(single_buf_view); + single_buf->set_output_tag(tag); + single_buf->RecvInitialMetadata(context); + single_buf->RecvMessage(static_cast(msg)); + single_buf->AllowNoMessage(); + single_buf->ClientRecvStatus(context, status); + call->PerformOps(single_buf); + } + }; + } + + static void StartCall(grpc::ClientContext* context, + grpc::internal::CallOpSendInitialMetadata* single_buf) { + single_buf->SendInitialMetadata(&context->send_initial_metadata_, + context->initial_metadata_flags()); + } +}; + +// TODO(vjpai): This templated factory is deprecated and will be replaced by +//. the non-templated helper as soon as possible. +template +class ClientAsyncResponseReaderFactory { + public: + template + static ClientAsyncResponseReader* Create( + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, + const W& request, bool start) { + auto* result = ClientAsyncResponseReaderHelper::Create( + channel, cq, method, context, request); + if (start) { + result->StartCall(); + } + return result; + } +}; + +} // namespace internal + +/// Async API for client-side unary RPCs, where the message response +/// received from the server is of type \a R. +template +class ClientAsyncResponseReader final + : public ClientAsyncResponseReaderInterface { + public: + // always allocated against a call arena, no memory free required + static void operator delete(void* /*ptr*/, std::size_t size) { + GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); + } + + // This operator should never be called as the memory should be freed as part + // of the arena destruction. It only exists to provide a matching operator + // delete to the operator new so that some compilers will not complain (see + // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this + // there are no tests catching the compiler warning. + static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } + + void StartCall() override { + GPR_CODEGEN_DEBUG_ASSERT(!started_); + started_ = true; + internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); + } + + /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for + /// semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void ReadInitialMetadata(void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); + read_initial_metadata_(context_, &call_, single_buf_, tag); + initial_metadata_read_ = true; + } + + /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. + /// + /// Side effect: + /// - the \a ClientContext associated with this call is updated with + /// possible initial and trailing metadata sent from the server. + void Finish(R* msg, grpc::Status* status, void* tag) override { + GPR_CODEGEN_DEBUG_ASSERT(started_); + finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, + static_cast(msg), status, tag); + } + + private: + friend class internal::ClientAsyncResponseReaderHelper; + grpc::ClientContext* const context_; + grpc::internal::Call call_; + bool started_ = false; + bool initial_metadata_read_ = false; + + ClientAsyncResponseReader(grpc::internal::Call call, + grpc::ClientContext* context) + : context_(context), call_(call) {} + + // disable operator new + static void* operator new(std::size_t size); + static void* operator new(std::size_t /*size*/, void* p) { return p; } + + internal::CallOpSendInitialMetadata* single_buf_; + internal::CallOpSetInterface* finish_buf_ = nullptr; + std::function + read_initial_metadata_; + std::function + finish_; +}; + +/// Async server-side API for handling unary calls, where the single +/// response message sent to the client is of type \a W. +template +class ServerAsyncResponseWriter final + : public grpc::internal::ServerAsyncStreamingInterface { + public: + explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) + : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} + + /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. + /// + /// Side effect: + /// The initial metadata that will be sent to the client from this op will + /// be taken from the \a ServerContext associated with the call. + /// + /// \param[in] tag Tag identifying this request. + void SendInitialMetadata(void* tag) override { + GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); + + meta_buf_.set_output_tag(tag); + meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + call_.PerformOps(&meta_buf_); + } + + /// Indicate that the stream is to be finished and request notification + /// when the server has sent the appropriate signals to the client to + /// end the call. Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// \param[in] msg Message to be sent to the client. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// Note: if \a status has a non-OK code, then \a msg will not be sent, + /// and the client will receive only the status with possible trailing + /// metadata. + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). + void Finish(const W& msg, const grpc::Status& status, void* tag) { + finish_buf_.set_output_tag(tag); + finish_buf_.set_core_cq_tag(&finish_buf_); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + // The response is dropped if the status is not OK. + if (status.ok()) { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, + finish_buf_.SendMessage(msg)); + } else { + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + } + call_.PerformOps(&finish_buf_); + } + + /// Indicate that the stream is to be finished with a non-OK status, + /// and request notification for when the server has finished sending the + /// appropriate signals to the client to end the call. + /// Should not be used concurrently with other operations. + /// + /// \param[in] tag Tag identifying this request. + /// \param[in] status To be sent to the client as the result of the call. + /// - Note: \a status must have a non-OK code. + /// + /// Side effect: + /// - also sends initial metadata if not already sent (using the + /// \a ServerContext associated with this call). + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). + void FinishWithError(const grpc::Status& status, void* tag) { + GPR_CODEGEN_ASSERT(!status.ok()); + finish_buf_.set_output_tag(tag); + if (!ctx_->sent_initial_metadata_) { + finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, + ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } + ctx_->sent_initial_metadata_ = true; + } + finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); + call_.PerformOps(&finish_buf_); + } + + private: + void BindCall(grpc::internal::Call* call) override { call_ = *call; } + + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet + meta_buf_; + grpc::internal::CallOpSet + finish_buf_; +}; + +} // namespace grpc + +namespace std { +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +template +class default_delete> { + public: + void operator()(void* /*p*/) {} +}; +} // namespace std #endif // GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h index d1969953..a9ba7d16 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/byte_buffer.h @@ -19,9 +19,221 @@ #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include + +#include +#include +#include +#include +#include +#include + +namespace grpc { + +class ServerInterface; +class ByteBuffer; +class ServerInterface; + +namespace internal { +template +class CallbackUnaryHandler; +template +class CallbackServerStreamingHandler; +template +void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); +template +class ServerStreamingHandler; +template +class ErrorMethodHandler; +class CallOpSendMessage; +template +class CallOpRecvMessage; +class CallOpGenericRecvMessage; +class ExternalConnectionAcceptorImpl; +template +class DeserializeFuncType; +class GrpcByteBufferPeer; + +} // namespace internal +/// A sequence of bytes. +class ByteBuffer final { + public: + /// Constuct an empty buffer. + ByteBuffer() : buffer_(nullptr) {} + + /// Construct buffer from \a slices, of which there are \a nslices. + ByteBuffer(const Slice* slices, size_t nslices) { + // The following assertions check that the representation of a grpc::Slice + // is identical to that of a grpc_slice: it has a grpc_slice field, and + // nothing else. + static_assert(std::is_same::value, + "Slice must have same representation as grpc_slice"); + static_assert(sizeof(Slice) == sizeof(grpc_slice), + "Slice must have same representation as grpc_slice"); + // The following assertions check that the representation of a ByteBuffer is + // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, + // and nothing else. + static_assert(std::is_same::value, + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), + "ByteBuffer must have same representation as " + "grpc_byte_buffer*"); + // The const_cast is legal if grpc_raw_byte_buffer_create() does no more + // than its advertised side effect of increasing the reference count of the + // slices it processes, and such an increase does not affect the semantics + // seen by the caller of this constructor. + buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( + reinterpret_cast(const_cast(slices)), nslices); + } + + /// Constuct a byte buffer by referencing elements of existing buffer + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } + + ~ByteBuffer() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + } + } + + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. + ByteBuffer& operator=(const ByteBuffer& buf) { + if (this != &buf) { + Clear(); // first remove existing data + } + if (buf.buffer_) { + // then copy + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); + } + return *this; + } + + // If this ByteBuffer's representation is a single flat slice, returns a + // slice referencing that array. + Status TrySingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slics. + Status DumpToSingleSlice(Slice* slice) const; + + /// Dump (read) the buffer contents into \a slices. + Status Dump(std::vector* slices) const; + + /// Remove all data. + void Clear() { + if (buffer_) { + g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); + buffer_ = nullptr; + } + } + + /// Make a duplicate copy of the internals of this byte + /// buffer so that we have our own owned version of it. + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. + void Duplicate() { + buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); + } + + /// Forget underlying byte buffer without destroying + /// Use this only for un-owned byte buffers + void Release() { buffer_ = nullptr; } + + /// Buffer size in bytes. + size_t Length() const { + return buffer_ == nullptr + ? 0 + : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); + } + + /// Swap the state of *this and *other. + void Swap(ByteBuffer* other) { + grpc_byte_buffer* tmp = other->buffer_; + other->buffer_ = buffer_; + buffer_ = tmp; + } + + /// Is this ByteBuffer valid? + bool Valid() const { return (buffer_ != nullptr); } + + private: + friend class SerializationTraits; + friend class ServerInterface; + friend class internal::CallOpSendMessage; + template + friend class internal::CallOpRecvMessage; + friend class internal::CallOpGenericRecvMessage; + template + friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, + grpc::Status*, RequestType*); + template + friend class internal::ServerStreamingHandler; + template + friend class internal::CallbackUnaryHandler; + template + friend class internal::CallbackServerStreamingHandler; + template + friend class internal::ErrorMethodHandler; + template + friend class internal::DeserializeFuncType; + friend class ProtoBufferReader; + friend class ProtoBufferWriter; + friend class internal::GrpcByteBufferPeer; + friend class internal::ExternalConnectionAcceptorImpl; + + grpc_byte_buffer* buffer_; + + // takes ownership + void set_buffer(grpc_byte_buffer* buf) { + if (buffer_) { + Clear(); + } + buffer_ = buf; + } + + grpc_byte_buffer* c_buffer() { return buffer_; } + grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } + + class ByteBufferPointer { + public: + /* NOLINTNEXTLINE(google-explicit-constructor) */ + ByteBufferPointer(const ByteBuffer* b) + : bbuf_(const_cast(b)) {} + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator ByteBuffer*() { return bbuf_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer*() { return bbuf_->buffer_; } + /* NOLINTNEXTLINE(google-explicit-constructor) */ + operator grpc_byte_buffer**() { return &bbuf_->buffer_; } + + private: + ByteBuffer* bbuf_; + }; + ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } +}; + +template <> +class SerializationTraits { + public: + static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { + dest->set_buffer(byte_buffer->buffer_); + return Status::OK; + } + static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, + bool* own_buffer) { + *buffer = source; + *own_buffer = true; + return g_core_codegen_interface->ok(); + } +}; + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h index 71f6cb8e..90d54bc5 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call.h @@ -18,9 +18,78 @@ #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +namespace grpc { +class CompletionQueue; +namespace experimental { +class ClientRpcInfo; +class ServerRpcInfo; +} // namespace experimental +namespace internal { +class CallHook; +class CallOpSetInterface; + +/// Straightforward wrapping of the C call object +class Call final { + public: + Call() + : call_hook_(nullptr), + cq_(nullptr), + call_(nullptr), + max_receive_message_size_(-1) {} + /** call is owned by the caller */ + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + experimental::ClientRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(-1), + client_rpc_info_(rpc_info) {} + + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, + int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_receive_message_size_(max_receive_message_size), + server_rpc_info_(rpc_info) {} + + void PerformOps(CallOpSetInterface* ops) { + call_hook_->PerformOpsOnCall(ops, this); + } + + grpc_call* call() const { return call_; } + grpc::CompletionQueue* cq() const { return cq_; } + + int max_receive_message_size() const { return max_receive_message_size_; } + + experimental::ClientRpcInfo* client_rpc_info() const { + return client_rpc_info_; + } + + experimental::ServerRpcInfo* server_rpc_info() const { + return server_rpc_info_; + } + + private: + CallHook* call_hook_; + grpc::CompletionQueue* cq_; + grpc_call* call_; + int max_receive_message_size_; + experimental::ClientRpcInfo* client_rpc_info_ = nullptr; + experimental::ServerRpcInfo* server_rpc_info_ = nullptr; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h index db10a0fc..8c4278e7 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_hook.h @@ -21,7 +21,21 @@ // IWYU pragma: private -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +namespace grpc { + +namespace internal { +class CallOpSetInterface; +class Call; + +/// This is an interface that Channel and Server implement to allow them to hook +/// performing ops. +class CallHook { + public: + virtual ~CallHook() {} + virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0; +}; +} // namespace internal + +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_HOOK_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h index 62b11680..5b1d4409 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h index ce5f2036..a8eed9f6 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/call_op_set_interface.h @@ -21,6 +21,41 @@ // IWYU pragma: private -#include +#include + +namespace grpc { +namespace internal { + +class Call; + +/// An abstract collection of call ops, used to generate the +/// grpc_call_op structure to pass down to the lower layers, +/// and as it is-a CompletionQueueTag, also massages the final +/// completion into the correct form for consumption in the C++ +/// API. +class CallOpSetInterface : public CompletionQueueTag { + public: + /// Fills in grpc_op, starting from ops[*nops] and moving + /// upwards. + virtual void FillOps(internal::Call* call) = 0; + + /// Get the tag to be used at the core completion queue. Generally, the + /// value of core_cq_tag will be "this". However, it can be overridden if we + /// want core to process the tag differently (e.g., as a core callback) + virtual void* core_cq_tag() = 0; + + // This will be called while interceptors are run if the RPC is a hijacked + // RPC. This should set hijacking state for each of the ops. + virtual void SetHijackingState() = 0; + + // Should be called after interceptors are done running + virtual void ContinueFillOpsAfterInterception() = 0; + + // Should be called after interceptors are done running on the finalize result + // path + virtual void ContinueFinalizeResultAfterInterception() = 0; +}; +} // namespace internal +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h index c0f605ac..7c67c928 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/callback_common.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h index dde3ae7b..19fef7e2 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/channel_interface.h @@ -22,7 +22,7 @@ // IWYU pragma: private #include -#include +#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h index 1c6b8ce5..f3560b5a 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/client_interceptor.h @@ -19,9 +19,181 @@ #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H -// IWYU pragma: private +// IWYU pragma: private, include -/// TODO(chengyuc): Remove this file after solving compatibility. -#include +#include +#include + +#include +#include +#include + +namespace grpc { + +class Channel; +class ClientContext; + +namespace internal { +class InterceptorBatchMethodsImpl; +} + +namespace experimental { +class ClientRpcInfo; + +// A factory interface for creation of client interceptors. A vector of +// factories can be provided at channel creation which will be used to create a +// new vector of client interceptors per RPC. Client interceptor authors should +// create a subclass of ClientInterceptorFactorInterface which creates objects +// of their interceptors. +class ClientInterceptorFactoryInterface { + public: + virtual ~ClientInterceptorFactoryInterface() {} + // Returns a pointer to an Interceptor object on successful creation, nullptr + // otherwise. If nullptr is returned, this server interceptor factory is + // ignored for the purposes of that RPC. + virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; +}; +} // namespace experimental + +namespace internal { +extern experimental::ClientInterceptorFactoryInterface* + g_global_client_interceptor_factory; +} + +/// ClientRpcInfo represents the state of a particular RPC as it +/// appears to an interceptor. It is created and owned by the library and +/// passed to the CreateClientInterceptor method of the application's +/// ClientInterceptorFactoryInterface implementation +namespace experimental { +class ClientRpcInfo { + public: + // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN + // from the list of possible Types. + /// Type categorizes RPCs by unary or streaming type + enum class Type { + UNARY, + CLIENT_STREAMING, + SERVER_STREAMING, + BIDI_STREAMING, + UNKNOWN // UNKNOWN is not API and will be removed later + }; + + ~ClientRpcInfo() {} + + // Delete copy constructor but allow default move constructor + ClientRpcInfo(const ClientRpcInfo&) = delete; + ClientRpcInfo(ClientRpcInfo&&) = default; + + // Getter methods + + /// Return the fully-specified method name + const char* method() const { return method_; } + + /// Return an identifying suffix for the client stub, or nullptr if one wasn't + /// specified. + const char* suffix_for_stats() const { return suffix_for_stats_; } + + /// Return a pointer to the channel on which the RPC is being sent + ChannelInterface* channel() { return channel_; } + + /// Return a pointer to the underlying ClientContext structure associated + /// with the RPC to support features that apply to it + grpc::ClientContext* client_context() { return ctx_; } + + /// Return the type of the RPC (unary or a streaming flavor) + Type type() const { return type_; } + + private: + static_assert(Type::UNARY == + static_cast(internal::RpcMethod::NORMAL_RPC), + "violated expectation about Type enum"); + static_assert(Type::CLIENT_STREAMING == + static_cast(internal::RpcMethod::CLIENT_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::SERVER_STREAMING == + static_cast(internal::RpcMethod::SERVER_STREAMING), + "violated expectation about Type enum"); + static_assert(Type::BIDI_STREAMING == + static_cast(internal::RpcMethod::BIDI_STREAMING), + "violated expectation about Type enum"); + + // Default constructor should only be used by ClientContext + ClientRpcInfo() = default; + + // Constructor will only be called from ClientContext + ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, + const char* method, const char* suffix_for_stats, + grpc::ChannelInterface* channel) + : ctx_(ctx), + type_(static_cast(type)), + method_(method), + suffix_for_stats_(suffix_for_stats), + channel_(channel) {} + + // Move assignment should only be used by ClientContext + // TODO(yashykt): Delete move assignment + ClientRpcInfo& operator=(ClientRpcInfo&&) = default; + + // Runs interceptor at pos \a pos. + void RunInterceptor( + experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { + GPR_CODEGEN_ASSERT(pos < interceptors_.size()); + interceptors_[pos]->Intercept(interceptor_methods); + } + + void RegisterInterceptors( + const std::vector>& creators, + size_t interceptor_pos) { + if (interceptor_pos > creators.size()) { + // No interceptors to register + return; + } + // NOTE: The following is not a range-based for loop because it will only + // iterate over a portion of the creators vector. + for (auto it = creators.begin() + interceptor_pos; it != creators.end(); + ++it) { + auto* interceptor = (*it)->CreateClientInterceptor(this); + if (interceptor != nullptr) { + interceptors_.push_back( + std::unique_ptr(interceptor)); + } + } + if (internal::g_global_client_interceptor_factory != nullptr) { + interceptors_.push_back(std::unique_ptr( + internal::g_global_client_interceptor_factory + ->CreateClientInterceptor(this))); + } + } + + grpc::ClientContext* ctx_ = nullptr; + // TODO(yashykt): make type_ const once move-assignment is deleted + Type type_{Type::UNKNOWN}; + const char* method_ = nullptr; + const char* suffix_for_stats_ = nullptr; + grpc::ChannelInterface* channel_ = nullptr; + std::vector> interceptors_; + bool hijacked_ = false; + size_t hijacked_interceptor_ = 0; + + friend class internal::InterceptorBatchMethodsImpl; + friend class grpc::ClientContext; +}; + +// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL +// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. +// Registers a global client interceptor factory object, which is used for all +// RPCs made in this process. The application is responsible for maintaining the +// life of the object while gRPC operations are in progress. The global +// interceptor factory should only be registered once at the start of the +// process before any gRPC operations have begun. +void RegisterGlobalClientInterceptorFactory( + ClientInterceptorFactoryInterface* factory); + +// For testing purposes only +void TestOnlyResetGlobalClientInterceptorFactory(); + +} // namespace experimental +} // namespace grpc #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h index bcb85746..14450533 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor.h @@ -26,11 +26,11 @@ #include #include +#include #include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h index 2595938c..b084b7ce 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/interceptor_common.h @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h index 797e8256..58056314 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/method_handler.h @@ -21,10 +21,10 @@ // IWYU pragma: private, include +#include #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h index 2aa7774a..6f6730a1 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/rpc_service_method.h @@ -28,10 +28,10 @@ #include #include +#include #include #include #include -#include namespace grpc { class ServerContextBase; diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h index 2f20dade..0deac825 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/server_interface.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include namespace grpc { diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h index 1235b8de..aca60790 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/impl/codegen/sync_stream.h @@ -20,7 +20,7 @@ // IWYU pragma: private, include -#include +#include #include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h index d9b43934..18dce966 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/security/credentials.h @@ -25,11 +25,11 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h index 2264585c..dce87448 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/server.h @@ -31,13 +31,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h index 18e84dfc..5f717014 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_stream.h @@ -19,1115 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H #define GRPCPP_SUPPORT_ASYNC_STREAM_H -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -namespace internal { -/// Common interface for all client side asynchronous streaming. -class ClientAsyncStreamingInterface { - public: - virtual ~ClientAsyncStreamingInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall(void* tag) = 0; - - /// Request notification of the reading of the initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a AsyncReaderInterface::Read method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Indicate that the stream is to be finished and request notification for - /// when the call has been ended. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method exactly once when both: - /// * the client side has no more message to send - /// (this can be declared implicitly by calling this method, or - /// explicitly through an earlier call to the WritesDone method - /// of the class in use, e.g. \a ClientAsyncWriterInterface::WritesDone or - /// \a ClientAsyncReaderWriterInterface::WritesDone). - /// * there are no more messages to be received from the server (this can - /// be known implicitly by the calling code, or explicitly from an - /// earlier call to \a AsyncReaderInterface::Read that yielded a failed - /// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// The tag will be returned when either: - /// - all incoming messages have been read and the server has returned - /// a status. - /// - the server has returned a non-OK status. - /// - the call failed for some reason and the library generated a - /// status. - /// - /// Note that implementations of this method attempt to receive initial - /// metadata from the server if initial metadata hasn't yet been received. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - virtual void Finish(grpc::Status* status, void* tag) = 0; -}; - -/// An interface that yields a sequence of messages of type \a R. -template -class AsyncReaderInterface { - public: - virtual ~AsyncReaderInterface() {} - - /// Read a message of type \a R into \a msg. Completion will be notified by \a - /// tag on the associated completion queue. - /// This is thread-safe with respect to \a Write or \a WritesDone methods. It - /// should not be called concurrently with other streaming APIs - /// on the same stream. It is not meaningful to call it concurrently - /// with another \a AsyncReaderInterface::Read on the same stream since reads - /// on the same stream are delivered in order. - /// - /// \param[out] msg Where to eventually store the read message. - /// \param[in] tag The tag identifying the operation. - /// - /// Side effect: note that this method attempt to receive initial metadata for - /// a stream if it hasn't yet been received. - virtual void Read(R* msg, void* tag) = 0; -}; - -/// An interface that can be fed a sequence of messages of type \a W. -template -class AsyncWriterInterface { - public: - virtual ~AsyncWriterInterface() {} - - /// Request the writing of \a msg with identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, void* tag) = 0; - - /// Request the writing of \a msg using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// WriteOptions \a options is used to set the write options of this message. - /// This is thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with the writing - /// of trailing metadata, using WriteOptions \a options with - /// identifying tag \a tag. - /// - /// For client, WriteLast is equivalent of performing Write and - /// WritesDone in a single step. - /// For server, WriteLast buffers the \a msg. The writing of \a msg is held - /// until Finish is called, where \a msg and trailing metadata are coalesced - /// and write is initiated. Note that WriteLast can only buffer \a msg up to - /// the flow control window size. If \a msg size is larger than the window - /// size, it will be sent on wire without buffering. - /// - /// gRPC doesn't take ownership or a reference to \a msg, so it is safe to - /// to deallocate once Write returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] tag The tag identifying the operation. - void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { - Write(msg, options.set_last_message(), tag); - } -}; - -} // namespace internal - -template -class ClientAsyncReaderInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncReaderInterface {}; - -namespace internal { -template -class ClientAsyncReaderFactory { - public: - /// Create a stream object. - /// Write the first request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started and - /// \a request has been written out. If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - template - static ClientAsyncReader* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, - const W& request, bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReader))) - ClientAsyncReader(call, context, request, start, tag); - } -}; -} // namespace internal - -/// Async client-side API for doing server-streaming RPCs, -/// where the incoming message stream coming from the server has -/// messages of type \a R. -template -class ClientAsyncReader final : public ClientAsyncReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata - /// method for semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, - /// the \a ClientContext associated with this call is updated, and the - /// calling code can access the received metadata through the - /// \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderFactory; - template - ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, - const W& request, bool start, void* tag) - : context_(context), call_(call), started_(start) { - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - init_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - init_ops_.set_output_tag(tag); - call_.PerformOps(&init_ops_); - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - init_ops_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Common interface for client side asynchronous writing. -template -class ClientAsyncWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncWriterFactory { - public: - /// Create a stream object. - /// Start the RPC if \a start is set - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, \a tag must be nullptr and the actual call - /// must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// \a response will be filled in with the single expected response - /// message from the server upon a successful call to the \a Finish - /// method of this instance. - template - static ClientAsyncWriter* Create(grpc::ChannelInterface* channel, - grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, - grpc::ClientContext* context, R* response, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncWriter))) - ClientAsyncWriter(call, context, response, start, tag); - } -}; -} // namespace internal - -/// Async API on the client side for doing client-streaming RPCs, -/// where the outgoing message stream going to the server contains -/// messages of type \a W. -template -class ClientAsyncWriter final : public ClientAsyncWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method for - /// semantics. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// associated with this call is updated, and the calling code can access - /// the received metadata through the \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata received from the server. - /// - attempts to fill in the \a response parameter passed to this class's - /// constructor with the server's response message. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncWriterFactory; - template - ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, - R* response, bool start, void* tag) - : context_(context), call_(call), started_(start) { - finish_ops_.RecvMessage(response); - finish_ops_.AllowNoMessage(); - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Async client-side interface for bi-directional streaming, -/// where the client-to-server message stream has messages of type \a W, -/// and the server-to-client message stream has messages of type \a R. -template -class ClientAsyncReaderWriterInterface - : public internal::ClientAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Signal the client is done with the writes (half-close the client stream). - /// Thread-safe with respect to \a AsyncReaderInterface::Read - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -namespace internal { -template -class ClientAsyncReaderWriterFactory { - public: - /// Create a stream object. - /// Start the RPC request if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent). If \a start is not set, \a tag must be - /// nullptr and the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - static ClientAsyncReaderWriter* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - bool start, void* tag) { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - - return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReaderWriter))) - ClientAsyncReaderWriter(call, context, start, tag); - } -}; -} // namespace internal - -/// Async client-side interface for bi-directional streaming, -/// where the outgoing message stream going to the server -/// has messages of type \a W, and the incoming message stream coming -/// from the server has messages of type \a R. -template -class ClientAsyncReaderWriter final - : public ClientAsyncReaderWriterInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReaderWriter)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall(void* tag) override { - GPR_CODEGEN_ASSERT(!started_); - started_ = true; - StartCallInternal(tag); - } - - /// See the \a ClientAsyncStreamingInterface.ReadInitialMetadata method - /// for semantics of this method. - /// - /// Side effect: - /// - upon receiving initial metadata from the server, the \a ClientContext - /// is updated with it, and then the receiving initial metadata can - /// be accessed through this \a ClientContext. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - write_ops_.ClientSendClose(); - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) override { - GPR_CODEGEN_ASSERT(started_); - write_ops_.set_output_tag(tag); - write_ops_.ClientSendClose(); - call_.PerformOps(&write_ops_); - } - - /// See the \a ClientAsyncStreamingInterface.Finish method for semantics. - /// Side effect - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(grpc::Status* status, void* tag) override { - GPR_CODEGEN_ASSERT(started_); - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class internal::ClientAsyncReaderWriterFactory; - ClientAsyncReaderWriter(grpc::internal::Call call, - grpc::ClientContext* context, bool start, void* tag) - : context_(context), call_(call), started_(start) { - if (start) { - StartCallInternal(tag); - } else { - GPR_CODEGEN_ASSERT(tag == nullptr); - } - } - - void StartCallInternal(void* tag) { - write_ops_.SendInitialMetadata(&context_->send_initial_metadata_, - context_->initial_metadata_flags()); - // if corked bit is set in context, we just keep the initial metadata - // buffered up to coalesce with later message send. No op is performed. - if (!context_->initial_metadata_corked_) { - write_ops_.set_output_tag(tag); - call_.PerformOps(&write_ops_); - } - } - - grpc::ClientContext* context_; - grpc::internal::Call call_; - bool started_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> - read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncReaderInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code - /// and also send out \a msg response to the client. - /// Request notification for when the server has sent the response and the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous - /// \a AsyncReaderInterface::Read operation with a non-ok result, - /// e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a msg or \a status, so it - /// is safe to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// \param[in] msg To be sent to the client as the response for this call. - virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; - - /// Indicate that the stream is to be finished with a certain - /// non-OK status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// This call is meant to end the call with some error, and can be called at - /// any point that the server would like to "fail" the call (though note - /// this shouldn't be called concurrently with any other "sending" call, like - /// \a AsyncWriterInterface::Write). - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), and status, or if some failure occurred - /// when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - /// - Note: \a status must have a non-OK code. - virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing client-streaming RPCs, -/// where the incoming message stream from the client has messages of type \a R, -/// and the single response message sent from the server is type \a W. -template -class ServerAsyncReader final : public ServerAsyncReaderInterface { - public: - explicit ServerAsyncReader(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// Note: \a msg is not sent if \a status has a non-OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once Finish returns. - void Finish(const W& msg, const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_ops_.SendMessage(msg)); - } else { - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_ops_); - } - - /// See the \a ServerAsyncReaderInterface.Read method for semantics - /// - /// Side effect: - /// - also sends initial metadata if not alreay sent. - /// - uses the \a ServerContext associated with this call to send possible - /// initial and trailing metadata. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once FinishWithError returns. - void FinishWithError(const grpc::Status& status, void* tag) override { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -template -class ServerAsyncWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation with a non-ok - /// result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if - /// some failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish - /// in a single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing server streaming RPCs, -/// where the outgoing message stream from the server has messages of type \a W. -template -class ServerAsyncWriter final : public ServerAsyncWriterInterface { - public: - explicit ServerAsyncWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.WriteAndFinish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of - /// \a status,it may be non-OK - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -/// Server-side interface for asynchronous bi-directional streaming. -template -class ServerAsyncReaderWriterInterface - : public grpc::internal::ServerAsyncStreamingInterface, - public internal::AsyncWriterInterface, - public internal::AsyncReaderInterface { - public: - /// Indicate that the stream is to be finished with a certain status code. - /// Request notification for when the server has sent the appropriate - /// signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// It is appropriate to call this method when either: - /// * all messages from the client have been received (either known - /// implictly, or explicitly because a previous \a - /// AsyncReaderInterface::Read operation - /// with a non-ok result (e.g., cq->Next(&read_tag, &ok) filled in 'ok' - /// with 'false'. - /// * it is desired to end the call early with some non-OK status code. - /// - /// This operation will end when the server has finished sending out initial - /// metadata (if not sent already), response message, and status, or if some - /// failure occurred when trying to do so. - /// - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const grpc::Status& status, void* tag) = 0; - - /// Request the writing of \a msg and coalesce it with trailing metadata which - /// contains \a status, using WriteOptions options with - /// identifying tag \a tag. - /// - /// WriteAndFinish is equivalent of performing WriteLast and Finish in a - /// single step. - /// - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - /// - /// \param[in] msg The message to be written. - /// \param[in] options The WriteOptions to be used to write this message. - /// \param[in] status The Status that server returns to client. - /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) = 0; -}; - -/// Async server-side API for doing bidirectional streaming RPCs, -/// where the incoming message stream coming from the client has messages of -/// type \a R, and the outgoing message stream coming from the server has -/// messages of type \a W. -template -class ServerAsyncReaderWriter final - : public ServerAsyncReaderWriterInterface { - public: - explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Implicit input parameter: - /// - The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_ops_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) override { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Write(const W& msg, grpc::WriteOptions options, void* tag) override { - write_ops_.set_output_tag(tag); - if (options.is_last_message()) { - options.set_buffer_hint(); - } - EnsureInitialMetadataSent(&write_ops_); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.WriteAndFinish - /// method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used - /// for sending trailing (and initial) metadata to the client. - /// - /// Note: \a status must have an OK code. - // - /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it - /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, grpc::WriteOptions options, - const grpc::Status& status, void* tag) override { - write_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&write_ops_); - options.set_buffer_hint(); - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok()); - write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&write_ops_); - } - - /// See the \a ServerAsyncReaderWriterInterface.Finish method for semantics. - /// - /// Implicit input parameter: - /// - the \a ServerContext associated with this call is used for sending - /// trailing (and initial if not already sent) metadata to the client. - /// - /// Note: there are no restrictions are the code of \a status, - /// it may be non-OK - // - /// gRPC doesn't take ownership or a reference to \a status, so it is safe to - /// to deallocate once Finish returns. - void Finish(const grpc::Status& status, void* tag) override { - finish_ops_.set_output_tag(tag); - EnsureInitialMetadataSent(&finish_ops_); - - finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class grpc::Server; - - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - template - void EnsureInitialMetadataSent(T* ops) { - if (!ctx_->sent_initial_metadata_) { - ops->SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - ops->set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_ops_; - grpc::internal::CallOpSet> read_ops_; - grpc::internal::CallOpSet - write_ops_; - grpc::internal::CallOpSet - finish_ops_; -}; - -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_STREAM_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h index a9886031..02071e48 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/async_unary_call.h @@ -19,402 +19,6 @@ #ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H #define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { - -// Forward declaration for use in Helper class -template -class ClientAsyncResponseReader; - -/// An interface relevant for async client side unary RPCs (which send -/// one request message to a server and receive one response message). -template -class ClientAsyncResponseReaderInterface { - public: - virtual ~ClientAsyncResponseReaderInterface() {} - - /// Start the call that was set up by the constructor, but only if the - /// constructor was invoked through the "Prepare" API which doesn't actually - /// start the call - virtual void StartCall() = 0; - - /// Request notification of the reading of initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// This call is optional, but if it is used, it cannot be used concurrently - /// with or after the \a Finish method. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Request to receive the server's response \a msg and final \a status for - /// the call, and to notify \a tag on this call's completion queue when - /// finished. - /// - /// This function will return when either: - /// - when the server's response message and status have been received. - /// - when the server has returned a non-OK status (no message expected in - /// this case). - /// - when the call failed for some reason and the library generated a - /// non-OK status. - /// - /// \param[in] tag Tag identifying this request. - /// \param[out] status To be updated with the operation status. - /// \param[out] msg To be filled in with the server's response message. - virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; -}; - -namespace internal { - -class ClientAsyncResponseReaderHelper { - public: - /// Start a call and write the request out if \a start is set. - /// \a tag will be notified on \a cq when the call has been started (i.e. - /// intitial metadata sent) and \a request has been written out. - /// If \a start is not set, the actual call must be initiated by StartCall - /// Note that \a context will be used to fill in custom initial metadata - /// used to send to the server when starting the call. - /// - /// Optionally pass in a base class for request and response types so that the - /// internal functions and structs can be templated based on that, allowing - /// reuse across RPCs (e.g., MessageLite for protobuf). Since constructors - /// can't have an explicit template parameter, the last argument is an - /// extraneous parameter just to provide the needed type information. - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request) /* __attribute__((noinline)) */ { - grpc::internal::Call call = channel->CreateCall(method, context, cq); - ClientAsyncResponseReader* result = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncResponseReader))) - ClientAsyncResponseReader(call, context); - SetupRequest( - call.call(), &result->single_buf_, &result->read_initial_metadata_, - &result->finish_, static_cast(request)); - - return result; - } - - // Various helper functions to reduce templating use - - template - static void SetupRequest( - grpc_call* call, - grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, - std::function* - read_initial_metadata, - std::function< - void(ClientContext*, internal::Call*, bool initial_metadata_read, - internal::CallOpSendInitialMetadata*, - internal::CallOpSetInterface**, void*, Status*, void*)>* finish, - const W& request) { - using SingleBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - SingleBufType* single_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(SingleBufType))) SingleBufType; - *single_buf_ptr = single_buf; - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(single_buf->SendMessage(request).ok()); - single_buf->ClientSendClose(); - - // The purpose of the following functions is to type-erase the actual - // templated type of the CallOpSet being used by hiding that type inside the - // function definition rather than specifying it as an argument of the - // function or a member of the class. The type-erased CallOpSet will get - // static_cast'ed back to the real type so that it can be used properly. - *read_initial_metadata = - [](ClientContext* context, internal::Call* call, - internal::CallOpSendInitialMetadata* single_buf_view, void* tag) { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - call->PerformOps(single_buf); - }; - - // Note that this function goes one step further than the previous one - // because it type-erases the message being written down to a void*. This - // will be static-cast'ed back to the class specified here by hiding that - // class information inside the function definition. Note that this feature - // expects the class being specified here for R to be a base-class of the - // "real" R without any multiple-inheritance (as applies in protbuf wrt - // MessageLite) - *finish = [](ClientContext* context, internal::Call* call, - bool initial_metadata_read, - internal::CallOpSendInitialMetadata* single_buf_view, - internal::CallOpSetInterface** finish_buf_ptr, void* msg, - Status* status, void* tag) { - if (initial_metadata_read) { - using FinishBufType = - grpc::internal::CallOpSet, - grpc::internal::CallOpClientRecvStatus>; - FinishBufType* finish_buf = - new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call->call(), sizeof(FinishBufType))) FinishBufType; - *finish_buf_ptr = finish_buf; - finish_buf->set_output_tag(tag); - finish_buf->RecvMessage(static_cast(msg)); - finish_buf->AllowNoMessage(); - finish_buf->ClientRecvStatus(context, status); - call->PerformOps(finish_buf); - } else { - auto* single_buf = static_cast(single_buf_view); - single_buf->set_output_tag(tag); - single_buf->RecvInitialMetadata(context); - single_buf->RecvMessage(static_cast(msg)); - single_buf->AllowNoMessage(); - single_buf->ClientRecvStatus(context, status); - call->PerformOps(single_buf); - } - }; - } - - static void StartCall(grpc::ClientContext* context, - grpc::internal::CallOpSendInitialMetadata* single_buf) { - single_buf->SendInitialMetadata(&context->send_initial_metadata_, - context->initial_metadata_flags()); - } -}; - -// TODO(vjpai): This templated factory is deprecated and will be replaced by -//. the non-templated helper as soon as possible. -template -class ClientAsyncResponseReaderFactory { - public: - template - static ClientAsyncResponseReader* Create( - grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, - const W& request, bool start) { - auto* result = ClientAsyncResponseReaderHelper::Create( - channel, cq, method, context, request); - if (start) { - result->StartCall(); - } - return result; - } -}; - -} // namespace internal - -/// Async API for client-side unary RPCs, where the message response -/// received from the server is of type \a R. -template -class ClientAsyncResponseReader final - : public ClientAsyncResponseReaderInterface { - public: - // always allocated against a call arena, no memory free required - static void operator delete(void* /*ptr*/, std::size_t size) { - GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncResponseReader)); - } - - // This operator should never be called as the memory should be freed as part - // of the arena destruction. It only exists to provide a matching operator - // delete to the operator new so that some compilers will not complain (see - // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this - // there are no tests catching the compiler warning. - static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); } - - void StartCall() override { - GPR_CODEGEN_DEBUG_ASSERT(!started_); - started_ = true; - internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_); - } - - /// See \a ClientAsyncResponseReaderInterface::ReadInitialMetadata for - /// semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void ReadInitialMetadata(void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - GPR_CODEGEN_DEBUG_ASSERT(!context_->initial_metadata_received_); - read_initial_metadata_(context_, &call_, single_buf_, tag); - initial_metadata_read_ = true; - } - - /// See \a ClientAsyncResponseReaderInterface::Finish for semantics. - /// - /// Side effect: - /// - the \a ClientContext associated with this call is updated with - /// possible initial and trailing metadata sent from the server. - void Finish(R* msg, grpc::Status* status, void* tag) override { - GPR_CODEGEN_DEBUG_ASSERT(started_); - finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, - static_cast(msg), status, tag); - } - - private: - friend class internal::ClientAsyncResponseReaderHelper; - grpc::ClientContext* const context_; - grpc::internal::Call call_; - bool started_ = false; - bool initial_metadata_read_ = false; - - ClientAsyncResponseReader(grpc::internal::Call call, - grpc::ClientContext* context) - : context_(context), call_(call) {} - - // disable operator new - static void* operator new(std::size_t size); - static void* operator new(std::size_t /*size*/, void* p) { return p; } - - internal::CallOpSendInitialMetadata* single_buf_; - internal::CallOpSetInterface* finish_buf_ = nullptr; - std::function - read_initial_metadata_; - std::function - finish_; -}; - -/// Async server-side API for handling unary calls, where the single -/// response message sent to the client is of type \a W. -template -class ServerAsyncResponseWriter final - : public grpc::internal::ServerAsyncStreamingInterface { - public: - explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. - /// - /// Side effect: - /// The initial metadata that will be sent to the client from this op will - /// be taken from the \a ServerContext associated with the call. - /// - /// \param[in] tag Tag identifying this request. - void SendInitialMetadata(void* tag) override { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_buf_.set_output_tag(tag); - meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - meta_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_buf_); - } - - /// Indicate that the stream is to be finished and request notification - /// when the server has sent the appropriate signals to the client to - /// end the call. Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// \param[in] msg Message to be sent to the client. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// Note: if \a status has a non-OK code, then \a msg will not be sent, - /// and the client will receive only the status with possible trailing - /// metadata. - /// - /// gRPC doesn't take ownership or a reference to msg and status, so it is - /// safe to deallocate them once the Finish operation is complete (i.e. a - /// result arrives in the completion queue). - void Finish(const W& msg, const grpc::Status& status, void* tag) { - finish_buf_.set_output_tag(tag); - finish_buf_.set_core_cq_tag(&finish_buf_); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, - finish_buf_.SendMessage(msg)); - } else { - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_buf_); - } - - /// Indicate that the stream is to be finished with a non-OK status, - /// and request notification for when the server has finished sending the - /// appropriate signals to the client to end the call. - /// Should not be used concurrently with other operations. - /// - /// \param[in] tag Tag identifying this request. - /// \param[in] status To be sent to the client as the result of the call. - /// - Note: \a status must have a non-OK code. - /// - /// Side effect: - /// - also sends initial metadata if not already sent (using the - /// \a ServerContext associated with this call). - /// - /// gRPC doesn't take ownership or a reference to status, so it is safe to - /// deallocate them once the Finish operation is complete (i.e. a result - /// arrives in the completion queue). - void FinishWithError(const grpc::Status& status, void* tag) { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_buf_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_, - ctx_->initial_metadata_flags()); - if (ctx_->compression_level_set()) { - finish_buf_.set_compression_level(ctx_->compression_level()); - } - ctx_->sent_initial_metadata_ = true; - } - finish_buf_.ServerSendStatus(&ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_buf_); - } - - private: - void BindCall(grpc::internal::Call* call) override { call_ = *call; } - - grpc::internal::Call call_; - grpc::ServerContext* ctx_; - grpc::internal::CallOpSet - meta_buf_; - grpc::internal::CallOpSet - finish_buf_; -}; - -} // namespace grpc - -namespace std { -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -template -class default_delete> { - public: - void operator()(void* /*p*/) {} -}; -} // namespace std +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h index 7ca7c4b2..6f566e76 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/byte_buffer.h @@ -19,221 +19,13 @@ #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H #define GRPCPP_SUPPORT_BYTE_BUFFER_H -#include - #include #include #include -#include +#include // IWYU pragma: export #include #include #include #include -namespace grpc { - -class ServerInterface; -class ByteBuffer; -class ServerInterface; - -namespace internal { -template -class CallbackUnaryHandler; -template -class CallbackServerStreamingHandler; -template -void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); -template -class ServerStreamingHandler; -template -class ErrorMethodHandler; -class CallOpSendMessage; -template -class CallOpRecvMessage; -class CallOpGenericRecvMessage; -class ExternalConnectionAcceptorImpl; -template -class DeserializeFuncType; -class GrpcByteBufferPeer; - -} // namespace internal -/// A sequence of bytes. -class ByteBuffer final { - public: - /// Constuct an empty buffer. - ByteBuffer() : buffer_(nullptr) {} - - /// Construct buffer from \a slices, of which there are \a nslices. - ByteBuffer(const Slice* slices, size_t nslices) { - // The following assertions check that the representation of a grpc::Slice - // is identical to that of a grpc_slice: it has a grpc_slice field, and - // nothing else. - static_assert(std::is_same::value, - "Slice must have same representation as grpc_slice"); - static_assert(sizeof(Slice) == sizeof(grpc_slice), - "Slice must have same representation as grpc_slice"); - // The following assertions check that the representation of a ByteBuffer is - // identical to grpc_byte_buffer*: it has a grpc_byte_buffer* field, - // and nothing else. - static_assert(std::is_same::value, - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - static_assert(sizeof(ByteBuffer) == sizeof(grpc_byte_buffer*), - "ByteBuffer must have same representation as " - "grpc_byte_buffer*"); - // The const_cast is legal if grpc_raw_byte_buffer_create() does no more - // than its advertised side effect of increasing the reference count of the - // slices it processes, and such an increase does not affect the semantics - // seen by the caller of this constructor. - buffer_ = g_core_codegen_interface->grpc_raw_byte_buffer_create( - reinterpret_cast(const_cast(slices)), nslices); - } - - /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer(const ByteBuffer& buf) : buffer_(nullptr) { operator=(buf); } - - ~ByteBuffer() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - } - } - - /// Wrapper of core function grpc_byte_buffer_copy . This is not - /// a deep copy; it is just a referencing. As a result, its performance is - /// size-independent. - ByteBuffer& operator=(const ByteBuffer& buf) { - if (this != &buf) { - Clear(); // first remove existing data - } - if (buf.buffer_) { - // then copy - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buf.buffer_); - } - return *this; - } - - // If this ByteBuffer's representation is a single flat slice, returns a - // slice referencing that array. - Status TrySingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slics. - Status DumpToSingleSlice(Slice* slice) const; - - /// Dump (read) the buffer contents into \a slices. - Status Dump(std::vector* slices) const; - - /// Remove all data. - void Clear() { - if (buffer_) { - g_core_codegen_interface->grpc_byte_buffer_destroy(buffer_); - buffer_ = nullptr; - } - } - - /// Make a duplicate copy of the internals of this byte - /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. - /// This is not a deep copy; it is a referencing and its performance - /// is size-independent. - void Duplicate() { - buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); - } - - /// Forget underlying byte buffer without destroying - /// Use this only for un-owned byte buffers - void Release() { buffer_ = nullptr; } - - /// Buffer size in bytes. - size_t Length() const { - return buffer_ == nullptr - ? 0 - : g_core_codegen_interface->grpc_byte_buffer_length(buffer_); - } - - /// Swap the state of *this and *other. - void Swap(ByteBuffer* other) { - grpc_byte_buffer* tmp = other->buffer_; - other->buffer_ = buffer_; - buffer_ = tmp; - } - - /// Is this ByteBuffer valid? - bool Valid() const { return (buffer_ != nullptr); } - - private: - friend class SerializationTraits; - friend class ServerInterface; - friend class internal::CallOpSendMessage; - template - friend class internal::CallOpRecvMessage; - friend class internal::CallOpGenericRecvMessage; - template - friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, - grpc::Status*, RequestType*); - template - friend class internal::ServerStreamingHandler; - template - friend class internal::CallbackUnaryHandler; - template - friend class internal::CallbackServerStreamingHandler; - template - friend class internal::ErrorMethodHandler; - template - friend class internal::DeserializeFuncType; - friend class ProtoBufferReader; - friend class ProtoBufferWriter; - friend class internal::GrpcByteBufferPeer; - friend class internal::ExternalConnectionAcceptorImpl; - - grpc_byte_buffer* buffer_; - - // takes ownership - void set_buffer(grpc_byte_buffer* buf) { - if (buffer_) { - Clear(); - } - buffer_ = buf; - } - - grpc_byte_buffer* c_buffer() { return buffer_; } - grpc_byte_buffer** c_buffer_ptr() { return &buffer_; } - - class ByteBufferPointer { - public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ - ByteBufferPointer(const ByteBuffer* b) - : bbuf_(const_cast(b)) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator ByteBuffer*() { return bbuf_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer*() { return bbuf_->buffer_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ - operator grpc_byte_buffer**() { return &bbuf_->buffer_; } - - private: - ByteBuffer* bbuf_; - }; - ByteBufferPointer bbuf_ptr() const { return ByteBufferPointer(this); } -}; - -template <> -class SerializationTraits { - public: - static Status Deserialize(ByteBuffer* byte_buffer, ByteBuffer* dest) { - dest->set_buffer(byte_buffer->buffer_); - return Status::OK; - } - static Status Serialize(const ByteBuffer& source, ByteBuffer* buffer, - bool* own_buffer) { - *buffer = source; - *own_buffer = true; - return g_core_codegen_interface->ok(); - } -}; - -} // namespace grpc - #endif // GRPCPP_SUPPORT_BYTE_BUFFER_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h index 8e5e1ce6..552cab4c 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Headers/support/client_interceptor.h @@ -19,179 +19,6 @@ #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H -#include -#include - -#include -#include -#include - -namespace grpc { - -class Channel; -class ClientContext; - -namespace internal { -class InterceptorBatchMethodsImpl; -} - -namespace experimental { -class ClientRpcInfo; - -// A factory interface for creation of client interceptors. A vector of -// factories can be provided at channel creation which will be used to create a -// new vector of client interceptors per RPC. Client interceptor authors should -// create a subclass of ClientInterceptorFactorInterface which creates objects -// of their interceptors. -class ClientInterceptorFactoryInterface { - public: - virtual ~ClientInterceptorFactoryInterface() {} - // Returns a pointer to an Interceptor object on successful creation, nullptr - // otherwise. If nullptr is returned, this server interceptor factory is - // ignored for the purposes of that RPC. - virtual Interceptor* CreateClientInterceptor(ClientRpcInfo* info) = 0; -}; -} // namespace experimental - -namespace internal { -extern experimental::ClientInterceptorFactoryInterface* - g_global_client_interceptor_factory; -} - -/// ClientRpcInfo represents the state of a particular RPC as it -/// appears to an interceptor. It is created and owned by the library and -/// passed to the CreateClientInterceptor method of the application's -/// ClientInterceptorFactoryInterface implementation -namespace experimental { -class ClientRpcInfo { - public: - // TODO(yashykt): Stop default-constructing ClientRpcInfo and remove UNKNOWN - // from the list of possible Types. - /// Type categorizes RPCs by unary or streaming type - enum class Type { - UNARY, - CLIENT_STREAMING, - SERVER_STREAMING, - BIDI_STREAMING, - UNKNOWN // UNKNOWN is not API and will be removed later - }; - - ~ClientRpcInfo() {} - - // Delete copy constructor but allow default move constructor - ClientRpcInfo(const ClientRpcInfo&) = delete; - ClientRpcInfo(ClientRpcInfo&&) = default; - - // Getter methods - - /// Return the fully-specified method name - const char* method() const { return method_; } - - /// Return an identifying suffix for the client stub, or nullptr if one wasn't - /// specified. - const char* suffix_for_stats() const { return suffix_for_stats_; } - - /// Return a pointer to the channel on which the RPC is being sent - ChannelInterface* channel() { return channel_; } - - /// Return a pointer to the underlying ClientContext structure associated - /// with the RPC to support features that apply to it - grpc::ClientContext* client_context() { return ctx_; } - - /// Return the type of the RPC (unary or a streaming flavor) - Type type() const { return type_; } - - private: - static_assert(Type::UNARY == - static_cast(internal::RpcMethod::NORMAL_RPC), - "violated expectation about Type enum"); - static_assert(Type::CLIENT_STREAMING == - static_cast(internal::RpcMethod::CLIENT_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::SERVER_STREAMING == - static_cast(internal::RpcMethod::SERVER_STREAMING), - "violated expectation about Type enum"); - static_assert(Type::BIDI_STREAMING == - static_cast(internal::RpcMethod::BIDI_STREAMING), - "violated expectation about Type enum"); - - // Default constructor should only be used by ClientContext - ClientRpcInfo() = default; - - // Constructor will only be called from ClientContext - ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type, - const char* method, const char* suffix_for_stats, - grpc::ChannelInterface* channel) - : ctx_(ctx), - type_(static_cast(type)), - method_(method), - suffix_for_stats_(suffix_for_stats), - channel_(channel) {} - - // Move assignment should only be used by ClientContext - // TODO(yashykt): Delete move assignment - ClientRpcInfo& operator=(ClientRpcInfo&&) = default; - - // Runs interceptor at pos \a pos. - void RunInterceptor( - experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) { - GPR_CODEGEN_ASSERT(pos < interceptors_.size()); - interceptors_[pos]->Intercept(interceptor_methods); - } - - void RegisterInterceptors( - const std::vector>& creators, - size_t interceptor_pos) { - if (interceptor_pos > creators.size()) { - // No interceptors to register - return; - } - // NOTE: The following is not a range-based for loop because it will only - // iterate over a portion of the creators vector. - for (auto it = creators.begin() + interceptor_pos; it != creators.end(); - ++it) { - auto* interceptor = (*it)->CreateClientInterceptor(this); - if (interceptor != nullptr) { - interceptors_.push_back( - std::unique_ptr(interceptor)); - } - } - if (internal::g_global_client_interceptor_factory != nullptr) { - interceptors_.push_back(std::unique_ptr( - internal::g_global_client_interceptor_factory - ->CreateClientInterceptor(this))); - } - } - - grpc::ClientContext* ctx_ = nullptr; - // TODO(yashykt): make type_ const once move-assignment is deleted - Type type_{Type::UNKNOWN}; - const char* method_ = nullptr; - const char* suffix_for_stats_ = nullptr; - grpc::ChannelInterface* channel_ = nullptr; - std::vector> interceptors_; - bool hijacked_ = false; - size_t hijacked_interceptor_ = 0; - - friend class internal::InterceptorBatchMethodsImpl; - friend class grpc::ClientContext; -}; - -// PLEASE DO NOT USE THIS. ALWAYS PREFER PER CHANNEL INTERCEPTORS OVER A GLOBAL -// INTERCEPTOR. IF USAGE IS ABSOLUTELY NECESSARY, PLEASE READ THE SAFETY NOTES. -// Registers a global client interceptor factory object, which is used for all -// RPCs made in this process. The application is responsible for maintaining the -// life of the object while gRPC operations are in progress. The global -// interceptor factory should only be registered once at the start of the -// process before any gRPC operations have begun. -void RegisterGlobalClientInterceptorFactory( - ClientInterceptorFactoryInterface* factory); - -// For testing purposes only -void TestOnlyResetGlobalClientInterceptorFactory(); - -} // namespace experimental -} // namespace grpc +#include // IWYU pragma: export #endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist index 3c7e8970..7a2e5e54 100644 --- a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist +++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ index 07d33351..c8fb1de4 100644 Binary files a/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ and b/FirebaseFirestore/gRPC-C++.xcframework/tvos-arm64_x86_64-simulator/gRPC-C++.framework/gRPC-C++ differ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/Info.plist b/FirebaseFirestore/gRPC-Core.xcframework/Info.plist index 6403f81e..49854c89 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/Info.plist +++ b/FirebaseFirestore/gRPC-Core.xcframework/Info.plist @@ -6,7 +6,7 @@ LibraryIdentifier - ios-arm64_x86_64-simulator + ios-arm64_x86_64-maccatalyst LibraryPath gRPC-Core.framework SupportedArchitectures @@ -17,19 +17,22 @@ SupportedPlatform ios SupportedPlatformVariant - simulator + maccatalyst LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-simulator LibraryPath gRPC-Core.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator LibraryIdentifier @@ -46,22 +49,19 @@ LibraryIdentifier - tvos-arm64_x86_64-simulator + tvos-arm64 LibraryPath gRPC-Core.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform tvos - SupportedPlatformVariant - simulator LibraryIdentifier - tvos-arm64 + ios-arm64 LibraryPath gRPC-Core.framework SupportedArchitectures @@ -69,11 +69,11 @@ arm64 SupportedPlatform - tvos + ios LibraryIdentifier - ios-arm64_x86_64-maccatalyst + tvos-arm64_x86_64-simulator LibraryPath gRPC-Core.framework SupportedArchitectures @@ -82,9 +82,9 @@ x86_64 SupportedPlatform - ios + tvos SupportedPlatformVariant - maccatalyst + simulator CFBundlePackageType diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h index 68dae44c..6ca4b4f7 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h @@ -19,7 +19,7 @@ #include #include "absl/strings/string_view.h" -#include "absl/types/optional.h" +#include "absl/types/variant.h" namespace grpc_event_engine { namespace experimental { @@ -31,16 +31,10 @@ namespace experimental { class EndpointConfig { public: virtual ~EndpointConfig() = default; - // If the key points to an integer config, an integer value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetInt(absl::string_view key) const = 0; - // If the key points to an string config, an string value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetString( - absl::string_view key) const = 0; - // If the key points to an void* config, a void* pointer value gets returned. - // Otherwise it returns nullptr - virtual void* GetVoidPointer(absl::string_view key) const = 0; + using Setting = absl::variant; + /// Returns the Setting for a specified key, or \a absl::monostate if there is + /// no such entry. Caller does not take ownership of the resulting value. + virtual Setting Get(absl::string_view key) const = 0; }; } // namespace experimental diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h index 3af75bb2..52edb5ad 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h @@ -72,7 +72,7 @@ namespace experimental { /// server->Wait(); /// //////////////////////////////////////////////////////////////////////////////// -class EventEngine : public std::enable_shared_from_this { +class EventEngine { public: /// A duration between two events. /// diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h index ad3f91f0..05d6e42c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h @@ -33,6 +33,20 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#ifdef GPR_LOW_LEVEL_COUNTERS +extern gpr_atm gpr_counter_atm_cas; +extern gpr_atm gpr_counter_atm_add; +#define GPR_ATM_INC_COUNTER(counter) \ + __atomic_fetch_add(&counter, 1, __ATOMIC_RELAXED) +#define GPR_ATM_INC_CAS_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_cas), blah) +#define GPR_ATM_INC_ADD_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_add), blah) +#else +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah +#endif + #define gpr_atm_full_barrier() (__atomic_thread_fence(__ATOMIC_SEQ_CST)) #define gpr_atm_acq_load(p) (__atomic_load_n((p), __ATOMIC_ACQUIRE)) @@ -43,39 +57,34 @@ typedef intptr_t gpr_atm; (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELAXED)) #define gpr_atm_no_barrier_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED)) #define gpr_atm_full_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL)) static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELAXED, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)); } static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQUIRE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELEASE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)); } -#define gpr_atm_full_xchg(p, n) __atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL) +#define gpr_atm_full_xchg(p, n) \ + GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL)) #ifdef __cplusplus } diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h index cf946748..bdc7a172 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h @@ -28,6 +28,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory") diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h index 39cd8399..816c9a9c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h @@ -29,6 +29,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define gpr_atm_full_barrier MemoryBarrier diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h index 3bbef00b..2dfdbf3c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h @@ -368,12 +368,6 @@ typedef struct { balancer before using fallback backend addresses from the resolver. If 0, enter fallback mode immediately. Default value is 10000. */ #define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" -/* Experimental Arg. Channel args to be used for the control-plane channel - * created to the grpclb load balancers. This is a pointer arg whose value is a - * grpc_channel_args object. If unset, most channel args from the parent channel - * will be propagated to the grpclb channel. */ -#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ - "grpc.experimental.grpclb_channel_args" /* Timeout in milliseconds to wait for the child of a specific priority to complete its initial connection attempt before the priority LB policy fails over to the next priority. Default value is 10 seconds. */ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Info.plist b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Info.plist index 90cb4b7b..31a23be2 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Info.plist +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/gRPC-Core b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/gRPC-Core index aa3b5c3b..e5b94034 100644 Binary files a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/gRPC-Core and b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64/gRPC-Core.framework/gRPC-Core differ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/endpoint_config.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/endpoint_config.h index 68dae44c..6ca4b4f7 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/endpoint_config.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/endpoint_config.h @@ -19,7 +19,7 @@ #include #include "absl/strings/string_view.h" -#include "absl/types/optional.h" +#include "absl/types/variant.h" namespace grpc_event_engine { namespace experimental { @@ -31,16 +31,10 @@ namespace experimental { class EndpointConfig { public: virtual ~EndpointConfig() = default; - // If the key points to an integer config, an integer value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetInt(absl::string_view key) const = 0; - // If the key points to an string config, an string value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetString( - absl::string_view key) const = 0; - // If the key points to an void* config, a void* pointer value gets returned. - // Otherwise it returns nullptr - virtual void* GetVoidPointer(absl::string_view key) const = 0; + using Setting = absl::variant; + /// Returns the Setting for a specified key, or \a absl::monostate if there is + /// no such entry. Caller does not take ownership of the resulting value. + virtual Setting Get(absl::string_view key) const = 0; }; } // namespace experimental diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/event_engine.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/event_engine.h index 3af75bb2..52edb5ad 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/event_engine.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/event_engine/event_engine.h @@ -72,7 +72,7 @@ namespace experimental { /// server->Wait(); /// //////////////////////////////////////////////////////////////////////////////// -class EventEngine : public std::enable_shared_from_this { +class EventEngine { public: /// A duration between two events. /// diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h index ad3f91f0..05d6e42c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h @@ -33,6 +33,20 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#ifdef GPR_LOW_LEVEL_COUNTERS +extern gpr_atm gpr_counter_atm_cas; +extern gpr_atm gpr_counter_atm_add; +#define GPR_ATM_INC_COUNTER(counter) \ + __atomic_fetch_add(&counter, 1, __ATOMIC_RELAXED) +#define GPR_ATM_INC_CAS_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_cas), blah) +#define GPR_ATM_INC_ADD_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_add), blah) +#else +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah +#endif + #define gpr_atm_full_barrier() (__atomic_thread_fence(__ATOMIC_SEQ_CST)) #define gpr_atm_acq_load(p) (__atomic_load_n((p), __ATOMIC_ACQUIRE)) @@ -43,39 +57,34 @@ typedef intptr_t gpr_atm; (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELAXED)) #define gpr_atm_no_barrier_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED)) #define gpr_atm_full_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL)) static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELAXED, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)); } static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQUIRE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELEASE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)); } -#define gpr_atm_full_xchg(p, n) __atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL) +#define gpr_atm_full_xchg(p, n) \ + GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL)) #ifdef __cplusplus } diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h index cf946748..bdc7a172 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h @@ -28,6 +28,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory") diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h index 39cd8399..816c9a9c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h @@ -29,6 +29,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define gpr_atm_full_barrier MemoryBarrier diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h index 3bbef00b..2dfdbf3c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h @@ -368,12 +368,6 @@ typedef struct { balancer before using fallback backend addresses from the resolver. If 0, enter fallback mode immediately. Default value is 10000. */ #define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" -/* Experimental Arg. Channel args to be used for the control-plane channel - * created to the grpclb load balancers. This is a pointer arg whose value is a - * grpc_channel_args object. If unset, most channel args from the parent channel - * will be propagated to the grpclb channel. */ -#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ - "grpc.experimental.grpclb_channel_args" /* Timeout in milliseconds to wait for the child of a specific priority to complete its initial connection attempt before the priority LB policy fails over to the next priority. Default value is 10 seconds. */ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Info.plist b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Info.plist index 90cb4b7b..31a23be2 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Info.plist +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/gRPC-Core b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/gRPC-Core index 0f5d37f6..41b7a357 100644 Binary files a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/gRPC-Core and b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-maccatalyst/gRPC-Core.framework/gRPC-Core differ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h index 68dae44c..6ca4b4f7 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h @@ -19,7 +19,7 @@ #include #include "absl/strings/string_view.h" -#include "absl/types/optional.h" +#include "absl/types/variant.h" namespace grpc_event_engine { namespace experimental { @@ -31,16 +31,10 @@ namespace experimental { class EndpointConfig { public: virtual ~EndpointConfig() = default; - // If the key points to an integer config, an integer value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetInt(absl::string_view key) const = 0; - // If the key points to an string config, an string value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetString( - absl::string_view key) const = 0; - // If the key points to an void* config, a void* pointer value gets returned. - // Otherwise it returns nullptr - virtual void* GetVoidPointer(absl::string_view key) const = 0; + using Setting = absl::variant; + /// Returns the Setting for a specified key, or \a absl::monostate if there is + /// no such entry. Caller does not take ownership of the resulting value. + virtual Setting Get(absl::string_view key) const = 0; }; } // namespace experimental diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h index 3af75bb2..52edb5ad 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h @@ -72,7 +72,7 @@ namespace experimental { /// server->Wait(); /// //////////////////////////////////////////////////////////////////////////////// -class EventEngine : public std::enable_shared_from_this { +class EventEngine { public: /// A duration between two events. /// diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h index ad3f91f0..05d6e42c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h @@ -33,6 +33,20 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#ifdef GPR_LOW_LEVEL_COUNTERS +extern gpr_atm gpr_counter_atm_cas; +extern gpr_atm gpr_counter_atm_add; +#define GPR_ATM_INC_COUNTER(counter) \ + __atomic_fetch_add(&counter, 1, __ATOMIC_RELAXED) +#define GPR_ATM_INC_CAS_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_cas), blah) +#define GPR_ATM_INC_ADD_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_add), blah) +#else +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah +#endif + #define gpr_atm_full_barrier() (__atomic_thread_fence(__ATOMIC_SEQ_CST)) #define gpr_atm_acq_load(p) (__atomic_load_n((p), __ATOMIC_ACQUIRE)) @@ -43,39 +57,34 @@ typedef intptr_t gpr_atm; (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELAXED)) #define gpr_atm_no_barrier_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED)) #define gpr_atm_full_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL)) static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELAXED, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)); } static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQUIRE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELEASE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)); } -#define gpr_atm_full_xchg(p, n) __atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL) +#define gpr_atm_full_xchg(p, n) \ + GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL)) #ifdef __cplusplus } diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h index cf946748..bdc7a172 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h @@ -28,6 +28,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory") diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h index 39cd8399..816c9a9c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h @@ -29,6 +29,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define gpr_atm_full_barrier MemoryBarrier diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h index 3bbef00b..2dfdbf3c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h @@ -368,12 +368,6 @@ typedef struct { balancer before using fallback backend addresses from the resolver. If 0, enter fallback mode immediately. Default value is 10000. */ #define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" -/* Experimental Arg. Channel args to be used for the control-plane channel - * created to the grpclb load balancers. This is a pointer arg whose value is a - * grpc_channel_args object. If unset, most channel args from the parent channel - * will be propagated to the grpclb channel. */ -#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ - "grpc.experimental.grpclb_channel_args" /* Timeout in milliseconds to wait for the child of a specific priority to complete its initial connection attempt before the priority LB policy fails over to the next priority. Default value is 10 seconds. */ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist index 90cb4b7b..31a23be2 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist +++ b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core index 801caa96..257c92d4 100644 Binary files a/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core and b/FirebaseFirestore/gRPC-Core.xcframework/ios-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core differ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h index 68dae44c..6ca4b4f7 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h @@ -19,7 +19,7 @@ #include #include "absl/strings/string_view.h" -#include "absl/types/optional.h" +#include "absl/types/variant.h" namespace grpc_event_engine { namespace experimental { @@ -31,16 +31,10 @@ namespace experimental { class EndpointConfig { public: virtual ~EndpointConfig() = default; - // If the key points to an integer config, an integer value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetInt(absl::string_view key) const = 0; - // If the key points to an string config, an string value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetString( - absl::string_view key) const = 0; - // If the key points to an void* config, a void* pointer value gets returned. - // Otherwise it returns nullptr - virtual void* GetVoidPointer(absl::string_view key) const = 0; + using Setting = absl::variant; + /// Returns the Setting for a specified key, or \a absl::monostate if there is + /// no such entry. Caller does not take ownership of the resulting value. + virtual Setting Get(absl::string_view key) const = 0; }; } // namespace experimental diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/event_engine.h b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/event_engine.h index 3af75bb2..52edb5ad 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/event_engine.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/event_engine/event_engine.h @@ -72,7 +72,7 @@ namespace experimental { /// server->Wait(); /// //////////////////////////////////////////////////////////////////////////////// -class EventEngine : public std::enable_shared_from_this { +class EventEngine { public: /// A duration between two events. /// diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h index ad3f91f0..05d6e42c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h @@ -33,6 +33,20 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#ifdef GPR_LOW_LEVEL_COUNTERS +extern gpr_atm gpr_counter_atm_cas; +extern gpr_atm gpr_counter_atm_add; +#define GPR_ATM_INC_COUNTER(counter) \ + __atomic_fetch_add(&counter, 1, __ATOMIC_RELAXED) +#define GPR_ATM_INC_CAS_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_cas), blah) +#define GPR_ATM_INC_ADD_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_add), blah) +#else +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah +#endif + #define gpr_atm_full_barrier() (__atomic_thread_fence(__ATOMIC_SEQ_CST)) #define gpr_atm_acq_load(p) (__atomic_load_n((p), __ATOMIC_ACQUIRE)) @@ -43,39 +57,34 @@ typedef intptr_t gpr_atm; (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELAXED)) #define gpr_atm_no_barrier_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED)) #define gpr_atm_full_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL)) static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELAXED, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)); } static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQUIRE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELEASE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)); } -#define gpr_atm_full_xchg(p, n) __atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL) +#define gpr_atm_full_xchg(p, n) \ + GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL)) #ifdef __cplusplus } diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h index cf946748..bdc7a172 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h @@ -28,6 +28,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory") diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h index 39cd8399..816c9a9c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h @@ -29,6 +29,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define gpr_atm_full_barrier MemoryBarrier diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h index 3bbef00b..2dfdbf3c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h @@ -368,12 +368,6 @@ typedef struct { balancer before using fallback backend addresses from the resolver. If 0, enter fallback mode immediately. Default value is 10000. */ #define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" -/* Experimental Arg. Channel args to be used for the control-plane channel - * created to the grpclb load balancers. This is a pointer arg whose value is a - * grpc_channel_args object. If unset, most channel args from the parent channel - * will be propagated to the grpclb channel. */ -#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ - "grpc.experimental.grpclb_channel_args" /* Timeout in milliseconds to wait for the child of a specific priority to complete its initial connection attempt before the priority LB policy fails over to the next priority. Default value is 10 seconds. */ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Info.plist b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Info.plist index 90cb4b7b..31a23be2 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Info.plist +++ b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/gRPC-Core b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/gRPC-Core index 11cf2000..be461c28 100644 Binary files a/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/gRPC-Core and b/FirebaseFirestore/gRPC-Core.xcframework/macos-arm64_x86_64/gRPC-Core.framework/gRPC-Core differ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h index 68dae44c..6ca4b4f7 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/endpoint_config.h @@ -19,7 +19,7 @@ #include #include "absl/strings/string_view.h" -#include "absl/types/optional.h" +#include "absl/types/variant.h" namespace grpc_event_engine { namespace experimental { @@ -31,16 +31,10 @@ namespace experimental { class EndpointConfig { public: virtual ~EndpointConfig() = default; - // If the key points to an integer config, an integer value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetInt(absl::string_view key) const = 0; - // If the key points to an string config, an string value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetString( - absl::string_view key) const = 0; - // If the key points to an void* config, a void* pointer value gets returned. - // Otherwise it returns nullptr - virtual void* GetVoidPointer(absl::string_view key) const = 0; + using Setting = absl::variant; + /// Returns the Setting for a specified key, or \a absl::monostate if there is + /// no such entry. Caller does not take ownership of the resulting value. + virtual Setting Get(absl::string_view key) const = 0; }; } // namespace experimental diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h index 3af75bb2..52edb5ad 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/event_engine/event_engine.h @@ -72,7 +72,7 @@ namespace experimental { /// server->Wait(); /// //////////////////////////////////////////////////////////////////////////////// -class EventEngine : public std::enable_shared_from_this { +class EventEngine { public: /// A duration between two events. /// diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h index ad3f91f0..05d6e42c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h @@ -33,6 +33,20 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#ifdef GPR_LOW_LEVEL_COUNTERS +extern gpr_atm gpr_counter_atm_cas; +extern gpr_atm gpr_counter_atm_add; +#define GPR_ATM_INC_COUNTER(counter) \ + __atomic_fetch_add(&counter, 1, __ATOMIC_RELAXED) +#define GPR_ATM_INC_CAS_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_cas), blah) +#define GPR_ATM_INC_ADD_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_add), blah) +#else +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah +#endif + #define gpr_atm_full_barrier() (__atomic_thread_fence(__ATOMIC_SEQ_CST)) #define gpr_atm_acq_load(p) (__atomic_load_n((p), __ATOMIC_ACQUIRE)) @@ -43,39 +57,34 @@ typedef intptr_t gpr_atm; (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELAXED)) #define gpr_atm_no_barrier_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED)) #define gpr_atm_full_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL)) static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELAXED, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)); } static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQUIRE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELEASE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)); } -#define gpr_atm_full_xchg(p, n) __atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL) +#define gpr_atm_full_xchg(p, n) \ + GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL)) #ifdef __cplusplus } diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h index cf946748..bdc7a172 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h @@ -28,6 +28,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory") diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h index 39cd8399..816c9a9c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h @@ -29,6 +29,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define gpr_atm_full_barrier MemoryBarrier diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h index 3bbef00b..2dfdbf3c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h @@ -368,12 +368,6 @@ typedef struct { balancer before using fallback backend addresses from the resolver. If 0, enter fallback mode immediately. Default value is 10000. */ #define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" -/* Experimental Arg. Channel args to be used for the control-plane channel - * created to the grpclb load balancers. This is a pointer arg whose value is a - * grpc_channel_args object. If unset, most channel args from the parent channel - * will be propagated to the grpclb channel. */ -#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ - "grpc.experimental.grpclb_channel_args" /* Timeout in milliseconds to wait for the child of a specific priority to complete its initial connection attempt before the priority LB policy fails over to the next priority. Default value is 10 seconds. */ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Info.plist b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Info.plist index 90cb4b7b..31a23be2 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Info.plist +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/gRPC-Core b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/gRPC-Core index bd190570..d211da21 100644 Binary files a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/gRPC-Core and b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64/gRPC-Core.framework/gRPC-Core differ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h index 68dae44c..6ca4b4f7 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/endpoint_config.h @@ -19,7 +19,7 @@ #include #include "absl/strings/string_view.h" -#include "absl/types/optional.h" +#include "absl/types/variant.h" namespace grpc_event_engine { namespace experimental { @@ -31,16 +31,10 @@ namespace experimental { class EndpointConfig { public: virtual ~EndpointConfig() = default; - // If the key points to an integer config, an integer value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetInt(absl::string_view key) const = 0; - // If the key points to an string config, an string value gets returned. - // Otherwise it returns an absl::nullopt_t - virtual absl::optional GetString( - absl::string_view key) const = 0; - // If the key points to an void* config, a void* pointer value gets returned. - // Otherwise it returns nullptr - virtual void* GetVoidPointer(absl::string_view key) const = 0; + using Setting = absl::variant; + /// Returns the Setting for a specified key, or \a absl::monostate if there is + /// no such entry. Caller does not take ownership of the resulting value. + virtual Setting Get(absl::string_view key) const = 0; }; } // namespace experimental diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h index 3af75bb2..52edb5ad 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/event_engine/event_engine.h @@ -72,7 +72,7 @@ namespace experimental { /// server->Wait(); /// //////////////////////////////////////////////////////////////////////////////// -class EventEngine : public std::enable_shared_from_this { +class EventEngine { public: /// A duration between two events. /// diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h index ad3f91f0..05d6e42c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_atomic.h @@ -33,6 +33,20 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#ifdef GPR_LOW_LEVEL_COUNTERS +extern gpr_atm gpr_counter_atm_cas; +extern gpr_atm gpr_counter_atm_add; +#define GPR_ATM_INC_COUNTER(counter) \ + __atomic_fetch_add(&counter, 1, __ATOMIC_RELAXED) +#define GPR_ATM_INC_CAS_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_cas), blah) +#define GPR_ATM_INC_ADD_THEN(blah) \ + (GPR_ATM_INC_COUNTER(gpr_counter_atm_add), blah) +#else +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah +#endif + #define gpr_atm_full_barrier() (__atomic_thread_fence(__ATOMIC_SEQ_CST)) #define gpr_atm_acq_load(p) (__atomic_load_n((p), __ATOMIC_ACQUIRE)) @@ -43,39 +57,34 @@ typedef intptr_t gpr_atm; (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELAXED)) #define gpr_atm_no_barrier_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED)) #define gpr_atm_full_fetch_add(p, delta) \ - __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL) + GPR_ATM_INC_ADD_THEN( \ + __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL)) static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELAXED, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)); } static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQUIRE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELEASE, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED)); } static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) { - // Need to be c89 compatible, so we can't use false for the fourth argument. - // NOLINTNEXTLINE(modernize-use-bool-literals) - return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); + return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n( + p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)); } -#define gpr_atm_full_xchg(p, n) __atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL) +#define gpr_atm_full_xchg(p, n) \ + GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL)) #ifdef __cplusplus } diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h index cf946748..bdc7a172 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_gcc_sync.h @@ -28,6 +28,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory") diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h index 39cd8399..816c9a9c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/atm_windows.h @@ -29,6 +29,8 @@ typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX #define GPR_ATM_MIN INTPTR_MIN +#define GPR_ATM_INC_CAS_THEN(blah) blah +#define GPR_ATM_INC_ADD_THEN(blah) blah #define gpr_atm_full_barrier MemoryBarrier diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h index 3bbef00b..2dfdbf3c 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Headers/impl/codegen/grpc_types.h @@ -368,12 +368,6 @@ typedef struct { balancer before using fallback backend addresses from the resolver. If 0, enter fallback mode immediately. Default value is 10000. */ #define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" -/* Experimental Arg. Channel args to be used for the control-plane channel - * created to the grpclb load balancers. This is a pointer arg whose value is a - * grpc_channel_args object. If unset, most channel args from the parent channel - * will be propagated to the grpclb channel. */ -#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ - "grpc.experimental.grpclb_channel_args" /* Timeout in milliseconds to wait for the child of a specific priority to complete its initial connection attempt before the priority LB policy fails over to the next priority. Default value is 10 seconds. */ diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist index 90cb4b7b..31a23be2 100644 --- a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist +++ b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType FMWK CFBundleVersion - 1.50.1 + 1.49.1 DTSDKName iphonesimulator11.2 diff --git a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core index 5fc256e6..1b1feba0 100644 Binary files a/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core and b/FirebaseFirestore/gRPC-Core.xcframework/tvos-arm64_x86_64-simulator/gRPC-Core.framework/gRPC-Core differ diff --git a/FirebaseFirestore/leveldb-library.xcframework/Info.plist b/FirebaseFirestore/leveldb-library.xcframework/Info.plist index ef1ae75e..2b28c750 100644 --- a/FirebaseFirestore/leveldb-library.xcframework/Info.plist +++ b/FirebaseFirestore/leveldb-library.xcframework/Info.plist @@ -6,7 +6,7 @@ LibraryIdentifier - tvos-arm64_x86_64-simulator + ios-arm64_x86_64-maccatalyst LibraryPath leveldb-library.framework SupportedArchitectures @@ -15,13 +15,13 @@ x86_64 SupportedPlatform - tvos + ios SupportedPlatformVariant - simulator + maccatalyst LibraryIdentifier - ios-arm64_x86_64-simulator + macos-arm64_x86_64 LibraryPath leveldb-library.framework SupportedArchitectures @@ -30,28 +30,23 @@ x86_64 SupportedPlatform - ios - SupportedPlatformVariant - simulator + macos LibraryIdentifier - ios-arm64_x86_64-maccatalyst + ios-arm64 LibraryPath leveldb-library.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - maccatalyst LibraryIdentifier - macos-arm64_x86_64 + ios-arm64_x86_64-simulator LibraryPath leveldb-library.framework SupportedArchitectures @@ -60,23 +55,28 @@ x86_64 SupportedPlatform - macos + ios + SupportedPlatformVariant + simulator LibraryIdentifier - tvos-arm64 + tvos-arm64_x86_64-simulator LibraryPath leveldb-library.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform tvos + SupportedPlatformVariant + simulator LibraryIdentifier - ios-arm64 + tvos-arm64 LibraryPath leveldb-library.framework SupportedArchitectures @@ -84,7 +84,7 @@ arm64 SupportedPlatform - ios + tvos CFBundlePackageType diff --git a/FirebaseFirestore/leveldb-library.xcframework/ios-arm64/leveldb-library.framework/leveldb-library b/FirebaseFirestore/leveldb-library.xcframework/ios-arm64/leveldb-library.framework/leveldb-library index f266e063..40f442c6 100644 Binary files a/FirebaseFirestore/leveldb-library.xcframework/ios-arm64/leveldb-library.framework/leveldb-library and b/FirebaseFirestore/leveldb-library.xcframework/ios-arm64/leveldb-library.framework/leveldb-library differ diff --git a/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-maccatalyst/leveldb-library.framework/leveldb-library b/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-maccatalyst/leveldb-library.framework/leveldb-library index 1a29972f..29991381 100644 Binary files a/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-maccatalyst/leveldb-library.framework/leveldb-library and b/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-maccatalyst/leveldb-library.framework/leveldb-library differ diff --git a/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library b/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library index 0cc3049b..5077a685 100644 Binary files a/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library and b/FirebaseFirestore/leveldb-library.xcframework/ios-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library differ diff --git a/FirebaseFirestore/leveldb-library.xcframework/macos-arm64_x86_64/leveldb-library.framework/leveldb-library b/FirebaseFirestore/leveldb-library.xcframework/macos-arm64_x86_64/leveldb-library.framework/leveldb-library index b8d9e1e6..12fd3752 100644 Binary files a/FirebaseFirestore/leveldb-library.xcframework/macos-arm64_x86_64/leveldb-library.framework/leveldb-library and b/FirebaseFirestore/leveldb-library.xcframework/macos-arm64_x86_64/leveldb-library.framework/leveldb-library differ diff --git a/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64/leveldb-library.framework/leveldb-library b/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64/leveldb-library.framework/leveldb-library index e1b2d91a..2c19dd9b 100644 Binary files a/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64/leveldb-library.framework/leveldb-library and b/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64/leveldb-library.framework/leveldb-library differ diff --git a/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library b/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library index 41b3d6c8..8c0ce3da 100644 Binary files a/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library and b/FirebaseFirestore/leveldb-library.xcframework/tvos-arm64_x86_64-simulator/leveldb-library.framework/leveldb-library differ diff --git a/README.md b/README.md index a4245947..f3fccc76 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ The below are the currently supported Firebase iOS SDK versions of this reposito > **⚠️ Note:** if you are looking for a new version that is not listed in the supported versions list, examine the upstream release notes for firebase-ios-sdk carefully. This can happen if the firebase-ios-sdk team issues an interim release to solve some urgent problem, but do not run their full release process. If that happens, don't worry - just wait for the next supported version before moving forward, or temporarily de-integrate this pre-compiled framework if you must use the interim version. 6.31.1 is an example of this, with more details [here](https://github.com/firebase/firebase-ios-sdk/pull/6368#issuecomment-685030446) for why it might happen. + - [10.16.0](https://github.com/invertase/firestore-ios-sdk-frameworks/releases/tag/10.16.0) - [10.15.0](https://github.com/invertase/firestore-ios-sdk-frameworks/releases/tag/10.15.0) - [10.14.0](https://github.com/invertase/firestore-ios-sdk-frameworks/releases/tag/10.14.0) - [10.13.0](https://github.com/invertase/firestore-ios-sdk-frameworks/releases/tag/10.13.0)