diff options
Diffstat (limited to 'src/core/lib/transport/metadata_batch.c')
-rw-r--r-- | src/core/lib/transport/metadata_batch.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/core/lib/transport/metadata_batch.c b/src/core/lib/transport/metadata_batch.c index 84b5a74d51..b62ecc3aa6 100644 --- a/src/core/lib/transport/metadata_batch.c +++ b/src/core/lib/transport/metadata_batch.c @@ -72,10 +72,11 @@ void grpc_metadata_batch_init(grpc_metadata_batch *batch) { batch->deadline = gpr_inf_future(GPR_CLOCK_REALTIME); } -void grpc_metadata_batch_destroy(grpc_metadata_batch *batch) { +void grpc_metadata_batch_destroy(grpc_exec_ctx *exec_ctx, + grpc_metadata_batch *batch) { grpc_linked_mdelem *l; for (l = batch->list.head; l; l = l->next) { - GRPC_MDELEM_UNREF(l->md); + GRPC_MDELEM_UNREF(exec_ctx, l->md); } } @@ -140,8 +141,10 @@ void grpc_metadata_batch_move(grpc_metadata_batch *dst, memset(src, 0, sizeof(grpc_metadata_batch)); } -void grpc_metadata_batch_filter(grpc_metadata_batch *batch, - grpc_mdelem *(*filter)(void *user_data, +void grpc_metadata_batch_filter(grpc_exec_ctx *exec_ctx, + grpc_metadata_batch *batch, + grpc_mdelem *(*filter)(grpc_exec_ctx *exec_ctx, + void *user_data, grpc_mdelem *elem), void *user_data) { grpc_linked_mdelem *l; @@ -152,7 +155,7 @@ void grpc_metadata_batch_filter(grpc_metadata_batch *batch, assert_valid_list(&batch->list); for (l = batch->list.head; l; l = next) { grpc_mdelem *orig = l->md; - grpc_mdelem *filt = filter(user_data, orig); + grpc_mdelem *filt = filter(exec_ctx, user_data, orig); next = l->next; if (filt == NULL) { if (l->prev) { @@ -168,9 +171,9 @@ void grpc_metadata_batch_filter(grpc_metadata_batch *batch, batch->list.tail = l->prev; } assert_valid_list(&batch->list); - GRPC_MDELEM_UNREF(l->md); + GRPC_MDELEM_UNREF(exec_ctx, l->md); } else if (filt != orig) { - GRPC_MDELEM_UNREF(orig); + GRPC_MDELEM_UNREF(exec_ctx, orig); l->md = filt; } } @@ -179,13 +182,15 @@ void grpc_metadata_batch_filter(grpc_metadata_batch *batch, GPR_TIMER_END("grpc_metadata_batch_filter", 0); } -static grpc_mdelem *no_metadata_for_you(void *user_data, grpc_mdelem *elem) { +static grpc_mdelem *no_metadata_for_you(grpc_exec_ctx *exec_ctx, + void *user_data, grpc_mdelem *elem) { return NULL; } -void grpc_metadata_batch_clear(grpc_metadata_batch *batch) { +void grpc_metadata_batch_clear(grpc_exec_ctx *exec_ctx, + grpc_metadata_batch *batch) { batch->deadline = gpr_inf_future(GPR_CLOCK_REALTIME); - grpc_metadata_batch_filter(batch, no_metadata_for_you, NULL); + grpc_metadata_batch_filter(exec_ctx, batch, no_metadata_for_you, NULL); } bool grpc_metadata_batch_is_empty(grpc_metadata_batch *batch) { |