Index: third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc |
index 735d164a48f3157513c5f92f4f10cf5dc772ca67..16411e49c70475bd7fad184a168d453b39e3c4d0 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc |
+++ b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc |
@@ -39,14 +39,17 @@ |
#include <google/protobuf/compiler/csharp/csharp_source_generator_base.h> |
#include <google/protobuf/compiler/csharp/csharp_helpers.h> |
+#include <google/protobuf/compiler/csharp/csharp_names.h> |
+#include <google/protobuf/compiler/csharp/csharp_options.h> |
namespace google { |
namespace protobuf { |
namespace compiler { |
namespace csharp { |
-SourceGeneratorBase::SourceGeneratorBase(const FileDescriptor* descriptor) |
- : descriptor_(descriptor) { |
+SourceGeneratorBase::SourceGeneratorBase(const FileDescriptor* descriptor, |
+ const Options *options) |
+ : descriptor_(descriptor), options_(options) { |
} |
SourceGeneratorBase::~SourceGeneratorBase() { |
@@ -57,7 +60,11 @@ void SourceGeneratorBase::WriteGeneratedCodeAttributes(io::Printer* printer) { |
} |
std::string SourceGeneratorBase::class_access_level() { |
- return IsDescriptorProto(descriptor_) ? "internal" : "public"; // public_classes is always on. |
+ return (IsDescriptorProto(descriptor_) || this->options()->internal_access) ? "internal" : "public"; |
+} |
+ |
+const Options* SourceGeneratorBase::options() { |
+ return this->options_; |
} |
} // namespace csharp |