Skip to content

Commit

Permalink
Change CallOnCompletion to OnCompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
darinf committed Feb 13, 2024
1 parent c7d8d47 commit 29ee322
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Sources/FirebaseCore/FutureProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public protocol FutureProtocol {
func error() -> Int32
func __error_messageUnsafe() -> UnsafePointer<CChar>?
func __resultUnsafe() -> UnsafePointer<ResultType>?
func CallOnCompletion(
func OnCompletion(
_ completion: FutureCompletionType,
_ user_data: UnsafeMutableRawPointer?
)
Expand All @@ -35,7 +35,7 @@ public extension FutureProtocol {
// While the underlying Firebase `OnCompletion` method can provide a reference
// back to the Future, we don't need to expose that here.
func setCompletion(_ completion: @escaping () -> Void) {
CallOnCompletion({ ptr in
OnCompletion({ ptr in
Unmanaged<CompletionReference>.fromOpaque(ptr!).takeRetainedValue().completion()
}, Unmanaged.passRetained(CompletionReference(completion)).toOpaque())
}
Expand Down
9 changes: 5 additions & 4 deletions Sources/firebase/include/FirebaseCore.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ template <class R> class ConformingFuture: public ::firebase::Future<R> {

ConformingFuture(const FutureType& rhs) : FutureType(rhs) {}

void CallOnCompletion(
void OnCompletion(
_Nonnull FutureCompletionType completion,
_Nullable void* user_data) const {
OnCompletion([completion, user_data](const FutureBase&) {
completion(user_data);
});
::firebase::FutureBase::OnCompletion(
[completion, user_data](const FutureBase&) {
completion(user_data);
});
}
} __attribute__((swift_attr("conforms_to:FirebaseCore.FutureProtocol")));

Expand Down

0 comments on commit 29ee322

Please sign in to comment.