Change ProtoReflectionDescriptorDatabase to take grpc::ChannelInterface. (#31858)

Updates the ProtoReflectionDescriptorDatabase ctor to take a reference
to std::shared_ptr<grpc::ChannelInterface> rather than
std::shared_ptr<grpc::Channel>. This helps code that is making use of
grpc::ChannelInterface from having to perform a cast from the Base to
the Derived when creating the refelction db.
pull/32041/head
cut4th 2 years ago committed by GitHub
parent 70d0b21e2a
commit aa2956b05b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/cpp/util/proto_reflection_descriptor_database.cc
  2. 2
      test/cpp/util/proto_reflection_descriptor_database.h

@ -35,7 +35,7 @@ ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase(
: stub_(std::move(stub)) {}
ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase(
const std::shared_ptr<grpc::Channel>& channel)
const std::shared_ptr<grpc::ChannelInterface>& channel)
: stub_(ServerReflection::NewStub(channel)) {}
ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {

@ -39,7 +39,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase {
std::unique_ptr<reflection::v1alpha::ServerReflection::Stub> stub);
explicit ProtoReflectionDescriptorDatabase(
const std::shared_ptr<grpc::Channel>& channel);
const std::shared_ptr<grpc::ChannelInterface>& channel);
~ProtoReflectionDescriptorDatabase() override;

Loading…
Cancel
Save