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

Unified Diff: third_party/protobuf/python/google/protobuf/pyext/cpp_message.py

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years 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/python/google/protobuf/pyext/cpp_message.py
diff --git a/third_party/protobuf/python/google/protobuf/pyext/cpp_message.py b/third_party/protobuf/python/google/protobuf/pyext/cpp_message.py
index b215211ee581f2bfa4fa8d06cf3ca3fc27941f56..fc8eb32d79f60ff95b328ec5a828593ab78e1802 100644
--- a/third_party/protobuf/python/google/protobuf/pyext/cpp_message.py
+++ b/third_party/protobuf/python/google/protobuf/pyext/cpp_message.py
@@ -48,9 +48,9 @@ class GeneratedProtocolMessageType(_message.MessageMeta):
classes at runtime, as in this example:
mydescriptor = Descriptor(.....)
- class MyProtoClass(Message):
- __metaclass__ = GeneratedProtocolMessageType
- DESCRIPTOR = mydescriptor
+ factory = symbol_database.Default()
+ factory.pool.AddDescriptor(mydescriptor)
+ MyProtoClass = factory.GetPrototype(mydescriptor)
myproto_instance = MyProtoClass()
myproto.foo_field = 23
...

Powered by Google App Engine
This is Rietveld 408576698