aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Robbie Shade <rjshade@google.com>2016-07-26 07:44:10 -0400
committerGravatar Robbie Shade <rjshade@google.com>2016-07-26 07:44:10 -0400
commit43b633d54f4708750cffe4374c9f56c65bec8fef (patch)
tree8b1813cd15a7792bfadf1275ab59773d74e71efc /test/cpp
parent53826511f95cbfa31e3b8316b11cf397830502b0 (diff)
parent7b104cd1c23a3e6ee3cb0809f39617ceda5e2575 (diff)
Merge branch 'master' into move_timeout_encoding
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/end2end/async_end2end_test.cc15
-rw-r--r--test/cpp/end2end/end2end_test.cc2
-rw-r--r--test/cpp/end2end/proto_server_reflection_test.cc24
-rw-r--r--test/cpp/util/grpc_cli.cc89
-rw-r--r--test/cpp/util/proto_file_parser.cc47
-rw-r--r--test/cpp/util/proto_file_parser.h11
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.cc24
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.h23
8 files changed, 154 insertions, 81 deletions
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 4a8936d281..ac79fe8274 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -200,6 +200,10 @@ class Verifier {
bool spin_;
};
+bool plugin_has_sync_methods(std::unique_ptr<ServerBuilderPlugin>& plugin) {
+ return plugin->has_sync_methods();
+}
+
// This class disables the server builder plugins that may add sync services to
// the server. If there are sync services, UnimplementedRpc test will triger
// the sync unkown rpc routine on the server side, rather than the async one
@@ -210,14 +214,9 @@ class ServerBuilderSyncPluginDisabler : public ::grpc::ServerBuilderOption {
void UpdatePlugins(std::vector<std::unique_ptr<ServerBuilderPlugin>>* plugins)
GRPC_OVERRIDE {
- auto plugin = plugins->begin();
- while (plugin != plugins->end()) {
- if ((*plugin)->has_sync_methods()) {
- plugins->erase(plugin++);
- } else {
- plugin++;
- }
- }
+ plugins->erase(std::remove_if(plugins->begin(), plugins->end(),
+ plugin_has_sync_methods),
+ plugins->end());
}
};
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 0f87ae3e44..46a58d3ac3 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -1414,7 +1414,7 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) {
std::shared_ptr<const AuthContext> auth_ctx = context.auth_context();
std::vector<grpc::string_ref> tst =
auth_ctx->FindPropertyValues("transport_security_type");
- EXPECT_EQ(1u, tst.size());
+ ASSERT_EQ(1u, tst.size());
EXPECT_EQ(GetParam().credentials_type, ToString(tst[0]));
if (GetParam().credentials_type == kTlsCredentialsType) {
EXPECT_EQ("x509_subject_alternative_name",
diff --git a/test/cpp/end2end/proto_server_reflection_test.cc b/test/cpp/end2end/proto_server_reflection_test.cc
index f8fc39b553..efbb0e1f8e 100644
--- a/test/cpp/end2end/proto_server_reflection_test.cc
+++ b/test/cpp/end2end/proto_server_reflection_test.cc
@@ -31,7 +31,6 @@
*
*/
-#include <google/protobuf/descriptor.h>
#include <grpc++/channel.h>
#include <grpc++/client_context.h>
#include <grpc++/create_channel.h>
@@ -59,7 +58,7 @@ class ProtoServerReflectionTest : public ::testing::Test {
void SetUp() GRPC_OVERRIDE {
port_ = grpc_pick_unused_port_or_die();
- ref_desc_pool_ = google::protobuf::DescriptorPool::generated_pool();
+ ref_desc_pool_ = protobuf::DescriptorPool::generated_pool();
ServerBuilder builder;
grpc::string server_address = "localhost:" + to_string(port_);
@@ -73,7 +72,7 @@ class ProtoServerReflectionTest : public ::testing::Test {
CreateChannel(target, InsecureChannelCredentials());
stub_ = grpc::testing::EchoTestService::NewStub(channel);
desc_db_.reset(new ProtoReflectionDescriptorDatabase(channel));
- desc_pool_.reset(new google::protobuf::DescriptorPool(desc_db_.get()));
+ desc_pool_.reset(new protobuf::DescriptorPool(desc_db_.get()));
}
string to_string(const int number) {
@@ -83,15 +82,15 @@ class ProtoServerReflectionTest : public ::testing::Test {
}
void CompareService(const grpc::string& service) {
- const google::protobuf::ServiceDescriptor* service_desc =
+ const protobuf::ServiceDescriptor* service_desc =
desc_pool_->FindServiceByName(service);
- const google::protobuf::ServiceDescriptor* ref_service_desc =
+ const protobuf::ServiceDescriptor* ref_service_desc =
ref_desc_pool_->FindServiceByName(service);
EXPECT_TRUE(service_desc != nullptr);
EXPECT_TRUE(ref_service_desc != nullptr);
EXPECT_EQ(service_desc->DebugString(), ref_service_desc->DebugString());
- const google::protobuf::FileDescriptor* file_desc = service_desc->file();
+ const protobuf::FileDescriptor* file_desc = service_desc->file();
if (known_files_.find(file_desc->package() + "/" + file_desc->name()) !=
known_files_.end()) {
EXPECT_EQ(file_desc->DebugString(),
@@ -105,9 +104,9 @@ class ProtoServerReflectionTest : public ::testing::Test {
}
void CompareMethod(const grpc::string& method) {
- const google::protobuf::MethodDescriptor* method_desc =
+ const protobuf::MethodDescriptor* method_desc =
desc_pool_->FindMethodByName(method);
- const google::protobuf::MethodDescriptor* ref_method_desc =
+ const protobuf::MethodDescriptor* ref_method_desc =
ref_desc_pool_->FindMethodByName(method);
EXPECT_TRUE(method_desc != nullptr);
EXPECT_TRUE(ref_method_desc != nullptr);
@@ -122,9 +121,8 @@ class ProtoServerReflectionTest : public ::testing::Test {
return;
}
- const google::protobuf::Descriptor* desc =
- desc_pool_->FindMessageTypeByName(type);
- const google::protobuf::Descriptor* ref_desc =
+ const protobuf::Descriptor* desc = desc_pool_->FindMessageTypeByName(type);
+ const protobuf::Descriptor* ref_desc =
ref_desc_pool_->FindMessageTypeByName(type);
EXPECT_TRUE(desc != nullptr);
EXPECT_TRUE(ref_desc != nullptr);
@@ -135,10 +133,10 @@ class ProtoServerReflectionTest : public ::testing::Test {
std::unique_ptr<Server> server_;
std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
std::unique_ptr<ProtoReflectionDescriptorDatabase> desc_db_;
- std::unique_ptr<google::protobuf::DescriptorPool> desc_pool_;
+ std::unique_ptr<protobuf::DescriptorPool> desc_pool_;
std::unordered_set<string> known_files_;
std::unordered_set<string> known_types_;
- const google::protobuf::DescriptorPool* ref_desc_pool_;
+ const protobuf::DescriptorPool* ref_desc_pool_;
int port_;
reflection::ProtoServerReflectionPlugin plugin_;
};
diff --git a/test/cpp/util/grpc_cli.cc b/test/cpp/util/grpc_cli.cc
index c52e48bae6..53529da782 100644
--- a/test/cpp/util/grpc_cli.cc
+++ b/test/cpp/util/grpc_cli.cc
@@ -34,18 +34,21 @@
/*
A command line tool to talk to a grpc server.
Example of talking to grpc interop server:
- grpc_cli call localhost:50051 UnaryCall src/proto/grpc/testing/test.proto \
- "response_size:10" --enable_ssl=false
+ grpc_cli call localhost:50051 UnaryCall "response_size:10" \
+ --protofiles=src/proto/grpc/testing/test.proto --enable_ssl=false
Options:
- 1. --proto_path, if your proto file is not under current working directory,
+ 1. --protofiles, use this flag to provide a proto file if the server does
+ does not have the reflection service.
+ 2. --proto_path, if your proto file is not under current working directory,
use this flag to provide a search root. It should work similar to the
- counterpart in protoc.
- 2. --metadata specifies metadata to be sent to the server, such as:
+ counterpart in protoc. This option is valid only when protofiles is
+ provided.
+ 3. --metadata specifies metadata to be sent to the server, such as:
--metadata="MyHeaderKey1:Value1:MyHeaderKey2:Value2"
- 3. --enable_ssl, whether to use tls.
- 4. --use_auth, if set to true, attach a GoogleDefaultCredentials to the call
- 3. --input_binary_file, a file containing the serialized request. The file
+ 4. --enable_ssl, whether to use tls.
+ 5. --use_auth, if set to true, attach a GoogleDefaultCredentials to the call
+ 6. --input_binary_file, a file containing the serialized request. The file
can be generated by calling something like:
protoc --proto_path=src/proto/grpc/testing/ \
--encode=grpc.testing.SimpleRequest \
@@ -53,7 +56,7 @@
< input.txt > input.bin
If this is used and no proto file is provided in the argument list, the
method string has to be exact in the form of /package.service/method.
- 4. --output_binary_file, a file to write binary format response into, it can
+ 7. --output_binary_file, a file to write binary format response into, it can
be later decoded using protoc:
protoc --proto_path=src/proto/grpc/testing/ \
--decode=grpc.testing.SimpleResponse \
@@ -61,6 +64,7 @@
< output.bin > output.txt
*/
+#include <unistd.h>
#include <fstream>
#include <iostream>
#include <sstream>
@@ -86,6 +90,8 @@ DEFINE_string(output_binary_file, "",
DEFINE_string(metadata, "",
"Metadata to send to server, in the form of key1:val1:key2:val2");
DEFINE_string(proto_path, ".", "Path to look for the proto file.");
+// TODO(zyc): support a list of input proto files
+DEFINE_string(protofiles, "", "Name of the proto file.");
void ParseMetadataFlag(
std::multimap<grpc::string, grpc::string>* client_metadata) {
@@ -129,35 +135,61 @@ void PrintMetadata(const T& m, const grpc::string& message) {
int main(int argc, char** argv) {
grpc::testing::InitTest(&argc, &argv, true);
- if (argc < 4 || argc == 5 || grpc::string(argv[1]) != "call") {
+ if (argc < 4 || grpc::string(argv[1]) != "call") {
std::cout << "Usage: grpc_cli call server_host:port method_name "
<< "[proto file] [text format request] [<options>]" << std::endl;
+ return 1;
}
- grpc::string file_name;
grpc::string request_text;
grpc::string server_address(argv[2]);
grpc::string method_name(argv[3]);
std::unique_ptr<grpc::testing::ProtoFileParser> parser;
grpc::string serialized_request_proto;
- if (argc == 6) {
- file_name = argv[4];
- // TODO(yangg) read from stdin as well?
- request_text = argv[5];
+ if (argc == 5) {
+ request_text = argv[4];
+ }
+
+ std::shared_ptr<grpc::ChannelCredentials> creds;
+ if (!FLAGS_enable_ssl) {
+ creds = grpc::InsecureChannelCredentials();
+ } else {
+ if (FLAGS_use_auth) {
+ creds = grpc::GoogleDefaultCredentials();
+ } else {
+ creds = grpc::SslCredentials(grpc::SslCredentialsOptions());
+ }
}
+ std::shared_ptr<grpc::Channel> channel =
+ grpc::CreateChannel(server_address, creds);
if (request_text.empty() && FLAGS_input_binary_file.empty()) {
- std::cout << "Missing input. Use text format input or "
- << "--input_binary_file for serialized request" << std::endl;
- return 1;
- } else if (!request_text.empty()) {
- parser.reset(new grpc::testing::ProtoFileParser(FLAGS_proto_path, file_name,
- method_name));
+ if (isatty(STDIN_FILENO)) {
+ std::cout << "reading request message from stdin..." << std::endl;
+ }
+ std::stringstream input_stream;
+ input_stream << std::cin.rdbuf();
+ request_text = input_stream.str();
+ }
+
+ if (!request_text.empty()) {
+ if (!FLAGS_protofiles.empty()) {
+ parser.reset(new grpc::testing::ProtoFileParser(
+ FLAGS_proto_path, FLAGS_protofiles, method_name));
+ } else {
+ parser.reset(new grpc::testing::ProtoFileParser(channel, method_name));
+ }
method_name = parser->GetFullMethodName();
if (parser->HasError()) {
return 1;
}
+
+ if (!FLAGS_input_binary_file.empty()) {
+ std::cout
+ << "warning: request given in argv, ignoring --input_binary_file"
+ << std::endl;
+ }
}
if (parser) {
@@ -175,19 +207,6 @@ int main(int argc, char** argv) {
}
std::cout << "connecting to " << server_address << std::endl;
- std::shared_ptr<grpc::ChannelCredentials> creds;
- if (!FLAGS_enable_ssl) {
- creds = grpc::InsecureChannelCredentials();
- } else {
- if (FLAGS_use_auth) {
- creds = grpc::GoogleDefaultCredentials();
- } else {
- creds = grpc::SslCredentials(grpc::SslCredentialsOptions());
- }
- }
- std::shared_ptr<grpc::Channel> channel =
- grpc::CreateChannel(server_address, creds);
-
grpc::string serialized_response_proto;
std::multimap<grpc::string, grpc::string> client_metadata;
std::multimap<grpc::string_ref, grpc::string_ref> server_initial_metadata,
@@ -219,7 +238,7 @@ int main(int argc, char** argv) {
}
} else {
std::cout << "Rpc failed with status code " << s.error_code()
- << " error message " << s.error_message() << std::endl;
+ << ", error message: " << s.error_message() << std::endl;
}
return 0;
diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc
index 25aec329eb..5b0d925e1c 100644
--- a/test/cpp/util/proto_file_parser.cc
+++ b/test/cpp/util/proto_file_parser.cc
@@ -95,9 +95,48 @@ ProtoFileParser::ProtoFileParser(const grpc::string& proto_path,
dynamic_factory_.reset(
new google::protobuf::DynamicMessageFactory(importer_->pool()));
+ std::vector<const google::protobuf::ServiceDescriptor*> service_desc_list;
+ for (int i = 0; i < file_desc->service_count(); i++) {
+ service_desc_list.push_back(file_desc->service(i));
+ }
+ InitProtoFileParser(method, service_desc_list);
+}
+
+ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
+ const grpc::string& method)
+ : has_error_(false),
+ desc_db_(new grpc::ProtoReflectionDescriptorDatabase(channel)),
+ desc_pool_(new google::protobuf::DescriptorPool(desc_db_.get())) {
+ std::vector<std::string> service_list;
+ if (!desc_db_->GetServices(&service_list)) {
+ LogError(
+ "Failed to get services from the server, "
+ "it may not have the reflection service.\n"
+ "Please try to use the --protofiles option to provide a proto file.");
+ }
+ if (has_error_) {
+ return;
+ }
+ dynamic_factory_.reset(
+ new google::protobuf::DynamicMessageFactory(desc_pool_.get()));
+
+ std::vector<const google::protobuf::ServiceDescriptor*> service_desc_list;
+ for (auto it = service_list.begin(); it != service_list.end(); it++) {
+ service_desc_list.push_back(desc_pool_->FindServiceByName(*it));
+ }
+ InitProtoFileParser(method, service_desc_list);
+}
+
+ProtoFileParser::~ProtoFileParser() {}
+
+void ProtoFileParser::InitProtoFileParser(
+ const grpc::string& method,
+ const std::vector<const google::protobuf::ServiceDescriptor*>
+ service_desc_list) {
const google::protobuf::MethodDescriptor* method_descriptor = nullptr;
- for (int i = 0; !method_descriptor && i < file_desc->service_count(); i++) {
- const auto* service_desc = file_desc->service(i);
+ for (auto it = service_desc_list.begin(); it != service_desc_list.end();
+ it++) {
+ const auto* service_desc = *it;
for (int j = 0; j < service_desc->method_count(); j++) {
const auto* method_desc = service_desc->method(j);
if (MethodNameMatch(method_desc->full_name(), method)) {
@@ -130,8 +169,6 @@ ProtoFileParser::ProtoFileParser(const grpc::string& proto_path,
dynamic_factory_->GetPrototype(method_descriptor->output_type())->New());
}
-ProtoFileParser::~ProtoFileParser() {}
-
grpc::string ProtoFileParser::GetSerializedProto(
const grpc::string& text_format_proto, bool is_request) {
grpc::string serialized;
@@ -143,7 +180,7 @@ grpc::string ProtoFileParser::GetSerializedProto(
LogError("Failed to parse text format to proto.");
return "";
}
- ok = request_prototype_->SerializeToString(&serialized);
+ ok = msg->SerializeToString(&serialized);
if (!ok) {
LogError("Failed to serialize proto.");
return "";
diff --git a/test/cpp/util/proto_file_parser.h b/test/cpp/util/proto_file_parser.h
index 46cdd66503..b442d77db9 100644
--- a/test/cpp/util/proto_file_parser.h
+++ b/test/cpp/util/proto_file_parser.h
@@ -38,8 +38,10 @@
#include <google/protobuf/compiler/importer.h>
#include <google/protobuf/dynamic_message.h>
+#include <grpc++/channel.h>
#include "src/compiler/config.h"
+#include "test/cpp/util/proto_reflection_descriptor_database.h"
namespace grpc {
namespace testing {
@@ -53,6 +55,9 @@ class ProtoFileParser {
// even just Method. It will log an error if there is ambiguity.
ProtoFileParser(const grpc::string& proto_path, const grpc::string& file_name,
const grpc::string& method);
+
+ ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
+ const grpc::string& method);
~ProtoFileParser();
grpc::string GetFullMethodName() const { return full_method_name_; }
@@ -68,12 +73,18 @@ class ProtoFileParser {
void LogError(const grpc::string& error_msg);
private:
+ void InitProtoFileParser(
+ const grpc::string& method,
+ const std::vector<const google::protobuf::ServiceDescriptor*> services);
+
bool has_error_;
grpc::string request_text_;
grpc::string full_method_name_;
google::protobuf::compiler::DiskSourceTree source_tree_;
std::unique_ptr<ErrorPrinter> error_printer_;
std::unique_ptr<google::protobuf::compiler::Importer> importer_;
+ std::unique_ptr<grpc::ProtoReflectionDescriptorDatabase> desc_db_;
+ std::unique_ptr<google::protobuf::DescriptorPool> desc_pool_;
std::unique_ptr<google::protobuf::DynamicMessageFactory> dynamic_factory_;
std::unique_ptr<grpc::protobuf::Message> request_prototype_;
std::unique_ptr<grpc::protobuf::Message> response_prototype_;
diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc
index 25b720aee0..8fd466feb0 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.cc
+++ b/test/cpp/util/proto_reflection_descriptor_database.cc
@@ -53,10 +53,20 @@ ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase(
std::shared_ptr<grpc::Channel> channel)
: stub_(ServerReflection::NewStub(channel)) {}
-ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {}
+ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {
+ if (stream_) {
+ stream_->WritesDone();
+ Status status = stream_->Finish();
+ if (!status.ok()) {
+ gpr_log(GPR_ERROR,
+ "ServerReflectionInfo rpc failed. Error code: %d, details: %s",
+ (int)status.error_code(), status.error_message().c_str());
+ }
+ }
+}
bool ProtoReflectionDescriptorDatabase::FindFileByName(
- const string& filename, google::protobuf::FileDescriptorProto* output) {
+ const string& filename, protobuf::FileDescriptorProto* output) {
if (cached_db_.FindFileByName(filename, output)) {
return true;
}
@@ -101,7 +111,7 @@ bool ProtoReflectionDescriptorDatabase::FindFileByName(
}
bool ProtoReflectionDescriptorDatabase::FindFileContainingSymbol(
- const string& symbol_name, google::protobuf::FileDescriptorProto* output) {
+ const string& symbol_name, protobuf::FileDescriptorProto* output) {
if (cached_db_.FindFileContainingSymbol(symbol_name, output)) {
return true;
}
@@ -148,7 +158,7 @@ bool ProtoReflectionDescriptorDatabase::FindFileContainingSymbol(
bool ProtoReflectionDescriptorDatabase::FindFileContainingExtension(
const string& containing_type, int field_number,
- google::protobuf::FileDescriptorProto* output) {
+ protobuf::FileDescriptorProto* output) {
if (cached_db_.FindFileContainingExtension(containing_type, field_number,
output)) {
return true;
@@ -276,10 +286,10 @@ bool ProtoReflectionDescriptorDatabase::GetServices(
return false;
}
-const google::protobuf::FileDescriptorProto
+const protobuf::FileDescriptorProto
ProtoReflectionDescriptorDatabase::ParseFileDescriptorProtoResponse(
const std::string& byte_fd_proto) {
- google::protobuf::FileDescriptorProto file_desc_proto;
+ protobuf::FileDescriptorProto file_desc_proto;
file_desc_proto.ParseFromString(byte_fd_proto);
return file_desc_proto;
}
@@ -287,7 +297,7 @@ ProtoReflectionDescriptorDatabase::ParseFileDescriptorProtoResponse(
void ProtoReflectionDescriptorDatabase::AddFileFromResponse(
const grpc::reflection::v1alpha::FileDescriptorResponse& response) {
for (int i = 0; i < response.file_descriptor_proto_size(); ++i) {
- const google::protobuf::FileDescriptorProto file_proto =
+ const protobuf::FileDescriptorProto file_proto =
ParseFileDescriptorProtoResponse(response.file_descriptor_proto(i));
if (known_files_.find(file_proto.name()) == known_files_.end()) {
known_files_.insert(file_proto.name());
diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h
index 99c00675bb..eb7cf4907d 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.h
+++ b/test/cpp/util/proto_reflection_descriptor_database.h
@@ -38,19 +38,19 @@
#include <unordered_set>
#include <vector>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/descriptor_database.h>
+// GRPC_NO_GENERATED_CODE indicates generated pb files should not be used
+#ifdef GRPC_NO_GENERATED_CODE
+#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h"
+#else
#include <grpc++/ext/reflection.grpc.pb.h>
+#endif // GRPC_NO_GENERATED_CODE
#include <grpc++/grpc++.h>
-
namespace grpc {
// ProtoReflectionDescriptorDatabase takes a stub of ServerReflection and
// provides the methods defined by DescriptorDatabase interfaces. It can be used
// to feed a DescriptorPool instance.
-class ProtoReflectionDescriptorDatabase
- : public google::protobuf::DescriptorDatabase {
+class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase {
public:
explicit ProtoReflectionDescriptorDatabase(
std::unique_ptr<reflection::v1alpha::ServerReflection::Stub> stub);
@@ -65,14 +65,13 @@ class ProtoReflectionDescriptorDatabase
// Find a file by file name. Fills in in *output and returns true if found.
// Otherwise, returns false, leaving the contents of *output undefined.
bool FindFileByName(const string& filename,
- google::protobuf::FileDescriptorProto* output)
- GRPC_OVERRIDE;
+ protobuf::FileDescriptorProto* output) GRPC_OVERRIDE;
// Find the file that declares the given fully-qualified symbol name.
// If found, fills in *output and returns true, otherwise returns false
// and leaves *output undefined.
bool FindFileContainingSymbol(const string& symbol_name,
- google::protobuf::FileDescriptorProto* output)
+ protobuf::FileDescriptorProto* output)
GRPC_OVERRIDE;
// Find the file which defines an extension extending the given message type
@@ -81,7 +80,7 @@ class ProtoReflectionDescriptorDatabase
// must be a fully-qualified type name.
bool FindFileContainingExtension(
const string& containing_type, int field_number,
- google::protobuf::FileDescriptorProto* output) GRPC_OVERRIDE;
+ protobuf::FileDescriptorProto* output) GRPC_OVERRIDE;
// Finds the tag numbers used by all known extensions of
// extendee_type, and appends them to output in an undefined
@@ -102,7 +101,7 @@ class ProtoReflectionDescriptorDatabase
grpc::reflection::v1alpha::ServerReflectionResponse>
ClientStream;
- const google::protobuf::FileDescriptorProto ParseFileDescriptorProtoResponse(
+ const protobuf::FileDescriptorProto ParseFileDescriptorProtoResponse(
const std::string& byte_fd_proto);
void AddFileFromResponse(
@@ -123,7 +122,7 @@ class ProtoReflectionDescriptorDatabase
std::unordered_map<string, std::vector<int>> cached_extension_numbers_;
std::mutex stream_mutex_;
- google::protobuf::SimpleDescriptorDatabase cached_db_;
+ protobuf::SimpleDescriptorDatabase cached_db_;
};
} // namespace grpc