From c8159eabdf222a444839f361e7d75b5f2f7132e2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 18 May 2022 07:16:53 -0700 Subject: [PATCH] [iwyu] grpc++ (#29610) * [iwyu] grpc++ * fix * fix * Automated change: Fix sanity tests * fix * fix * fix * [iwyu] Better script * eliminate race * fixes * Automated change: Fix sanity tests Co-authored-by: ctiller --- BUILD | 83 ++++++++++++++++++- CMakeLists.txt | 62 ++++++++++++++ bazel/grpc_deps.bzl | 5 ++ build_autogenerated.yaml | 62 ++++++++++++++ src/cpp/client/channel_cc.cc | 19 +++-- src/cpp/client/channel_test_peer.cc | 1 - src/cpp/client/client_callback.cc | 2 + src/cpp/client/client_context.cc | 18 +++- src/cpp/client/client_interceptor.cc | 3 +- src/cpp/client/create_channel.cc | 7 ++ src/cpp/client/create_channel_internal.cc | 2 - src/cpp/client/create_channel_internal.h | 5 +- src/cpp/client/create_channel_posix.cc | 9 +- src/cpp/client/insecure_credentials.cc | 8 +- src/cpp/client/secure_credentials.cc | 19 ++++- src/cpp/client/secure_credentials.h | 15 +++- src/cpp/client/xds_credentials.cc | 7 ++ src/cpp/codegen/codegen_init.cc | 2 +- src/cpp/common/alarm.cc | 12 ++- src/cpp/common/alts_context.cc | 12 ++- src/cpp/common/alts_util.cc | 15 +++- src/cpp/common/auth_property_iterator.cc | 3 + src/cpp/common/channel_arguments.cc | 9 +- src/cpp/common/channel_filter.cc | 8 +- src/cpp/common/channel_filter.h | 22 ++++- src/cpp/common/completion_queue_cc.cc | 11 ++- src/cpp/common/core_codegen.cc | 11 ++- .../common/insecure_create_auth_context.cc | 2 +- src/cpp/common/resource_quota_cc.cc | 5 ++ src/cpp/common/secure_auth_context.cc | 2 + src/cpp/common/secure_auth_context.h | 6 ++ src/cpp/common/secure_channel_arguments.cc | 9 +- src/cpp/common/secure_create_auth_context.cc | 3 +- src/cpp/common/tls_certificate_provider.cc | 6 +- src/cpp/common/tls_certificate_verifier.cc | 18 +++- src/cpp/common/tls_credentials_options.cc | 10 ++- src/cpp/common/validate_service_config.cc | 4 + src/cpp/common/version_cc.cc | 5 +- src/cpp/ext/filters/census/channel_filter.h | 5 +- src/cpp/ext/filters/census/client_filter.cc | 27 +++++- src/cpp/ext/filters/census/client_filter.h | 7 +- src/cpp/ext/filters/census/context.cc | 5 ++ src/cpp/ext/filters/census/context.h | 19 ++--- src/cpp/ext/filters/census/grpc_plugin.cc | 7 ++ src/cpp/ext/filters/census/grpc_plugin.h | 2 - src/cpp/ext/filters/census/measures.h | 2 - .../filters/census/open_census_call_tracer.h | 19 +++++ src/cpp/ext/filters/census/rpc_encoding.h | 4 +- src/cpp/ext/filters/census/server_filter.cc | 11 +++ src/cpp/ext/filters/census/server_filter.h | 19 ++++- src/cpp/ext/filters/census/views.cc | 4 + src/cpp/ext/proto_server_reflection.cc | 4 + src/cpp/ext/proto_server_reflection.h | 6 ++ src/cpp/ext/proto_server_reflection_plugin.cc | 2 +- src/cpp/server/admin/admin_services.cc | 3 - src/cpp/server/async_generic_service.cc | 1 + .../server/authorization_policy_provider.cc | 8 +- src/cpp/server/channel_argument_option.cc | 8 ++ src/cpp/server/channelz/channelz_service.cc | 5 +- src/cpp/server/channelz/channelz_service.h | 2 + .../channelz/channelz_service_plugin.cc | 6 +- src/cpp/server/create_default_thread_pool.cc | 1 + src/cpp/server/csds/csds.cc | 11 +-- src/cpp/server/csds/csds.h | 5 +- src/cpp/server/dynamic_thread_pool.cc | 3 - src/cpp/server/dynamic_thread_pool.h | 4 +- .../external_connection_acceptor_impl.cc | 3 + .../external_connection_acceptor_impl.h | 3 +- .../health/default_health_check_service.cc | 11 ++- .../health/default_health_check_service.h | 15 +++- ...lth_check_service_server_builder_option.cc | 7 ++ src/cpp/server/insecure_server_credentials.cc | 6 ++ src/cpp/server/load_reporter/constants.h | 1 + src/cpp/server/load_reporter/get_cpu_stats.h | 2 + .../load_reporter/get_cpu_stats_linux.cc | 2 + .../server/load_reporter/load_data_store.cc | 6 +- .../server/load_reporter/load_data_store.h | 11 ++- src/cpp/server/load_reporter/load_reporter.cc | 8 +- src/cpp/server/load_reporter/load_reporter.h | 15 +++- .../load_reporter_async_service_impl.cc | 9 ++ .../load_reporter_async_service_impl.h | 12 +++ ...reporting_service_server_builder_option.cc | 7 ++ ...reporting_service_server_builder_plugin.cc | 3 + ..._reporting_service_server_builder_plugin.h | 7 ++ src/cpp/server/load_reporter/util.cc | 6 ++ src/cpp/server/orca/orca_service.cc | 25 ++++++ src/cpp/server/secure_server_credentials.cc | 13 ++- src/cpp/server/secure_server_credentials.h | 8 +- src/cpp/server/server_builder.cc | 28 ++++++- src/cpp/server/server_callback.cc | 2 + src/cpp/server/server_cc.cc | 44 ++++++++-- src/cpp/server/server_context.cc | 29 +++++-- src/cpp/server/server_posix.cc | 2 + src/cpp/server/xds_server_credentials.cc | 7 ++ src/cpp/thread_manager/thread_manager.cc | 5 +- src/cpp/thread_manager/thread_manager.h | 5 +- src/cpp/util/byte_buffer_cc.cc | 8 ++ src/cpp/util/core_stats.cc | 9 ++ src/cpp/util/status.cc | 1 + src/cpp/util/string_ref.cc | 2 + src/cpp/util/time_cc.cc | 7 +- .../src/cpp/common/version_cc.cc.template | 5 +- .../microbenchmarks/bm_opencensus_plugin.cc | 1 + .../load_reporter/load_data_store_test.cc | 1 + tools/dockerfile/grpc_iwyu/iwyu.sh | 24 ++++-- .../sanity/check_bad_dependencies.sh | 2 +- 106 files changed, 900 insertions(+), 164 deletions(-) diff --git a/BUILD b/BUILD index ac64c6fc1b4..f54262efa09 100644 --- a/BUILD +++ b/BUILD @@ -473,6 +473,17 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "gpr_public_hdrs", + hdrs = GPR_PUBLIC_HDRS, +) + +grpc_cc_library( + name = "grpc_public_hdrs", + hdrs = GRPC_PUBLIC_HDRS, + deps = ["gpr_public_hdrs"], +) + grpc_cc_library( name = "grpc++_public_hdrs", hdrs = GRPCXX_PUBLIC_HDRS, @@ -481,6 +492,7 @@ grpc_cc_library( "protobuf_headers", ], visibility = ["@grpc:public"], + deps = ["grpc_public_hdrs"], ) grpc_cc_library( @@ -549,11 +561,13 @@ grpc_cc_library( deps = [ "error", "gpr_base", + "gpr_codegen", "grpc", "grpc++_base", "grpc++_codegen_base", "grpc++_codegen_base_src", "grpc++_codegen_proto", + "grpc++_internal_hdrs_only", "grpc_base", "grpc_codegen", "grpc_credentials_util", @@ -562,6 +576,7 @@ grpc_cc_library( "json", "ref_counted_ptr", "slice", + "slice_refcount", ], ) @@ -658,6 +673,8 @@ grpc_cc_library( ], language = "c++", deps = [ + "gpr", + "grpc", "grpc++_internals", ], ) @@ -676,6 +693,8 @@ grpc_cc_library( ], visibility = ["@grpc:xds"], deps = [ + "gpr", + "grpc", "grpc++_internals", ], ) @@ -697,6 +716,7 @@ grpc_cc_library( "grpc++_codegen_base", "grpc++_codegen_base_src", "grpc++_codegen_proto", + "grpc_codegen", "grpc_insecure_credentials", "grpc_unsecure", ], @@ -730,6 +750,7 @@ grpc_cc_library( "include/grpcpp/security/alts_util.h", ], external_deps = [ + "absl/memory", "upb_lib", ], language = "c++", @@ -3886,6 +3907,9 @@ grpc_cc_library( deps = [ "gpr", "gpr_codegen", + "grpc", + "grpc++", + "grpc_codegen", "lb_server_load_reporting_filter", "lb_server_load_reporting_service_server_builder_plugin", "slice", @@ -3900,10 +3924,15 @@ grpc_cc_library( hdrs = [ "src/cpp/server/load_reporter/load_reporter_async_service_impl.h", ], - external_deps = ["absl/memory"], + external_deps = [ + "absl/memory", + "protobuf_headers", + ], language = "c++", deps = [ "gpr", + "gpr_codegen", + "grpc++", "lb_load_reporter", ], ) @@ -3938,6 +3967,7 @@ grpc_cc_library( external_deps = [ "opencensus-stats", "opencensus-tags", + "protobuf_headers", ], language = "c++", deps = [ @@ -5414,6 +5444,8 @@ grpc_cc_library( srcs = GRPCXX_SRCS, hdrs = GRPCXX_HDRS, external_deps = [ + "absl/base:core_headers", + "absl/strings", "absl/synchronization", "absl/memory", "upb_lib", @@ -5423,8 +5455,10 @@ grpc_cc_library( public_hdrs = GRPCXX_PUBLIC_HDRS, visibility = ["@grpc:alt_grpc++_base_legacy"], deps = [ + "channel_init", "config", "gpr_base", + "gpr_codegen", "grpc", "grpc++_codegen_base", "grpc++_codegen_base_src", @@ -5438,6 +5472,10 @@ grpc_cc_library( "grpc_transport_inproc", "iomgr_timer", "ref_counted", + "ref_counted_ptr", + "resource_quota", + "slice", + "time", "useful", ], ) @@ -5447,6 +5485,8 @@ grpc_cc_library( srcs = GRPCXX_SRCS, hdrs = GRPCXX_HDRS, external_deps = [ + "absl/base:core_headers", + "absl/strings", "absl/synchronization", "absl/memory", "upb_lib", @@ -5457,8 +5497,10 @@ grpc_cc_library( tags = ["avoid_dep"], visibility = ["@grpc:alt_grpc++_base_unsecure_legacy"], deps = [ + "channel_init", "config", "gpr_base", + "gpr_codegen", "grpc++_codegen_base", "grpc++_codegen_base_src", "grpc++_internal_hdrs_only", @@ -5473,6 +5515,10 @@ grpc_cc_library( "grpc_unsecure", "iomgr_timer", "ref_counted", + "ref_counted_ptr", + "resource_quota", + "slice", + "time", "useful", ], ) @@ -5572,6 +5618,7 @@ grpc_cc_library( language = "c++", deps = [ "grpc++_codegen_base", + "grpc++_public_hdrs", ], ) @@ -5616,6 +5663,9 @@ grpc_cc_library( hdrs = [ "src/cpp/ext/proto_server_reflection.h", ], + external_deps = [ + "protobuf_headers", + ], language = "c++", public_hdrs = [ "include/grpc++/ext/proto_server_reflection_plugin.h", @@ -5635,6 +5685,9 @@ grpc_cc_library( "src/cpp/server/orca/orca_service.cc", ], external_deps = [ + "absl/base:core_headers", + "absl/time", + "absl/types:optional", "upb_lib", ], language = "c++", @@ -5643,12 +5696,15 @@ grpc_cc_library( ], visibility = ["@grpc:public"], deps = [ + "gpr", "grpc++", "grpc++_codegen_base", + "grpc++_internal_hdrs_only", "grpc_base", "iomgr_timer", "protobuf_duration_upb", "ref_counted", + "ref_counted_ptr", "time", "xds_orca_service_upb", "xds_orca_upb", @@ -5665,6 +5721,9 @@ grpc_cc_library( hdrs = [ "src/cpp/server/channelz/channelz_service.h", ], + external_deps = [ + "protobuf_headers", + ], language = "c++", public_hdrs = [ "include/grpcpp/ext/channelz_service_plugin.h", @@ -5674,6 +5733,7 @@ grpc_cc_library( "gpr", "grpc", "grpc++", + "grpc++_config_proto", "//src/proto/grpc/channelz:channelz_proto", ], alwayslink = 1, @@ -5687,7 +5747,10 @@ grpc_cc_library( hdrs = [ "src/cpp/server/csds/csds.h", ], - external_deps = ["absl/status:statusor"], + external_deps = [ + "absl/status", + "absl/status:statusor", + ], language = "c++", deps = [ "gpr", @@ -5762,10 +5825,14 @@ grpc_cc_library( hdrs = [ "src/cpp/util/core_stats.h", ], + external_deps = [ + "protobuf_headers", + ], language = "c++", deps = [ "gpr", "grpc++", + "grpc_base", "//src/proto/grpc/core:stats_proto", ], ) @@ -5796,10 +5863,14 @@ grpc_cc_library( external_deps = [ "absl-base", "absl-time", + "absl/base:core_headers", + "absl/status", + "absl/types:optional", "absl/strings", "opencensus-trace", "opencensus-trace-context_util", "opencensus-trace-propagation", + "opencensus-trace-span_context", "opencensus-tags", "opencensus-tags-context_util", "opencensus-stats", @@ -5808,10 +5879,18 @@ grpc_cc_library( language = "c++", visibility = ["@grpc:grpc_opencensus_plugin"], deps = [ + "arena", "census", + "channel_stack_type", + "debug_location", + "gpr", "gpr_base", + "gpr_codegen", "grpc++", + "grpc++_base", "grpc_base", + "slice", + "slice_refcount", ], ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ee2b4a7f8c..68eb1183bc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3195,6 +3195,37 @@ foreach(_hdr include/grpc++/support/stub_options.h include/grpc++/support/sync_stream.h include/grpc++/support/time.h + include/grpc/byte_buffer.h + include/grpc/byte_buffer_reader.h + include/grpc/compression.h + include/grpc/fork.h + include/grpc/grpc.h + include/grpc/grpc_posix.h + include/grpc/grpc_security.h + include/grpc/grpc_security_constants.h + include/grpc/load_reporting.h + include/grpc/slice.h + include/grpc/slice_buffer.h + include/grpc/status.h + include/grpc/support/alloc.h + include/grpc/support/atm.h + include/grpc/support/atm_gcc_atomic.h + include/grpc/support/atm_gcc_sync.h + include/grpc/support/atm_windows.h + include/grpc/support/cpu.h + include/grpc/support/log.h + include/grpc/support/log_windows.h + include/grpc/support/port_platform.h + include/grpc/support/string_util.h + include/grpc/support/sync.h + include/grpc/support/sync_abseil.h + include/grpc/support/sync_custom.h + include/grpc/support/sync_generic.h + include/grpc/support/sync_posix.h + include/grpc/support/sync_windows.h + include/grpc/support/thd_id.h + include/grpc/support/time.h + include/grpc/support/workaround_list.h include/grpcpp/alarm.h include/grpcpp/channel.h include/grpcpp/client_context.h @@ -3852,6 +3883,37 @@ foreach(_hdr include/grpc++/support/stub_options.h include/grpc++/support/sync_stream.h include/grpc++/support/time.h + include/grpc/byte_buffer.h + include/grpc/byte_buffer_reader.h + include/grpc/compression.h + include/grpc/fork.h + include/grpc/grpc.h + include/grpc/grpc_posix.h + include/grpc/grpc_security.h + include/grpc/grpc_security_constants.h + include/grpc/load_reporting.h + include/grpc/slice.h + include/grpc/slice_buffer.h + include/grpc/status.h + include/grpc/support/alloc.h + include/grpc/support/atm.h + include/grpc/support/atm_gcc_atomic.h + include/grpc/support/atm_gcc_sync.h + include/grpc/support/atm_windows.h + include/grpc/support/cpu.h + include/grpc/support/log.h + include/grpc/support/log_windows.h + include/grpc/support/port_platform.h + include/grpc/support/string_util.h + include/grpc/support/sync.h + include/grpc/support/sync_abseil.h + include/grpc/support/sync_custom.h + include/grpc/support/sync_generic.h + include/grpc/support/sync_posix.h + include/grpc/support/sync_windows.h + include/grpc/support/thd_id.h + include/grpc/support/time.h + include/grpc/support/workaround_list.h include/grpcpp/alarm.h include/grpcpp/channel.h include/grpcpp/client_context.h diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 40292ca657e..bae066d7396 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -155,6 +155,11 @@ def grpc_deps(): actual = "@io_opencensus_cpp//opencensus/trace:grpc_trace_bin", ) + native.bind( + name = "opencensus-trace-span_context", + actual = "@io_opencensus_cpp//opencensus/trace:span_context", + ) + native.bind( name = "opencensus-stats", actual = "@io_opencensus_cpp//opencensus/stats:stats", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index eca57d423e7..7d52b1d76d3 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2564,6 +2564,37 @@ libs: - include/grpc++/support/stub_options.h - include/grpc++/support/sync_stream.h - include/grpc++/support/time.h + - include/grpc/byte_buffer.h + - include/grpc/byte_buffer_reader.h + - include/grpc/compression.h + - include/grpc/fork.h + - include/grpc/grpc.h + - include/grpc/grpc_posix.h + - include/grpc/grpc_security.h + - include/grpc/grpc_security_constants.h + - include/grpc/load_reporting.h + - include/grpc/slice.h + - include/grpc/slice_buffer.h + - include/grpc/status.h + - include/grpc/support/alloc.h + - include/grpc/support/atm.h + - include/grpc/support/atm_gcc_atomic.h + - include/grpc/support/atm_gcc_sync.h + - include/grpc/support/atm_windows.h + - include/grpc/support/cpu.h + - include/grpc/support/log.h + - include/grpc/support/log_windows.h + - include/grpc/support/port_platform.h + - include/grpc/support/string_util.h + - include/grpc/support/sync.h + - include/grpc/support/sync_abseil.h + - include/grpc/support/sync_custom.h + - include/grpc/support/sync_generic.h + - include/grpc/support/sync_posix.h + - include/grpc/support/sync_windows.h + - include/grpc/support/thd_id.h + - include/grpc/support/time.h + - include/grpc/support/workaround_list.h - include/grpcpp/alarm.h - include/grpcpp/channel.h - include/grpcpp/client_context.h @@ -2951,6 +2982,37 @@ libs: - include/grpc++/support/stub_options.h - include/grpc++/support/sync_stream.h - include/grpc++/support/time.h + - include/grpc/byte_buffer.h + - include/grpc/byte_buffer_reader.h + - include/grpc/compression.h + - include/grpc/fork.h + - include/grpc/grpc.h + - include/grpc/grpc_posix.h + - include/grpc/grpc_security.h + - include/grpc/grpc_security_constants.h + - include/grpc/load_reporting.h + - include/grpc/slice.h + - include/grpc/slice_buffer.h + - include/grpc/status.h + - include/grpc/support/alloc.h + - include/grpc/support/atm.h + - include/grpc/support/atm_gcc_atomic.h + - include/grpc/support/atm_gcc_sync.h + - include/grpc/support/atm_windows.h + - include/grpc/support/cpu.h + - include/grpc/support/log.h + - include/grpc/support/log_windows.h + - include/grpc/support/port_platform.h + - include/grpc/support/string_util.h + - include/grpc/support/sync.h + - include/grpc/support/sync_abseil.h + - include/grpc/support/sync_custom.h + - include/grpc/support/sync_generic.h + - include/grpc/support/sync_posix.h + - include/grpc/support/sync_windows.h + - include/grpc/support/thd_id.h + - include/grpc/support/time.h + - include/grpc/support/workaround_list.h - include/grpcpp/alarm.h - include/grpcpp/channel.h - include/grpcpp/client_context.h diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index e4aa072db00..4f92d670688 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -16,31 +16,36 @@ * */ +#include #include #include +#include +#include +#include #include +#include +#include +#include #include #include #include -#include -#include #include #include #include #include #include +#include #include +#include +#include #include #include -#include -#include +#include #include -#include +#include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/iomgr/iomgr.h" -#include "src/core/lib/surface/completion_queue.h" namespace grpc { diff --git a/src/cpp/client/channel_test_peer.cc b/src/cpp/client/channel_test_peer.cc index de9779011ee..d91f692ea6e 100644 --- a/src/cpp/client/channel_test_peer.cc +++ b/src/cpp/client/channel_test_peer.cc @@ -16,7 +16,6 @@ * */ -#include #include #include diff --git a/src/cpp/client/client_callback.cc b/src/cpp/client/client_callback.cc index 9e4ebbb3f82..719b8597052 100644 --- a/src/cpp/client/client_callback.cc +++ b/src/cpp/client/client_callback.cc @@ -16,8 +16,10 @@ */ #include +#include #include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/surface/call.h" diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 72e6653f0e7..a6c5c70dcdc 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -16,18 +16,32 @@ * */ +#include + +#include +#include +#include +#include +#include + #include #include +#include +#include +#include +#include #include #include -#include +#include +#include #include #include #include #include #include #include -#include +#include +#include namespace grpc { diff --git a/src/cpp/client/client_interceptor.cc b/src/cpp/client/client_interceptor.cc index a91950cae2d..f4e4acbed19 100644 --- a/src/cpp/client/client_interceptor.cc +++ b/src/cpp/client/client_interceptor.cc @@ -16,7 +16,8 @@ * */ -#include +#include +#include namespace grpc { diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc index 48831d0fede..34b9227ddd9 100644 --- a/src/cpp/client/create_channel.cc +++ b/src/cpp/client/create_channel.cc @@ -17,12 +17,19 @@ */ #include +#include +#include +#include +#include +#include #include #include #include #include #include +#include +#include #include "src/cpp/client/create_channel_internal.h" diff --git a/src/cpp/client/create_channel_internal.cc b/src/cpp/client/create_channel_internal.cc index 3523d503a95..06ccc0d5ad0 100644 --- a/src/cpp/client/create_channel_internal.cc +++ b/src/cpp/client/create_channel_internal.cc @@ -25,8 +25,6 @@ #include -struct grpc_channel; - namespace grpc { std::shared_ptr CreateChannelInternal( diff --git a/src/cpp/client/create_channel_internal.h b/src/cpp/client/create_channel_internal.h index 997b3769d22..c737fdcbeea 100644 --- a/src/cpp/client/create_channel_internal.h +++ b/src/cpp/client/create_channel_internal.h @@ -23,12 +23,11 @@ #include #include +#include #include -#include +#include #include -struct grpc_channel; - namespace grpc { std::shared_ptr CreateChannelInternal( diff --git a/src/cpp/client/create_channel_posix.cc b/src/cpp/client/create_channel_posix.cc index 8e02088ac38..f9f2012817e 100644 --- a/src/cpp/client/create_channel_posix.cc +++ b/src/cpp/client/create_channel_posix.cc @@ -16,13 +16,20 @@ * */ +#include +#include +#include +#include + #include #include #include +#include #include #include -#include #include +#include +#include #include "src/cpp/client/create_channel_internal.h" diff --git a/src/cpp/client/insecure_credentials.cc b/src/cpp/client/insecure_credentials.cc index b7727436ba8..95f770cc3af 100644 --- a/src/cpp/client/insecure_credentials.cc +++ b/src/cpp/client/insecure_credentials.cc @@ -15,12 +15,18 @@ * limitations under the License. * */ +#include +#include +#include +#include + #include #include -#include +#include #include #include #include +#include #include #include "src/cpp/client/create_channel_internal.h" diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index d3351e3447c..086a562e1f8 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -18,26 +18,37 @@ #include "src/cpp/client/secure_credentials.h" +#include + +#include +#include +#include + #include "absl/strings/str_join.h" -#include +#include +#include #include #include #include #include +#include #include -#include #include +#include #include - +#include +#include +#include // TODO(yashykt): We shouldn't be including "src/core" headers. #include "src/core/lib/gpr/env.h" +#include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/json/json.h" -#include "src/core/lib/security/transport/auth_filters.h" #include "src/core/lib/security/util/json_util.h" +#include "src/core/lib/slice/slice_refcount.h" #include "src/cpp/client/create_channel_internal.h" #include "src/cpp/common/secure_auth_context.h" diff --git a/src/cpp/client/secure_credentials.h b/src/cpp/client/secure_credentials.h index 992e2237593..29496f7c4f9 100644 --- a/src/cpp/client/secure_credentials.h +++ b/src/cpp/client/secure_credentials.h @@ -19,13 +19,26 @@ #ifndef GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H #define GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H +#include + +#include +#include +#include + #include "absl/strings/str_cat.h" +#include #include +#include +#include +#include +#include #include -#include +#include +#include #include // TODO(yashykt): We shouldn't be including "src/core" headers. +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/cpp/server/thread_pool_interface.h" diff --git a/src/cpp/client/xds_credentials.cc b/src/cpp/client/xds_credentials.cc index d5446a02fe5..360d44c94b2 100644 --- a/src/cpp/client/xds_credentials.cc +++ b/src/cpp/client/xds_credentials.cc @@ -16,6 +16,13 @@ // // +#include + +#include +#include +#include +#include + #include "src/cpp/client/secure_credentials.h" namespace grpc { diff --git a/src/cpp/codegen/codegen_init.cc b/src/cpp/codegen/codegen_init.cc index e1e47cbb17b..4e1176f1f0f 100644 --- a/src/cpp/codegen/codegen_init.cc +++ b/src/cpp/codegen/codegen_init.cc @@ -17,7 +17,7 @@ */ #include -#include +#include /// Null-initializes the global gRPC variables for the codegen library. These /// stay null in the absence of grpc++ library. In this case, no gRPC diff --git a/src/cpp/common/alarm.cc b/src/cpp/common/alarm.cc index 913c0c7317c..47b047823c1 100644 --- a/src/cpp/common/alarm.cc +++ b/src/cpp/common/alarm.cc @@ -17,15 +17,21 @@ #include -#include +#include +#include +#include +#include #include +#include #include #include +#include #include -#include -#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/timer.h" diff --git a/src/cpp/common/alts_context.cc b/src/cpp/common/alts_context.cc index 5e674ff7240..674c898ef6f 100644 --- a/src/cpp/common/alts_context.cc +++ b/src/cpp/common/alts_context.cc @@ -16,11 +16,19 @@ * */ -#include +#include + +#include +#include + +#include "upb/upb.h" + +#include #include +#include -#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h" #include "src/proto/grpc/gcp/altscontext.upb.h" +#include "src/proto/grpc/gcp/transport_security_common.upb.h" namespace grpc { namespace experimental { diff --git a/src/cpp/common/alts_util.cc b/src/cpp/common/alts_util.cc index b1dc38d01a0..7cf05a4a753 100644 --- a/src/cpp/common/alts_util.cc +++ b/src/cpp/common/alts_util.cc @@ -16,16 +16,25 @@ * */ +#include +#include +#include +#include + +#include "absl/memory/memory.h" #include "upb/upb.hpp" -#include +#include #include #include #include +#include +#include +#include +#include +#include -#include "src/core/lib/gprpp/memory.h" #include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h" -#include "src/cpp/common/secure_auth_context.h" #include "src/proto/grpc/gcp/altscontext.upb.h" namespace grpc { diff --git a/src/cpp/common/auth_property_iterator.cc b/src/cpp/common/auth_property_iterator.cc index 1334ea99663..45d6db9c3cf 100644 --- a/src/cpp/common/auth_property_iterator.cc +++ b/src/cpp/common/auth_property_iterator.cc @@ -16,8 +16,11 @@ * */ +#include + #include #include +#include namespace grpc { diff --git a/src/cpp/common/channel_arguments.cc b/src/cpp/common/channel_arguments.cc index 6c45dda2de4..2308739a385 100644 --- a/src/cpp/common/channel_arguments.cc +++ b/src/cpp/common/channel_arguments.cc @@ -15,15 +15,20 @@ * limitations under the License. * */ -#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include +#include -#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/socket_mutator.h" diff --git a/src/cpp/common/channel_filter.cc b/src/cpp/common/channel_filter.cc index 5ea832c4018..88916bec8ac 100644 --- a/src/cpp/common/channel_filter.cc +++ b/src/cpp/common/channel_filter.cc @@ -18,13 +18,17 @@ #include "src/cpp/common/channel_filter.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/string_view.h" -#include +#include +#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/config/core_configuration.h" +#include "src/core/lib/slice/slice.h" +#include "src/core/lib/surface/channel_init.h" namespace grpc { diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h index 3d8d155b753..105b973229d 100644 --- a/src/cpp/common/channel_filter.h +++ b/src/cpp/common/channel_filter.h @@ -19,16 +19,30 @@ #ifndef GRPCXX_CHANNEL_FILTER_H #define GRPCXX_CHANNEL_FILTER_H +#include +#include + #include -#include +#include +#include +#include #include -#include -#include +#include +#include +#include #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/surface/channel_init.h" +#include "src/core/lib/channel/channel_stack_builder.h" +#include "src/core/lib/channel/context.h" +#include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/polling_entity.h" +#include "src/core/lib/surface/channel_stack_type.h" +#include "src/core/lib/transport/byte_stream.h" #include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/transport.h" /// An interface to define filters. /// diff --git a/src/cpp/common/completion_queue_cc.cc b/src/cpp/common/completion_queue_cc.cc index 078f928fde9..7a22a48bb41 100644 --- a/src/cpp/common/completion_queue_cc.cc +++ b/src/cpp/common/completion_queue_cc.cc @@ -15,17 +15,22 @@ * */ -#include +#include + +#include "absl/base/thread_annotations.h" #include +#include +#include #include #include +#include +#include #include +#include #include -#include #include "src/core/lib/gpr/useful.h" -#include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/thd.h" diff --git a/src/cpp/common/core_codegen.cc b/src/cpp/common/core_codegen.cc index 6501650aeb0..cf5dc084b5c 100644 --- a/src/cpp/common/core_codegen.cc +++ b/src/cpp/common/core_codegen.cc @@ -21,19 +21,18 @@ #include #include -#include #include +#include +#include #include #include +#include #include #include #include +#include #include -#include - -#include "src/core/lib/profiling/timers.h" - -struct grpc_byte_buffer; +#include namespace grpc { diff --git a/src/cpp/common/insecure_create_auth_context.cc b/src/cpp/common/insecure_create_auth_context.cc index 4e5cbd03723..adcf4e77a37 100644 --- a/src/cpp/common/insecure_create_auth_context.cc +++ b/src/cpp/common/insecure_create_auth_context.cc @@ -17,7 +17,7 @@ */ #include -#include +#include #include namespace grpc { diff --git a/src/cpp/common/resource_quota_cc.cc b/src/cpp/common/resource_quota_cc.cc index 25aa01ed015..a52ea59e0ea 100644 --- a/src/cpp/common/resource_quota_cc.cc +++ b/src/cpp/common/resource_quota_cc.cc @@ -16,8 +16,13 @@ * */ +#include + +#include + #include #include +#include namespace grpc { diff --git a/src/cpp/common/secure_auth_context.cc b/src/cpp/common/secure_auth_context.cc index 0ba01e5553f..35795db5117 100644 --- a/src/cpp/common/secure_auth_context.cc +++ b/src/cpp/common/secure_auth_context.cc @@ -18,6 +18,8 @@ #include "src/cpp/common/secure_auth_context.h" +#include + #include namespace grpc { diff --git a/src/cpp/common/secure_auth_context.h b/src/cpp/common/secure_auth_context.h index 83c222749b8..e89801fcff1 100644 --- a/src/cpp/common/secure_auth_context.h +++ b/src/cpp/common/secure_auth_context.h @@ -19,7 +19,13 @@ #ifndef GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H #define GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H +#include +#include + +#include #include +#include +#include #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/security/context/security_context.h" diff --git a/src/cpp/common/secure_channel_arguments.cc b/src/cpp/common/secure_channel_arguments.cc index 339d94b1dde..a893cf36253 100644 --- a/src/cpp/common/secure_channel_arguments.cc +++ b/src/cpp/common/secure_channel_arguments.cc @@ -16,10 +16,13 @@ * */ -#include -#include +#include +#include +#include -#include "src/core/lib/channel/channel_args.h" +#include +#include +#include namespace grpc { diff --git a/src/cpp/common/secure_create_auth_context.cc b/src/cpp/common/secure_create_auth_context.cc index 6633374b65b..feb3885d528 100644 --- a/src/cpp/common/secure_create_auth_context.cc +++ b/src/cpp/common/secure_create_auth_context.cc @@ -17,11 +17,12 @@ */ #include -#include #include +#include #include #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/security/context/security_context.h" #include "src/cpp/common/secure_auth_context.h" namespace grpc { diff --git a/src/cpp/common/tls_certificate_provider.cc b/src/cpp/common/tls_certificate_provider.cc index 62a2a5cf26b..f802ab1870b 100644 --- a/src/cpp/common/tls_certificate_provider.cc +++ b/src/cpp/common/tls_certificate_provider.cc @@ -14,11 +14,13 @@ // limitations under the License. // -#include "absl/container/inlined_vector.h" +#include +#include #include -#include +#include #include +#include namespace grpc { namespace experimental { diff --git a/src/cpp/common/tls_certificate_verifier.cc b/src/cpp/common/tls_certificate_verifier.cc index 2e52548fd3b..f55637088b0 100644 --- a/src/cpp/common/tls_certificate_verifier.cc +++ b/src/cpp/common/tls_certificate_verifier.cc @@ -14,13 +14,27 @@ // limitations under the License. // -#include "absl/container/inlined_vector.h" -#include "absl/status/status.h" +#include + +#include +#include +#include +#include +#include +#include #include +#include #include +#include #include +#include +#include #include +#include +#include +#include +#include namespace grpc { namespace experimental { diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index 3e561561c27..f60c19e759b 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -16,11 +16,17 @@ * */ -#include "absl/container/inlined_vector.h" +#include +#include +#include #include -#include +#include +#include +#include +#include #include +#include namespace grpc { namespace experimental { diff --git a/src/cpp/common/validate_service_config.cc b/src/cpp/common/validate_service_config.cc index c444ea2d62e..5f68013660a 100644 --- a/src/cpp/common/validate_service_config.cc +++ b/src/cpp/common/validate_service_config.cc @@ -16,9 +16,13 @@ * */ +#include + #include +#include #include +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/service_config/service_config_impl.h" namespace grpc { diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index e296a5204e9..e2acc38ae79 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -17,9 +17,12 @@ */ /* This file is autogenerated from: - templates/src/core/surface/version.c.template */ + templates/src/cpp/common/version_cc.cc.template */ + +#include #include +#include namespace grpc { std::string Version() { return "1.47.0-dev"; } diff --git a/src/cpp/ext/filters/census/channel_filter.h b/src/cpp/ext/filters/census/channel_filter.h index d756f23258e..2b167c8b254 100644 --- a/src/cpp/ext/filters/census/channel_filter.h +++ b/src/cpp/ext/filters/census/channel_filter.h @@ -21,7 +21,10 @@ #include -#include "src/cpp/ext/filters/census/context.h" +#include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/channel/channel_stack_builder.h" +#include "src/core/lib/iomgr/error.h" +#include "src/cpp/common/channel_filter.h" namespace grpc { diff --git a/src/cpp/ext/filters/census/client_filter.cc b/src/cpp/ext/filters/census/client_filter.cc index 618324f523a..9ad447b4237 100644 --- a/src/cpp/ext/filters/census/client_filter.cc +++ b/src/cpp/ext/filters/census/client_filter.cc @@ -20,18 +20,41 @@ #include "src/cpp/ext/filters/census/client_filter.h" +#include +#include + +#include #include #include #include +#include "absl/status/status.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" +#include "absl/time/clock.h" +#include "absl/time/time.h" +#include "absl/types/optional.h" #include "opencensus/stats/stats.h" -#include "opencensus/tags/context_util.h" #include "opencensus/tags/tag_key.h" #include "opencensus/tags/tag_map.h" +#include "opencensus/trace/span.h" +#include "opencensus/trace/span_context.h" +#include "opencensus/trace/status_code.h" + +#include +#include +#include +#include -#include "src/core/lib/surface/call.h" +#include "src/core/lib/channel/context.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/resource_quota/arena.h" +#include "src/core/lib/slice/slice.h" +#include "src/core/lib/slice/slice_refcount.h" +#include "src/core/lib/transport/byte_stream.h" +#include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/transport.h" +#include "src/cpp/ext/filters/census/context.h" #include "src/cpp/ext/filters/census/grpc_plugin.h" #include "src/cpp/ext/filters/census/measures.h" diff --git a/src/cpp/ext/filters/census/client_filter.h b/src/cpp/ext/filters/census/client_filter.h index 871b8faa14b..a7c431719d7 100644 --- a/src/cpp/ext/filters/census/client_filter.h +++ b/src/cpp/ext/filters/census/client_filter.h @@ -21,10 +21,9 @@ #include -#include "absl/strings/string_view.h" -#include "absl/time/time.h" - -#include "src/cpp/ext/filters/census/channel_filter.h" +#include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/iomgr/error.h" +#include "src/cpp/common/channel_filter.h" #include "src/cpp/ext/filters/census/open_census_call_tracer.h" namespace grpc { diff --git a/src/cpp/ext/filters/census/context.cc b/src/cpp/ext/filters/census/context.cc index 672228a83bf..9e5ead22ace 100644 --- a/src/cpp/ext/filters/census/context.cc +++ b/src/cpp/ext/filters/census/context.cc @@ -20,10 +20,15 @@ #include "src/cpp/ext/filters/census/context.h" +#include + #include "opencensus/tags/context_util.h" #include "opencensus/trace/context_util.h" #include "opencensus/trace/propagation/grpc_trace_bin.h" +#include "src/core/lib/transport/transport.h" +#include "src/cpp/ext/filters/census/rpc_encoding.h" + namespace grpc { using ::opencensus::tags::TagMap; diff --git a/src/cpp/ext/filters/census/context.h b/src/cpp/ext/filters/census/context.h index 608a93b9704..e38fda8cda1 100644 --- a/src/cpp/ext/filters/census/context.h +++ b/src/cpp/ext/filters/census/context.h @@ -21,25 +21,22 @@ #include -#include "absl/memory/memory.h" +#include +#include + #include "absl/strings/string_view.h" #include "absl/strings/strip.h" -#include "opencensus/context/context.h" #include "opencensus/tags/tag_map.h" -#include "opencensus/trace/context_util.h" +#include "opencensus/trace/attribute_value_ref.h" #include "opencensus/trace/span.h" #include "opencensus/trace/span_context.h" -#include "opencensus/trace/trace_params.h" +#include +#include #include -#include "src/core/lib/slice/slice_internal.h" -#include "src/cpp/common/channel_filter.h" -#include "src/cpp/ext/filters/census/rpc_encoding.h" - -// This is needed because grpc has hardcoded CensusContext with a -// forward declaration of 'struct census_context;' -struct census_context; +#include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/slice/slice.h" namespace grpc { diff --git a/src/cpp/ext/filters/census/grpc_plugin.cc b/src/cpp/ext/filters/census/grpc_plugin.cc index 41ded5cbcc0..6a1d823fc9b 100644 --- a/src/cpp/ext/filters/census/grpc_plugin.cc +++ b/src/cpp/ext/filters/census/grpc_plugin.cc @@ -20,13 +20,20 @@ #include "src/cpp/ext/filters/census/grpc_plugin.h" +#include + +#include "absl/base/attributes.h" #include "opencensus/tags/tag_key.h" #include "opencensus/trace/span.h" +#include #include +#include "src/core/lib/surface/channel_stack_type.h" +#include "src/cpp/common/channel_filter.h" #include "src/cpp/ext/filters/census/channel_filter.h" #include "src/cpp/ext/filters/census/client_filter.h" +#include "src/cpp/ext/filters/census/context.h" #include "src/cpp/ext/filters/census/measures.h" #include "src/cpp/ext/filters/census/server_filter.h" diff --git a/src/cpp/ext/filters/census/grpc_plugin.h b/src/cpp/ext/filters/census/grpc_plugin.h index 54754aa88fa..3c424b815de 100644 --- a/src/cpp/ext/filters/census/grpc_plugin.h +++ b/src/cpp/ext/filters/census/grpc_plugin.h @@ -25,8 +25,6 @@ #include "opencensus/stats/stats.h" #include "opencensus/tags/tag_key.h" -#include - namespace grpc { // The tag keys set when recording RPC stats. diff --git a/src/cpp/ext/filters/census/measures.h b/src/cpp/ext/filters/census/measures.h index 0682f2e5b87..6709323c65a 100644 --- a/src/cpp/ext/filters/census/measures.h +++ b/src/cpp/ext/filters/census/measures.h @@ -23,8 +23,6 @@ #include "opencensus/stats/stats.h" -#include "src/cpp/ext/filters/census/grpc_plugin.h" - namespace grpc { ::opencensus::stats::MeasureInt64 RpcClientSentMessagesPerRpc(); diff --git a/src/cpp/ext/filters/census/open_census_call_tracer.h b/src/cpp/ext/filters/census/open_census_call_tracer.h index d856afbe51e..990630c17ed 100644 --- a/src/cpp/ext/filters/census/open_census_call_tracer.h +++ b/src/cpp/ext/filters/census/open_census_call_tracer.h @@ -21,7 +21,26 @@ #include +#include + +#include "absl/base/thread_annotations.h" +#include "absl/status/status.h" +#include "absl/strings/string_view.h" +#include "absl/time/time.h" + +#include +#include + #include "src/core/lib/channel/call_tracer.h" +#include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/channel/context.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/resource_quota/arena.h" +#include "src/core/lib/slice/slice.h" +#include "src/core/lib/transport/byte_stream.h" +#include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/transport.h" #include "src/cpp/ext/filters/census/context.h" namespace grpc { diff --git a/src/cpp/ext/filters/census/rpc_encoding.h b/src/cpp/ext/filters/census/rpc_encoding.h index 821c7158dd9..daec6e5ea79 100644 --- a/src/cpp/ext/filters/census/rpc_encoding.h +++ b/src/cpp/ext/filters/census/rpc_encoding.h @@ -21,13 +21,11 @@ #include +#include #include #include "absl/base/internal/endian.h" #include "absl/strings/string_view.h" -#include "opencensus/trace/span_context.h" -#include "opencensus/trace/span_id.h" -#include "opencensus/trace/trace_id.h" namespace grpc { diff --git a/src/cpp/ext/filters/census/server_filter.cc b/src/cpp/ext/filters/census/server_filter.cc index 011cd420755..fe6d013d8aa 100644 --- a/src/cpp/ext/filters/census/server_filter.cc +++ b/src/cpp/ext/filters/census/server_filter.cc @@ -20,13 +20,24 @@ #include "src/cpp/ext/filters/census/server_filter.h" +#include +#include + #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/time/clock.h" #include "absl/time/time.h" +#include "absl/types/optional.h" #include "opencensus/stats/stats.h" +#include "opencensus/tags/tag_key.h" + +#include +#include +#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/surface/call.h" +#include "src/core/lib/transport/transport.h" +#include "src/cpp/ext/filters/census/channel_filter.h" #include "src/cpp/ext/filters/census/grpc_plugin.h" #include "src/cpp/ext/filters/census/measures.h" diff --git a/src/cpp/ext/filters/census/server_filter.h b/src/cpp/ext/filters/census/server_filter.h index de20b0b2415..07542d374e2 100644 --- a/src/cpp/ext/filters/census/server_filter.h +++ b/src/cpp/ext/filters/census/server_filter.h @@ -21,13 +21,26 @@ #include +#include +#include + +#include + #include "absl/strings/string_view.h" -#include "absl/time/clock.h" #include "absl/time/time.h" #include - -#include "src/cpp/ext/filters/census/channel_filter.h" +#include +#include + +#include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/slice/slice.h" +#include "src/core/lib/transport/byte_stream.h" +#include "src/core/lib/transport/metadata_batch.h" +#include "src/cpp/common/channel_filter.h" #include "src/cpp/ext/filters/census/context.h" namespace grpc { diff --git a/src/cpp/ext/filters/census/views.cc b/src/cpp/ext/filters/census/views.cc index 926e842551c..9586eab5f12 100644 --- a/src/cpp/ext/filters/census/views.cc +++ b/src/cpp/ext/filters/census/views.cc @@ -18,11 +18,15 @@ #include +#include + #include "absl/time/time.h" #include "opencensus/stats/internal/aggregation_window.h" #include "opencensus/stats/internal/set_aggregation_window.h" #include "opencensus/stats/stats.h" +#include + #include "src/cpp/ext/filters/census/grpc_plugin.h" namespace grpc { diff --git a/src/cpp/ext/proto_server_reflection.cc b/src/cpp/ext/proto_server_reflection.cc index af35a28564e..f1df079ef24 100644 --- a/src/cpp/ext/proto_server_reflection.cc +++ b/src/cpp/ext/proto_server_reflection.cc @@ -21,7 +21,11 @@ #include #include +#include + #include +#include +#include using grpc::Status; using grpc::StatusCode; diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h index 04f1e6380c5..a9b5db0b272 100644 --- a/src/cpp/ext/proto_server_reflection.h +++ b/src/cpp/ext/proto_server_reflection.h @@ -19,12 +19,18 @@ #ifndef GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H #define GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H +#include #include #include #include +#include +#include +#include +#include #include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h" +#include "src/proto/grpc/reflection/v1alpha/reflection.pb.h" namespace grpc { diff --git a/src/cpp/ext/proto_server_reflection_plugin.cc b/src/cpp/ext/proto_server_reflection_plugin.cc index c3c2bfb5104..ca844bcf0b1 100644 --- a/src/cpp/ext/proto_server_reflection_plugin.cc +++ b/src/cpp/ext/proto_server_reflection_plugin.cc @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "src/cpp/ext/proto_server_reflection.h" diff --git a/src/cpp/server/admin/admin_services.cc b/src/cpp/server/admin/admin_services.cc index 7a8713d1768..aee9a61d3d9 100644 --- a/src/cpp/server/admin/admin_services.cc +++ b/src/cpp/server/admin/admin_services.cc @@ -18,10 +18,7 @@ #include -#include "absl/memory/memory.h" - #include -#include #include // TODO(lidiz) build a real registration system that can pull in services diff --git a/src/cpp/server/async_generic_service.cc b/src/cpp/server/async_generic_service.cc index 9580219ec15..15381fafef4 100644 --- a/src/cpp/server/async_generic_service.cc +++ b/src/cpp/server/async_generic_service.cc @@ -16,6 +16,7 @@ * */ +#include #include #include diff --git a/src/cpp/server/authorization_policy_provider.cc b/src/cpp/server/authorization_policy_provider.cc index 8dab33ddc3e..72ce62f9faa 100644 --- a/src/cpp/server/authorization_policy_provider.cc +++ b/src/cpp/server/authorization_policy_provider.cc @@ -12,10 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include +#include #include -#include #include +#include +#include +#include namespace grpc { namespace experimental { diff --git a/src/cpp/server/channel_argument_option.cc b/src/cpp/server/channel_argument_option.cc index 680b0ee0484..4c032bd4e98 100644 --- a/src/cpp/server/channel_argument_option.cc +++ b/src/cpp/server/channel_argument_option.cc @@ -16,7 +16,15 @@ * */ +#include +#include +#include + #include +#include +#include +#include +#include namespace grpc { diff --git a/src/cpp/server/channelz/channelz_service.cc b/src/cpp/server/channelz/channelz_service.cc index 6dcf84bf40d..d5e5982a9ce 100644 --- a/src/cpp/server/channelz/channelz_service.cc +++ b/src/cpp/server/channelz/channelz_service.cc @@ -20,8 +20,11 @@ #include "src/cpp/server/channelz/channelz_service.h" -#include +#include + #include +#include +#include namespace grpc { diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h index 824f0a9fe17..91936da959e 100644 --- a/src/cpp/server/channelz/channelz_service.h +++ b/src/cpp/server/channelz/channelz_service.h @@ -22,8 +22,10 @@ #include #include +#include #include "src/proto/grpc/channelz/channelz.grpc.pb.h" +#include "src/proto/grpc/channelz/channelz.pb.h" namespace grpc { diff --git a/src/cpp/server/channelz/channelz_service_plugin.cc b/src/cpp/server/channelz/channelz_service_plugin.cc index 2fc5b2a6d05..541dea2e812 100644 --- a/src/cpp/server/channelz/channelz_service_plugin.cc +++ b/src/cpp/server/channelz/channelz_service_plugin.cc @@ -18,10 +18,14 @@ #include +#include +#include + #include #include #include -#include +#include +#include #include "src/cpp/server/channelz/channelz_service.h" diff --git a/src/cpp/server/create_default_thread_pool.cc b/src/cpp/server/create_default_thread_pool.cc index 8ca3e32c2fb..89d5914d098 100644 --- a/src/cpp/server/create_default_thread_pool.cc +++ b/src/cpp/server/create_default_thread_pool.cc @@ -19,6 +19,7 @@ #include #include "src/cpp/server/dynamic_thread_pool.h" +#include "src/cpp/server/thread_pool_interface.h" #ifndef GRPC_CUSTOM_DEFAULT_THREAD_POOL diff --git a/src/cpp/server/csds/csds.cc b/src/cpp/server/csds/csds.cc index 61de37604dc..5042456221f 100644 --- a/src/cpp/server/csds/csds.cc +++ b/src/cpp/server/csds/csds.cc @@ -21,14 +21,15 @@ #include "src/cpp/server/csds/csds.h" #include +#include +#include "absl/status/status.h" #include "absl/status/statusor.h" -#include -#include -#include - -#include "src/proto/grpc/testing/xds/v3/csds.grpc.pb.h" +#include +#include +#include +#include namespace grpc { namespace xds { diff --git a/src/cpp/server/csds/csds.h b/src/cpp/server/csds/csds.h index d08e15241f0..cd1a5900dec 100644 --- a/src/cpp/server/csds/csds.h +++ b/src/cpp/server/csds/csds.h @@ -21,11 +21,12 @@ #include -#include "absl/status/status.h" - #include +#include +#include #include "src/proto/grpc/testing/xds/v3/csds.grpc.pb.h" +#include "src/proto/grpc/testing/xds/v3/csds.pb.h" namespace grpc { namespace xds { diff --git a/src/cpp/server/dynamic_thread_pool.cc b/src/cpp/server/dynamic_thread_pool.cc index e96dc4c4551..2a3d5bc576b 100644 --- a/src/cpp/server/dynamic_thread_pool.cc +++ b/src/cpp/server/dynamic_thread_pool.cc @@ -18,9 +18,6 @@ #include "src/cpp/server/dynamic_thread_pool.h" -#include -#include - #include "src/core/lib/gprpp/thd.h" namespace grpc { diff --git a/src/cpp/server/dynamic_thread_pool.h b/src/cpp/server/dynamic_thread_pool.h index 954aaff35da..34de51a59c2 100644 --- a/src/cpp/server/dynamic_thread_pool.h +++ b/src/cpp/server/dynamic_thread_pool.h @@ -19,12 +19,10 @@ #ifndef GRPC_INTERNAL_CPP_DYNAMIC_THREAD_POOL_H #define GRPC_INTERNAL_CPP_DYNAMIC_THREAD_POOL_H +#include #include -#include #include -#include - #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/thd.h" #include "src/cpp/server/thread_pool_interface.h" diff --git a/src/cpp/server/external_connection_acceptor_impl.cc b/src/cpp/server/external_connection_acceptor_impl.cc index 1b0c68ffcbd..2be1a9f18d1 100644 --- a/src/cpp/server/external_connection_acceptor_impl.cc +++ b/src/cpp/server/external_connection_acceptor_impl.cc @@ -19,8 +19,11 @@ #include "src/cpp/server/external_connection_acceptor_impl.h" #include +#include +#include #include +#include #include namespace grpc { diff --git a/src/cpp/server/external_connection_acceptor_impl.h b/src/cpp/server/external_connection_acceptor_impl.h index 674baff55a2..e7c1fd8857c 100644 --- a/src/cpp/server/external_connection_acceptor_impl.h +++ b/src/cpp/server/external_connection_acceptor_impl.h @@ -20,11 +20,12 @@ #define SRC_CPP_SERVER_EXTERNAL_CONNECTION_ACCEPTOR_IMPL_H_ #include +#include -#include #include #include #include +#include #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/iomgr/tcp_server.h" diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc index 2bc64c26b58..55226a7703c 100644 --- a/src/cpp/server/health/default_health_check_service.cc +++ b/src/cpp/server/health/default_health_check_service.cc @@ -18,15 +18,22 @@ #include "src/cpp/server/health/default_health_check_service.h" +#include + #include +#include #include "absl/memory/memory.h" +#include "upb/upb.h" #include "upb/upb.hpp" #include -#include #include -#include +#include +#include +#include +#include +#include #include "src/proto/grpc/health/v1/health.upb.h" diff --git a/src/cpp/server/health/default_health_check_service.h b/src/cpp/server/health/default_health_check_service.h index a58338cbff4..449134b0a2b 100644 --- a/src/cpp/server/health/default_health_check_service.h +++ b/src/cpp/server/health/default_health_check_service.h @@ -19,15 +19,22 @@ #ifndef GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H #define GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H -#include +#include + +#include +#include +#include + +#include "absl/base/thread_annotations.h" -#include #include #include -#include -#include #include +#include #include +#include +#include +#include #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" diff --git a/src/cpp/server/health/health_check_service_server_builder_option.cc b/src/cpp/server/health/health_check_service_server_builder_option.cc index 3fa384ace9e..bd32c327904 100644 --- a/src/cpp/server/health/health_check_service_server_builder_option.cc +++ b/src/cpp/server/health/health_check_service_server_builder_option.cc @@ -16,7 +16,14 @@ * */ +#include +#include +#include + #include +#include +#include +#include namespace grpc { diff --git a/src/cpp/server/insecure_server_credentials.cc b/src/cpp/server/insecure_server_credentials.cc index bafd60ded8b..0c89d409adc 100644 --- a/src/cpp/server/insecure_server_credentials.cc +++ b/src/cpp/server/insecure_server_credentials.cc @@ -16,10 +16,16 @@ * */ +#include +#include + #include #include +#include #include +#include #include +#include namespace grpc { namespace { diff --git a/src/cpp/server/load_reporter/constants.h b/src/cpp/server/load_reporter/constants.h index dc9fadeab0a..dab1d7c54a0 100644 --- a/src/cpp/server/load_reporter/constants.h +++ b/src/cpp/server/load_reporter/constants.h @@ -22,6 +22,7 @@ #include #include +#include namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/get_cpu_stats.h b/src/cpp/server/load_reporter/get_cpu_stats.h index f514b0752f7..a037c35952e 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats.h +++ b/src/cpp/server/load_reporter/get_cpu_stats.h @@ -21,6 +21,8 @@ #include +#include + #include namespace grpc { diff --git a/src/cpp/server/load_reporter/get_cpu_stats_linux.cc b/src/cpp/server/load_reporter/get_cpu_stats_linux.cc index f778b137855..f5fdbf865b5 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats_linux.cc +++ b/src/cpp/server/load_reporter/get_cpu_stats_linux.cc @@ -18,6 +18,8 @@ #include +#include + #ifdef GPR_LINUX #include diff --git a/src/cpp/server/load_reporter/load_data_store.cc b/src/cpp/server/load_reporter/load_data_store.cc index 9a65c3e78ba..a5a0c027994 100644 --- a/src/cpp/server/load_reporter/load_data_store.cc +++ b/src/cpp/server/load_reporter/load_data_store.cc @@ -20,14 +20,18 @@ #include "src/cpp/server/load_reporter/load_data_store.h" +#include #include #include +#include #include #include -#include + +#include #include "src/core/lib/iomgr/socket_utils.h" +#include "src/cpp/server/load_reporter/constants.h" namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/load_data_store.h b/src/cpp/server/load_reporter/load_data_store.h index 658b1526a5e..1f0681800ed 100644 --- a/src/cpp/server/load_reporter/load_data_store.h +++ b/src/cpp/server/load_reporter/load_data_store.h @@ -21,14 +21,17 @@ #include +#include +#include + +#include #include #include +#include #include +#include -#include -#include - -#include "src/cpp/server/load_reporter/constants.h" +#include namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/load_reporter.cc b/src/cpp/server/load_reporter/load_reporter.cc index c4ea44e51af..f5dd9582648 100644 --- a/src/cpp/server/load_reporter/load_reporter.cc +++ b/src/cpp/server/load_reporter/load_reporter.cc @@ -25,12 +25,18 @@ #include #include -#include +#include #include +#include +#include + +#include #include "opencensus/stats/internal/set_aggregation_window.h" #include "opencensus/tags/tag_key.h" +#include + #include "src/cpp/server/load_reporter/constants.h" #include "src/cpp/server/load_reporter/get_cpu_stats.h" diff --git a/src/cpp/server/load_reporter/load_reporter.h b/src/cpp/server/load_reporter/load_reporter.h index 586e62db07a..380ed37c53e 100644 --- a/src/cpp/server/load_reporter/load_reporter.h +++ b/src/cpp/server/load_reporter/load_reporter.h @@ -21,20 +21,29 @@ #include +#include +#include + #include #include +#include #include +#include +#include +#include +#include #include +#include + #include "opencensus/stats/stats.h" #include "opencensus/tags/tag_key.h" -#include -#include +#include #include "src/core/lib/gprpp/sync.h" #include "src/cpp/server/load_reporter/load_data_store.h" -#include "src/proto/grpc/lb/v1/load_reporter.grpc.pb.h" +#include "src/proto/grpc/lb/v1/load_reporter.pb.h" namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc index 21164173ac2..05d7f033f81 100644 --- a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc +++ b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc @@ -22,8 +22,17 @@ #include +#include +#include + #include "absl/memory/memory.h" +#include +#include +#include + +#include "src/cpp/server/load_reporter/constants.h" + namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/load_reporter_async_service_impl.h b/src/cpp/server/load_reporter/load_reporter_async_service_impl.h index 728a193af3d..5a3f79a80e1 100644 --- a/src/cpp/server/load_reporter/load_reporter_async_service_impl.h +++ b/src/cpp/server/load_reporter/load_reporter_async_service_impl.h @@ -21,13 +21,25 @@ #include +#include + +#include +#include +#include +#include +#include + #include #include #include +#include +#include #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/thd.h" #include "src/cpp/server/load_reporter/load_reporter.h" +#include "src/proto/grpc/lb/v1/load_reporter.grpc.pb.h" +#include "src/proto/grpc/lb/v1/load_reporter.pb.h" namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc b/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc index 29041c9ffa2..bdb99664aaa 100644 --- a/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc +++ b/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc @@ -18,7 +18,14 @@ #include +#include +#include +#include + +#include #include +#include +#include #include "src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h" diff --git a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc index aa0ac19ff7d..cea1b8eced5 100644 --- a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc +++ b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc @@ -20,7 +20,10 @@ #include "src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h" +#include + #include +#include namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h index 22b8a72ff49..30c4e1bf2a8 100644 --- a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h +++ b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h @@ -21,7 +21,14 @@ #include +#include +#include + +#include #include +#include +#include +#include #include "src/cpp/server/load_reporter/load_reporter_async_service_impl.h" diff --git a/src/cpp/server/load_reporter/util.cc b/src/cpp/server/load_reporter/util.cc index 75be7f16174..475408a00b2 100644 --- a/src/cpp/server/load_reporter/util.cc +++ b/src/cpp/server/load_reporter/util.cc @@ -18,10 +18,16 @@ #include +#include + #include +#include +#include #include #include +#include +#include namespace grpc { namespace load_reporter { diff --git a/src/cpp/server/orca/orca_service.cc b/src/cpp/server/orca/orca_service.cc index ff76427575d..30856eca866 100644 --- a/src/cpp/server/orca/orca_service.cc +++ b/src/cpp/server/orca/orca_service.cc @@ -14,16 +14,41 @@ // limitations under the License. // +#include + +#include +#include +#include + +#include "absl/base/thread_annotations.h" +#include "absl/time/time.h" +#include "absl/types/optional.h" #include "google/protobuf/duration.upb.h" +#include "upb/upb.h" #include "upb/upb.hpp" #include "xds/data/orca/v3/orca_load_report.upb.h" #include "xds/service/orca/v3/orca.upb.h" +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/timer.h" namespace grpc { diff --git a/src/cpp/server/secure_server_credentials.cc b/src/cpp/server/secure_server_credentials.cc index 412b7931fc4..ab20ec305df 100644 --- a/src/cpp/server/secure_server_credentials.cc +++ b/src/cpp/server/secure_server_credentials.cc @@ -18,13 +18,20 @@ #include "src/cpp/server/secure_server_credentials.h" -#include +#include #include #include +#include +#include -#include -#include +#include +#include +#include #include +#include +#include +#include +#include #include "src/cpp/common/secure_auth_context.h" diff --git a/src/cpp/server/secure_server_credentials.h b/src/cpp/server/secure_server_credentials.h index 6a74fd9a487..620e7c76a16 100644 --- a/src/cpp/server/secure_server_credentials.h +++ b/src/cpp/server/secure_server_credentials.h @@ -19,11 +19,17 @@ #ifndef GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H #define GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H +#include + #include +#include +#include #include +#include +#include #include -#include +#include #include "src/cpp/server/thread_pool_interface.h" diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index f0fec7481a8..2d6de7d6903 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -16,20 +16,42 @@ * */ +// IWYU pragma: no_include + +#include +#include +#include + +#include +#include +#include #include +#include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include #include +#include +#include +#include +#include -#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/useful.h" #include "src/cpp/server/external_connection_acceptor_impl.h" -#include "src/cpp/server/thread_pool_interface.h" namespace grpc { diff --git a/src/cpp/server/server_callback.cc b/src/cpp/server/server_callback.cc index 5b2d328b81b..e62052b36f6 100644 --- a/src/cpp/server/server_callback.cc +++ b/src/cpp/server/server_callback.cc @@ -16,8 +16,10 @@ */ #include +#include #include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/executor.h" diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 7d3a62f62bd..6e0f42a2fbf 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -15,40 +15,68 @@ * */ +#include +#include + +#include +#include #include +#include +#include #include +#include #include #include +#include #include "absl/memory/memory.h" +#include #include +#include #include -#include +#include #include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include #include +#include #include #include #include #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "src/core/ext/transport/inproc/inproc_transport.h" #include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/profiling/timers.h" -#include "src/core/lib/surface/call.h" +#include "src/core/lib/resource_quota/api.h" #include "src/core/lib/surface/completion_queue.h" #include "src/core/lib/surface/server.h" #include "src/cpp/client/create_channel_internal.h" diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 6bfe19d46ad..588227431f9 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -16,25 +16,44 @@ * */ -#include +#include + #include +#include +#include +#include +#include +#include #include +#include #include #include +#include +#include +#include #include +#include #include #include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include -#include +#include #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/sync.h" -#include "src/core/lib/surface/call.h" namespace grpc { diff --git a/src/cpp/server/server_posix.cc b/src/cpp/server/server_posix.cc index 5854242176a..01c75c25cd7 100644 --- a/src/cpp/server/server_posix.cc +++ b/src/cpp/server/server_posix.cc @@ -16,8 +16,10 @@ * */ +#include #include #include +#include #include namespace grpc { diff --git a/src/cpp/server/xds_server_credentials.cc b/src/cpp/server/xds_server_credentials.cc index f1842389066..329052488c0 100644 --- a/src/cpp/server/xds_server_credentials.cc +++ b/src/cpp/server/xds_server_credentials.cc @@ -16,6 +16,13 @@ // // +#include + +#include +#include +#include +#include + #include "src/cpp/server/secure_server_credentials.h" namespace grpc { diff --git a/src/cpp/thread_manager/thread_manager.cc b/src/cpp/thread_manager/thread_manager.cc index 25c065588ee..d6144f94094 100644 --- a/src/cpp/thread_manager/thread_manager.cc +++ b/src/cpp/thread_manager/thread_manager.cc @@ -18,12 +18,15 @@ #include "src/cpp/thread_manager/thread_manager.h" +#include + #include #include +#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/thd.h" -#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/resource_quota/resource_quota.h" namespace grpc { diff --git a/src/cpp/thread_manager/thread_manager.h b/src/cpp/thread_manager/thread_manager.h index 4c49854d32e..b2bbba7c6ee 100644 --- a/src/cpp/thread_manager/thread_manager.h +++ b/src/cpp/thread_manager/thread_manager.h @@ -20,14 +20,11 @@ #define GRPC_INTERNAL_CPP_THREAD_MANAGER_H #include -#include - -#include -#include #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/resource_quota/api.h" +#include "src/core/lib/resource_quota/thread_quota.h" namespace grpc { diff --git a/src/cpp/util/byte_buffer_cc.cc b/src/cpp/util/byte_buffer_cc.cc index 5c6f22bd7c6..3ed178b5dbf 100644 --- a/src/cpp/util/byte_buffer_cc.cc +++ b/src/cpp/util/byte_buffer_cc.cc @@ -16,10 +16,18 @@ * */ +#include + #include #include +#include +#include +#include #include #include +#include +#include +#include namespace grpc { diff --git a/src/cpp/util/core_stats.cc b/src/cpp/util/core_stats.cc index edf0b1bb678..5d94b07da83 100644 --- a/src/cpp/util/core_stats.cc +++ b/src/cpp/util/core_stats.cc @@ -18,8 +18,17 @@ #include "src/cpp/util/core_stats.h" +#include + +#include + +#include + +#include #include +#include "src/core/lib/debug/stats_data.h" + using grpc::core::Bucket; using grpc::core::Histogram; using grpc::core::Metric; diff --git a/src/cpp/util/status.cc b/src/cpp/util/status.cc index 93696d81268..3c029f1c289 100644 --- a/src/cpp/util/status.cc +++ b/src/cpp/util/status.cc @@ -17,6 +17,7 @@ */ #include +#include namespace grpc { diff --git a/src/cpp/util/string_ref.cc b/src/cpp/util/string_ref.cc index 8b09a82a634..35348d6138a 100644 --- a/src/cpp/util/string_ref.cc +++ b/src/cpp/util/string_ref.cc @@ -16,6 +16,8 @@ * */ +#include + #include namespace grpc { diff --git a/src/cpp/util/time_cc.cc b/src/cpp/util/time_cc.cc index 6c9c228d7cd..62ee375896c 100644 --- a/src/cpp/util/time_cc.cc +++ b/src/cpp/util/time_cc.cc @@ -16,10 +16,15 @@ * */ +#include +#include + +#include #include -#include #include +// IWYU pragma: no_include + using std::chrono::duration_cast; using std::chrono::high_resolution_clock; using std::chrono::nanoseconds; diff --git a/templates/src/cpp/common/version_cc.cc.template b/templates/src/cpp/common/version_cc.cc.template index 5c14ffd0a22..5fcf6e44174 100644 --- a/templates/src/cpp/common/version_cc.cc.template +++ b/templates/src/cpp/common/version_cc.cc.template @@ -19,9 +19,12 @@ */ /* This file is autogenerated from: - templates/src/core/surface/version.c.template */ + templates/src/cpp/common/version_cc.cc.template */ + #include + #include + #include namespace grpc { std::string Version() { return "${settings.cpp_version}"; } diff --git a/test/cpp/microbenchmarks/bm_opencensus_plugin.cc b/test/cpp/microbenchmarks/bm_opencensus_plugin.cc index 611f9983708..e5636a9b71e 100644 --- a/test/cpp/microbenchmarks/bm_opencensus_plugin.cc +++ b/test/cpp/microbenchmarks/bm_opencensus_plugin.cc @@ -27,6 +27,7 @@ #include #include +#include #include "src/core/lib/config/core_configuration.h" #include "src/cpp/ext/filters/census/grpc_plugin.h" diff --git a/test/cpp/server/load_reporter/load_data_store_test.cc b/test/cpp/server/load_reporter/load_data_store_test.cc index 72a31df98a6..02d5e82f32e 100644 --- a/test/cpp/server/load_reporter/load_data_store_test.cc +++ b/test/cpp/server/load_reporter/load_data_store_test.cc @@ -27,6 +27,7 @@ #include +#include "src/cpp/server/load_reporter/constants.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" diff --git a/tools/dockerfile/grpc_iwyu/iwyu.sh b/tools/dockerfile/grpc_iwyu/iwyu.sh index c5d66259685..1730c8737a3 100755 --- a/tools/dockerfile/grpc_iwyu/iwyu.sh +++ b/tools/dockerfile/grpc_iwyu/iwyu.sh @@ -54,26 +54,28 @@ export ENABLED_MODULES=' src/core/lib/surface src/core/lib/transport src/core/lib/uri + src/cpp ' export INCLUSION_REGEX=`echo $ENABLED_MODULES | sed 's/ /|/g' | sed 's,\\(.*\\),^(\\1)/,g'` # figure out which files to include -cat compile_commands.json | jq -r '.[].file' \ - | grep -E $INCLUSION_REGEX \ +cat compile_commands.json | jq -r '.[].file' \ + | grep -E $INCLUSION_REGEX \ | grep -v -E "/upb-generated/|/upbdefs-generated/" \ - | sort \ + | sort \ > iwyu_files0.txt -cat iwyu_files0.txt \ +cat iwyu_files0.txt \ | xargs -d '\n' ls -1df 2> /dev/null \ - > iwyu_files.txt \ + > iwyu_files.txt \ || true echo '#!/bin/sh -${IWYU_ROOT}/iwyu/iwyu_tool.py -p compile_commands_for_iwyu.json $1 -- -Xiwyu --no_fwd_decls \ - | grep -v -E "port_platform.h" \ - | grep -v -E "^(- )?namespace " \ +${IWYU_ROOT}/iwyu/iwyu_tool.py -p compile_commands_for_iwyu.json $1 \ + -- -Xiwyu --no_fwd_decls -Xiwyu --update_comments \ + | grep -v -E "port_platform.h" \ + | grep -v -E "^(- )?namespace " \ > iwyu/iwyu.`echo $1 | sha1sum`.out ' > iwyu/run_iwyu_on.sh chmod +x iwyu/run_iwyu_on.sh @@ -84,4 +86,8 @@ xargs -n 1 -P $CPU_COUNT -a iwyu_files.txt ${IWYU_ROOT}/iwyu/run_iwyu_on.sh cat iwyu/iwyu.*.out > iwyu.out # apply the suggested changes -${IWYU_ROOT}/iwyu/fix_includes.py --nocomments --nosafe_headers < iwyu.out +${IWYU_ROOT}/iwyu/fix_includes.py \ + --nocomments \ + --nosafe_headers \ + --ignore_re='^include/.*' \ + < iwyu.out \ diff --git a/tools/run_tests/sanity/check_bad_dependencies.sh b/tools/run_tests/sanity/check_bad_dependencies.sh index fa88af2d1a7..8883d928c99 100755 --- a/tools/run_tests/sanity/check_bad_dependencies.sh +++ b/tools/run_tests/sanity/check_bad_dependencies.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -e +set -ex # Make sure that there is no path from known unsecure libraries and targets # to an SSL library. Any failure among these will make the script fail.