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

Unified Diff: third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 8 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/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
diff --git a/third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc b/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
similarity index 60%
copy from third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc
copy to third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
index 1b1ab5d1dc7f4bf986884718c67d69a460232ada..e547d834986de8d80703504469e9c39b3d8ae93d 100644
--- a/third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc
+++ b/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
@@ -1,6 +1,7 @@
+#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// http://code.google.com/p/protobuf/
+// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -27,37 +28,41 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#endregion
-// Author: qrczak@google.com (Marcin Kowalczyk)
+namespace Google.Protobuf.Reflection
+{
+ /// <summary>
+ /// Represents a package in the symbol table. We use PackageDescriptors
+ /// just as placeholders so that someone cannot define, say, a message type
+ /// that has the same name as an existing package.
+ /// </summary>
+ internal sealed class PackageDescriptor : IDescriptor
+ {
+ private readonly string name;
+ private readonly string fullName;
+ private readonly FileDescriptor file;
-#include <google/protobuf/pyext/python_protobuf.h>
+ internal PackageDescriptor(string name, string fullName, FileDescriptor file)
+ {
+ this.file = file;
+ this.fullName = fullName;
+ this.name = name;
+ }
-namespace google {
-namespace protobuf {
-namespace python {
+ public string Name
+ {
+ get { return name; }
+ }
-static const Message* GetCProtoInsidePyProtoStub(PyObject* msg) {
- return NULL;
-}
-static Message* MutableCProtoInsidePyProtoStub(PyObject* msg) {
- return NULL;
-}
+ public string FullName
+ {
+ get { return fullName; }
+ }
-// This is initialized with a default, stub implementation.
-// If python-google.protobuf.cc is loaded, the function pointer is overridden
-// with a full implementation.
-const Message* (*GetCProtoInsidePyProtoPtr)(PyObject* msg) =
- GetCProtoInsidePyProtoStub;
-Message* (*MutableCProtoInsidePyProtoPtr)(PyObject* msg) =
- MutableCProtoInsidePyProtoStub;
-
-const Message* GetCProtoInsidePyProto(PyObject* msg) {
- return GetCProtoInsidePyProtoPtr(msg);
-}
-Message* MutableCProtoInsidePyProto(PyObject* msg) {
- return MutableCProtoInsidePyProtoPtr(msg);
-}
-
-} // namespace python
-} // namespace protobuf
-} // namespace google
+ public FileDescriptor File
+ {
+ get { return file; }
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698