Internal changes

PiperOrigin-RevId: 531626077
pull/12773/head
Mike Kruskal 2 years ago committed by Copybara-Service
parent 902af9abf7
commit 8234e3ec56
  1. 18
      src/google/protobuf/descriptor.cc
  2. 2
      src/google/protobuf/descriptor.h

@ -6456,9 +6456,12 @@ void DescriptorBuilder::BuildService(const ServiceDescriptorProto& proto,
BUILD_ARRAY(proto, result, method, BuildMethod, result); BUILD_ARRAY(proto, result, method, BuildMethod, result);
// Copy options. // Copy options.
result->options_ = AllocateOptions( {
proto, result, ServiceDescriptorProto::kOptionsFieldNumber, ServiceOptions* options = AllocateOptions(
"google.protobuf.ServiceOptions", alloc); proto, result, ServiceDescriptorProto::kOptionsFieldNumber,
"google.protobuf.ServiceOptions", alloc);
result->options_ = options;
}
AddSymbol(result->full_name(), nullptr, result->name(), proto, AddSymbol(result->full_name(), nullptr, result->name(), proto,
Symbol(result)); Symbol(result));
@ -6479,9 +6482,12 @@ void DescriptorBuilder::BuildMethod(const MethodDescriptorProto& proto,
result->output_type_.Init(); result->output_type_.Init();
// Copy options. // Copy options.
result->options_ = {
AllocateOptions(proto, result, MethodDescriptorProto::kOptionsFieldNumber, MethodOptions* options = AllocateOptions(
"google.protobuf.MethodOptions", alloc); proto, result, MethodDescriptorProto::kOptionsFieldNumber,
"google.protobuf.MethodOptions", alloc);
result->options_ = options;
}
result->client_streaming_ = proto.client_streaming(); result->client_streaming_ = proto.client_streaming();
result->server_streaming_ = proto.server_streaming(); result->server_streaming_ = proto.server_streaming();

@ -1486,6 +1486,7 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase {
// available extensions of that message. // available extensions of that message.
const ServiceOptions& options() const; const ServiceOptions& options() const;
// The number of methods this service defines. // The number of methods this service defines.
int method_count() const; int method_count() const;
// Gets a MethodDescriptor by index, where 0 <= index < method_count(). // Gets a MethodDescriptor by index, where 0 <= index < method_count().
@ -1587,6 +1588,7 @@ class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase {
// descriptor.proto, and any available extensions of that message. // descriptor.proto, and any available extensions of that message.
const MethodOptions& options() const; const MethodOptions& options() const;
// See Descriptor::CopyTo(). // See Descriptor::CopyTo().
void CopyTo(MethodDescriptorProto* proto) const; void CopyTo(MethodDescriptorProto* proto) const;

Loading…
Cancel
Save