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

Unified Diff: third_party/protobuf/python/google/protobuf/pyext/map_container.h

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 months 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/map_container.h
diff --git a/third_party/protobuf/python/google/protobuf/pyext/map_container.h b/third_party/protobuf/python/google/protobuf/pyext/map_container.h
index 2de611875dab31191f1af7573e0d73d06549090c..fbd6713f7319da73e7c45e79c7940f00bb89526c 100644
--- a/third_party/protobuf/python/google/protobuf/pyext/map_container.h
+++ b/third_party/protobuf/python/google/protobuf/pyext/map_container.h
@@ -55,6 +55,7 @@ using internal::shared_ptr;
namespace python {
struct CMessage;
+struct CMessageClass;
// This struct is used directly for ScalarMap, and is the base class of
// MessageMapContainer, which is used for MessageMap.
@@ -104,15 +105,23 @@ struct MapContainer {
};
struct MessageMapContainer : public MapContainer {
- // A callable that is used to create new child messages.
- PyObject* subclass_init;
+ // The type used to create new child messages.
+ CMessageClass* message_class;
// A dict mapping Message* -> CMessage.
PyObject* message_dict;
};
-extern PyTypeObject ScalarMapContainer_Type;
-extern PyTypeObject MessageMapContainer_Type;
+#if PY_MAJOR_VERSION >= 3
+ extern PyObject *MessageMapContainer_Type;
+ extern PyType_Spec MessageMapContainer_Type_spec;
+ extern PyObject *ScalarMapContainer_Type;
+ extern PyType_Spec ScalarMapContainer_Type_spec;
+#else
+ extern PyTypeObject MessageMapContainer_Type;
+ extern PyTypeObject ScalarMapContainer_Type;
+#endif
+
extern PyTypeObject MapIterator_Type; // Both map types use the same iterator.
// Builds a MapContainer object, from a parent message and a
@@ -124,7 +133,7 @@ extern PyObject* NewScalarMapContainer(
// field descriptor.
extern PyObject* NewMessageMapContainer(
CMessage* parent, const FieldDescriptor* parent_field_descriptor,
- PyObject* concrete_class);
+ CMessageClass* message_class);
} // namespace python
} // namespace protobuf

Powered by Google App Engine
This is Rietveld 408576698