File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Firestore/Source/Public/FirebaseFirestore Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1515 */
1616
1717#import < Foundation/Foundation.h>
18- #import < memory>
18+ #include < memory>
19+ #include < vector>
1920
2021namespace firebase {
2122namespace firestore {
@@ -47,10 +48,15 @@ NS_SWIFT_SENDABLE
4748NS_SWIFT_NAME (CallbackWrapper)
4849@interface FIRCallbackWrapper : NSObject
4950
51+ // Note: Marking callbacks in callback-based APIs as `Sendable` can help prevent crashes when they
52+ // are invoked on a different thread than the one they were originally defined in. If this callback
53+ // is expected to be called on a different thread, it should be marked as `Sendable` to ensure
54+ // thread safety.
5055+ (std::unique_ptr<core::EventListener<std::vector<api::PipelineResult>>>)
5156 wrapPipelineCallback:(std::shared_ptr<api::Firestore>)firestore
52- completion:(void (^)(std::shared_ptr<std::vector<api::PipelineResult>> result,
53- NSError *_Nullable error))completion
57+ completion:(void (^NS_SWIFT_SENDABLE)(
58+ std::shared_ptr<std::vector<api::PipelineResult>> result,
59+ NSError *_Nullable error))completion
5460 NS_SWIFT_NAME(wrapPipelineCallback(firestore:completion:));
5561
5662@end
Original file line number Diff line number Diff line change 1515 */
1616
1717#import < Foundation/Foundation.h>
18- #import < memory>
18+ #include < memory>
1919
2020#import " FIRListenerRegistration.h"
2121
Original file line number Diff line number Diff line change 1515 */
1616
1717#import < Foundation/Foundation.h>
18- #import < memory>
1918
2019#import " FIRFirestoreSource.h"
2120#import " FIRListenerRegistration.h"
You can’t perform that action at this time.
0 commit comments