Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/protobuf/src/google/protobuf/compiler/java/java_context.h

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Update to new HEAD (b7632464b4) + restore GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/compiler/java/java_context.h
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_context.h b/third_party/protobuf/src/google/protobuf/compiler/java/java_context.h
index a480e45dc40cdb98067b869fddd32e8977dccef0..f92ae87ea7dcbbf6e37b391b2a07d6bdb82bd936 100644
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_context.h
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_context.h
@@ -39,6 +39,7 @@
#include <vector>
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/compiler/java/java_options.h>
namespace google {
namespace protobuf {
@@ -64,7 +65,7 @@ struct OneofGeneratorInfo;
// generators.
class Context {
public:
- explicit Context(const FileDescriptor* file);
+ Context(const FileDescriptor* file, const Options& options);
~Context();
// Get the name resolver associated with this context. The resolver
@@ -79,15 +80,12 @@ class Context {
const OneofGeneratorInfo* GetOneofGeneratorInfo(
const OneofDescriptor* oneof) const;
+ const Options& options() const { return options_; }
+
// Enforces all the files (including transitive dependencies) to use
// LiteRuntime.
- void SetEnforceLite(bool enforce_lite) {
- enforce_lite_ = enforce_lite;
- }
- bool EnforceLite() const {
- return enforce_lite_;
- }
+ bool EnforceLite() const { return options_.enforce_lite; }
// Does this message class have generated parsing, serialization, and other
// standard methods for which reflection-based fallback implementations exist?
@@ -102,7 +100,7 @@ class Context {
google::protobuf::scoped_ptr<ClassNameResolver> name_resolver_;
map<const FieldDescriptor*, FieldGeneratorInfo> field_generator_info_map_;
map<const OneofDescriptor*, OneofGeneratorInfo> oneof_generator_info_map_;
- bool enforce_lite_;
+ Options options_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Context);
};

Powered by Google App Engine
This is Rietveld 408576698