diff --git a/BUILD b/BUILD index 9cdec863296..0b348478511 100644 --- a/BUILD +++ b/BUILD @@ -239,7 +239,6 @@ GRPCXX_SRCS = [ "src/cpp/client/create_channel.cc", "src/cpp/client/create_channel_internal.cc", "src/cpp/client/create_channel_posix.cc", - "src/cpp/client/credentials_cc.cc", "src/cpp/common/alarm.cc", "src/cpp/common/channel_arguments.cc", "src/cpp/common/channel_filter.cc", @@ -259,7 +258,6 @@ GRPCXX_SRCS = [ "src/cpp/server/server_callback.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", - "src/cpp/server/server_credentials.cc", "src/cpp/server/server_posix.cc", "src/cpp/thread_manager/thread_manager.cc", "src/cpp/util/byte_buffer_cc.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index 325e1e10420..af99d85c4d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3259,7 +3259,6 @@ add_library(grpc++ src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/client/secure_credentials.cc src/cpp/client/xds_credentials.cc @@ -3292,7 +3291,6 @@ add_library(grpc++ src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/server/xds_server_credentials.cc src/cpp/thread_manager/thread_manager.cc @@ -3960,7 +3958,6 @@ add_library(grpc++_unsecure src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/common/alarm.cc src/cpp/common/channel_arguments.cc @@ -3984,7 +3981,6 @@ add_library(grpc++_unsecure src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/thread_manager/thread_manager.cc src/cpp/util/byte_buffer_cc.cc @@ -7013,7 +7009,6 @@ add_executable(binder_transport_test src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/client/secure_credentials.cc src/cpp/common/alarm.cc @@ -7045,7 +7040,6 @@ add_executable(binder_transport_test src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/thread_manager/thread_manager.cc src/cpp/util/byte_buffer_cc.cc @@ -9853,7 +9847,6 @@ add_executable(endpoint_binder_pool_test src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/client/secure_credentials.cc src/cpp/common/alarm.cc @@ -9885,7 +9878,6 @@ add_executable(endpoint_binder_pool_test src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/thread_manager/thread_manager.cc src/cpp/util/byte_buffer_cc.cc @@ -10503,7 +10495,6 @@ add_executable(fake_binder_test src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/client/secure_credentials.cc src/cpp/common/alarm.cc @@ -10535,7 +10526,6 @@ add_executable(fake_binder_test src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/thread_manager/thread_manager.cc src/cpp/util/byte_buffer_cc.cc @@ -21153,7 +21143,6 @@ add_executable(transport_stream_receiver_test src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/client/secure_credentials.cc src/cpp/common/alarm.cc @@ -21185,7 +21174,6 @@ add_executable(transport_stream_receiver_test src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/thread_manager/thread_manager.cc src/cpp/util/byte_buffer_cc.cc @@ -21827,7 +21815,6 @@ add_executable(wire_reader_test src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/client/secure_credentials.cc src/cpp/common/alarm.cc @@ -21859,7 +21846,6 @@ add_executable(wire_reader_test src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/thread_manager/thread_manager.cc src/cpp/util/byte_buffer_cc.cc @@ -21929,7 +21915,6 @@ add_executable(wire_writer_test src/cpp/client/create_channel.cc src/cpp/client/create_channel_internal.cc src/cpp/client/create_channel_posix.cc - src/cpp/client/credentials_cc.cc src/cpp/client/insecure_credentials.cc src/cpp/client/secure_credentials.cc src/cpp/common/alarm.cc @@ -21961,7 +21946,6 @@ add_executable(wire_writer_test src/cpp/server/server_callback.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc - src/cpp/server/server_credentials.cc src/cpp/server/server_posix.cc src/cpp/thread_manager/thread_manager.cc src/cpp/util/byte_buffer_cc.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 85d63478981..7a2f1a95e30 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2966,7 +2966,6 @@ libs: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/client/secure_credentials.cc - src/cpp/client/xds_credentials.cc @@ -2999,7 +2998,6 @@ libs: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/server/xds_server_credentials.cc - src/cpp/thread_manager/thread_manager.cc @@ -3343,7 +3341,6 @@ libs: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/common/alarm.cc - src/cpp/common/channel_arguments.cc @@ -3367,7 +3364,6 @@ libs: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/thread_manager/thread_manager.cc - src/cpp/util/byte_buffer_cc.cc @@ -5017,7 +5013,6 @@ targets: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/client/secure_credentials.cc - src/cpp/common/alarm.cc @@ -5049,7 +5044,6 @@ targets: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/thread_manager/thread_manager.cc - src/cpp/util/byte_buffer_cc.cc @@ -6332,7 +6326,6 @@ targets: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/client/secure_credentials.cc - src/cpp/common/alarm.cc @@ -6364,7 +6357,6 @@ targets: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/thread_manager/thread_manager.cc - src/cpp/util/byte_buffer_cc.cc @@ -6725,7 +6717,6 @@ targets: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/client/secure_credentials.cc - src/cpp/common/alarm.cc @@ -6757,7 +6748,6 @@ targets: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/thread_manager/thread_manager.cc - src/cpp/util/byte_buffer_cc.cc @@ -11881,7 +11871,6 @@ targets: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/client/secure_credentials.cc - src/cpp/common/alarm.cc @@ -11913,7 +11902,6 @@ targets: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/thread_manager/thread_manager.cc - src/cpp/util/byte_buffer_cc.cc @@ -12256,7 +12244,6 @@ targets: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/client/secure_credentials.cc - src/cpp/common/alarm.cc @@ -12288,7 +12275,6 @@ targets: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/thread_manager/thread_manager.cc - src/cpp/util/byte_buffer_cc.cc @@ -12362,7 +12348,6 @@ targets: - src/cpp/client/create_channel.cc - src/cpp/client/create_channel_internal.cc - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - src/cpp/client/insecure_credentials.cc - src/cpp/client/secure_credentials.cc - src/cpp/common/alarm.cc @@ -12394,7 +12379,6 @@ targets: - src/cpp/server/server_callback.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - src/cpp/server/server_posix.cc - src/cpp/thread_manager/thread_manager.cc - src/cpp/util/byte_buffer_cc.cc diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 642af39569f..e0974c1c373 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -1041,7 +1041,6 @@ Pod::Spec.new do |s| 'src/cpp/client/create_channel_internal.cc', 'src/cpp/client/create_channel_internal.h', 'src/cpp/client/create_channel_posix.cc', - 'src/cpp/client/credentials_cc.cc', 'src/cpp/client/insecure_credentials.cc', 'src/cpp/client/secure_credentials.cc', 'src/cpp/client/secure_credentials.h', @@ -1081,7 +1080,6 @@ Pod::Spec.new do |s| 'src/cpp/server/server_callback.cc', 'src/cpp/server/server_cc.cc', 'src/cpp/server/server_context.cc', - 'src/cpp/server/server_credentials.cc', 'src/cpp/server/server_posix.cc', 'src/cpp/server/thread_pool_interface.h', 'src/cpp/server/xds_server_credentials.cc', diff --git a/grpc.gyp b/grpc.gyp index 4cb82859152..2ba5cda5dbf 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1558,7 +1558,6 @@ 'src/cpp/client/create_channel.cc', 'src/cpp/client/create_channel_internal.cc', 'src/cpp/client/create_channel_posix.cc', - 'src/cpp/client/credentials_cc.cc', 'src/cpp/client/insecure_credentials.cc', 'src/cpp/client/secure_credentials.cc', 'src/cpp/client/xds_credentials.cc', @@ -1591,7 +1590,6 @@ 'src/cpp/server/server_callback.cc', 'src/cpp/server/server_cc.cc', 'src/cpp/server/server_context.cc', - 'src/cpp/server/server_credentials.cc', 'src/cpp/server/server_posix.cc', 'src/cpp/server/xds_server_credentials.cc', 'src/cpp/thread_manager/thread_manager.cc', @@ -1701,7 +1699,6 @@ 'src/cpp/client/create_channel.cc', 'src/cpp/client/create_channel_internal.cc', 'src/cpp/client/create_channel_posix.cc', - 'src/cpp/client/credentials_cc.cc', 'src/cpp/client/insecure_credentials.cc', 'src/cpp/common/alarm.cc', 'src/cpp/common/channel_arguments.cc', @@ -1725,7 +1722,6 @@ 'src/cpp/server/server_callback.cc', 'src/cpp/server/server_cc.cc', 'src/cpp/server/server_context.cc', - 'src/cpp/server/server_credentials.cc', 'src/cpp/server/server_posix.cc', 'src/cpp/thread_manager/thread_manager.cc', 'src/cpp/util/byte_buffer_cc.cc', diff --git a/include/grpcpp/impl/grpc_library.h b/include/grpcpp/impl/grpc_library.h index 3a38c960c42..2e960cf2d04 100644 --- a/include/grpcpp/impl/grpc_library.h +++ b/include/grpcpp/impl/grpc_library.h @@ -47,16 +47,6 @@ class GrpcLibrary { bool grpc_init_called_; }; -/// Instantiating this class ensures the proper initialization of gRPC. -class GrpcLibraryInitializer final { - public: - GrpcLibraryInitializer() {} - - /// A no-op method to force the linker to reference this class, which will - /// take care of initializing and shutting down the gRPC runtime. - int summon() { return 0; } -}; - } // namespace internal } // namespace grpc diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h index 0285bcc3b74..7dcbae2f33b 100644 --- a/include/grpcpp/security/credentials.h +++ b/include/grpcpp/security/credentials.h @@ -68,9 +68,6 @@ std::shared_ptr XdsCredentials( /// \see https://grpc.io/docs/guides/auth.html class ChannelCredentials : private grpc::internal::GrpcLibrary { public: - ChannelCredentials(); - ~ChannelCredentials() override; - protected: friend std::shared_ptr CompositeChannelCredentials( const std::shared_ptr& channel_creds, @@ -125,9 +122,6 @@ class ChannelCredentials : private grpc::internal::GrpcLibrary { /// \see https://grpc.io/docs/guides/auth.html class CallCredentials : private grpc::internal::GrpcLibrary { public: - CallCredentials(); - ~CallCredentials() override; - /// Apply this instance's credentials to \a call. virtual bool ApplyToCall(grpc_call* call) = 0; virtual grpc::string DebugString() { diff --git a/include/grpcpp/security/server_credentials.h b/include/grpcpp/security/server_credentials.h index 19cdaafe8df..fa39dbcadde 100644 --- a/include/grpcpp/security/server_credentials.h +++ b/include/grpcpp/security/server_credentials.h @@ -68,9 +68,6 @@ std::shared_ptr XdsServerCredentials( /// Wrapper around \a grpc_server_credentials, a way to authenticate a server. class ServerCredentials : private grpc::internal::GrpcLibrary { public: - ServerCredentials(); - ~ServerCredentials() override; - /// This method is not thread-safe and has to be called before the server is /// started. The last call to this function wins. virtual void SetAuthMetadataProcessor( diff --git a/include/grpcpp/security/tls_certificate_verifier.h b/include/grpcpp/security/tls_certificate_verifier.h index 157e2e90c8f..de2df4194d5 100644 --- a/include/grpcpp/security/tls_certificate_verifier.h +++ b/include/grpcpp/security/tls_certificate_verifier.h @@ -141,8 +141,6 @@ class ExternalCertificateVerifier { // Subclass. template static std::shared_ptr Create(Args&&... args) { - grpc::internal::GrpcLibraryInitializer g_gli_initializer; - g_gli_initializer.summon(); auto* external_verifier = new Subclass(std::forward(args)...); return std::make_shared( grpc_tls_certificate_verifier_external_create( diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index 9475029c8bd..edce3c6332c 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -46,7 +46,6 @@ namespace grpc { -static grpc::internal::GrpcLibraryInitializer g_gli_initializer; Channel::Channel( const std::string& host, grpc_channel* channel, std::vector< @@ -54,7 +53,6 @@ Channel::Channel( interceptor_creators) : host_(host), c_channel_(channel) { interceptor_creators_ = std::move(interceptor_creators); - g_gli_initializer.summon(); } Channel::~Channel() { diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 740b3914e51..223274c2a51 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -53,7 +53,6 @@ class DefaultGlobalClientCallbacks final void Destructor(ClientContext* /*context*/) override {} }; -static internal::GrpcLibraryInitializer g_gli_initializer; static DefaultGlobalClientCallbacks* g_default_client_callbacks = new DefaultGlobalClientCallbacks(); static ClientContext::GlobalCallbacks* g_client_callbacks = @@ -70,7 +69,6 @@ ClientContext::ClientContext() propagate_from_call_(nullptr), compression_algorithm_(GRPC_COMPRESS_NONE), initial_metadata_corked_(false) { - g_gli_initializer.summon(); g_client_callbacks->DefaultConstructor(this); } diff --git a/src/cpp/client/credentials_cc.cc b/src/cpp/client/credentials_cc.cc deleted file mode 100644 index 9dfb2f491ca..00000000000 --- a/src/cpp/client/credentials_cc.cc +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include - -namespace grpc { - -static grpc::internal::GrpcLibraryInitializer g_gli_initializer; -ChannelCredentials::ChannelCredentials() { g_gli_initializer.summon(); } - -ChannelCredentials::~ChannelCredentials() {} - -CallCredentials::CallCredentials() { g_gli_initializer.summon(); } - -CallCredentials::~CallCredentials() {} - -} // namespace grpc diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index c204963df70..7b745c8906f 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -55,12 +55,9 @@ namespace grpc { -static grpc::internal::GrpcLibraryInitializer g_gli_initializer; SecureChannelCredentials::SecureChannelCredentials( grpc_channel_credentials* c_creds) - : c_creds_(c_creds) { - g_gli_initializer.summon(); -} + : c_creds_(c_creds) {} std::shared_ptr SecureChannelCredentials::CreateChannelImpl( const std::string& target, const ChannelArguments& args) { @@ -85,9 +82,7 @@ SecureChannelCredentials::CreateChannelWithInterceptors( } SecureCallCredentials::SecureCallCredentials(grpc_call_credentials* c_creds) - : c_creds_(c_creds) { - g_gli_initializer.summon(); -} + : c_creds_(c_creds) {} bool SecureCallCredentials::ApplyToCall(grpc_call* call) { return grpc_call_set_credentials(call, c_creds_) == GRPC_CALL_OK; diff --git a/src/cpp/common/alarm.cc b/src/cpp/common/alarm.cc index 1b8acafb7bb..868431f4a28 100644 --- a/src/cpp/common/alarm.cc +++ b/src/cpp/common/alarm.cc @@ -133,11 +133,7 @@ class AlarmImpl : public grpc::internal::CompletionQueueTag { }; } // namespace internal -static grpc::internal::GrpcLibraryInitializer g_gli_initializer; - -Alarm::Alarm() : alarm_(new internal::AlarmImpl()) { - g_gli_initializer.summon(); -} +Alarm::Alarm() : alarm_(new internal::AlarmImpl()) {} void Alarm::SetInternal(grpc::CompletionQueue* cq, gpr_timespec deadline, void* tag) { diff --git a/src/cpp/common/completion_queue_cc.cc b/src/cpp/common/completion_queue_cc.cc index 9217e9a1c9e..fae7d62d097 100644 --- a/src/cpp/common/completion_queue_cc.cc +++ b/src/cpp/common/completion_queue_cc.cc @@ -36,8 +36,6 @@ namespace grpc { namespace { -internal::GrpcLibraryInitializer g_gli_initializer; - gpr_once g_once_init_callback_alternative = GPR_ONCE_INIT; grpc_core::Mutex* g_callback_alternative_mu; @@ -134,7 +132,6 @@ CompletionQueue::CompletionQueue(grpc_completion_queue* take) } void CompletionQueue::Shutdown() { - g_gli_initializer.summon(); #ifndef NDEBUG if (!ServerListEmpty()) { gpr_log(GPR_ERROR, diff --git a/src/cpp/common/tls_certificate_verifier.cc b/src/cpp/common/tls_certificate_verifier.cc index f6ff257da8f..c02b796e9db 100644 --- a/src/cpp/common/tls_certificate_verifier.cc +++ b/src/cpp/common/tls_certificate_verifier.cc @@ -37,8 +37,6 @@ namespace grpc { namespace experimental { -static internal::GrpcLibraryInitializer g_gli_initializer; - TlsCustomVerificationCheckRequest::TlsCustomVerificationCheckRequest( grpc_tls_custom_verification_check_request* request) : c_request_(request) { @@ -106,9 +104,7 @@ std::vector TlsCustomVerificationCheckRequest::ip_names() } CertificateVerifier::CertificateVerifier(grpc_tls_certificate_verifier* v) - : verifier_(v) { - g_gli_initializer.summon(); -} + : verifier_(v) {} CertificateVerifier::~CertificateVerifier() { grpc_tls_certificate_verifier_release(verifier_); diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index ccc1a7361e2..25ddf7721d2 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -868,7 +868,6 @@ class Server::SyncRequestThreadManager : public grpc::ThreadManager { std::shared_ptr global_callbacks_; }; -static grpc::internal::GrpcLibraryInitializer g_gli_initializer; Server::Server( grpc::ChannelArguments* args, std::shared_ptr>> @@ -891,7 +890,6 @@ Server::Server( server_(nullptr), server_initializer_(new ServerInitializer(this)), health_check_service_disabled_(false) { - g_gli_initializer.summon(); gpr_once_init(&grpc::g_once_init_callbacks, grpc::InitGlobalCallbacks); global_callbacks_ = grpc::g_callbacks; global_callbacks_->UpdateArguments(args); diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 19ceaaeaee0..a649195c419 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -61,8 +61,6 @@ namespace grpc { -static internal::GrpcLibraryInitializer g_gli_initializer; - // CompletionOp class ServerContextBase::CompletionOp final @@ -259,9 +257,7 @@ bool ServerContextBase::CompletionOp::FinalizeResult(void** tag, bool* status) { // ServerContextBase body ServerContextBase::ServerContextBase() - : deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)) { - g_gli_initializer.summon(); -} + : deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)) {} ServerContextBase::ServerContextBase(gpr_timespec deadline, grpc_metadata_array* arr) diff --git a/src/cpp/server/server_credentials.cc b/src/cpp/server/server_credentials.cc deleted file mode 100644 index 454e8b4e9d6..00000000000 --- a/src/cpp/server/server_credentials.cc +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include - -namespace grpc { - -static internal::GrpcLibraryInitializer g_gli_initializer; -ServerCredentials::ServerCredentials() { g_gli_initializer.summon(); } - -ServerCredentials::~ServerCredentials() {} - -} // namespace grpc diff --git a/src/cpp/util/byte_buffer_cc.cc b/src/cpp/util/byte_buffer_cc.cc index a072fb8d936..279e2397cff 100644 --- a/src/cpp/util/byte_buffer_cc.cc +++ b/src/cpp/util/byte_buffer_cc.cc @@ -30,8 +30,6 @@ namespace grpc { -static internal::GrpcLibraryInitializer g_gli_initializer; - Status ByteBuffer::TrySingleSlice(Slice* slice) const { if (!buffer_) { return Status(StatusCode::FAILED_PRECONDITION, "Buffer not initialized"); diff --git a/test/cpp/cocoapods/test/server_context_test_spouse_test.mm b/test/cpp/cocoapods/test/server_context_test_spouse_test.mm index e26942147a6..3ac71298724 100644 --- a/test/cpp/cocoapods/test/server_context_test_spouse_test.mm +++ b/test/cpp/cocoapods/test/server_context_test_spouse_test.mm @@ -31,8 +31,6 @@ #include -static grpc::internal::GrpcLibraryInitializer g_initializer; - const char key1[] = "metadata-key1"; const char key2[] = "metadata-key2"; const char val1[] = "metadata-val1"; diff --git a/test/cpp/codegen/proto_utils_test.cc b/test/cpp/codegen/proto_utils_test.cc index ffb160a2e45..75297e326b2 100644 --- a/test/cpp/codegen/proto_utils_test.cc +++ b/test/cpp/codegen/proto_utils_test.cc @@ -55,8 +55,6 @@ class ProtoUtilsTest : public ::testing::Test { protected: static void SetUpTestSuite() { // Ensure the ProtoBufferWriter internals are initialized. - grpc::internal::GrpcLibraryInitializer init; - init.summon(); grpc::internal::GrpcLibrary lib; grpc_init(); } @@ -152,8 +150,6 @@ void BufferWriterTest(int block_size, int total_size, int backup_size) { class WriterTest : public ::testing::Test { protected: static void SetUpTestSuite() { - grpc::internal::GrpcLibraryInitializer init; - init.summon(); grpc::internal::GrpcLibrary lib; // Ensure the ProtoBufferWriter internals are initialized. grpc_init(); diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc index 67b20019587..3f504256a47 100644 --- a/test/cpp/microbenchmarks/helpers.cc +++ b/test/cpp/microbenchmarks/helpers.cc @@ -20,14 +20,11 @@ #include -static grpc::internal::GrpcLibraryInitializer g_gli_initializer; static LibraryInitializer* g_libraryInitializer; LibraryInitializer::LibraryInitializer() { GPR_ASSERT(g_libraryInitializer == nullptr); g_libraryInitializer = this; - - g_gli_initializer.summon(); } LibraryInitializer::~LibraryInitializer() { g_libraryInitializer = nullptr; } diff --git a/test/cpp/test/client_context_test_peer_test.cc b/test/cpp/test/client_context_test_peer_test.cc index 67ab62d6cb2..f04032494d6 100644 --- a/test/cpp/test/client_context_test_peer_test.cc +++ b/test/cpp/test/client_context_test_peer_test.cc @@ -27,8 +27,6 @@ namespace grpc { namespace testing { -static internal::GrpcLibraryInitializer g_initializer; - const char key1[] = "metadata-key1"; const char key2[] = "metadata-key2"; const char val1[] = "metadata-val1"; diff --git a/test/cpp/test/server_context_test_spouse_test.cc b/test/cpp/test/server_context_test_spouse_test.cc index cb11dcbf0e4..8034fbcb8c5 100644 --- a/test/cpp/test/server_context_test_spouse_test.cc +++ b/test/cpp/test/server_context_test_spouse_test.cc @@ -27,8 +27,6 @@ namespace grpc { namespace testing { -static internal::GrpcLibraryInitializer g_initializer; - const char key1[] = "metadata-key1"; const char key2[] = "metadata-key2"; const char val1[] = "metadata-val1"; diff --git a/test/cpp/util/byte_buffer_test.cc b/test/cpp/util/byte_buffer_test.cc index e8b527a9c06..4fd27c30f03 100644 --- a/test/cpp/util/byte_buffer_test.cc +++ b/test/cpp/util/byte_buffer_test.cc @@ -31,8 +31,6 @@ namespace grpc { -static internal::GrpcLibraryInitializer g_gli_initializer; - namespace { const char* kContent1 = "hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; diff --git a/test/cpp/util/slice_test.cc b/test/cpp/util/slice_test.cc index c8593f013ba..2bb57cc2302 100644 --- a/test/cpp/util/slice_test.cc +++ b/test/cpp/util/slice_test.cc @@ -27,8 +27,6 @@ namespace grpc { -static internal::GrpcLibraryInitializer g_gli_initializer; - namespace { const char* kContent = "hello xxxxxxxxxxxxxxxxxxxx world"; diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index cbd2d908e57..6d698f3bd84 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2631,7 +2631,6 @@ src/cpp/client/create_channel.cc \ src/cpp/client/create_channel_internal.cc \ src/cpp/client/create_channel_internal.h \ src/cpp/client/create_channel_posix.cc \ -src/cpp/client/credentials_cc.cc \ src/cpp/client/insecure_credentials.cc \ src/cpp/client/secure_credentials.cc \ src/cpp/client/secure_credentials.h \ @@ -2671,7 +2670,6 @@ src/cpp/server/server_builder.cc \ src/cpp/server/server_callback.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ -src/cpp/server/server_credentials.cc \ src/cpp/server/server_posix.cc \ src/cpp/server/thread_pool_interface.h \ src/cpp/server/xds_server_credentials.cc \