[event_engine] Move security executor usage to event engine (#31231)

* [event_engine] Move security executor usage to event engine

* build-fix

* fix-iwyu
pull/31239/head
Craig Tiller 2 years ago committed by GitHub
parent a10a591612
commit c802adfa8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 21
      src/cpp/client/secure_credentials.cc

@ -7326,6 +7326,7 @@ grpc_cc_library(
"channel_init",
"channel_stack_type",
"config",
"default_event_engine",
"env",
"error",
"gpr",

@ -29,6 +29,7 @@
#include "absl/strings/str_join.h"
#include "absl/types/optional.h"
#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/slice.h>
@ -42,10 +43,9 @@
#include <grpcpp/support/slice.h>
#include <grpcpp/support/status.h>
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/gprpp/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/util/json_util.h"
@ -412,14 +412,6 @@ std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
c_plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr));
}
namespace {
void DeleteWrapper(void* wrapper, grpc_error_handle /*ignored*/) {
MetadataCredentialsPluginWrapper* w =
static_cast<MetadataCredentialsPluginWrapper*>(wrapper);
delete w;
}
} // namespace
char* MetadataCredentialsPluginWrapper::DebugString(void* wrapper) {
GPR_ASSERT(wrapper);
MetadataCredentialsPluginWrapper* w =
@ -429,10 +421,11 @@ char* MetadataCredentialsPluginWrapper::DebugString(void* wrapper) {
void MetadataCredentialsPluginWrapper::Destroy(void* wrapper) {
if (wrapper == nullptr) return;
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_core::Executor::Run(GRPC_CLOSURE_CREATE(DeleteWrapper, wrapper, nullptr),
absl::OkStatus());
grpc_event_engine::experimental::GetDefaultEventEngine()->Run([wrapper] {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
delete static_cast<MetadataCredentialsPluginWrapper*>(wrapper);
});
}
int MetadataCredentialsPluginWrapper::GetMetadata(

Loading…
Cancel
Save