Merge branch 'pid++' of github.com:ctiller/grpc into flow++

pull/12915/head
Craig Tiller 7 years ago
commit 72c9ba8457
  1. 60
      doc/core/moving-to-c++.md
  2. 2
      src/core/ext/census/base_resources.h
  3. 2
      src/core/ext/census/census_interface.h
  4. 2
      src/core/ext/census/census_log.h
  5. 2
      src/core/ext/census/hash_table.h
  6. 2
      src/core/ext/census/mlog.h
  7. 2
      src/core/ext/census/resource.h
  8. 2
      src/core/ext/census/trace_context.h
  9. 2
      src/core/ext/census/trace_propagation.h
  10. 2
      src/core/ext/census/tracing.h
  11. 2
      src/core/ext/census/window_stats.h
  12. 2
      src/core/ext/filters/client_channel/client_channel.h
  13. 2
      src/core/ext/filters/client_channel/client_channel_factory.h
  14. 2
      src/core/ext/filters/client_channel/connector.h
  15. 2
      src/core/ext/filters/client_channel/http_connect_handshaker.h
  16. 2
      src/core/ext/filters/client_channel/http_proxy.h
  17. 2
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
  18. 2
      src/core/ext/filters/client_channel/lb_policy_factory.h
  19. 2
      src/core/ext/filters/client_channel/lb_policy_registry.h
  20. 2
      src/core/ext/filters/client_channel/parse_address.h
  21. 2
      src/core/ext/filters/client_channel/proxy_mapper.h
  22. 2
      src/core/ext/filters/client_channel/proxy_mapper_registry.h
  23. 2
      src/core/ext/filters/client_channel/resolver_factory.h
  24. 2
      src/core/ext/filters/client_channel/resolver_registry.h
  25. 2
      src/core/ext/filters/client_channel/retry_throttle.h
  26. 2
      src/core/ext/filters/client_channel/subchannel_index.h
  27. 2
      src/core/ext/filters/client_channel/uri_parser.h
  28. 2
      src/core/ext/filters/deadline/deadline_filter.h
  29. 2
      src/core/ext/filters/workarounds/workaround_utils.h
  30. 2
      src/core/ext/transport/chttp2/alpn/alpn.h
  31. 2
      src/core/ext/transport/chttp2/server/chttp2_server.h
  32. 2
      src/core/ext/transport/chttp2/transport/bin_decoder.h
  33. 2
      src/core/ext/transport/chttp2/transport/bin_encoder.h
  34. 2
      src/core/ext/transport/chttp2/transport/frame_data.h
  35. 2
      src/core/ext/transport/chttp2/transport/frame_goaway.h
  36. 2
      src/core/ext/transport/chttp2/transport/frame_ping.h
  37. 2
      src/core/ext/transport/chttp2/transport/frame_rst_stream.h
  38. 2
      src/core/ext/transport/chttp2/transport/frame_settings.h
  39. 2
      src/core/ext/transport/chttp2/transport/frame_window_update.h
  40. 2
      src/core/ext/transport/chttp2/transport/hpack_encoder.h
  41. 2
      src/core/ext/transport/chttp2/transport/hpack_parser.h
  42. 2
      src/core/ext/transport/chttp2/transport/http2_settings.h
  43. 2
      src/core/ext/transport/chttp2/transport/incoming_metadata.h
  44. 2
      src/core/ext/transport/chttp2/transport/stream_map.h
  45. 2
      src/core/lib/channel/channel_args.h
  46. 2
      src/core/lib/channel/connected_channel.h
  47. 2
      src/core/lib/channel/handshaker.h
  48. 2
      src/core/lib/channel/handshaker_factory.h
  49. 2
      src/core/lib/channel/handshaker_registry.h
  50. 2
      src/core/lib/compression/algorithm_metadata.h
  51. 2
      src/core/lib/compression/message_compress.h
  52. 2
      src/core/lib/http/format_request.h
  53. 2
      src/core/lib/http/httpcli.h
  54. 2
      src/core/lib/http/parser.h
  55. 2
      src/core/lib/iomgr/endpoint.h
  56. 2
      src/core/lib/iomgr/endpoint_pair.h
  57. 2
      src/core/lib/iomgr/error_internal.h
  58. 2
      src/core/lib/iomgr/ev_epoll1_linux.h
  59. 2
      src/core/lib/iomgr/ev_epollex_linux.h
  60. 2
      src/core/lib/iomgr/ev_poll_posix.h
  61. 2
      src/core/lib/iomgr/ev_posix.h
  62. 2
      src/core/lib/iomgr/executor.h
  63. 9
      src/core/lib/iomgr/iocp_windows.cc
  64. 2
      src/core/lib/iomgr/iocp_windows.h
  65. 2
      src/core/lib/iomgr/iomgr.h
  66. 2
      src/core/lib/iomgr/iomgr_internal.h
  67. 2
      src/core/lib/iomgr/is_epollexclusive_available.h
  68. 2
      src/core/lib/iomgr/lockfree_event.h
  69. 2
      src/core/lib/iomgr/network_status_tracker.h
  70. 2
      src/core/lib/iomgr/polling_entity.h
  71. 2
      src/core/lib/iomgr/pollset_set.h
  72. 2
      src/core/lib/iomgr/pollset_uv.h
  73. 2
      src/core/lib/iomgr/pollset_windows.h
  74. 2
      src/core/lib/iomgr/resolve_address.h
  75. 2
      src/core/lib/iomgr/resource_quota.h
  76. 2
      src/core/lib/iomgr/sockaddr_utils.h
  77. 2
      src/core/lib/iomgr/socket_utils.h
  78. 2
      src/core/lib/iomgr/socket_utils_posix.h
  79. 2
      src/core/lib/iomgr/socket_windows.h
  80. 2
      src/core/lib/iomgr/tcp_client.h
  81. 2
      src/core/lib/iomgr/tcp_client_posix.h
  82. 2
      src/core/lib/iomgr/tcp_posix.h
  83. 2
      src/core/lib/iomgr/tcp_server.h
  84. 2
      src/core/lib/iomgr/tcp_server_utils_posix.h
  85. 2
      src/core/lib/iomgr/tcp_uv.h
  86. 2
      src/core/lib/iomgr/time_averaged_stats.h
  87. 2
      src/core/lib/iomgr/timer_heap.h
  88. 2
      src/core/lib/iomgr/timer_manager.h
  89. 2
      src/core/lib/iomgr/udp_server.h
  90. 2
      src/core/lib/iomgr/unix_sockets_posix.h
  91. 2
      src/core/lib/json/json.h
  92. 2
      src/core/lib/json/json_reader.h
  93. 2
      src/core/lib/json/json_writer.h
  94. 2
      src/core/lib/security/credentials/fake/fake_credentials.h
  95. 2
      src/core/lib/security/credentials/jwt/jwt_credentials.h
  96. 2
      src/core/lib/security/credentials/oauth2/oauth2_credentials.h
  97. 2
      src/core/lib/security/transport/lb_targets_info.h
  98. 2
      src/core/lib/security/transport/secure_endpoint.h
  99. 2
      src/core/lib/security/transport/security_handshaker.h
  100. 2
      src/core/lib/security/transport/tsi_error.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,60 @@
