Skip to content
Permalink
Branch: master
Commits on May 14, 2019
  1. encoding: switch ordering of Unmarshal arguments

    dsnet committed May 14, 2019
    While it is general convention that the receiver being mutated
    is the first argument, the standard library specifically goes against
    this convention when it comes to the Unmarshal function.
    
    Switch the ordering of the Unmarshal function to match the Go stdlib.
    
    Change-Id: I893346680233ef9fec7104415a54a0a7ae353378
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/177258
    Reviewed-by: Damien Neil <dneil@google.com>
  2. reflect/protoreflect: add helper methods to FieldDescriptor

    dsnet committed May 13, 2019
    Added API:
    	FieldDescriptor.IsExtension
    	FieldDescriptor.IsList
    	FieldDescriptor.MapKey
    	FieldDescriptor.MapValue
    	FieldDescriptor.ContainingOneof
    	FieldDescriptor.ContainingMessage
    
    Deprecated API (to be removed in subsequent CL):
    	FieldDescriptor.Oneof
    	FieldDescriptor.Extendee
    
    These methods help cleanup several common usage patterns.
    
    Change-Id: I9a3ffabc2edb2173c536509b22f330f98bba7cf3
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/176977
    Reviewed-by: Damien Neil <dneil@google.com>
Commits on May 13, 2019
  1. reflect/protoreflect: add Descriptor.ParentFile

    dsnet committed May 12, 2019
    Querying for the parent file that contains a descriptor declaration
    is a common enough operation to warrant its own first-class method.
    
    Change-Id: I2f41e5126a5b465df23897904a6513dd3ed8dd92
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/176777
    Reviewed-by: Damien Neil <dneil@google.com>
  2. reflect/protoreflect: add Descriptor specific methods

    dsnet committed May 1, 2019
    Added methods:
    	Enum.Descriptor
    	Message.Descriptor
    	EnumType.Descriptor
    	MessageType.Descriptor
    	ExtensionType.Descriptor
    	Message.New
    
    All functionality is switched over to use those methods instead of
    implicitly relying on the fact that {Enum,Message}Type implicitly
    implement the associated descriptor interface.
    
    This CL does not yet remove {Enum,Message}.Type or prevent
    {Enum,Message,Extension}Type from implementating a descriptor.
    That is a subsequent CL.
    
    The Message.New method is also added to replace functionality
    that will be lost when the Type methods are removed.
    
    Change-Id: I7fefde1673bbd40bfdac489aca05cec9a6c98eb1
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/174918
    Reviewed-by: Damien Neil <dneil@google.com>
    Reviewed-by: Herbie Ong <herbie@google.com>
Commits on May 9, 2019
  1. internal/impl: remove ExtensionFieldV1.Raw

    dsnet committed May 7, 2019
    CL/175579 switches v2 to use XXX_unrecognized exclusively.
    CL/175838 switches v1 to use XXX_unrecognized exclusively.
    
    This means that it is now safe to delete the Raw field.
    
    Change-Id: Ic60c58147c2df4078e72c34d1202d226a7ea4bed
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/175839
    Reviewed-by: Damien Neil <dneil@google.com>
  2. internal/impl: use XXX_unrecognized exclusively for unknown fields

    dsnet committed May 7, 2019
    The protobuf data model makes no distinction between unknown fields
    that are within the extension field ranges or not. Now that we eagerly
    unmarshal extensions, there is even less need for storing unknown
    fields in the extension map. Instead, use the XXX_unrecognized field
    exclusively for this purpose.
    
    Change-Id: I673a7d6259fe9fdbdc295bcfa8252ef4da415343
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/175579
    Reviewed-by: Damien Neil <dneil@google.com>
  3. proto: eagerly unmarshal extensions

    dsnet committed May 7, 2019
    CL/172399 switches the v1 code to eagerly unmarshal extensions.
    This CL does the equivalent for v2.
    
    For the test, we simply switch from protoV1.Equal to protoV2.Equal,
    since the v2 equal does not magically unmarshal raw extensions.
    
    Change-Id: I6f64455b0a75bbc9a9a82108558641a29bd2b982
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/175838
    Reviewed-by: Damien Neil <dneil@google.com>
Commits on May 7, 2019
  1. internal/encoding/wire: increase maximum field number

    dsnet committed May 7, 2019
    The protobuf documentation explicitly specifies (1<<29)-1 as the maximum
    field number, but the C++ implementation itself has a special-case where it
    allows field numbers up to MaxInt32 for MessageSet fields, but continues
    to apply the former limit in all non-MessageSet cases.
    
    To avoid complicated branching logic, we use the larger limit for all cases
    if MessageSet is supported, otherwise, we impose the documented limit.
    
    Change-Id: I710a2a21aa3beba161c3e6ca2f2ed9a266920a5a
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/175817
    Reviewed-by: Damien Neil <dneil@google.com>
You can’t perform that action at this time.