Skip to content

Commit dab1fc6

Browse files
Googlera-maurice
authored andcommitted
Add ListenerRegistration.ListenerTask property.
PiperOrigin-RevId: 315484295
1 parent 4858fce commit dab1fc6

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

firestore/src/include/firebase/csharp/document_event_listener.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ void DocumentEventListener::DocumentSnapshotEvent(int callback_id,
5959
DocumentSnapshot value,
6060
Error error) {
6161
MutexLock lock(g_mutex);
62-
if (error != Error::kOk ||
63-
g_document_snapshot_event_listener_callback == nullptr) {
62+
if (g_document_snapshot_event_listener_callback == nullptr) {
6463
return;
6564
}
6665
// The ownership is passed through the call to C# handler.
6766
DocumentSnapshot* copy = new DocumentSnapshot(value);
68-
g_document_snapshot_event_listener_callback(callback_id, copy);
67+
g_document_snapshot_event_listener_callback(callback_id, copy, error);
6968
}
7069

7170
} // namespace csharp

firestore/src/include/firebase/csharp/document_event_listener.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace csharp {
2727
// The callbacks that are used by the listener, that need to reach back to C#
2828
// callbacks.
2929
typedef void(SWIGSTDCALL* DocumentEventListenerCallback)(int callback_id,
30-
void* snapshot);
30+
void* snapshot,
31+
Error error);
3132

3233
// Provide a C++ implementation of the EventListener for DocumentSnapshot that
3334
// can forward the calls back to the C# delegates.

firestore/src/include/firebase/csharp/query_event_listener.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ ListenerRegistration QueryEventListener::AddListenerTo(
5454
void QueryEventListener::QuerySnapshotEvent(int callback_id,
5555
QuerySnapshot value, Error error) {
5656
MutexLock lock(g_mutex);
57-
if (error != Error::kOk ||
58-
g_query_snapshot_event_listener_callback == nullptr) {
57+
if (g_query_snapshot_event_listener_callback == nullptr) {
5958
return;
6059
}
6160
// The ownership is passed through the call to C# handler.
6261
QuerySnapshot* copy = new QuerySnapshot(value);
63-
g_query_snapshot_event_listener_callback(callback_id, copy);
62+
g_query_snapshot_event_listener_callback(callback_id, copy, error);
6463
}
6564

6665
} // namespace csharp

firestore/src/include/firebase/csharp/query_event_listener.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ namespace csharp {
2626
// The callbacks that are used by the listener, that need to reach back to C#
2727
// callbacks.
2828
typedef void(SWIGSTDCALL* QueryEventListenerCallback)(int callback_id,
29-
void* snapshot);
29+
void* snapshot,
30+
Error error);
3031

3132
// Provide a C++ implementation of the EventListener for QuerySnapshot that
3233
// can forward the calls back to the C# delegates.

0 commit comments

Comments
 (0)