# Moving gRPC core to C++
October 2017
ctiller, markdroth, vjpai
## Background and Goal
gRPC core was originally written in C89 for several reasons
(possibility of kernel integration, ease of wrapping, compiler
support, etc). Over time, this was changed to C99 as all relevant
compilers in active use came to support C99 effectively.
[Now, gRPC core is C++](https://github.com/grpc/proposal/blob/master/L6-allow-c%2B%2B-in-grpc-core.md)
(although the code is still idiomatically C code) with C linkage for
public functions. Throughout all of these transitions, the public
header files are committed to remain in C89.
The goal now is to make the gRPC core implementation true idiomatic
C++ compatible with
[Google's C++ style guide](https://google.github.io/styleguide/cppguide.html).
## Constraints
- No use of standard library
- Standard library makes wrapping difficult/impossible and also reduces platform portability
- This takes precedence over using C++ style guide
- But lambdas are ok
- As are third-party libraries that meet our build requirements (such as many parts of abseil)
- There will be some C++ features that don't work
- `new` and `delete`
- pure virtual functions are not allowed because the message that prints out "Pure Virtual Function called" is part of the standard library
- Make a `#define GRPC_ABSTRACT {GPR_ASSERT(false);}` instead of `= 0;`
- The sanity for making sure that we don't depend on libstdc++ is that at least some tests should explicitly not include it
- Most tests can migrate to use gtest
- There are tremendous # of code paths that can now be exposed to unit tests because of the use of gtest and C++
- But at least some tests should not use gtest
## Roadmap
- What should be the phases of getting code converted to idiomatic C++
- Opportunistically do leaf code that other parts don't depend on
- Spend a little time deciding how to do non-leaf stuff that isn't central or polymorphic (e.g., timer, call combiner)
- For big central or polymorphic interfaces, actually do an API review (for things like transport, filter API, endpoint, closure, exec_ctx, ...) .
- Core internal changes don't need a gRFC, but core surface changes do
- But an API review should include at least a PR with the header change and tests to use it before it gets used more broadly
- iomgr polling for POSIX is a gray area whether it's a leaf or central
- What is the schedule?
- In Q4 2017, if some stuff happens opportunistically, great; otherwise ¯\\\_(ツ)\_/¯
- More updates as team time becomes available and committed to this project
## Implications for C++ API and wrapped languages
- For C++ structs, switch to `using` when possible (e.g., Slice,
ByteBuffer, ...)
- The C++ API implementation might directly start using
`grpc_transport_stream_op_batch` rather than the core surface `grpc_op`.
- Can we get wrapped languages to a point where we can statically link C++? This will take a year in probability but that would allow the use of `std::`
- Are there other environments that don't support std library, like maybe Android NDK?
- Probably, that might push things out to 18 months

@ -29,4 +29,4 @@ void define_base_resources();
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H */
#endif /* GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H */

@ -66,4 +66,4 @@ void census_tracing_end_op(census_op_id op_id);
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */

@ -81,4 +81,4 @@ int census_log_out_of_space_count(void);
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */

@ -121,4 +121,4 @@ uint64_t census_ht_for_all(const census_ht *ht, census_ht_itr_cb);
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */
#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */

@ -85,4 +85,4 @@ int64_t census_log_out_of_space_count(void);
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */
#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */

@ -53,4 +53,4 @@ int32_t define_resource(const resource *base);
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_RESOURCE_H */
#endif /* GRPC_CORE_EXT_CENSUS_RESOURCE_H */

@ -61,4 +61,4 @@ bool decode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H */
#endif /* GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H */

@ -53,4 +53,4 @@ size_t http_format_to_trace_span_context(const char *buf, size_t buf_size,
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H */
#endif /* GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H */

@ -114,4 +114,4 @@ void trace_end_span(const trace_status *status, trace_span_context *span_ctxt);
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_TRACING_H */
#endif /* GRPC_CORE_EXT_CENSUS_TRACING_H */

@ -163,4 +163,4 @@ void census_window_stats_destroy(struct census_window_stats *wstats);
}
#endif
#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */
#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */

@ -60,4 +60,4 @@ grpc_subchannel_call *grpc_client_channel_get_subchannel_call(
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */

@ -82,4 +82,4 @@ grpc_arg grpc_client_channel_factory_create_channel_arg(
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */

@ -78,4 +78,4 @@ void grpc_connector_shutdown(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */

@ -39,4 +39,4 @@ void grpc_http_connect_register_handshaker_factory();
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */

@ -29,4 +29,4 @@ void grpc_register_http_proxy_mapper();
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */

@ -34,4 +34,4 @@ grpc_lb_policy_factory *grpc_glb_lb_factory_create();
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H */

@ -138,4 +138,4 @@ grpc_lb_policy *grpc_lb_policy_factory_create_lb_policy(
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */

@ -45,4 +45,4 @@ grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name,
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */

@ -53,4 +53,4 @@ bool grpc_parse_ipv6_hostport(const char *hostport, grpc_resolved_address *addr,
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */

@ -79,4 +79,4 @@ void grpc_proxy_mapper_destroy(grpc_proxy_mapper* mapper);
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */

@ -49,4 +49,4 @@ bool grpc_proxy_mappers_map_address(grpc_exec_ctx* exec_ctx,
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */

@ -75,4 +75,4 @@ char *grpc_resolver_factory_get_default_authority(
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */

@ -74,4 +74,4 @@ char *grpc_resolver_factory_add_default_prefix_if_needed(
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */

@ -55,4 +55,4 @@ grpc_server_retry_throttle_data* grpc_retry_throttle_map_get_data_for_server(
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */

@ -86,4 +86,4 @@ void grpc_subchannel_index_test_only_set_force_creation(bool force_creation);
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */

@ -55,4 +55,4 @@ void grpc_uri_destroy(grpc_uri *uri);
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */

@ -98,4 +98,4 @@ extern const grpc_channel_filter grpc_server_deadline_filter;
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */
#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */

@ -42,4 +42,4 @@ void grpc_register_workaround(uint32_t id, user_agent_parser parser);
}
#endif
#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */
#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */

@ -39,4 +39,4 @@ const char *grpc_chttp2_get_alpn_version_index(size_t i);
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */

@ -37,4 +37,4 @@ grpc_error *grpc_chttp2_server_add_port(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */

@ -57,4 +57,4 @@ grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */

@ -44,4 +44,4 @@ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(grpc_slice input);
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */

@ -88,4 +88,4 @@ grpc_error *grpc_deframe_unprocessed_incoming_frames(
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */

@ -68,4 +68,4 @@ void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */

@ -49,4 +49,4 @@ void grpc_set_disable_ping_ack(bool disable_ping_ack);
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */

@ -48,4 +48,4 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */

@ -66,4 +66,4 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */

@ -47,4 +47,4 @@ grpc_error *grpc_chttp2_window_update_parser_parse(
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */

@ -99,4 +99,4 @@ void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */

@ -119,4 +119,4 @@ grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */

@ -64,4 +64,4 @@ extern const grpc_chttp2_setting_parameters
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */

@ -53,4 +53,4 @@ void grpc_chttp2_incoming_metadata_buffer_set_deadline(
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */

@ -73,4 +73,4 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map,
}
#endif
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */

@ -157,4 +157,4 @@ grpc_arg grpc_channel_arg_pointer_create(char *name, void *value,
}
#endif
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */

@ -38,4 +38,4 @@ grpc_stream *grpc_connected_channel_get_stream(grpc_call_element *elem);
}
#endif
#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */
#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */

@ -172,4 +172,4 @@ void grpc_handshake_manager_pending_list_shutdown_all(
}
#endif
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */

@ -56,4 +56,4 @@ void grpc_handshaker_factory_destroy(
}
#endif
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_FACTORY_H */
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_FACTORY_H */

@ -53,4 +53,4 @@ void grpc_handshakers_add(grpc_exec_ctx* exec_ctx,
}
#endif
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_REGISTRY_H */
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_REGISTRY_H */

@ -57,4 +57,4 @@ grpc_stream_compression_algorithm grpc_stream_compression_algorithm_from_slice(
}
#endif
#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */
#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */

@ -44,4 +44,4 @@ int grpc_msg_decompress(grpc_exec_ctx* exec_ctx,
}
#endif
#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */
#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */

@ -37,4 +37,4 @@ grpc_slice grpc_httpcli_format_connect_request(
}
#endif
#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */
#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */

@ -131,4 +131,4 @@ void grpc_httpcli_set_override(grpc_httpcli_get_override get,
}
#endif
#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */
#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */

@ -117,4 +117,4 @@ extern grpc_tracer_flag grpc_http1_trace;
}
#endif
#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */
#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */

@ -103,4 +103,4 @@ struct grpc_endpoint {
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */
#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */

@ -37,4 +37,4 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char *name,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */
#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */

@ -65,4 +65,4 @@ bool grpc_error_is_special(grpc_error *err);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */

@ -34,4 +34,4 @@ const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */

@ -33,4 +33,4 @@ const grpc_event_engine_vtable *grpc_init_epollex_linux(
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */

@ -32,4 +32,4 @@ const grpc_event_engine_vtable *grpc_init_poll_cv_posix(bool explicit_request);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */
#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */

@ -166,4 +166,4 @@ const grpc_event_engine_vtable *grpc_get_event_engine_test_only();
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */
#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */

@ -53,4 +53,4 @@ void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool enable);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */
#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */

@ -21,6 +21,7 @@
#ifdef GRPC_WINSOCK_SOCKET
#include <winsock2.h>
#include <limits>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -43,11 +44,14 @@ static HANDLE g_iocp;
static DWORD deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
grpc_millis deadline) {
gpr_timespec timeout;
if (deadline == GRPC_MILLIS_INF_FUTURE) {
return INFINITE;
}
return (DWORD)GPR_MAX(0, deadline - grpc_exec_ctx_now(exec_ctx));
grpc_millis now = grpc_exec_ctx_now(exec_ctx);
if (deadline < now) return 0;
grpc_millis timeout = deadline - now;
if (timeout > std::numeric_limits<DWORD>::max()) return INFINITE;
return static_cast<DWORD>(deadline - now);
}
grpc_iocp_work_status grpc_iocp_work(grpc_exec_ctx *exec_ctx,
@ -63,6 +67,7 @@ grpc_iocp_work_status grpc_iocp_work(grpc_exec_ctx *exec_ctx,
success =
GetQueuedCompletionStatus(g_iocp, &bytes, &completion_key, &overlapped,
deadline_to_millis_timeout(exec_ctx, deadline));
grpc_exec_ctx_invalidate_now(exec_ctx);
if (success == 0 && overlapped == NULL) {
return GRPC_IOCP_WORK_TIMEOUT;
}

@ -45,4 +45,4 @@ void grpc_iocp_add_socket(grpc_winsocket *);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */
#endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */

@ -40,4 +40,4 @@ void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */

@ -48,4 +48,4 @@ bool grpc_iomgr_abort_on_leaks(void);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */

@ -31,4 +31,4 @@ bool grpc_is_epollexclusive_available(void);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */
#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */

@ -45,4 +45,4 @@ void grpc_lfev_set_ready(grpc_exec_ctx *exec_ctx, gpr_atm *state,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */
#endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */

@ -35,4 +35,4 @@ void grpc_network_status_shutdown_all_endpoints();
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H */
#endif /* GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H */

@ -72,4 +72,4 @@ void grpc_polling_entity_del_from_pollset_set(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */
#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */

@ -52,4 +52,4 @@ void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */

@ -32,4 +32,4 @@ void grpc_pollset_global_shutdown(void);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */

@ -68,4 +68,4 @@ void grpc_pollset_global_shutdown(void);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */

@ -60,4 +60,4 @@ extern grpc_error *(*grpc_blocking_resolve_address)(
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */
#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */

@ -158,4 +158,4 @@ grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */
#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */

@ -85,4 +85,4 @@ int grpc_sockaddr_get_family(const grpc_resolved_address *resolved_addr);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */
#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */

@ -32,4 +32,4 @@ const char *grpc_inet_ntop(int af, const void *src, char *dst, size_t size);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */

@ -137,4 +137,4 @@ grpc_error *grpc_create_dualstack_socket_using_factory(
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */

@ -115,4 +115,4 @@ void grpc_socket_become_ready(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */

@ -45,4 +45,4 @@ void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *on_connect,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */

@ -35,4 +35,4 @@ grpc_endpoint *grpc_tcp_client_create_from_fd(
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */

@ -61,4 +61,4 @@ void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */
#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */

@ -106,4 +106,4 @@ void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */
#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */

@ -125,4 +125,4 @@ bool grpc_tcp_server_have_ifaddrs(void);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */
#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */

@ -50,4 +50,4 @@ grpc_endpoint *grpc_tcp_create(uv_tcp_t *handle,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TCP_UV_H */
#endif /* GRPC_CORE_LIB_IOMGR_TCP_UV_H */

@ -78,4 +78,4 @@ double grpc_time_averaged_stats_update_average(grpc_time_averaged_stats* stats);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H */
#endif /* GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H */

@ -47,4 +47,4 @@ int grpc_timer_heap_is_empty(grpc_timer_heap *heap);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */

@ -42,4 +42,4 @@ void grpc_timer_manager_tick(void);
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */

@ -81,4 +81,4 @@ void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *server,
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */
#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */

@ -46,4 +46,4 @@ char *grpc_sockaddr_to_uri_unix_if_possible(
}
#endif
#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */
#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */

@ -78,4 +78,4 @@ void grpc_json_destroy(grpc_json* json);
}
#endif
#endif /* GRPC_CORE_LIB_JSON_JSON_H */
#endif /* GRPC_CORE_LIB_JSON_JSON_H */

@ -150,4 +150,4 @@ int grpc_json_reader_is_complete(grpc_json_reader *reader);
}
#endif
#endif /* GRPC_CORE_LIB_JSON_JSON_READER_H */
#endif /* GRPC_CORE_LIB_JSON_JSON_READER_H */

@ -87,4 +87,4 @@ void grpc_json_writer_value_string(grpc_json_writer *writer,
}
#endif
#endif /* GRPC_CORE_LIB_JSON_JSON_WRITER_H */
#endif /* GRPC_CORE_LIB_JSON_JSON_WRITER_H */

@ -64,4 +64,4 @@ typedef struct {
}
#endif
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */

@ -53,4 +53,4 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
}
#endif
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */

@ -110,4 +110,4 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
}
#endif
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */

@ -37,4 +37,4 @@ grpc_slice_hash_table *grpc_lb_targets_info_find_in_args(
}
#endif
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_LB_TARGETS_INFO_H */
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_LB_TARGETS_INFO_H */

@ -44,4 +44,4 @@ grpc_endpoint *grpc_secure_endpoint_create(
}
#endif
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */

@ -39,4 +39,4 @@ void grpc_security_register_handshaker_factories();
}
#endif
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */

@ -32,4 +32,4 @@ grpc_error *grpc_set_tsi_error_result(grpc_error *error, tsi_result result);
}
#endif
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save