grpc 1.8.7 → 1.9.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (488) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +549 -325
  3. data/include/grpc/impl/codegen/grpc_types.h +1 -2
  4. data/include/grpc/impl/codegen/port_platform.h +46 -5
  5. data/include/grpc/impl/codegen/slice.h +1 -2
  6. data/include/grpc/module.modulemap +0 -2
  7. data/include/grpc/slice_buffer.h +1 -2
  8. data/include/grpc/support/log.h +4 -2
  9. data/include/grpc/support/thd.h +4 -1
  10. data/include/grpc/support/tls.h +6 -0
  11. data/include/grpc/support/tls_gcc.h +5 -40
  12. data/include/grpc/support/tls_msvc.h +9 -0
  13. data/include/grpc/support/tls_pthread.h +9 -0
  14. data/src/core/ext/filters/client_channel/backup_poller.cc +32 -29
  15. data/src/core/ext/filters/client_channel/backup_poller.h +2 -2
  16. data/src/core/ext/filters/client_channel/channel_connectivity.cc +26 -32
  17. data/src/core/ext/filters/client_channel/client_channel.cc +325 -356
  18. data/src/core/ext/filters/client_channel/client_channel.h +4 -12
  19. data/src/core/ext/filters/client_channel/client_channel_factory.cc +9 -14
  20. data/src/core/ext/filters/client_channel/client_channel_factory.h +7 -20
  21. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +7 -10
  22. data/src/core/ext/filters/client_channel/connector.cc +6 -7
  23. data/src/core/ext/filters/client_channel/connector.h +6 -16
  24. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +38 -50
  25. data/src/core/ext/filters/client_channel/http_connect_handshaker.h +0 -8
  26. data/src/core/ext/filters/client_channel/http_proxy.cc +9 -13
  27. data/src/core/ext/filters/client_channel/http_proxy.h +0 -8
  28. data/src/core/ext/filters/client_channel/lb_policy.cc +72 -94
  29. data/src/core/ext/filters/client_channel/lb_policy.h +83 -92
  30. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +14 -19
  31. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +0 -8
  32. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +474 -591
  33. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -8
  34. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +2 -10
  35. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +6 -6
  36. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +0 -8
  37. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +0 -9
  38. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +0 -9
  39. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +3 -4
  40. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +9 -12
  41. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +160 -182
  42. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +182 -221
  43. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +24 -35
  44. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +9 -20
  45. data/src/core/ext/filters/client_channel/lb_policy_factory.cc +6 -9
  46. data/src/core/ext/filters/client_channel/lb_policy_factory.h +4 -15
  47. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +3 -3
  48. data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -9
  49. data/src/core/ext/filters/client_channel/parse_address.cc +1 -1
  50. data/src/core/ext/filters/client_channel/parse_address.h +0 -8
  51. data/src/core/ext/filters/client_channel/proxy_mapper.cc +6 -8
  52. data/src/core/ext/filters/client_channel/proxy_mapper.h +6 -16
  53. data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +13 -17
  54. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +2 -12
  55. data/src/core/ext/filters/client_channel/resolver.cc +11 -13
  56. data/src/core/ext/filters/client_channel/resolver.h +14 -25
  57. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +57 -70
  58. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +2 -12
  59. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +23 -31
  60. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +27 -45
  61. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +5 -15
  62. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +9 -11
  63. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +53 -66
  64. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +25 -33
  65. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +1 -9
  66. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +26 -35
  67. data/src/core/ext/filters/client_channel/resolver_factory.cc +2 -3
  68. data/src/core/ext/filters/client_channel/resolver_factory.h +2 -12
  69. data/src/core/ext/filters/client_channel/resolver_registry.cc +12 -15
  70. data/src/core/ext/filters/client_channel/resolver_registry.h +3 -12
  71. data/src/core/ext/filters/client_channel/retry_throttle.h +0 -8
  72. data/src/core/ext/filters/client_channel/subchannel.cc +289 -301
  73. data/src/core/ext/filters/client_channel/subchannel.h +57 -84
  74. data/src/core/ext/filters/client_channel/subchannel_index.cc +30 -33
  75. data/src/core/ext/filters/client_channel/subchannel_index.h +4 -16
  76. data/src/core/ext/filters/client_channel/uri_parser.cc +13 -17
  77. data/src/core/ext/filters/client_channel/uri_parser.h +1 -10
  78. data/src/core/ext/filters/deadline/deadline_filter.cc +49 -67
  79. data/src/core/ext/filters/deadline/deadline_filter.h +4 -14
  80. data/src/core/ext/filters/http/client/http_client_filter.cc +60 -77
  81. data/src/core/ext/filters/http/client/http_client_filter.h +0 -8
  82. data/src/core/ext/filters/http/http_filters_plugin.cc +4 -6
  83. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +63 -79
  84. data/src/core/ext/filters/http/message_compress/message_compress_filter.h +0 -8
  85. data/src/core/ext/filters/http/server/http_server_filter.cc +57 -71
  86. data/src/core/ext/filters/http/server/http_server_filter.h +0 -8
  87. data/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +19 -24
  88. data/src/core/ext/filters/load_reporting/server_load_reporting_filter.h +0 -8
  89. data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc +3 -3
  90. data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h +0 -8
  91. data/src/core/ext/filters/max_age/max_age_filter.cc +49 -62
  92. data/src/core/ext/filters/max_age/max_age_filter.h +0 -8
  93. data/src/core/ext/filters/message_size/message_size_filter.cc +23 -29
  94. data/src/core/ext/filters/message_size/message_size_filter.h +0 -8
  95. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +15 -18
  96. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +0 -8
  97. data/src/core/ext/filters/workarounds/workaround_utils.h +0 -8
  98. data/src/core/ext/transport/chttp2/alpn/alpn.h +0 -8
  99. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +33 -40
  100. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +0 -8
  101. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +15 -17
  102. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +8 -8
  103. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +23 -28
  104. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +50 -57
  105. data/src/core/ext/transport/chttp2/server/chttp2_server.h +1 -10
  106. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +3 -3
  107. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +7 -10
  108. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +5 -6
  109. data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +7 -9
  110. data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -11
  111. data/src/core/ext/transport/chttp2/transport/bin_encoder.h +1 -9
  112. data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +10 -2
  113. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +516 -636
  114. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +4 -11
  115. data/src/core/ext/transport/chttp2/transport/flow_control.cc +29 -13
  116. data/src/core/ext/transport/chttp2/transport/flow_control.h +196 -53
  117. data/src/core/ext/transport/chttp2/transport/frame.h +0 -8
  118. data/src/core/ext/transport/chttp2/transport/frame_data.cc +31 -33
  119. data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -12
  120. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -3
  121. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -10
  122. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -6
  123. data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -9
  124. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -3
  125. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -10
  126. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +8 -3
  127. data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -10
  128. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +8 -8
  129. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +5 -11
  130. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +63 -81
  131. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -12
  132. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +230 -318
  133. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +6 -19
  134. data/src/core/ext/transport/chttp2/transport/hpack_table.cc +14 -20
  135. data/src/core/ext/transport/chttp2/transport/hpack_table.h +5 -16
  136. data/src/core/ext/transport/chttp2/transport/http2_settings.h +0 -7
  137. data/src/core/ext/transport/chttp2/transport/huffsyms.h +0 -8
  138. data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +8 -11
  139. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +4 -13
  140. data/src/core/ext/transport/chttp2/transport/internal.h +51 -75
  141. data/src/core/ext/transport/chttp2/transport/parsing.cc +83 -109
  142. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +2 -0
  143. data/src/core/ext/transport/chttp2/transport/stream_map.h +0 -8
  144. data/src/core/ext/transport/chttp2/transport/varint.h +0 -8
  145. data/src/core/ext/transport/chttp2/transport/writing.cc +61 -65
  146. data/src/core/ext/transport/inproc/inproc_plugin.cc +2 -4
  147. data/src/core/ext/transport/inproc/inproc_transport.cc +177 -188
  148. data/src/core/ext/transport/inproc/inproc_transport.h +0 -8
  149. data/src/core/lib/backoff/backoff.cc +39 -44
  150. data/src/core/lib/backoff/backoff.h +61 -57
  151. data/src/core/lib/channel/channel_args.cc +8 -10
  152. data/src/core/lib/channel/channel_args.h +4 -13
  153. data/src/core/lib/channel/channel_stack.cc +19 -27
  154. data/src/core/lib/channel/channel_stack.h +27 -47
  155. data/src/core/lib/channel/channel_stack_builder.cc +11 -14
  156. data/src/core/lib/channel/channel_stack_builder.h +4 -15
  157. data/src/core/lib/channel/connected_channel.cc +23 -36
  158. data/src/core/lib/channel/connected_channel.h +1 -10
  159. data/src/core/lib/channel/handshaker.cc +31 -40
  160. data/src/core/lib/channel/handshaker.h +14 -25
  161. data/src/core/lib/channel/handshaker_factory.cc +6 -6
  162. data/src/core/lib/channel/handshaker_factory.h +5 -15
  163. data/src/core/lib/channel/handshaker_registry.cc +9 -13
  164. data/src/core/lib/channel/handshaker_registry.h +2 -11
  165. data/src/core/lib/compression/algorithm_metadata.h +0 -8
  166. data/src/core/lib/compression/message_compress.cc +19 -23
  167. data/src/core/lib/compression/message_compress.h +2 -12
  168. data/src/core/lib/compression/stream_compression.cc +1 -1
  169. data/src/core/lib/compression/stream_compression.h +0 -8
  170. data/src/core/lib/compression/stream_compression_gzip.cc +12 -11
  171. data/src/core/lib/compression/stream_compression_gzip.h +0 -8
  172. data/src/core/lib/compression/stream_compression_identity.h +0 -8
  173. data/src/core/lib/debug/stats.cc +4 -4
  174. data/src/core/lib/debug/stats.h +9 -19
  175. data/src/core/lib/debug/stats_data.cc +85 -116
  176. data/src/core/lib/debug/stats_data.h +236 -312
  177. data/src/core/lib/debug/trace.cc +1 -1
  178. data/src/core/lib/debug/trace.h +0 -12
  179. data/src/core/lib/{support → gpr++}/abstract.h +8 -3
  180. data/src/core/lib/{support → gpr++}/atomic.h +5 -5
  181. data/src/core/lib/{support → gpr++}/atomic_with_atm.h +3 -3
  182. data/src/core/lib/{support → gpr++}/atomic_with_std.h +3 -3
  183. data/src/core/lib/gpr++/debug_location.h +52 -0
  184. data/src/core/lib/gpr++/inlined_vector.h +112 -0
  185. data/src/core/lib/{support → gpr++}/manual_constructor.h +2 -2
  186. data/src/core/lib/{support → gpr++}/memory.h +3 -3
  187. data/src/core/lib/gpr++/orphanable.h +171 -0
  188. data/src/core/lib/gpr++/ref_counted.h +133 -0
  189. data/src/core/lib/gpr++/ref_counted_ptr.h +99 -0
  190. data/src/core/lib/{support → gpr}/alloc.cc +0 -0
  191. data/src/core/lib/{support → gpr}/arena.cc +1 -1
  192. data/src/core/lib/{support → gpr}/arena.h +3 -11
  193. data/src/core/lib/{support → gpr}/atm.cc +0 -0
  194. data/src/core/lib/{support → gpr}/avl.cc +0 -0
  195. data/src/core/lib/{support → gpr}/cmdline.cc +1 -1
  196. data/src/core/lib/{support → gpr}/cpu_iphone.cc +0 -0
  197. data/src/core/lib/{support → gpr}/cpu_linux.cc +0 -0
  198. data/src/core/lib/{support → gpr}/cpu_posix.cc +0 -0
  199. data/src/core/lib/{support → gpr}/cpu_windows.cc +0 -0
  200. data/src/core/lib/{support → gpr}/env.h +3 -11
  201. data/src/core/lib/{support → gpr}/env_linux.cc +2 -2
  202. data/src/core/lib/{support → gpr}/env_posix.cc +4 -4
  203. data/src/core/lib/{support → gpr}/env_windows.cc +3 -3
  204. data/src/core/lib/{support → gpr}/fork.cc +3 -3
  205. data/src/core/lib/{support → gpr}/fork.h +3 -3
  206. data/src/core/lib/{support → gpr}/host_port.cc +1 -1
  207. data/src/core/lib/{support → gpr}/log.cc +3 -3
  208. data/src/core/lib/{support → gpr}/log_android.cc +3 -3
  209. data/src/core/lib/{support → gpr}/log_linux.cc +1 -1
  210. data/src/core/lib/{support → gpr}/log_posix.cc +5 -5
  211. data/src/core/lib/{support → gpr}/log_windows.cc +3 -3
  212. data/src/core/lib/{support → gpr}/mpscq.cc +1 -1
  213. data/src/core/lib/{support → gpr}/mpscq.h +3 -10
  214. data/src/core/lib/{support → gpr}/murmur_hash.cc +1 -1
  215. data/src/core/lib/{support → gpr}/murmur_hash.h +3 -11
  216. data/src/core/lib/{support → gpr}/spinlock.h +3 -3
  217. data/src/core/lib/{support → gpr}/string.cc +1 -1
  218. data/src/core/lib/{support → gpr}/string.h +3 -10
  219. data/src/core/lib/{support → gpr}/string_posix.cc +0 -0
  220. data/src/core/lib/{support → gpr}/string_util_windows.cc +2 -2
  221. data/src/core/lib/{support → gpr}/string_windows.cc +1 -1
  222. data/src/core/lib/{support → gpr}/string_windows.h +3 -11
  223. data/src/core/lib/{support → gpr}/subprocess_posix.cc +0 -0
  224. data/src/core/lib/{support → gpr}/subprocess_windows.cc +2 -2
  225. data/src/core/lib/{support → gpr}/sync.cc +0 -0
  226. data/src/core/lib/{support → gpr}/sync_posix.cc +10 -1
  227. data/src/core/lib/{support → gpr}/sync_windows.cc +0 -0
  228. data/src/core/lib/{support → gpr}/thd.cc +0 -0
  229. data/src/core/lib/{support → gpr}/thd_internal.h +3 -3
  230. data/src/core/lib/{support → gpr}/thd_posix.cc +18 -2
  231. data/src/core/lib/{support → gpr}/thd_windows.cc +2 -1
  232. data/src/core/lib/{support → gpr}/time.cc +0 -0
  233. data/src/core/lib/{support → gpr}/time_posix.cc +2 -4
  234. data/src/core/lib/{support → gpr}/time_precise.cc +1 -1
  235. data/src/core/lib/{support → gpr}/time_precise.h +3 -11
  236. data/src/core/lib/{support → gpr}/time_windows.cc +1 -3
  237. data/src/core/lib/{support → gpr}/tls_pthread.cc +0 -0
  238. data/src/core/lib/{support → gpr}/tmpfile.h +3 -11
  239. data/src/core/lib/{support → gpr}/tmpfile_msys.cc +2 -2
  240. data/src/core/lib/{support → gpr}/tmpfile_posix.cc +2 -2
  241. data/src/core/lib/{support → gpr}/tmpfile_windows.cc +2 -2
  242. data/src/core/lib/{support → gpr}/wrap_memcpy.cc +0 -0
  243. data/src/core/lib/http/format_request.cc +1 -1
  244. data/src/core/lib/http/format_request.h +0 -8
  245. data/src/core/lib/http/httpcli.cc +55 -74
  246. data/src/core/lib/http/httpcli.h +13 -22
  247. data/src/core/lib/http/httpcli_security_connector.cc +27 -33
  248. data/src/core/lib/http/parser.h +0 -8
  249. data/src/core/lib/iomgr/block_annotate.h +10 -17
  250. data/src/core/lib/iomgr/call_combiner.cc +14 -17
  251. data/src/core/lib/iomgr/call_combiner.h +16 -34
  252. data/src/core/lib/iomgr/closure.h +24 -37
  253. data/src/core/lib/iomgr/combiner.cc +62 -66
  254. data/src/core/lib/iomgr/combiner.h +6 -16
  255. data/src/core/lib/iomgr/endpoint.cc +15 -21
  256. data/src/core/lib/iomgr/endpoint.h +16 -33
  257. data/src/core/lib/iomgr/endpoint_pair.h +0 -8
  258. data/src/core/lib/iomgr/endpoint_pair_posix.cc +4 -5
  259. data/src/core/lib/iomgr/endpoint_pair_windows.cc +4 -6
  260. data/src/core/lib/iomgr/error.cc +2 -6
  261. data/src/core/lib/iomgr/error.h +4 -9
  262. data/src/core/lib/iomgr/error_internal.h +0 -8
  263. data/src/core/lib/iomgr/ev_epoll1_linux.cc +110 -117
  264. data/src/core/lib/iomgr/ev_epoll1_linux.h +0 -8
  265. data/src/core/lib/iomgr/ev_epollex_linux.cc +111 -141
  266. data/src/core/lib/iomgr/ev_epollex_linux.h +0 -8
  267. data/src/core/lib/iomgr/ev_epollsig_linux.cc +83 -109
  268. data/src/core/lib/iomgr/ev_epollsig_linux.h +2 -10
  269. data/src/core/lib/iomgr/ev_poll_posix.cc +103 -125
  270. data/src/core/lib/iomgr/ev_poll_posix.h +0 -8
  271. data/src/core/lib/iomgr/ev_posix.cc +35 -50
  272. data/src/core/lib/iomgr/ev_posix.h +27 -53
  273. data/src/core/lib/iomgr/exec_ctx.cc +46 -78
  274. data/src/core/lib/iomgr/exec_ctx.h +127 -60
  275. data/src/core/lib/iomgr/executor.cc +34 -38
  276. data/src/core/lib/iomgr/executor.h +3 -11
  277. data/src/core/lib/iomgr/fork_posix.cc +13 -12
  278. data/src/core/lib/iomgr/gethostname.h +0 -8
  279. data/src/core/lib/iomgr/gethostname_sysconf.cc +1 -1
  280. data/src/core/lib/iomgr/iocp_windows.cc +14 -16
  281. data/src/core/lib/iomgr/iocp_windows.h +1 -10
  282. data/src/core/lib/iomgr/iomgr.cc +60 -59
  283. data/src/core/lib/iomgr/iomgr.h +3 -12
  284. data/src/core/lib/iomgr/iomgr_internal.h +0 -8
  285. data/src/core/lib/iomgr/iomgr_uv.cc +2 -3
  286. data/src/core/lib/iomgr/iomgr_uv.h +0 -8
  287. data/src/core/lib/iomgr/is_epollexclusive_available.cc +1 -1
  288. data/src/core/lib/iomgr/load_file.cc +1 -1
  289. data/src/core/lib/iomgr/load_file.h +0 -8
  290. data/src/core/lib/iomgr/lockfree_event.cc +7 -8
  291. data/src/core/lib/iomgr/lockfree_event.h +3 -3
  292. data/src/core/lib/iomgr/polling_entity.cc +6 -10
  293. data/src/core/lib/iomgr/polling_entity.h +2 -11
  294. data/src/core/lib/iomgr/pollset.h +4 -13
  295. data/src/core/lib/iomgr/pollset_set.h +5 -18
  296. data/src/core/lib/iomgr/pollset_set_uv.cc +5 -10
  297. data/src/core/lib/iomgr/pollset_set_windows.cc +5 -10
  298. data/src/core/lib/iomgr/pollset_uv.cc +8 -9
  299. data/src/core/lib/iomgr/pollset_uv.h +0 -8
  300. data/src/core/lib/iomgr/pollset_windows.cc +14 -15
  301. data/src/core/lib/iomgr/pollset_windows.h +0 -8
  302. data/src/core/lib/iomgr/port.h +6 -1
  303. data/src/core/lib/iomgr/resolve_address.h +1 -10
  304. data/src/core/lib/iomgr/resolve_address_posix.cc +10 -12
  305. data/src/core/lib/iomgr/resolve_address_uv.cc +7 -8
  306. data/src/core/lib/iomgr/resolve_address_windows.cc +8 -9
  307. data/src/core/lib/iomgr/resource_quota.cc +77 -107
  308. data/src/core/lib/iomgr/resource_quota.h +8 -25
  309. data/src/core/lib/iomgr/sockaddr_utils.cc +1 -1
  310. data/src/core/lib/iomgr/sockaddr_utils.h +0 -8
  311. data/src/core/lib/iomgr/socket_factory_posix.cc +1 -1
  312. data/src/core/lib/iomgr/socket_factory_posix.h +0 -8
  313. data/src/core/lib/iomgr/socket_mutator.cc +1 -1
  314. data/src/core/lib/iomgr/socket_mutator.h +1 -9
  315. data/src/core/lib/iomgr/socket_utils.h +0 -8
  316. data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -1
  317. data/src/core/lib/iomgr/socket_utils_posix.h +0 -8
  318. data/src/core/lib/iomgr/socket_windows.cc +8 -11
  319. data/src/core/lib/iomgr/socket_windows.h +3 -14
  320. data/src/core/lib/iomgr/tcp_client.h +1 -10
  321. data/src/core/lib/iomgr/tcp_client_posix.cc +94 -78
  322. data/src/core/lib/iomgr/tcp_client_posix.h +36 -8
  323. data/src/core/lib/iomgr/tcp_client_uv.cc +16 -23
  324. data/src/core/lib/iomgr/tcp_client_windows.cc +22 -25
  325. data/src/core/lib/iomgr/tcp_posix.cc +131 -153
  326. data/src/core/lib/iomgr/tcp_posix.h +3 -12
  327. data/src/core/lib/iomgr/tcp_server.h +6 -17
  328. data/src/core/lib/iomgr/tcp_server_posix.cc +31 -35
  329. data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -8
  330. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -1
  331. data/src/core/lib/iomgr/tcp_server_uv.cc +23 -34
  332. data/src/core/lib/iomgr/tcp_server_windows.cc +24 -34
  333. data/src/core/lib/iomgr/tcp_uv.cc +42 -56
  334. data/src/core/lib/iomgr/tcp_uv.h +0 -8
  335. data/src/core/lib/iomgr/tcp_windows.cc +43 -50
  336. data/src/core/lib/iomgr/tcp_windows.h +1 -9
  337. data/src/core/lib/iomgr/time_averaged_stats.h +0 -8
  338. data/src/core/lib/iomgr/timer.h +6 -15
  339. data/src/core/lib/iomgr/timer_generic.cc +22 -27
  340. data/src/core/lib/iomgr/timer_heap.h +0 -8
  341. data/src/core/lib/iomgr/timer_manager.cc +17 -19
  342. data/src/core/lib/iomgr/timer_manager.h +0 -8
  343. data/src/core/lib/iomgr/timer_uv.cc +12 -14
  344. data/src/core/lib/iomgr/udp_server.cc +148 -54
  345. data/src/core/lib/iomgr/udp_server.h +16 -21
  346. data/src/core/lib/iomgr/unix_sockets_posix.h +0 -8
  347. data/src/core/lib/iomgr/wakeup_fd_cv.cc +4 -4
  348. data/src/core/lib/iomgr/wakeup_fd_cv.h +12 -20
  349. data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +1 -1
  350. data/src/core/lib/iomgr/wakeup_fd_pipe.h +0 -8
  351. data/src/core/lib/iomgr/wakeup_fd_posix.h +0 -8
  352. data/src/core/lib/json/json.h +0 -8
  353. data/src/core/lib/json/json_reader.h +0 -8
  354. data/src/core/lib/json/json_writer.h +0 -8
  355. data/src/core/lib/profiling/basic_timers.cc +3 -2
  356. data/src/core/lib/profiling/timers.h +0 -8
  357. data/src/core/lib/security/context/security_context.cc +9 -10
  358. data/src/core/lib/security/context/security_context.h +0 -8
  359. data/src/core/lib/security/credentials/composite/composite_credentials.cc +23 -28
  360. data/src/core/lib/security/credentials/composite/composite_credentials.h +0 -8
  361. data/src/core/lib/security/credentials/credentials.cc +33 -42
  362. data/src/core/lib/security/credentials/credentials.h +24 -43
  363. data/src/core/lib/security/credentials/credentials_metadata.cc +2 -2
  364. data/src/core/lib/security/credentials/fake/fake_credentials.cc +16 -22
  365. data/src/core/lib/security/credentials/fake/fake_credentials.h +0 -8
  366. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +3 -3
  367. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +28 -34
  368. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +0 -8
  369. data/src/core/lib/security/credentials/iam/iam_credentials.cc +9 -13
  370. data/src/core/lib/security/credentials/jwt/json_token.cc +1 -1
  371. data/src/core/lib/security/credentials/jwt/json_token.h +0 -8
  372. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +14 -20
  373. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +1 -10
  374. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +56 -72
  375. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +5 -17
  376. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +47 -55
  377. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +3 -12
  378. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +23 -28
  379. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +8 -13
  380. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +0 -8
  381. data/src/core/lib/security/transport/auth_filters.h +0 -8
  382. data/src/core/lib/security/transport/client_auth_filter.cc +45 -54
  383. data/src/core/lib/security/transport/lb_targets_info.cc +2 -2
  384. data/src/core/lib/security/transport/lb_targets_info.h +0 -8
  385. data/src/core/lib/security/transport/secure_endpoint.cc +54 -68
  386. data/src/core/lib/security/transport/secure_endpoint.h +0 -8
  387. data/src/core/lib/security/transport/security_connector.cc +62 -86
  388. data/src/core/lib/security/transport/security_connector.h +22 -39
  389. data/src/core/lib/security/transport/security_handshaker.cc +83 -106
  390. data/src/core/lib/security/transport/security_handshaker.h +1 -10
  391. data/src/core/lib/security/transport/server_auth_filter.cc +31 -38
  392. data/src/core/lib/security/transport/tsi_error.h +0 -8
  393. data/src/core/lib/security/util/json_util.h +0 -8
  394. data/src/core/lib/slice/b64.cc +5 -6
  395. data/src/core/lib/slice/b64.h +3 -12
  396. data/src/core/lib/slice/percent_encoding.h +0 -8
  397. data/src/core/lib/slice/slice.cc +8 -9
  398. data/src/core/lib/slice/slice_buffer.cc +11 -16
  399. data/src/core/lib/slice/slice_hash_table.cc +5 -7
  400. data/src/core/lib/slice/slice_hash_table.h +2 -12
  401. data/src/core/lib/slice/slice_intern.cc +4 -5
  402. data/src/core/lib/slice/slice_internal.h +4 -15
  403. data/src/core/lib/slice/slice_string_helpers.cc +1 -1
  404. data/src/core/lib/slice/slice_string_helpers.h +1 -9
  405. data/src/core/lib/surface/alarm.cc +11 -14
  406. data/src/core/lib/surface/alarm_internal.h +0 -8
  407. data/src/core/lib/surface/byte_buffer.cc +2 -3
  408. data/src/core/lib/surface/byte_buffer_reader.cc +7 -9
  409. data/src/core/lib/surface/call.cc +198 -241
  410. data/src/core/lib/surface/call.h +9 -23
  411. data/src/core/lib/surface/call_details.cc +3 -4
  412. data/src/core/lib/surface/call_log_batch.cc +1 -1
  413. data/src/core/lib/surface/call_test_only.h +0 -8
  414. data/src/core/lib/surface/channel.cc +53 -64
  415. data/src/core/lib/surface/channel.h +12 -23
  416. data/src/core/lib/surface/channel_init.cc +2 -3
  417. data/src/core/lib/surface/channel_init.h +2 -12
  418. data/src/core/lib/surface/channel_ping.cc +7 -9
  419. data/src/core/lib/surface/channel_stack_type.h +0 -8
  420. data/src/core/lib/surface/completion_queue.cc +158 -176
  421. data/src/core/lib/surface/completion_queue.h +9 -20
  422. data/src/core/lib/surface/completion_queue_factory.h +0 -8
  423. data/src/core/lib/surface/event_string.cc +1 -1
  424. data/src/core/lib/surface/event_string.h +0 -8
  425. data/src/core/lib/surface/init.cc +27 -25
  426. data/src/core/lib/surface/init.h +0 -8
  427. data/src/core/lib/surface/init_secure.cc +2 -2
  428. data/src/core/lib/surface/lame_client.cc +30 -33
  429. data/src/core/lib/surface/lame_client.h +0 -8
  430. data/src/core/lib/surface/server.cc +151 -203
  431. data/src/core/lib/surface/server.h +7 -16
  432. data/src/core/lib/surface/validate_metadata.h +0 -8
  433. data/src/core/lib/surface/version.cc +2 -2
  434. data/src/core/lib/transport/bdp_estimator.cc +2 -2
  435. data/src/core/lib/transport/bdp_estimator.h +1 -1
  436. data/src/core/lib/transport/byte_stream.cc +24 -38
  437. data/src/core/lib/transport/byte_stream.h +10 -25
  438. data/src/core/lib/transport/connectivity_state.cc +9 -13
  439. data/src/core/lib/transport/connectivity_state.h +4 -14
  440. data/src/core/lib/transport/error_utils.cc +6 -6
  441. data/src/core/lib/transport/error_utils.h +2 -11
  442. data/src/core/lib/transport/metadata.cc +21 -23
  443. data/src/core/lib/transport/metadata.h +8 -20
  444. data/src/core/lib/transport/metadata_batch.cc +34 -45
  445. data/src/core/lib/transport/metadata_batch.h +18 -32
  446. data/src/core/lib/transport/service_config.cc +11 -15
  447. data/src/core/lib/transport/service_config.h +3 -13
  448. data/src/core/lib/transport/static_metadata.cc +1 -1
  449. data/src/core/lib/transport/static_metadata.h +1 -7
  450. data/src/core/lib/transport/status_conversion.cc +2 -3
  451. data/src/core/lib/transport/status_conversion.h +1 -10
  452. data/src/core/lib/transport/timeout_encoding.cc +1 -1
  453. data/src/core/lib/transport/timeout_encoding.h +1 -9
  454. data/src/core/lib/transport/transport.cc +36 -50
  455. data/src/core/lib/transport/transport.h +28 -30
  456. data/src/core/lib/transport/transport_impl.h +12 -23
  457. data/src/core/lib/transport/transport_op_string.cc +2 -2
  458. data/src/core/plugin_registry/grpc_plugin_registry.cc +34 -34
  459. data/src/core/tsi/fake_transport_security.cc +7 -10
  460. data/src/core/tsi/fake_transport_security.h +0 -8
  461. data/src/core/tsi/gts_transport_security.cc +2 -2
  462. data/src/core/tsi/gts_transport_security.h +0 -8
  463. data/src/core/tsi/ssl_transport_security.cc +3 -0
  464. data/src/core/tsi/ssl_transport_security.h +0 -8
  465. data/src/core/tsi/ssl_types.h +0 -8
  466. data/src/core/tsi/transport_security.h +1 -9
  467. data/src/core/tsi/transport_security_adapter.h +0 -8
  468. data/src/core/tsi/transport_security_grpc.cc +11 -18
  469. data/src/core/tsi/transport_security_grpc.h +9 -21
  470. data/src/core/tsi/transport_security_interface.h +0 -8
  471. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +0 -30
  472. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +2 -48
  473. data/src/ruby/lib/grpc/version.rb +1 -1
  474. data/src/ruby/spec/channel_connection_spec.rb +2 -1
  475. data/src/ruby/spec/client_auth_spec.rb +1 -1
  476. data/src/ruby/spec/client_server_spec.rb +2 -2
  477. data/src/ruby/spec/generic/active_call_spec.rb +1 -1
  478. data/src/ruby/spec/generic/client_stub_spec.rb +4 -4
  479. data/src/ruby/spec/generic/interceptor_registry_spec.rb +1 -1
  480. data/src/ruby/spec/generic/rpc_server_spec.rb +12 -12
  481. data/src/ruby/spec/google_rpc_status_utils_spec.rb +3 -2
  482. data/src/ruby/spec/pb/health/checker_spec.rb +1 -1
  483. data/src/ruby/spec/server_spec.rb +9 -9
  484. data/src/ruby/spec/support/helpers.rb +35 -1
  485. metadata +68 -66
  486. data/include/grpc/impl/codegen/exec_ctx_fwd.h +0 -26
  487. data/include/grpc/support/histogram.h +0 -64
  488. data/src/core/lib/support/histogram.cc +0 -227
