diff options
author | Bo Yang <teboring@google.com> | 2016-09-19 13:45:07 -0700 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2016-10-10 11:23:36 -0700 |
commit | cc8ca5b6a5478b40546d4206392eb1471454460d (patch) | |
tree | c0b45abfa16d7d373a6ea8f7fe50f1de00ab938e /src/google/protobuf/message_lite.h | |
parent | 337a028bb65ccca4dda768695950b5aba53ae2c9 (diff) | |
download | protobuf-cc8ca5b6a5478b40546d4206392eb1471454460d.tar.gz protobuf-cc8ca5b6a5478b40546d4206392eb1471454460d.tar.bz2 protobuf-cc8ca5b6a5478b40546d4206392eb1471454460d.zip |
Integrate internal changes
Diffstat (limited to 'src/google/protobuf/message_lite.h')
-rw-r--r-- | src/google/protobuf/message_lite.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/google/protobuf/message_lite.h b/src/google/protobuf/message_lite.h index 2bdfe496..d3c3b1f0 100644 --- a/src/google/protobuf/message_lite.h +++ b/src/google/protobuf/message_lite.h @@ -239,12 +239,13 @@ class LIBPROTOBUF_EXPORT MessageLite { bool AppendPartialToString(string* output) const; // Computes the serialized size of the message. This recursively calls - // ByteSize() on all embedded messages. If a subclass does not override - // this, it MUST override SetCachedSize(). + // ByteSize() on all embedded messages. Subclasses MUST override either + // ByteSize() or ByteSizeLong() (overriding both is fine). // // ByteSize() is generally linear in the number of fields defined for the // proto. - virtual int ByteSize() const = 0; + virtual int ByteSize() const { return ByteSizeLong(); } + virtual size_t ByteSizeLong() const; // Serializes the message without recomputing the size. The message must // not have changed since the last call to ByteSize(); if it has, the results |