Skip to content

Commit

Permalink
Address more feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylEnkidu committed Jan 8, 2025
1 parent da80692 commit dbf10d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 9 additions & 3 deletions Firestore/Source/Public/FirebaseFirestore/FIRCallbackWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

#import <Foundation/Foundation.h>
#import <memory>
#include <memory>
#include <vector>

namespace firebase {
namespace firestore {
Expand Down Expand Up @@ -47,10 +48,15 @@ NS_SWIFT_SENDABLE
NS_SWIFT_NAME(CallbackWrapper)
@interface FIRCallbackWrapper : NSObject

// Note: Marking callbacks in callback-based APIs as `Sendable` can help prevent crashes when they
// are invoked on a different thread than the one they were originally defined in. If this callback
// is expected to be called on a different thread, it should be marked as `Sendable` to ensure
// thread safety.
+ (std::unique_ptr<core::EventListener<std::vector<api::PipelineResult>>>)
wrapPipelineCallback:(std::shared_ptr<api::Firestore>)firestore
completion:(void (^)(std::shared_ptr<std::vector<api::PipelineResult>> result,
NSError *_Nullable error))completion
completion:(void (^NS_SWIFT_SENDABLE)(
std::shared_ptr<std::vector<api::PipelineResult>> result,
NSError *_Nullable error))completion
NS_SWIFT_NAME(wrapPipelineCallback(firestore:completion:));

@end
Expand Down
2 changes: 1 addition & 1 deletion Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#import <Foundation/Foundation.h>
#import <memory>
#include <memory>

#import "FIRListenerRegistration.h"

Expand Down
1 change: 0 additions & 1 deletion Firestore/Source/Public/FirebaseFirestore/FIRQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

#import <Foundation/Foundation.h>
#import <memory>

#import "FIRFirestoreSource.h"
#import "FIRListenerRegistration.h"
Expand Down

0 comments on commit dbf10d8

Please sign in to comment.