Skip to content

Commit 099b1bf

Browse files
smilesa-maurice
authored andcommitted
Move iOS invites receiver to SafeFutureHandle.
Fixes deprecation warnings in the class. PiperOrigin-RevId: 264654428
1 parent 6b43f1d commit 099b1bf

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/src/invites/invites_receiver_internal.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,18 @@ void InvitesReceiverInternal::ReceivedInviteCallback(
128128
Future<void> InvitesReceiverInternal::ConvertInvitation(
129129
const char* invitation_id) {
130130
if (!future_impl_.ValidFuture(future_handle_convert_)) {
131-
future_handle_convert_ = future_impl_.Alloc<void>(kInvitesFnConvert);
131+
future_handle_convert_ = future_impl_.SafeAlloc<void>(kInvitesFnConvert);
132132
if (!PerformConvertInvitation(invitation_id)) {
133133
future_impl_.Complete(future_handle_convert_, kConvertFailedCode,
134134
kConvertFailedMessage);
135135
// This will tell all of the pending Futures that we have failed. Once all
136136
// those futures are gone, the RefFuture will automatically be deleted.
137-
future_handle_convert_ = ReferenceCountedFutureImpl::kInvalidHandle;
137+
future_handle_convert_ = SafeFutureHandle<void>::kInvalidHandle;
138138
}
139139
} else {
140140
// If there's already a convert in progress, fail.
141-
const FutureHandle handle = future_impl_.Alloc<void>(kInvitesFnConvert);
141+
const SafeFutureHandle<void> handle =
142+
future_impl_.SafeAlloc<void>(kInvitesFnConvert);
142143
future_impl_.Complete(handle, kConvertInProgressCode,
143144
kConvertInProgressMessage);
144145
}
@@ -155,7 +156,7 @@ void InvitesReceiverInternal::ConvertedInviteCallback(
155156
std::string error_message) {
156157
future_impl_.Complete(future_handle_convert_, result_code,
157158
error_message.c_str());
158-
future_handle_convert_ = ReferenceCountedFutureImpl::kInvalidHandle;
159+
future_handle_convert_ = SafeFutureHandle<void>::kInvalidHandle;
159160
}
160161

161162
} // namespace internal

app/src/invites/invites_receiver_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class InvitesReceiverInternal : public SenderReceiverInterface {
133133
// When a conversion begins, future_handle_convert_ will be non-0
134134
// until the conversion finishes. The future for the convert can be accessed
135135
// via `future_impl_.LastResult(kInvitesFnConvert)`.
136-
FutureHandle future_handle_convert_;
136+
SafeFutureHandle<void> future_handle_convert_;
137137

138138
// Need to add a cache which stores the last invite and forwards it to the
139139
// newly registered receiver.

0 commit comments

Comments
 (0)