@@ -27,7 +27,7 @@
27
27
 
28
28
  struct grpc_slice_hash_table {
29
29
  gpr_refcount refs;
30
- void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value);
30
+ void (*destroy_value)(void* value);
31
31
  int (*value_cmp)(void* a, void* b);
32
32
  size_t size;
33
33
  size_t max_num_probes;
@@ -58,8 +58,7 @@ static void grpc_slice_hash_table_add(grpc_slice_hash_table* table,
58
58
 
59
59
  grpc_slice_hash_table* grpc_slice_hash_table_create(
60
60
  size_t num_entries, grpc_slice_hash_table_entry* entries,
61
- void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value),
62
- int (*value_cmp)(void* a, void* b)) {
61
+ void (*destroy_value)(void* value), int (*value_cmp)(void* a, void* b)) {
63
62
  grpc_slice_hash_table* table =
64
63
  (grpc_slice_hash_table*)gpr_zalloc(sizeof(*table));
65
64
  gpr_ref_init(&table->refs, 1);
@@ -81,14 +80,13 @@ grpc_slice_hash_table* grpc_slice_hash_table_ref(grpc_slice_hash_table* table) {
81
80
  return table;
82
81
  }
83
82
 
84
- void grpc_slice_hash_table_unref(grpc_exec_ctx* exec_ctx,
85
- grpc_slice_hash_table* table) {
83
+ void grpc_slice_hash_table_unref(grpc_slice_hash_table* table) {
86
84
  if (table != nullptr && gpr_unref(&table->refs)) {
87
85
  for (size_t i = 0; i < table->size; ++i) {
88
86
  grpc_slice_hash_table_entry* entry = &table->entries[i];
89
87
  if (!is_empty(entry)) {
90
- grpc_slice_unref_internal(exec_ctx, entry->key);
91
- table->destroy_value(exec_ctx, entry->value);
88
+ grpc_slice_unref_internal(entry->key);
89
+ table->destroy_value(entry->value);
92
90
  }
93
91
  }
94
92
  gpr_free(table->entries);
@@ -19,10 +19,6 @@
19
19
 
20
20
  #include "src/core/lib/transport/metadata.h"
21
21
 
22
- #ifdef __cplusplus
23
- extern "C" {
24
- #endif
25
-
26
22
  /** Hash table implementation.
27
23
  *
28
24
  * This implementation uses open addressing
@@ -50,12 +46,10 @@ typedef struct grpc_slice_hash_table_entry {
50
46
  will be used. */
51
47
  grpc_slice_hash_table* grpc_slice_hash_table_create(
52
48
  size_t num_entries, grpc_slice_hash_table_entry* entries,
53
- void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value),
54
- int (*value_cmp)(void* a, void* b));
49
+ void (*destroy_value)(void* value), int (*value_cmp)(void* a, void* b));
55
50
 
56
51
  grpc_slice_hash_table* grpc_slice_hash_table_ref(grpc_slice_hash_table* table);
57
- void grpc_slice_hash_table_unref(grpc_exec_ctx* exec_ctx,
58
- grpc_slice_hash_table* table);
52
+ void grpc_slice_hash_table_unref(grpc_slice_hash_table* table);
59
53
 
60
54
  /** Returns the value from \a table associated with \a key.
61
55
  Returns NULL if \a key is not found. */
@@ -71,8 +65,4 @@ void* grpc_slice_hash_table_get(const grpc_slice_hash_table* table,
71
65
  int grpc_slice_hash_table_cmp(const grpc_slice_hash_table* a,
72
66
  const grpc_slice_hash_table* b);
73
67
 
74
- #ifdef __cplusplus
75
- }
76
- #endif
77
-
78
68
  #endif /* GRPC_CORE_LIB_SLICE_SLICE_HASH_TABLE_H */
@@ -24,10 +24,10 @@
24
24
  #include <grpc/support/alloc.h>
25
25
  #include <grpc/support/log.h>
26
26
 
27
+ #include "src/core/lib/gpr/murmur_hash.h"
27
28
  #include "src/core/lib/iomgr/iomgr_internal.h" /* for iomgr_abort_on_leaks() */
28
29
  #include "src/core/lib/profiling/timers.h"
29
30
  #include "src/core/lib/slice/slice_string_helpers.h"
30
- #include "src/core/lib/support/murmur_hash.h"
31
31
  #include "src/core/lib/transport/static_metadata.h"
32
32
 
33
33
  #define LOG2_SHARD_COUNT 5
@@ -90,7 +90,7 @@ static void interned_slice_destroy(interned_slice_refcount* s) {
90
90
  gpr_mu_unlock(&shard->mu);
91
91
  }
92
92
 
93
- static void interned_slice_unref(grpc_exec_ctx* exec_ctx, void* p) {
93
+ static void interned_slice_unref(void* p) {
94
94
  interned_slice_refcount* s = (interned_slice_refcount*)p;
95
95
  if (1 == gpr_atm_full_fetch_add(&s->refcnt, -1)) {
96
96
  interned_slice_destroy(s);
@@ -101,9 +101,8 @@ static void interned_slice_sub_ref(void* p) {
101
101
  interned_slice_ref(((char*)p) - offsetof(interned_slice_refcount, sub));
102
102
  }
103
103
 
104
- static void interned_slice_sub_unref(grpc_exec_ctx* exec_ctx, void* p) {
105
- interned_slice_unref(exec_ctx,
106
- ((char*)p) - offsetof(interned_slice_refcount, sub));
104
+ static void interned_slice_sub_unref(void* p) {
105
+ interned_slice_unref(((char*)p) - offsetof(interned_slice_refcount, sub));
107
106
  }
108
107
 
109
108
  static uint32_t interned_slice_hash(grpc_slice slice) {
@@ -24,19 +24,12 @@
24
24
 
25
25
  #include "src/core/lib/iomgr/exec_ctx.h"
26
26
 
27
- #ifdef __cplusplus
28
- extern "C" {
29
- #endif
30
-
31
27
  grpc_slice grpc_slice_ref_internal(grpc_slice slice);
32
- void grpc_slice_unref_internal(grpc_exec_ctx* exec_ctx, grpc_slice slice);
33
- void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx* exec_ctx,
34
- grpc_slice_buffer* sb);
35
- void grpc_slice_buffer_partial_unref_internal(grpc_exec_ctx* exec_ctx,
36
- grpc_slice_buffer* sb,
28
+ void grpc_slice_unref_internal(grpc_slice slice);
29
+ void grpc_slice_buffer_reset_and_unref_internal(grpc_slice_buffer* sb);
30
+ void grpc_slice_buffer_partial_unref_internal(grpc_slice_buffer* sb,
37
31
  size_t idx);
38
- void grpc_slice_buffer_destroy_internal(grpc_exec_ctx* exec_ctx,
39
- grpc_slice_buffer* sb);
32
+ void grpc_slice_buffer_destroy_internal(grpc_slice_buffer* sb);
40
33
 
41
34
  /* Check if a slice is interned */
42
35
  bool grpc_slice_is_interned(grpc_slice slice);
@@ -53,8 +46,4 @@ grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
53
46
  uint32_t grpc_static_slice_hash(grpc_slice s);
54
47
  int grpc_static_slice_eq(grpc_slice a, grpc_slice b);
55
48
 
56
- #ifdef __cplusplus
57
- }
58
- #endif
59
-
60
49
  #endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */
@@ -22,8 +22,8 @@
22
22
 
23
23
  #include <grpc/support/log.h>
24
24
 
25
+ #include "src/core/lib/gpr/string.h"
25
26
  #include "src/core/lib/slice/slice_internal.h"
26
- #include "src/core/lib/support/string.h"
27
27
 
28
28
  char* grpc_dump_slice(grpc_slice s, uint32_t flags) {
29
29
  return gpr_dump((const char*)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s),
@@ -26,11 +26,7 @@
26
26
  #include <grpc/slice_buffer.h>
27
27
  #include <grpc/support/port_platform.h>
28
28
 
29
- #include "src/core/lib/support/string.h"
30
-
31
- #ifdef __cplusplus
32
- extern "C" {
33
- #endif
29
+ #include "src/core/lib/gpr/string.h"
34
30
 
35
31
  /* Calls gpr_dump on a slice. */
36
32
  char* grpc_dump_slice(grpc_slice slice, uint32_t flags);
@@ -41,8 +37,4 @@ void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst);
41
37
 
42
38
  bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result);
43
39
 
44
- #ifdef __cplusplus
45
- }
46
- #endif
47
-
48
40
  #endif /* GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H */
@@ -45,11 +45,11 @@ static void alarm_ref(grpc_alarm* alarm) { gpr_ref(&alarm->refs); }
45
45
 
46
46
  static void alarm_unref(grpc_alarm* alarm) {
47
47
  if (gpr_unref(&alarm->refs)) {
48
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
48
+ grpc_core::ExecCtx exec_ctx;
49
49
  if (alarm->cq != nullptr) {
50
- GRPC_CQ_INTERNAL_UNREF(&exec_ctx, alarm->cq, "alarm");
50
+ GRPC_CQ_INTERNAL_UNREF(alarm->cq, "alarm");
51
51
  }
52
- grpc_exec_ctx_finish(&exec_ctx);
52
+
53
53
  gpr_free(alarm);
54
54
  }
55
55
  }
@@ -80,20 +80,19 @@ static void alarm_unref_dbg(grpc_alarm* alarm, const char* reason,
80
80
  }
81
81
  #endif
82
82
 
83
- static void alarm_end_completion(grpc_exec_ctx* exec_ctx, void* arg,
84
- grpc_cq_completion* c) {
83
+ static void alarm_end_completion(void* arg, grpc_cq_completion* c) {
85
84
  grpc_alarm* alarm = (grpc_alarm*)arg;
86
85
  GRPC_ALARM_UNREF(alarm, "dequeue-end-op");
87
86
  }
88
87
 
89
- static void alarm_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
88
+ static void alarm_cb(void* arg, grpc_error* error) {
90
89
  grpc_alarm* alarm = (grpc_alarm*)arg;
91
90
 
92
91
  /* We are queuing an op on completion queue. This means, the alarm's structure
93
92
  cannot be destroyed until the op is dequeued. Adding an extra ref
94
93
  here and unref'ing when the op is dequeued will achieve this */
95
94
  GRPC_ALARM_REF(alarm, "queue-end-op");
96
- grpc_cq_end_op(exec_ctx, alarm->cq, alarm->tag, error, alarm_end_completion,
95
+ grpc_cq_end_op(alarm->cq, alarm->tag, error, alarm_end_completion,
97
96
  (void*)alarm, &alarm->completion);
98
97
  }
99
98
 
@@ -116,22 +115,20 @@ grpc_alarm* grpc_alarm_create(void* reserved) {
116
115
 
117
116
  void grpc_alarm_set(grpc_alarm* alarm, grpc_completion_queue* cq,
118
117
  gpr_timespec deadline, void* tag, void* reserved) {
119
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
118
+ grpc_core::ExecCtx exec_ctx;
120
119
 
121
120
  GRPC_CQ_INTERNAL_REF(cq, "alarm");
122
121
  alarm->cq = cq;
123
122
  alarm->tag = tag;
124
123
 
125
124
  GPR_ASSERT(grpc_cq_begin_op(cq, tag));
126
- grpc_timer_init(&exec_ctx, &alarm->alarm,
127
- grpc_timespec_to_millis_round_up(deadline), &alarm->on_alarm);
128
- grpc_exec_ctx_finish(&exec_ctx);
125
+ grpc_timer_init(&alarm->alarm, grpc_timespec_to_millis_round_up(deadline),
126
+ &alarm->on_alarm);
129
127
  }
130
128
 
131
129
  void grpc_alarm_cancel(grpc_alarm* alarm, void* reserved) {
132
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
133
- grpc_timer_cancel(&exec_ctx, &alarm->alarm);
134
- grpc_exec_ctx_finish(&exec_ctx);
130
+ grpc_core::ExecCtx exec_ctx;
131
+ grpc_timer_cancel(&alarm->alarm);
135
132
  }
136
133
 
137
134
  void grpc_alarm_destroy(grpc_alarm* alarm, void* reserved) {
@@ -24,10 +24,6 @@
24
24
 
25
25
  extern grpc_core::DebugOnlyTraceFlag grpc_trace_alarm_refcount;
26
26
 
27
- #ifdef __cplusplus
28
- extern "C" {
29
- #endif
30
-
31
27
  #ifndef NDEBUG
32
28
 
33
29
  #define GRPC_ALARM_REF(a, reason) alarm_ref_dbg(a, reason, __FILE__, __LINE__)
@@ -41,8 +37,4 @@ extern "C" {
41
37
 
42
38
  #endif /* defined(NDEBUG) */
43
39
 
44
- #ifdef __cplusplus
45
- }
46
- #endif
47
-
48
40
  #endif /* GRPC_CORE_LIB_SURFACE_ALARM_INTERNAL_H */
@@ -71,14 +71,13 @@ grpc_byte_buffer* grpc_byte_buffer_copy(grpc_byte_buffer* bb) {
71
71
 
72
72
  void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) {
73
73
  if (!bb) return;
74
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
74
+ grpc_core::ExecCtx exec_ctx;
75
75
  switch (bb->type) {
76
76
  case GRPC_BB_RAW:
77
- grpc_slice_buffer_destroy_internal(&exec_ctx, &bb->data.raw.slice_buffer);
77
+ grpc_slice_buffer_destroy_internal(&bb->data.raw.slice_buffer);
78
78
  break;
79
79
  }
80
80
  gpr_free(bb);
81
- grpc_exec_ctx_finish(&exec_ctx);
82
81
  }
83
82
 
84
83
  size_t grpc_byte_buffer_length(grpc_byte_buffer* bb) {
@@ -42,15 +42,14 @@ static int is_compressed(grpc_byte_buffer* buffer) {
42
42
 
43
43
  int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
44
44
  grpc_byte_buffer* buffer) {
45
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
45
+ grpc_core::ExecCtx exec_ctx;
46
46
  grpc_slice_buffer decompressed_slices_buffer;
47
47
  reader->buffer_in = buffer;
48
48
  switch (reader->buffer_in->type) {
49
49
  case GRPC_BB_RAW:
50
50
  grpc_slice_buffer_init(&decompressed_slices_buffer);
51
51
  if (is_compressed(reader->buffer_in)) {
52
- if (grpc_msg_decompress(&exec_ctx,
53
- reader->buffer_in->data.raw.compression,
52
+ if (grpc_msg_decompress(reader->buffer_in->data.raw.compression,
54
53
  &reader->buffer_in->data.raw.slice_buffer,
55
54
  &decompressed_slices_buffer) == 0) {
56
55
  gpr_log(GPR_ERROR,
@@ -64,15 +63,14 @@ int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
64
63
  grpc_raw_byte_buffer_create(decompressed_slices_buffer.slices,
65
64
  decompressed_slices_buffer.count);
66
65
  }
67
- grpc_slice_buffer_destroy_internal(&exec_ctx,
68
- &decompressed_slices_buffer);
66
+ grpc_slice_buffer_destroy_internal(&decompressed_slices_buffer);
69
67
  } else { /* not compressed, use the input buffer as output */
70
68
  reader->buffer_out = reader->buffer_in;
71
69
  }
72
70
  reader->current.index = 0;
73
71
  break;
74
72
  }
75
- grpc_exec_ctx_finish(&exec_ctx);
73
+
76
74
  return 1;
77
75
  }
78
76
 
@@ -112,14 +110,14 @@ grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader* reader) {
112
110
  grpc_slice out_slice = GRPC_SLICE_MALLOC(input_size);
113
111
  uint8_t* const outbuf = GRPC_SLICE_START_PTR(out_slice); /* just an alias */
114
112
 
115
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
113
+ grpc_core::ExecCtx exec_ctx;
116
114
  while (grpc_byte_buffer_reader_next(reader, &in_slice) != 0) {
117
115
  const size_t slice_length = GRPC_SLICE_LENGTH(in_slice);
118
116
  memcpy(&(outbuf[bytes_read]), GRPC_SLICE_START_PTR(in_slice), slice_length);
119
117
  bytes_read += slice_length;
120
- grpc_slice_unref_internal(&exec_ctx, in_slice);
118
+ grpc_slice_unref_internal(in_slice);
121
119
  GPR_ASSERT(bytes_read <= input_size);
122
120
  }
123
- grpc_exec_ctx_finish(&exec_ctx);
121
+
124
122
  return out_slice;
125
123
  }
@@ -33,12 +33,12 @@
33
33
  #include "src/core/lib/channel/channel_stack.h"
34
34
  #include "src/core/lib/compression/algorithm_metadata.h"
35
35
  #include "src/core/lib/debug/stats.h"
36
+ #include "src/core/lib/gpr/arena.h"
37
+ #include "src/core/lib/gpr/string.h"
36
38
  #include "src/core/lib/iomgr/timer.h"
37
39
  #include "src/core/lib/profiling/timers.h"
38
40
  #include "src/core/lib/slice/slice_internal.h"
39
41
  #include "src/core/lib/slice/slice_string_helpers.h"
40
- #include "src/core/lib/support/arena.h"
41
- #include "src/core/lib/support/string.h"
42
42
  #include "src/core/lib/surface/api_trace.h"
43
43
  #include "src/core/lib/surface/call.h"
44
44
  #include "src/core/lib/surface/call_test_only.h"
@@ -270,30 +270,25 @@ grpc_core::TraceFlag grpc_compression_trace(false, "compression");
270
270
  #define CALL_FROM_TOP_ELEM(top_elem) \
271
271
  CALL_FROM_CALL_STACK(grpc_call_stack_from_top_element(top_elem))
272
272
 
273
- static void execute_batch(grpc_exec_ctx* exec_ctx, grpc_call* call,
274
- grpc_transport_stream_op_batch* op,
273
+ static void execute_batch(grpc_call* call, grpc_transport_stream_op_batch* op,
275
274
  grpc_closure* start_batch_closure);
276
- static void cancel_with_status(grpc_exec_ctx* exec_ctx, grpc_call* c,
277
- status_source source, grpc_status_code status,
275
+ static void cancel_with_status(grpc_call* c, status_source source,
276
+ grpc_status_code status,
278
277
  const char* description);
279
- static void cancel_with_error(grpc_exec_ctx* exec_ctx, grpc_call* c,
280
- status_source source, grpc_error* error);
281
- static void destroy_call(grpc_exec_ctx* exec_ctx, void* call_stack,
282
- grpc_error* error);
283
- static void receiving_slice_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
284
- grpc_error* error);
285
- static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call,
286
- void (*set_value)(grpc_status_code code,
287
- void* user_data),
288
- void* set_value_user_data, grpc_slice* details,
289
- const char** error_string);
278
+ static void cancel_with_error(grpc_call* c, status_source source,
279
+ grpc_error* error);
280
+ static void destroy_call(void* call_stack, grpc_error* error);
281
+ static void receiving_slice_ready(void* bctlp, grpc_error* error);
282
+ static void get_final_status(
283
+ grpc_call* call, void (*set_value)(grpc_status_code code, void* user_data),
284
+ void* set_value_user_data, grpc_slice* details, const char** error_string);
290
285
  static void set_status_value_directly(grpc_status_code status, void* dest);
291
- static void set_status_from_error(grpc_exec_ctx* exec_ctx, grpc_call* call,
292
- status_source source, grpc_error* error);
293
- static void process_data_after_md(grpc_exec_ctx* exec_ctx, batch_control* bctl);
294
- static void post_batch_completion(grpc_exec_ctx* exec_ctx, batch_control* bctl);
295
- static void add_batch_error(grpc_exec_ctx* exec_ctx, batch_control* bctl,
296
- grpc_error* error, bool has_cancelled);
286
+ static void set_status_from_error(grpc_call* call, status_source source,
287
+ grpc_error* error);
288
+ static void process_data_after_md(batch_control* bctl);
289
+ static void post_batch_completion(batch_control* bctl);
290
+ static void add_batch_error(batch_control* bctl, grpc_error* error,
291
+ bool has_cancelled);
297
292
 
298
293
  static void add_init_error(grpc_error** composite, grpc_error* new_err) {
299
294
  if (new_err == GRPC_ERROR_NONE) return;
@@ -311,7 +306,8 @@ static parent_call* get_or_create_parent_call(grpc_call* call) {
311
306
  if (p == nullptr) {
312
307
  p = (parent_call*)gpr_arena_alloc(call->arena, sizeof(*p));
313
308
  gpr_mu_init(&p->child_list_mu);
314
- if (!gpr_atm_rel_cas(&call->parent_call_atm, (gpr_atm)NULL, (gpr_atm)p)) {
309
+ if (!gpr_atm_rel_cas(&call->parent_call_atm, (gpr_atm) nullptr,
310
+ (gpr_atm)p)) {
315
311
  gpr_mu_destroy(&p->child_list_mu);
316
312
  p = (parent_call*)gpr_atm_acq_load(&call->parent_call_atm);
317
313
  }
@@ -323,8 +319,7 @@ static parent_call* get_parent_call(grpc_call* call) {
323
319
  return (parent_call*)gpr_atm_acq_load(&call->parent_call_atm);
324
320
  }
325
321
 
326
- grpc_error* grpc_call_create(grpc_exec_ctx* exec_ctx,
327
- const grpc_call_create_args* args,
322
+ grpc_error* grpc_call_create(const grpc_call_create_args* args,
328
323
  grpc_call** out_call) {
329
324
  size_t i, j;
330
325
  grpc_error* error = GRPC_ERROR_NONE;
@@ -333,7 +328,7 @@ grpc_error* grpc_call_create(grpc_exec_ctx* exec_ctx,
333
328
  grpc_call* call;
334
329
  GPR_TIMER_BEGIN("grpc_call_create", 0);
335
330
  size_t initial_size = grpc_channel_get_call_size_estimate(args->channel);
336
- GRPC_STATS_INC_CALL_INITIAL_SIZE(exec_ctx, initial_size);
331
+ GRPC_STATS_INC_CALL_INITIAL_SIZE(initial_size);
337
332
  gpr_arena* arena = gpr_arena_create(initial_size);
338
333
  call = (grpc_call*)gpr_arena_alloc(
339
334
  arena, sizeof(grpc_call) + channel_stack->call_stack_size);
@@ -348,9 +343,9 @@ grpc_error* grpc_call_create(grpc_exec_ctx* exec_ctx,
348
343
  GPR_BITSET(&call->encodings_accepted_by_peer, GRPC_COMPRESS_NONE);
349
344
  call->is_client = args->server_transport_data == nullptr;
350
345
  if (call->is_client) {
351
- GRPC_STATS_INC_CLIENT_CALLS_CREATED(exec_ctx);
346
+ GRPC_STATS_INC_CLIENT_CALLS_CREATED();
352
347
  } else {
353
- GRPC_STATS_INC_SERVER_CALLS_CREATED(exec_ctx);
348
+ GRPC_STATS_INC_SERVER_CALLS_CREATED();
354
349
  }
355
350
  call->stream_op_payload.context = call->context;
356
351
  grpc_slice path = grpc_empty_slice();
@@ -445,15 +440,13 @@ grpc_error* grpc_call_create(grpc_exec_ctx* exec_ctx,
445
440
  send_deadline,
446
441
  call->arena,
447
442
  &call->call_combiner};
448
- add_init_error(&error, grpc_call_stack_init(exec_ctx, channel_stack, 1,
449
- destroy_call, call, &call_args));
443
+ add_init_error(&error, grpc_call_stack_init(channel_stack, 1, destroy_call,
444
+ call, &call_args));
450
445
  if (error != GRPC_ERROR_NONE) {
451
- cancel_with_error(exec_ctx, call, STATUS_FROM_SURFACE,
452
- GRPC_ERROR_REF(error));
446
+ cancel_with_error(call, STATUS_FROM_SURFACE, GRPC_ERROR_REF(error));
453
447
  }
454
448
  if (immediately_cancel) {
455
- cancel_with_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE,
456
- GRPC_ERROR_CANCELLED);
449
+ cancel_with_error(call, STATUS_FROM_API_OVERRIDE, GRPC_ERROR_CANCELLED);
457
450
  }
458
451
  if (args->cq != nullptr) {
459
452
  GPR_ASSERT(
@@ -468,17 +461,17 @@ grpc_error* grpc_call_create(grpc_exec_ctx* exec_ctx,
468
461
  args->pollset_set_alternative);
469
462
  }
470
463
  if (!grpc_polling_entity_is_empty(&call->pollent)) {
471
- grpc_call_stack_set_pollset_or_pollset_set(
472
- exec_ctx, CALL_STACK_FROM_CALL(call), &call->pollent);
464
+ grpc_call_stack_set_pollset_or_pollset_set(CALL_STACK_FROM_CALL(call),
465
+ &call->pollent);
473
466
  }
474
467
 
475
- grpc_slice_unref_internal(exec_ctx, path);
468
+ grpc_slice_unref_internal(path);
476
469
 
477
470
  GPR_TIMER_END("grpc_call_create", 0);
478
471
  return error;
479
472
  }
480
473
 
481
- void grpc_call_set_completion_queue(grpc_exec_ctx* exec_ctx, grpc_call* call,
474
+ void grpc_call_set_completion_queue(grpc_call* call,
482
475
  grpc_completion_queue* cq) {
483
476
  GPR_ASSERT(cq);
484
477
 
@@ -489,8 +482,8 @@ void grpc_call_set_completion_queue(grpc_exec_ctx* exec_ctx, grpc_call* call,
489
482
  call->cq = cq;
490
483
  GRPC_CQ_INTERNAL_REF(cq, "bind");
491
484
  call->pollent = grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq));
492
- grpc_call_stack_set_pollset_or_pollset_set(
493
- exec_ctx, CALL_STACK_FROM_CALL(call), &call->pollent);
485
+ grpc_call_stack_set_pollset_or_pollset_set(CALL_STACK_FROM_CALL(call),
486
+ &call->pollent);
494
487
  }
495
488
 
496
489
  #ifndef NDEBUG
@@ -503,40 +496,38 @@ void grpc_call_set_completion_queue(grpc_exec_ctx* exec_ctx, grpc_call* call,
503
496
  void grpc_call_internal_ref(grpc_call* c REF_ARG) {
504
497
  GRPC_CALL_STACK_REF(CALL_STACK_FROM_CALL(c), REF_REASON);
505
498
  }
506
- void grpc_call_internal_unref(grpc_exec_ctx* exec_ctx, grpc_call* c REF_ARG) {
507
- GRPC_CALL_STACK_UNREF(exec_ctx, CALL_STACK_FROM_CALL(c), REF_REASON);
499
+ void grpc_call_internal_unref(grpc_call* c REF_ARG) {
500
+ GRPC_CALL_STACK_UNREF(CALL_STACK_FROM_CALL(c), REF_REASON);
508
501
  }
509
502
 
510
- static void release_call(grpc_exec_ctx* exec_ctx, void* call,
511
- grpc_error* error) {
503
+ static void release_call(void* call, grpc_error* error) {
512
504
  grpc_call* c = (grpc_call*)call;
513
505
  grpc_channel* channel = c->channel;
514
506
  grpc_call_combiner_destroy(&c->call_combiner);
515
507
  gpr_free((char*)c->peer_string);
516
508
  grpc_channel_update_call_size_estimate(channel, gpr_arena_destroy(c->arena));
517
- GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, "call");
509
+ GRPC_CHANNEL_INTERNAL_UNREF(channel, "call");
518
510
  }
519
511
 
520
512
  static void set_status_value_directly(grpc_status_code status, void* dest);
521
- static void destroy_call(grpc_exec_ctx* exec_ctx, void* call,
522
- grpc_error* error) {
513
+ static void destroy_call(void* call, grpc_error* error) {
523
514
  size_t i;
524
515
  int ii;
525
516
  grpc_call* c = (grpc_call*)call;
526
517
  GPR_TIMER_BEGIN("destroy_call", 0);
527
518
  for (i = 0; i < 2; i++) {
528
519
  grpc_metadata_batch_destroy(
529
- exec_ctx, &c->metadata_batch[1 /* is_receiving */][i /* is_initial */]);
520
+ &c->metadata_batch[1 /* is_receiving */][i /* is_initial */]);
530
521
  }
531
522
  if (c->receiving_stream != nullptr) {
532
- grpc_byte_stream_destroy(exec_ctx, c->receiving_stream);
523
+ grpc_byte_stream_destroy(c->receiving_stream);
533
524
  }
534
525
  parent_call* pc = get_parent_call(c);
535
526
  if (pc != nullptr) {
536
527
  gpr_mu_destroy(&pc->child_list_mu);
537
528
  }
538
529
  for (ii = 0; ii < c->send_extra_metadata_count; ii++) {
539
- GRPC_MDELEM_UNREF(exec_ctx, c->send_extra_metadata[ii].md);
530
+ GRPC_MDELEM_UNREF(c->send_extra_metadata[ii].md);
540
531
  }
541
532
  for (i = 0; i < GRPC_CONTEXT_COUNT; i++) {
542
533
  if (c->context[i].destroy) {
@@ -544,12 +535,11 @@ static void destroy_call(grpc_exec_ctx* exec_ctx, void* call,
544
535
  }
545
536
  }
546
537
  if (c->cq) {
547
- GRPC_CQ_INTERNAL_UNREF(exec_ctx, c->cq, "bind");
538
+ GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
548
539
  }
549
540
 
550
- get_final_status(exec_ctx, c, set_status_value_directly,
551
- &c->final_info.final_status, nullptr,
552
- c->final_info.error_string);
541
+ get_final_status(c, set_status_value_directly, &c->final_info.final_status,
542
+ nullptr, c->final_info.error_string);
553
543
  c->final_info.stats.latency =
554
544
  gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), c->start_time);
555
545
 
@@ -558,7 +548,7 @@ static void destroy_call(grpc_exec_ctx* exec_ctx, void* call,
558
548
  unpack_received_status(gpr_atm_acq_load(&c->status[i])).error);
559
549
  }
560
550
 
561
- grpc_call_stack_destroy(exec_ctx, CALL_STACK_FROM_CALL(c), &c->final_info,
551
+ grpc_call_stack_destroy(CALL_STACK_FROM_CALL(c), &c->final_info,
562
552
  GRPC_CLOSURE_INIT(&c->release_call, release_call, c,
563
553
  grpc_schedule_on_exec_ctx));
564
554
  GPR_TIMER_END("destroy_call", 0);
@@ -570,7 +560,7 @@ void grpc_call_unref(grpc_call* c) {
570
560
  if (!gpr_unref(&c->ext_ref)) return;
571
561
 
572
562
  child_call* cc = c->child;
573
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
563
+ grpc_core::ExecCtx exec_ctx;
574
564
 
575
565
  GPR_TIMER_BEGIN("grpc_call_unref", 0);
576
566
  GRPC_API_TRACE("grpc_call_unref(c=%p)", 1, (c));
@@ -587,7 +577,7 @@ void grpc_call_unref(grpc_call* c) {
587
577
  cc->sibling_prev->child->sibling_next = cc->sibling_next;
588
578
  cc->sibling_next->child->sibling_prev = cc->sibling_prev;
589
579
  gpr_mu_unlock(&pc->child_list_mu);
590
- GRPC_CALL_INTERNAL_UNREF(&exec_ctx, cc->parent, "child");
580
+ GRPC_CALL_INTERNAL_UNREF(cc->parent, "child");
591
581
  }
592
582
 
593
583
  GPR_ASSERT(!c->destroy_called);
@@ -595,53 +585,49 @@ void grpc_call_unref(grpc_call* c) {
595
585
  bool cancel = gpr_atm_acq_load(&c->any_ops_sent_atm) != 0 &&
596
586
  gpr_atm_acq_load(&c->received_final_op_atm) == 0;
597
587
  if (cancel) {
598
- cancel_with_error(&exec_ctx, c, STATUS_FROM_API_OVERRIDE,
599
- GRPC_ERROR_CANCELLED);
588
+ cancel_with_error(c, STATUS_FROM_API_OVERRIDE, GRPC_ERROR_CANCELLED);
600
589
  } else {
601
590
  // Unset the call combiner cancellation closure. This has the
602
591
  // effect of scheduling the previously set cancellation closure, if
603
592
  // any, so that it can release any internal references it may be
604
593
  // holding to the call stack.
605
- grpc_call_combiner_set_notify_on_cancel(&exec_ctx, &c->call_combiner,
606
- nullptr);
594
+ grpc_call_combiner_set_notify_on_cancel(&c->call_combiner, nullptr);
607
595
  }
608
- GRPC_CALL_INTERNAL_UNREF(&exec_ctx, c, "destroy");
609
- grpc_exec_ctx_finish(&exec_ctx);
596
+ GRPC_CALL_INTERNAL_UNREF(c, "destroy");
597
+
610
598
  GPR_TIMER_END("grpc_call_unref", 0);
611
599
  }
612
600
 
613
601
  grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
614
602
  GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved));
615
603
  GPR_ASSERT(!reserved);
616
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
617
- cancel_with_error(&exec_ctx, call, STATUS_FROM_API_OVERRIDE,
618
- GRPC_ERROR_CANCELLED);
619
- grpc_exec_ctx_finish(&exec_ctx);
604
+ grpc_core::ExecCtx exec_ctx;
605
+ cancel_with_error(call, STATUS_FROM_API_OVERRIDE, GRPC_ERROR_CANCELLED);
606
+
620
607
  return GRPC_CALL_OK;
621
608
  }
622
609
 
623
610
  // This is called via the call combiner to start sending a batch down
624
611
  // the filter stack.
625
- static void execute_batch_in_call_combiner(grpc_exec_ctx* exec_ctx, void* arg,
626
- grpc_error* ignored) {
612
+ static void execute_batch_in_call_combiner(void* arg, grpc_error* ignored) {
627
613
  grpc_transport_stream_op_batch* batch = (grpc_transport_stream_op_batch*)arg;
628
614
  grpc_call* call = (grpc_call*)batch->handler_private.extra_arg;
629
615
  GPR_TIMER_BEGIN("execute_batch", 0);
630
616
  grpc_call_element* elem = CALL_ELEM_FROM_CALL(call, 0);
631
617
  GRPC_CALL_LOG_OP(GPR_INFO, elem, batch);
632
- elem->filter->start_transport_stream_op_batch(exec_ctx, elem, batch);
618
+ elem->filter->start_transport_stream_op_batch(elem, batch);
633
619
  GPR_TIMER_END("execute_batch", 0);
634
620
  }
635
621
 
636
622
  // start_batch_closure points to a caller-allocated closure to be used
637
623
  // for entering the call combiner.
638
- static void execute_batch(grpc_exec_ctx* exec_ctx, grpc_call* call,
624
+ static void execute_batch(grpc_call* call,
639
625
  grpc_transport_stream_op_batch* batch,
640
626
  grpc_closure* start_batch_closure) {
641
627
  batch->handler_private.extra_arg = call;
642
628
  GRPC_CLOSURE_INIT(start_batch_closure, execute_batch_in_call_combiner, batch,
643
629
  grpc_schedule_on_exec_ctx);
644
- GRPC_CALL_COMBINER_START(exec_ctx, &call->call_combiner, start_batch_closure,
630
+ GRPC_CALL_COMBINER_START(&call->call_combiner, start_batch_closure,
645
631
  GRPC_ERROR_NONE, "executing batch");
646
632
  }
647
633
 
@@ -665,15 +651,14 @@ grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
665
651
  grpc_status_code status,
666
652
  const char* description,
667
653
  void* reserved) {
668
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
654
+ grpc_core::ExecCtx exec_ctx;
669
655
  GRPC_API_TRACE(
670
656
  "grpc_call_cancel_with_status("
671
657
  "c=%p, status=%d, description=%s, reserved=%p)",
672
658
  4, (c, (int)status, description, reserved));
673
659
  GPR_ASSERT(reserved == nullptr);
674
- cancel_with_status(&exec_ctx, c, STATUS_FROM_API_OVERRIDE, status,
675
- description);
676
- grpc_exec_ctx_finish(&exec_ctx);
660
+ cancel_with_status(c, STATUS_FROM_API_OVERRIDE, status, description);
661
+
677
662
  return GRPC_CALL_OK;
678
663
  }
679
664
 
@@ -685,24 +670,23 @@ typedef struct {
685
670
 
686
671
  // The on_complete callback used when sending a cancel_stream batch down
687
672
  // the filter stack. Yields the call combiner when the batch is done.
688
- static void done_termination(grpc_exec_ctx* exec_ctx, void* arg,
689
- grpc_error* error) {
673
+ static void done_termination(void* arg, grpc_error* error) {
690
674
  cancel_state* state = (cancel_state*)arg;
691
- GRPC_CALL_COMBINER_STOP(exec_ctx, &state->call->call_combiner,
675
+ GRPC_CALL_COMBINER_STOP(&state->call->call_combiner,
692
676
  "on_complete for cancel_stream op");
693
- GRPC_CALL_INTERNAL_UNREF(exec_ctx, state->call, "termination");
677
+ GRPC_CALL_INTERNAL_UNREF(state->call, "termination");
694
678
  gpr_free(state);
695
679
  }
696
680
 
697
- static void cancel_with_error(grpc_exec_ctx* exec_ctx, grpc_call* c,
698
- status_source source, grpc_error* error) {
681
+ static void cancel_with_error(grpc_call* c, status_source source,
682
+ grpc_error* error) {
699
683
  GRPC_CALL_INTERNAL_REF(c, "termination");
700
684
  // Inform the call combiner of the cancellation, so that it can cancel
701
685
  // any in-flight asynchronous actions that may be holding the call
702
686
  // combiner. This ensures that the cancel_stream batch can be sent
703
687
  // down the filter stack in a timely manner.
704
- grpc_call_combiner_cancel(exec_ctx, &c->call_combiner, GRPC_ERROR_REF(error));
705
- set_status_from_error(exec_ctx, c, source, GRPC_ERROR_REF(error));
688
+ grpc_call_combiner_cancel(&c->call_combiner, GRPC_ERROR_REF(error));
689
+ set_status_from_error(c, source, GRPC_ERROR_REF(error));
706
690
  cancel_state* state = (cancel_state*)gpr_malloc(sizeof(*state));
707
691
  state->call = c;
708
692
  GRPC_CLOSURE_INIT(&state->finish_batch, done_termination, state,
@@ -711,7 +695,7 @@ static void cancel_with_error(grpc_exec_ctx* exec_ctx, grpc_call* c,
711
695
  grpc_make_transport_stream_op(&state->finish_batch);
712
696
  op->cancel_stream = true;
713
697
  op->payload->cancel_stream.cancel_error = error;
714
- execute_batch(exec_ctx, c, op, &state->start_batch);
698
+ execute_batch(c, op, &state->start_batch);
715
699
  }
716
700
 
717
701
  static grpc_error* error_from_status(grpc_status_code status,
@@ -725,11 +709,10 @@ static grpc_error* error_from_status(grpc_status_code status,
725
709
  GRPC_ERROR_INT_GRPC_STATUS, status);
726
710
  }
727
711
 
728
- static void cancel_with_status(grpc_exec_ctx* exec_ctx, grpc_call* c,
729
- status_source source, grpc_status_code status,
712
+ static void cancel_with_status(grpc_call* c, status_source source,
713
+ grpc_status_code status,
730
714
  const char* description) {
731
- cancel_with_error(exec_ctx, c, source,
732
- error_from_status(status, description));
715
+ cancel_with_error(c, source, error_from_status(status, description));
733
716
  }
734
717
 
735
718
  /*******************************************************************************
@@ -737,14 +720,13 @@ static void cancel_with_status(grpc_exec_ctx* exec_ctx, grpc_call* c,
737
720
  */
738
721
 
739
722
  static bool get_final_status_from(
740
- grpc_exec_ctx* exec_ctx, grpc_call* call, grpc_error* error,
741
- bool allow_ok_status,
723
+ grpc_call* call, grpc_error* error, bool allow_ok_status,
742
724
  void (*set_value)(grpc_status_code code, void* user_data),
743
725
  void* set_value_user_data, grpc_slice* details, const char** error_string) {
744
726
  grpc_status_code code;
745
727
  grpc_slice slice = grpc_empty_slice();
746
- grpc_error_get_status(exec_ctx, error, call->send_deadline, &code, &slice,
747
- nullptr, error_string);
728
+ grpc_error_get_status(error, call->send_deadline, &code, &slice, nullptr,
729
+ error_string);
748
730
  if (code == GRPC_STATUS_OK && !allow_ok_status) {
749
731
  return false;
750
732
  }
@@ -756,11 +738,9 @@ static bool get_final_status_from(
756
738
  return true;
757
739
  }
758
740
 
759
- static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call,
760
- void (*set_value)(grpc_status_code code,
761
- void* user_data),
762
- void* set_value_user_data, grpc_slice* details,
763
- const char** error_string) {
741
+ static void get_final_status(
742
+ grpc_call* call, void (*set_value)(grpc_status_code code, void* user_data),
743
+ void* set_value_user_data, grpc_slice* details, const char** error_string) {
764
744
  int i;
765
745
  received_status status[STATUS_SOURCE_COUNT];
766
746
  for (i = 0; i < STATUS_SOURCE_COUNT; i++) {
@@ -782,9 +762,9 @@ static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call,
782
762
  for (i = 0; i < STATUS_SOURCE_COUNT; i++) {
783
763
  if (status[i].is_set &&
784
764
  grpc_error_has_clear_grpc_status(status[i].error)) {
785
- if (get_final_status_from(exec_ctx, call, status[i].error,
786
- allow_ok_status != 0, set_value,
787
- set_value_user_data, details, error_string)) {
765
+ if (get_final_status_from(call, status[i].error, allow_ok_status != 0,
766
+ set_value, set_value_user_data, details,
767
+ error_string)) {
788
768
  return;
789
769
  }
790
770
  }
@@ -792,9 +772,9 @@ static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call,
792
772
  /* If no clearly defined status exists, search for 'anything' */
793
773
  for (i = 0; i < STATUS_SOURCE_COUNT; i++) {
794
774
  if (status[i].is_set) {
795
- if (get_final_status_from(exec_ctx, call, status[i].error,
796
- allow_ok_status != 0, set_value,
797
- set_value_user_data, details, error_string)) {
775
+ if (get_final_status_from(call, status[i].error, allow_ok_status != 0,
776
+ set_value, set_value_user_data, details,
777
+ error_string)) {
798
778
  return;
799
779
  }
800
780
  }
@@ -808,8 +788,8 @@ static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call,
808
788
  }
809
789
  }
810
790
 
811
- static void set_status_from_error(grpc_exec_ctx* exec_ctx, grpc_call* call,
812
- status_source source, grpc_error* error) {
791
+ static void set_status_from_error(grpc_call* call, status_source source,
792
+ grpc_error* error) {
813
793
  if (!gpr_atm_rel_cas(&call->status[source],
814
794
  pack_received_status({false, GRPC_ERROR_NONE}),
815
795
  pack_received_status({true, error}))) {
@@ -861,8 +841,7 @@ uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
861
841
 
862
842
  static void destroy_encodings_accepted_by_peer(void* p) { return; }
863
843
 
864
- static void set_encodings_accepted_by_peer(grpc_exec_ctx* exec_ctx,
865
- grpc_call* call, grpc_mdelem mdel) {
844
+ static void set_encodings_accepted_by_peer(grpc_call* call, grpc_mdelem mdel) {
866
845
  size_t i;
867
846
  grpc_compression_algorithm algorithm;
868
847
  grpc_slice_buffer accept_encoding_parts;
@@ -900,15 +879,14 @@ static void set_encodings_accepted_by_peer(grpc_exec_ctx* exec_ctx,
900
879
  }
901
880
  }
902
881
 
903
- grpc_slice_buffer_destroy_internal(exec_ctx, &accept_encoding_parts);
882
+ grpc_slice_buffer_destroy_internal(&accept_encoding_parts);
904
883
 
905
884
  grpc_mdelem_set_user_data(
906
885
  mdel, destroy_encodings_accepted_by_peer,
907
886
  (void*)(((uintptr_t)call->encodings_accepted_by_peer) + 1));
908
887
  }
909
888
 
910
- static void set_stream_encodings_accepted_by_peer(grpc_exec_ctx* exec_ctx,
911
- grpc_call* call,
889
+ static void set_stream_encodings_accepted_by_peer(grpc_call* call,
912
890
  grpc_mdelem mdel) {
913
891
  size_t i;
914
892
  grpc_stream_compression_algorithm algorithm;
@@ -946,7 +924,7 @@ static void set_stream_encodings_accepted_by_peer(grpc_exec_ctx* exec_ctx,
946
924
  }
947
925
  }
948
926
 
949
- grpc_slice_buffer_destroy_internal(exec_ctx, &accept_encoding_parts);
927
+ grpc_slice_buffer_destroy_internal(&accept_encoding_parts);
950
928
 
951
929
  grpc_mdelem_set_user_data(
952
930
  mdel, destroy_encodings_accepted_by_peer,
@@ -984,10 +962,12 @@ static grpc_metadata* get_md_elem(grpc_metadata* metadata,
984
962
  return res;
985
963
  }
986
964
 
987
- static int prepare_application_metadata(
988
- grpc_exec_ctx* exec_ctx, grpc_call* call, int count,
989
- grpc_metadata* metadata, int is_trailing, int prepend_extra_metadata,
990
- grpc_metadata* additional_metadata, int additional_metadata_count) {
965
+ static int prepare_application_metadata(grpc_call* call, int count,
966
+ grpc_metadata* metadata,
967
+ int is_trailing,
968
+ int prepend_extra_metadata,
969
+ grpc_metadata* additional_metadata,
970
+ int additional_metadata_count) {
991
971
  int total_count = count + additional_metadata_count;
992
972
  int i;
993
973
  grpc_metadata_batch* batch =
@@ -1006,14 +986,14 @@ static int prepare_application_metadata(
1006
986
  grpc_validate_header_nonbin_value_is_legal(md->value))) {
1007
987
  break;
1008
988
  }
1009
- l->md = grpc_mdelem_from_grpc_metadata(exec_ctx, (grpc_metadata*)md);
989
+ l->md = grpc_mdelem_from_grpc_metadata((grpc_metadata*)md);
1010
990
  }
1011
991
  if (i != total_count) {
1012
992
  for (int j = 0; j < i; j++) {
1013
993
  const grpc_metadata* md =
1014
994
  get_md_elem(metadata, additional_metadata, j, count);
1015
995
  grpc_linked_mdelem* l = linked_from_md(md);
1016
- GRPC_MDELEM_UNREF(exec_ctx, l->md);
996
+ GRPC_MDELEM_UNREF(l->md);
1017
997
  }
1018
998
  return 0;
1019
999
  }
@@ -1024,16 +1004,16 @@ static int prepare_application_metadata(
1024
1004
  for (i = 0; i < call->send_extra_metadata_count; i++) {
1025
1005
  GRPC_LOG_IF_ERROR("prepare_application_metadata",
1026
1006
  grpc_metadata_batch_link_tail(
1027
- exec_ctx, batch, &call->send_extra_metadata[i]));
1007
+ batch, &call->send_extra_metadata[i]));
1028
1008
  }
1029
1009
  }
1030
1010
  }
1031
1011
  for (i = 0; i < total_count; i++) {
1032
1012
  grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
1033
1013
  grpc_linked_mdelem* l = linked_from_md(md);
1034
- grpc_error* error = grpc_metadata_batch_link_tail(exec_ctx, batch, l);
1014
+ grpc_error* error = grpc_metadata_batch_link_tail(batch, l);
1035
1015
  if (error != GRPC_ERROR_NONE) {
1036
- GRPC_MDELEM_UNREF(exec_ctx, l->md);
1016
+ GRPC_MDELEM_UNREF(l->md);
1037
1017
  }
1038
1018
  GRPC_LOG_IF_ERROR("prepare_application_metadata", error);
1039
1019
  }
@@ -1101,7 +1081,6 @@ static grpc_stream_compression_algorithm decode_stream_compression(
1101
1081
  static void publish_app_metadata(grpc_call* call, grpc_metadata_batch* b,
1102
1082
  int is_trailing) {
1103
1083
  if (b->list.count == 0) return;
1104
- if (is_trailing && call->buffered_metadata[1] == nullptr) return;
1105
1084
  GPR_TIMER_BEGIN("publish_app_metadata", 0);
1106
1085
  grpc_metadata_array* dest;
1107
1086
  grpc_metadata* mdusr;
@@ -1121,46 +1100,43 @@ static void publish_app_metadata(grpc_call* call, grpc_metadata_batch* b,
1121
1100
  GPR_TIMER_END("publish_app_metadata", 0);
1122
1101
  }
1123
1102
 
1124
- static void recv_initial_filter(grpc_exec_ctx* exec_ctx, grpc_call* call,
1125
- grpc_metadata_batch* b) {
1103
+ static void recv_initial_filter(grpc_call* call, grpc_metadata_batch* b) {
1126
1104
  if (b->idx.named.content_encoding != nullptr) {
1127
1105
  if (b->idx.named.grpc_encoding != nullptr) {
1128
1106
  gpr_log(GPR_ERROR,
1129
1107
  "Received both content-encoding and grpc-encoding header. "
1130
1108
  "Ignoring grpc-encoding.");
1131
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.grpc_encoding);
1109
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_encoding);
1132
1110
  }
1133
1111
  GPR_TIMER_BEGIN("incoming_stream_compression_algorithm", 0);
1134
1112
  set_incoming_stream_compression_algorithm(
1135
1113
  call, decode_stream_compression(b->idx.named.content_encoding->md));
1136
1114
  GPR_TIMER_END("incoming_stream_compression_algorithm", 0);
1137
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.content_encoding);
1115
+ grpc_metadata_batch_remove(b, b->idx.named.content_encoding);
1138
1116
  } else if (b->idx.named.grpc_encoding != nullptr) {
1139
1117
  GPR_TIMER_BEGIN("incoming_compression_algorithm", 0);
1140
1118
  set_incoming_compression_algorithm(
1141
1119
  call, decode_compression(b->idx.named.grpc_encoding->md));
1142
1120
  GPR_TIMER_END("incoming_compression_algorithm", 0);
1143
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.grpc_encoding);
1121
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_encoding);
1144
1122
  }
1145
1123
  if (b->idx.named.grpc_accept_encoding != nullptr) {
1146
1124
  GPR_TIMER_BEGIN("encodings_accepted_by_peer", 0);
1147
- set_encodings_accepted_by_peer(exec_ctx, call,
1148
- b->idx.named.grpc_accept_encoding->md);
1149
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.grpc_accept_encoding);
1125
+ set_encodings_accepted_by_peer(call, b->idx.named.grpc_accept_encoding->md);
1126
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_accept_encoding);
1150
1127
  GPR_TIMER_END("encodings_accepted_by_peer", 0);
1151
1128
  }
1152
1129
  if (b->idx.named.accept_encoding != nullptr) {
1153
1130
  GPR_TIMER_BEGIN("stream_encodings_accepted_by_peer", 0);
1154
- set_stream_encodings_accepted_by_peer(exec_ctx, call,
1131
+ set_stream_encodings_accepted_by_peer(call,
1155
1132
  b->idx.named.accept_encoding->md);
1156
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.accept_encoding);
1133
+ grpc_metadata_batch_remove(b, b->idx.named.accept_encoding);
1157
1134
  GPR_TIMER_END("stream_encodings_accepted_by_peer", 0);
1158
1135
  }
1159
1136
  publish_app_metadata(call, b, false);
1160
1137
  }
1161
1138
 
1162
- static void recv_trailing_filter(grpc_exec_ctx* exec_ctx, void* args,
1163
- grpc_metadata_batch* b) {
1139
+ static void recv_trailing_filter(void* args, grpc_metadata_batch* b) {
1164
1140
  grpc_call* call = (grpc_call*)args;
1165
1141
  if (b->idx.named.grpc_status != nullptr) {
1166
1142
  uint32_t status_code = decode_status(b->idx.named.grpc_status->md);
@@ -1175,13 +1151,13 @@ static void recv_trailing_filter(grpc_exec_ctx* exec_ctx, void* args,
1175
1151
  error = grpc_error_set_str(
1176
1152
  error, GRPC_ERROR_STR_GRPC_MESSAGE,
1177
1153
  grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_message->md)));
1178
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.grpc_message);
1154
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_message);
1179
1155
  } else if (error != GRPC_ERROR_NONE) {
1180
1156
  error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
1181
1157
  grpc_empty_slice());
1182
1158
  }
1183
- set_status_from_error(exec_ctx, call, STATUS_FROM_WIRE, error);
1184
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.grpc_status);
1159
+ set_status_from_error(call, STATUS_FROM_WIRE, error);
1160
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_status);
1185
1161
  }
1186
1162
  publish_app_metadata(call, b, true);
1187
1163
  }
@@ -1258,12 +1234,12 @@ static batch_control* allocate_batch_control(grpc_call* call,
1258
1234
  return bctl;
1259
1235
  }
1260
1236
 
1261
- static void finish_batch_completion(grpc_exec_ctx* exec_ctx, void* user_data,
1237
+ static void finish_batch_completion(void* user_data,
1262
1238
  grpc_cq_completion* storage) {
1263
1239
  batch_control* bctl = (batch_control*)user_data;
1264
1240
  grpc_call* call = bctl->call;
1265
1241
  bctl->call = nullptr;
1266
- GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, "completion");
1242
+ GRPC_CALL_INTERNAL_UNREF(call, "completion");
1267
1243
  }
1268
1244
 
1269
1245
  static grpc_error* consolidate_batch_errors(batch_control* bctl) {
@@ -1287,15 +1263,13 @@ static grpc_error* consolidate_batch_errors(batch_control* bctl) {
1287
1263
  }
1288
1264
  }
1289
1265
 
1290
- static void post_batch_completion(grpc_exec_ctx* exec_ctx,
1291
- batch_control* bctl) {
1266
+ static void post_batch_completion(batch_control* bctl) {
1292
1267
  grpc_call* next_child_call;
1293
1268
  grpc_call* call = bctl->call;
1294
1269
  grpc_error* error = consolidate_batch_errors(bctl);
1295
1270
 
1296
1271
  if (bctl->op.send_initial_metadata) {
1297
1272
  grpc_metadata_batch_destroy(
1298
- exec_ctx,
1299
1273
  &call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */]);
1300
1274
  }
1301
1275
  if (bctl->op.send_message) {
@@ -1303,13 +1277,12 @@ static void post_batch_completion(grpc_exec_ctx* exec_ctx,
1303
1277
  }
1304
1278
  if (bctl->op.send_trailing_metadata) {
1305
1279
  grpc_metadata_batch_destroy(
1306
- exec_ctx,
1307
1280
  &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */]);
1308
1281
  }
1309
1282
  if (bctl->op.recv_trailing_metadata) {
1310
1283
  grpc_metadata_batch* md =
1311
1284
  &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
1312
- recv_trailing_filter(exec_ctx, call, md);
1285
+ recv_trailing_filter(call, md);
1313
1286
 
1314
1287
  /* propagate cancellation to any interested children */
1315
1288
  gpr_atm_rel_store(&call->received_final_op_atm, 1);
@@ -1323,9 +1296,9 @@ static void post_batch_completion(grpc_exec_ctx* exec_ctx,
1323
1296
  next_child_call = child->child->sibling_next;
1324
1297
  if (child->cancellation_is_inherited) {
1325
1298
  GRPC_CALL_INTERNAL_REF(child, "propagate_cancel");
1326
- cancel_with_error(exec_ctx, child, STATUS_FROM_API_OVERRIDE,
1299
+ cancel_with_error(child, STATUS_FROM_API_OVERRIDE,
1327
1300
  GRPC_ERROR_CANCELLED);
1328
- GRPC_CALL_INTERNAL_UNREF(exec_ctx, child, "propagate_cancel");
1301
+ GRPC_CALL_INTERNAL_UNREF(child, "propagate_cancel");
1329
1302
  }
1330
1303
  child = next_child_call;
1331
1304
  } while (child != pc->first_child);
@@ -1334,12 +1307,12 @@ static void post_batch_completion(grpc_exec_ctx* exec_ctx,
1334
1307
  }
1335
1308
 
1336
1309
  if (call->is_client) {
1337
- get_final_status(exec_ctx, call, set_status_value_directly,
1310
+ get_final_status(call, set_status_value_directly,
1338
1311
  call->final_op.client.status,
1339
1312
  call->final_op.client.status_details,
1340
1313
  call->final_op.client.error_string);
1341
1314
  } else {
1342
- get_final_status(exec_ctx, call, set_cancelled_value,
1315
+ get_final_status(call, set_cancelled_value,
1343
1316
  call->final_op.server.cancelled, nullptr, nullptr);
1344
1317
  }
1345
1318
 
@@ -1355,25 +1328,24 @@ static void post_batch_completion(grpc_exec_ctx* exec_ctx,
1355
1328
  if (bctl->completion_data.notify_tag.is_closure) {
1356
1329
  /* unrefs bctl->error */
1357
1330
  bctl->call = nullptr;
1358
- GRPC_CLOSURE_RUN(
1359
- exec_ctx, (grpc_closure*)bctl->completion_data.notify_tag.tag, error);
1360
- GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, "completion");
1331
+ GRPC_CLOSURE_RUN((grpc_closure*)bctl->completion_data.notify_tag.tag,
1332
+ error);
1333
+ GRPC_CALL_INTERNAL_UNREF(call, "completion");
1361
1334
  } else {
1362
1335
  /* unrefs bctl->error */
1363
- grpc_cq_end_op(
1364
- exec_ctx, bctl->call->cq, bctl->completion_data.notify_tag.tag, error,
1365
- finish_batch_completion, bctl, &bctl->completion_data.cq_completion);
1336
+ grpc_cq_end_op(bctl->call->cq, bctl->completion_data.notify_tag.tag, error,
1337
+ finish_batch_completion, bctl,
1338
+ &bctl->completion_data.cq_completion);
1366
1339
  }
1367
1340
  }
1368
1341
 
1369
- static void finish_batch_step(grpc_exec_ctx* exec_ctx, batch_control* bctl) {
1342
+ static void finish_batch_step(batch_control* bctl) {
1370
1343
  if (gpr_unref(&bctl->steps_to_complete)) {
1371
- post_batch_completion(exec_ctx, bctl);
1344
+ post_batch_completion(bctl);
1372
1345
  }
1373
1346
  }
1374
1347
 
1375
- static void continue_receiving_slices(grpc_exec_ctx* exec_ctx,
1376
- batch_control* bctl) {
1348
+ static void continue_receiving_slices(batch_control* bctl) {
1377
1349
  grpc_error* error;
1378
1350
  grpc_call* call = bctl->call;
1379
1351
  for (;;) {
@@ -1381,25 +1353,25 @@ static void continue_receiving_slices(grpc_exec_ctx* exec_ctx,
1381
1353
  (*call->receiving_buffer)->data.raw.slice_buffer.length;
1382
1354
  if (remaining == 0) {
1383
1355
  call->receiving_message = 0;
1384
- grpc_byte_stream_destroy(exec_ctx, call->receiving_stream);
1356
+ grpc_byte_stream_destroy(call->receiving_stream);
1385
1357
  call->receiving_stream = nullptr;
1386
- finish_batch_step(exec_ctx, bctl);
1358
+ finish_batch_step(bctl);
1387
1359
  return;
1388
1360
  }
1389
- if (grpc_byte_stream_next(exec_ctx, call->receiving_stream, remaining,
1361
+ if (grpc_byte_stream_next(call->receiving_stream, remaining,
1390
1362
  &call->receiving_slice_ready)) {
1391
- error = grpc_byte_stream_pull(exec_ctx, call->receiving_stream,
1392
- &call->receiving_slice);
1363
+ error =
1364
+ grpc_byte_stream_pull(call->receiving_stream, &call->receiving_slice);
1393
1365
  if (error == GRPC_ERROR_NONE) {
1394
1366
  grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
1395
1367
  call->receiving_slice);
1396
1368
  } else {
1397
- grpc_byte_stream_destroy(exec_ctx, call->receiving_stream);
1369
+ grpc_byte_stream_destroy(call->receiving_stream);
1398
1370
  call->receiving_stream = nullptr;
1399
1371
  grpc_byte_buffer_destroy(*call->receiving_buffer);
1400
1372
  *call->receiving_buffer = nullptr;
1401
1373
  call->receiving_message = 0;
1402
- finish_batch_step(exec_ctx, bctl);
1374
+ finish_batch_step(bctl);
1403
1375
  return;
1404
1376
  }
1405
1377
  } else {
@@ -1408,8 +1380,7 @@ static void continue_receiving_slices(grpc_exec_ctx* exec_ctx,
1408
1380
  }
1409
1381
  }
1410
1382
 
1411
- static void receiving_slice_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
1412
- grpc_error* error) {
1383
+ static void receiving_slice_ready(void* bctlp, grpc_error* error) {
1413
1384
  batch_control* bctl = (batch_control*)bctlp;
1414
1385
  grpc_call* call = bctl->call;
1415
1386
  grpc_byte_stream* bs = call->receiving_stream;
@@ -1417,11 +1388,11 @@ static void receiving_slice_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
1417
1388
 
1418
1389
  if (error == GRPC_ERROR_NONE) {
1419
1390
  grpc_slice slice;
1420
- error = grpc_byte_stream_pull(exec_ctx, bs, &slice);
1391
+ error = grpc_byte_stream_pull(bs, &slice);
1421
1392
  if (error == GRPC_ERROR_NONE) {
1422
1393
  grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
1423
1394
  slice);
1424
- continue_receiving_slices(exec_ctx, bctl);
1395
+ continue_receiving_slices(bctl);
1425
1396
  } else {
1426
1397
  /* Error returned by grpc_byte_stream_pull needs to be released manually
1427
1398
  */
@@ -1433,25 +1404,24 @@ static void receiving_slice_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
1433
1404
  if (grpc_trace_operation_failures.enabled()) {
1434
1405
  GRPC_LOG_IF_ERROR("receiving_slice_ready", GRPC_ERROR_REF(error));
1435
1406
  }
1436
- grpc_byte_stream_destroy(exec_ctx, call->receiving_stream);
1407
+ grpc_byte_stream_destroy(call->receiving_stream);
1437
1408
  call->receiving_stream = nullptr;
1438
1409
  grpc_byte_buffer_destroy(*call->receiving_buffer);
1439
1410
  *call->receiving_buffer = nullptr;
1440
1411
  call->receiving_message = 0;
1441
- finish_batch_step(exec_ctx, bctl);
1412
+ finish_batch_step(bctl);
1442
1413
  if (release_error) {
1443
1414
  GRPC_ERROR_UNREF(error);
1444
1415
  }
1445
1416
  }
1446
1417
  }
1447
1418
 
1448
- static void process_data_after_md(grpc_exec_ctx* exec_ctx,
1449
- batch_control* bctl) {
1419
+ static void process_data_after_md(batch_control* bctl) {
1450
1420
  grpc_call* call = bctl->call;
1451
1421
  if (call->receiving_stream == nullptr) {
1452
1422
  *call->receiving_buffer = nullptr;
1453
1423
  call->receiving_message = 0;
1454
- finish_batch_step(exec_ctx, bctl);
1424
+ finish_batch_step(bctl);
1455
1425
  } else {
1456
1426
  call->test_only_last_message_flags = call->receiving_stream->flags;
1457
1427
  if ((call->receiving_stream->flags & GRPC_WRITE_INTERNAL_COMPRESS) &&
@@ -1463,46 +1433,42 @@ static void process_data_after_md(grpc_exec_ctx* exec_ctx,
1463
1433
  }
1464
1434
  GRPC_CLOSURE_INIT(&call->receiving_slice_ready, receiving_slice_ready, bctl,
1465
1435
  grpc_schedule_on_exec_ctx);
1466
- continue_receiving_slices(exec_ctx, bctl);
1436
+ continue_receiving_slices(bctl);
1467
1437
  }
1468
1438
  }
1469
1439
 
1470
- static void receiving_stream_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
1471
- grpc_error* error) {
1440
+ static void receiving_stream_ready(void* bctlp, grpc_error* error) {
1472
1441
  batch_control* bctl = (batch_control*)bctlp;
1473
1442
  grpc_call* call = bctl->call;
1474
1443
  if (error != GRPC_ERROR_NONE) {
1475
1444
  if (call->receiving_stream != nullptr) {
1476
- grpc_byte_stream_destroy(exec_ctx, call->receiving_stream);
1445
+ grpc_byte_stream_destroy(call->receiving_stream);
1477
1446
  call->receiving_stream = nullptr;
1478
1447
  }
1479
- add_batch_error(exec_ctx, bctl, GRPC_ERROR_REF(error), true);
1480
- cancel_with_error(exec_ctx, call, STATUS_FROM_SURFACE,
1481
- GRPC_ERROR_REF(error));
1448
+ add_batch_error(bctl, GRPC_ERROR_REF(error), true);
1449
+ cancel_with_error(call, STATUS_FROM_SURFACE, GRPC_ERROR_REF(error));
1482
1450
  }
1483
1451
  /* If recv_state is RECV_NONE, we will save the batch_control
1484
1452
  * object with rel_cas, and will not use it after the cas. Its corresponding
1485
1453
  * acq_load is in receiving_initial_metadata_ready() */
1486
1454
  if (error != GRPC_ERROR_NONE || call->receiving_stream == nullptr ||
1487
1455
  !gpr_atm_rel_cas(&call->recv_state, RECV_NONE, (gpr_atm)bctlp)) {
1488
- process_data_after_md(exec_ctx, bctl);
1456
+ process_data_after_md(bctl);
1489
1457
  }
1490
1458
  }
1491
1459
 
1492
1460
  // The recv_message_ready callback used when sending a batch containing
1493
1461
  // a recv_message op down the filter stack. Yields the call combiner
1494
1462
  // before processing the received message.
1495
- static void receiving_stream_ready_in_call_combiner(grpc_exec_ctx* exec_ctx,
1496
- void* bctlp,
1463
+ static void receiving_stream_ready_in_call_combiner(void* bctlp,
1497
1464
  grpc_error* error) {
1498
1465
  batch_control* bctl = (batch_control*)bctlp;
1499
1466
  grpc_call* call = bctl->call;
1500
- GRPC_CALL_COMBINER_STOP(exec_ctx, &call->call_combiner, "recv_message_ready");
1501
- receiving_stream_ready(exec_ctx, bctlp, error);
1467
+ GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_message_ready");
1468
+ receiving_stream_ready(bctlp, error);
1502
1469
  }
1503
1470
 
1504
- static void validate_filtered_metadata(grpc_exec_ctx* exec_ctx,
1505
- batch_control* bctl) {
1471
+ static void validate_filtered_metadata(batch_control* bctl) {
1506
1472
  grpc_call* call = bctl->call;
1507
1473
  /* validate compression algorithms */
1508
1474
  if (call->incoming_stream_compression_algorithm !=
@@ -1516,8 +1482,8 @@ static void validate_filtered_metadata(grpc_exec_ctx* exec_ctx,
1516
1482
  gpr_asprintf(&error_msg,
1517
1483
  "Invalid stream compression algorithm value '%d'.", algo);
1518
1484
  gpr_log(GPR_ERROR, "%s", error_msg);
1519
- cancel_with_status(exec_ctx, call, STATUS_FROM_SURFACE,
1520
- GRPC_STATUS_UNIMPLEMENTED, error_msg);
1485
+ cancel_with_status(call, STATUS_FROM_SURFACE, GRPC_STATUS_UNIMPLEMENTED,
1486
+ error_msg);
1521
1487
  } else if (grpc_compression_options_is_stream_compression_algorithm_enabled(
1522
1488
  &compression_options, algo) == 0) {
1523
1489
  /* check if algorithm is supported by current channel config */
@@ -1526,8 +1492,8 @@ static void validate_filtered_metadata(grpc_exec_ctx* exec_ctx,
1526
1492
  gpr_asprintf(&error_msg, "Stream compression algorithm '%s' is disabled.",
1527
1493
  algo_name);
1528
1494
  gpr_log(GPR_ERROR, "%s", error_msg);
1529
- cancel_with_status(exec_ctx, call, STATUS_FROM_SURFACE,
1530
- GRPC_STATUS_UNIMPLEMENTED, error_msg);
1495
+ cancel_with_status(call, STATUS_FROM_SURFACE, GRPC_STATUS_UNIMPLEMENTED,
1496
+ error_msg);
1531
1497
  }
1532
1498
  gpr_free(error_msg);
1533
1499
 
@@ -1557,8 +1523,8 @@ static void validate_filtered_metadata(grpc_exec_ctx* exec_ctx,
1557
1523
  gpr_asprintf(&error_msg, "Invalid compression algorithm value '%d'.",
1558
1524
  algo);
1559
1525
  gpr_log(GPR_ERROR, "%s", error_msg);
1560
- cancel_with_status(exec_ctx, call, STATUS_FROM_SURFACE,
1561
- GRPC_STATUS_UNIMPLEMENTED, error_msg);
1526
+ cancel_with_status(call, STATUS_FROM_SURFACE, GRPC_STATUS_UNIMPLEMENTED,
1527
+ error_msg);
1562
1528
  } else if (grpc_compression_options_is_algorithm_enabled(
1563
1529
  &compression_options, algo) == 0) {
1564
1530
  /* check if algorithm is supported by current channel config */
@@ -1567,8 +1533,8 @@ static void validate_filtered_metadata(grpc_exec_ctx* exec_ctx,
1567
1533
  gpr_asprintf(&error_msg, "Compression algorithm '%s' is disabled.",
1568
1534
  algo_name);
1569
1535
  gpr_log(GPR_ERROR, "%s", error_msg);
1570
- cancel_with_status(exec_ctx, call, STATUS_FROM_SURFACE,
1571
- GRPC_STATUS_UNIMPLEMENTED, error_msg);
1536
+ cancel_with_status(call, STATUS_FROM_SURFACE, GRPC_STATUS_UNIMPLEMENTED,
1537
+ error_msg);
1572
1538
  } else {
1573
1539
  call->incoming_compression_algorithm = algo;
1574
1540
  }
@@ -1591,34 +1557,31 @@ static void validate_filtered_metadata(grpc_exec_ctx* exec_ctx,
1591
1557
  }
1592
1558
  }
1593
1559
 
1594
- static void add_batch_error(grpc_exec_ctx* exec_ctx, batch_control* bctl,
1595
- grpc_error* error, bool has_cancelled) {
1560
+ static void add_batch_error(batch_control* bctl, grpc_error* error,
1561
+ bool has_cancelled) {
1596
1562
  if (error == GRPC_ERROR_NONE) return;
1597
1563
  int idx = (int)gpr_atm_full_fetch_add(&bctl->num_errors, 1);
1598
1564
  if (idx == 0 && !has_cancelled) {
1599
- cancel_with_error(exec_ctx, bctl->call, STATUS_FROM_CORE,
1600
- GRPC_ERROR_REF(error));
1565
+ cancel_with_error(bctl->call, STATUS_FROM_CORE, GRPC_ERROR_REF(error));
1601
1566
  }
1602
1567
  bctl->errors[idx] = error;
1603
1568
  }
1604
1569
 
1605
- static void receiving_initial_metadata_ready(grpc_exec_ctx* exec_ctx,
1606
- void* bctlp, grpc_error* error) {
1570
+ static void receiving_initial_metadata_ready(void* bctlp, grpc_error* error) {
1607
1571
  batch_control* bctl = (batch_control*)bctlp;
1608
1572
  grpc_call* call = bctl->call;
1609
1573
 
1610
- GRPC_CALL_COMBINER_STOP(exec_ctx, &call->call_combiner,
1611
- "recv_initial_metadata_ready");
1574
+ GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_initial_metadata_ready");
1612
1575
 
1613
- add_batch_error(exec_ctx, bctl, GRPC_ERROR_REF(error), false);
1576
+ add_batch_error(bctl, GRPC_ERROR_REF(error), false);
1614
1577
  if (error == GRPC_ERROR_NONE) {
1615
1578
  grpc_metadata_batch* md =
1616
1579
  &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
1617
- recv_initial_filter(exec_ctx, call, md);
1580
+ recv_initial_filter(call, md);
1618
1581
 
1619
1582
  /* TODO(ctiller): this could be moved into recv_initial_filter now */
1620
1583
  GPR_TIMER_BEGIN("validate_filtered_metadata", 0);
1621
- validate_filtered_metadata(exec_ctx, bctl);
1584
+ validate_filtered_metadata(bctl);
1622
1585
  GPR_TIMER_END("validate_filtered_metadata", 0);
1623
1586
 
1624
1587
  if (md->deadline != GRPC_MILLIS_INF_FUTURE && !call->is_client) {
@@ -1651,28 +1614,25 @@ static void receiving_initial_metadata_ready(grpc_exec_ctx* exec_ctx,
1651
1614
  }
1652
1615
  }
1653
1616
  if (saved_rsr_closure != nullptr) {
1654
- GRPC_CLOSURE_RUN(exec_ctx, saved_rsr_closure, GRPC_ERROR_REF(error));
1617
+ GRPC_CLOSURE_RUN(saved_rsr_closure, GRPC_ERROR_REF(error));
1655
1618
  }
1656
1619
 
1657
- finish_batch_step(exec_ctx, bctl);
1620
+ finish_batch_step(bctl);
1658
1621
  }
1659
1622
 
1660
- static void finish_batch(grpc_exec_ctx* exec_ctx, void* bctlp,
1661
- grpc_error* error) {
1623
+ static void finish_batch(void* bctlp, grpc_error* error) {
1662
1624
  batch_control* bctl = (batch_control*)bctlp;
1663
1625
  grpc_call* call = bctl->call;
1664
- GRPC_CALL_COMBINER_STOP(exec_ctx, &call->call_combiner, "on_complete");
1665
- add_batch_error(exec_ctx, bctl, GRPC_ERROR_REF(error), false);
1666
- finish_batch_step(exec_ctx, bctl);
1626
+ GRPC_CALL_COMBINER_STOP(&call->call_combiner, "on_complete");
1627
+ add_batch_error(bctl, GRPC_ERROR_REF(error), false);
1628
+ finish_batch_step(bctl);
1667
1629
  }
1668
1630
 
1669
- static void free_no_op_completion(grpc_exec_ctx* exec_ctx, void* p,
1670
- grpc_cq_completion* completion) {
1631
+ static void free_no_op_completion(void* p, grpc_cq_completion* completion) {
1671
1632
  gpr_free(completion);
1672
1633
  }
1673
1634
 
1674
- static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
1675
- grpc_call* call, const grpc_op* ops,
1635
+ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
1676
1636
  size_t nops, void* notify_tag,
1677
1637
  int is_notify_tag_closure) {
1678
1638
  size_t i;
@@ -1690,11 +1650,10 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
1690
1650
  if (!is_notify_tag_closure) {
1691
1651
  GPR_ASSERT(grpc_cq_begin_op(call->cq, notify_tag));
1692
1652
  grpc_cq_end_op(
1693
- exec_ctx, call->cq, notify_tag, GRPC_ERROR_NONE,
1694
- free_no_op_completion, nullptr,
1653
+ call->cq, notify_tag, GRPC_ERROR_NONE, free_no_op_completion, nullptr,
1695
1654
  (grpc_cq_completion*)gpr_malloc(sizeof(grpc_cq_completion)));
1696
1655
  } else {
1697
- GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure*)notify_tag, GRPC_ERROR_NONE);
1656
+ GRPC_CLOSURE_SCHED((grpc_closure*)notify_tag, GRPC_ERROR_NONE);
1698
1657
  }
1699
1658
  error = GRPC_CALL_OK;
1700
1659
  goto done;
@@ -1794,7 +1753,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
1794
1753
  stream_op->send_initial_metadata = true;
1795
1754
  call->sent_initial_metadata = true;
1796
1755
  if (!prepare_application_metadata(
1797
- exec_ctx, call, (int)op->data.send_initial_metadata.count,
1756
+ call, (int)op->data.send_initial_metadata.count,
1798
1757
  op->data.send_initial_metadata.metadata, 0, call->is_client,
1799
1758
  &call->compression_md, (int)additional_metadata_count)) {
1800
1759
  error = GRPC_CALL_ERROR_INVALID_METADATA;
@@ -1888,16 +1847,17 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
1888
1847
  GPR_ASSERT(call->send_extra_metadata_count == 0);
1889
1848
  call->send_extra_metadata_count = 1;
1890
1849
  call->send_extra_metadata[0].md = grpc_channel_get_reffed_status_elem(
1891
- exec_ctx, call->channel, op->data.send_status_from_server.status);
1850
+ call->channel, op->data.send_status_from_server.status);
1892
1851
  {
1893
1852
  grpc_error* override_error = GRPC_ERROR_NONE;
1894
1853
  if (op->data.send_status_from_server.status != GRPC_STATUS_OK) {
1895
- override_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1896
- "Error from server send status");
1854
+ override_error =
1855
+ error_from_status(op->data.send_status_from_server.status,
1856
+ "Returned non-ok status");
1897
1857
  }
1898
1858
  if (op->data.send_status_from_server.status_details != nullptr) {
1899
1859
  call->send_extra_metadata[1].md = grpc_mdelem_from_slices(
1900
- exec_ctx, GRPC_MDSTR_GRPC_MESSAGE,
1860
+ GRPC_MDSTR_GRPC_MESSAGE,
1901
1861
  grpc_slice_ref_internal(
1902
1862
  *op->data.send_status_from_server.status_details));
1903
1863
  call->send_extra_metadata_count++;
@@ -1908,16 +1868,15 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
1908
1868
  grpc_slice_from_copied_string(msg));
1909
1869
  gpr_free(msg);
1910
1870
  }
1911
- set_status_from_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE,
1912
- override_error);
1871
+ set_status_from_error(call, STATUS_FROM_API_OVERRIDE, override_error);
1913
1872
  }
1914
1873
  if (!prepare_application_metadata(
1915
- exec_ctx, call,
1874
+ call,
1916
1875
  (int)op->data.send_status_from_server.trailing_metadata_count,
1917
1876
  op->data.send_status_from_server.trailing_metadata, 1, 1,
1918
1877
  nullptr, 0)) {
1919
1878
  for (int n = 0; n < call->send_extra_metadata_count; n++) {
1920
- GRPC_MDELEM_UNREF(exec_ctx, call->send_extra_metadata[n].md);
1879
+ GRPC_MDELEM_UNREF(call->send_extra_metadata[n].md);
1921
1880
  }
1922
1881
  call->send_extra_metadata_count = 0;
1923
1882
  error = GRPC_CALL_ERROR_INVALID_METADATA;
@@ -2046,7 +2005,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
2046
2005
  stream_op->on_complete = &bctl->finish_batch;
2047
2006
  gpr_atm_rel_store(&call->any_ops_sent_atm, 1);
2048
2007
 
2049
- execute_batch(exec_ctx, call, stream_op, &bctl->start_batch);
2008
+ execute_batch(call, stream_op, &bctl->start_batch);
2050
2009
 
2051
2010
  done:
2052
2011
  GPR_TIMER_END("grpc_call_start_batch", 0);
@@ -2056,15 +2015,15 @@ done_with_error:
2056
2015
  /* reverse any mutations that occured */
2057
2016
  if (stream_op->send_initial_metadata) {
2058
2017
  call->sent_initial_metadata = false;
2059
- grpc_metadata_batch_clear(exec_ctx, &call->metadata_batch[0][0]);
2018
+ grpc_metadata_batch_clear(&call->metadata_batch[0][0]);
2060
2019
  }
2061
2020
  if (stream_op->send_message) {
2062
2021
  call->sending_message = false;
2063
- grpc_byte_stream_destroy(exec_ctx, &call->sending_stream.base);
2022
+ grpc_byte_stream_destroy(&call->sending_stream.base);
2064
2023
  }
2065
2024
  if (stream_op->send_trailing_metadata) {
2066
2025
  call->sent_final_op = false;
2067
- grpc_metadata_batch_clear(exec_ctx, &call->metadata_batch[0][1]);
2026
+ grpc_metadata_batch_clear(&call->metadata_batch[0][1]);
2068
2027
  }
2069
2028
  if (stream_op->recv_initial_metadata) {
2070
2029
  call->received_initial_metadata = false;
@@ -2080,7 +2039,7 @@ done_with_error:
2080
2039
 
2081
2040
  grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
2082
2041
  size_t nops, void* tag, void* reserved) {
2083
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
2042
+ grpc_core::ExecCtx exec_ctx;
2084
2043
  grpc_call_error err;
2085
2044
 
2086
2045
  GRPC_API_TRACE(
@@ -2091,19 +2050,17 @@ grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
2091
2050
  if (reserved != nullptr) {
2092
2051
  err = GRPC_CALL_ERROR;
2093
2052
  } else {
2094
- err = call_start_batch(&exec_ctx, call, ops, nops, tag, 0);
2053
+ err = call_start_batch(call, ops, nops, tag, 0);
2095
2054
  }
2096
2055
 
2097
- grpc_exec_ctx_finish(&exec_ctx);
2098
2056
  return err;
2099
2057
  }
2100
2058
 
2101
- grpc_call_error grpc_call_start_batch_and_execute(grpc_exec_ctx* exec_ctx,
2102
- grpc_call* call,
2059
+ grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
2103
2060
  const grpc_op* ops,
2104
2061
  size_t nops,
2105
2062
  grpc_closure* closure) {
2106
- return call_start_batch(exec_ctx, call, ops, nops, closure, 1);
2063
+ return call_start_batch(call, ops, nops, closure, 1);
2107
2064
  }
2108
2065
 
2109
2066
  void grpc_call_context_set(grpc_call* call, grpc_context_index elem,