| Index: third_party/protobuf/src/google/protobuf/arenastring.cc
|
| diff --git a/third_party/protobuf/src/google/protobuf/generated_message_util.cc b/third_party/protobuf/src/google/protobuf/arenastring.cc
|
| similarity index 72%
|
| copy from third_party/protobuf/src/google/protobuf/generated_message_util.cc
|
| copy to third_party/protobuf/src/google/protobuf/arenastring.cc
|
| index 92882d79ce7ae63cbf1964fc20474a0db6115609..cce61d74de241401917ef30c8a5a707fed10e177 100644
|
| --- a/third_party/protobuf/src/google/protobuf/generated_message_util.cc
|
| +++ b/third_party/protobuf/src/google/protobuf/arenastring.cc
|
| @@ -1,6 +1,6 @@
|
| // 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
|
| @@ -28,35 +28,24 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Author: kenton@google.com (Kenton Varda)
|
| -// Based on original Protocol Buffers design by
|
| -// Sanjay Ghemawat, Jeff Dean, and others.
|
| +// The ArenaString implementation is not included in the open-source release. Do
|
| +// not include this file in the distribution.
|
|
|
| -#include <google/protobuf/generated_message_util.h>
|
| -
|
| -#include <limits>
|
| +#include <google/protobuf/arenastring.h>
|
|
|
| namespace google {
|
| namespace protobuf {
|
| namespace internal {
|
|
|
| -double Infinity() {
|
| - return std::numeric_limits<double>::infinity();
|
| -}
|
| -double NaN() {
|
| - return std::numeric_limits<double>::quiet_NaN();
|
| -}
|
| -
|
| -const ::std::string* empty_string_;
|
| -ProtobufOnceType empty_string_once_init_;
|
| -
|
| -void InitEmptyString() {
|
| - empty_string_ = new std::string();
|
| -}
|
|
|
| -const ::std::string& GetEmptyString() {
|
| - GoogleOnceInit(&empty_string_once_init_, &InitEmptyString);
|
| - return *empty_string_;
|
| +void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,
|
| + ArenaStringPtr value) {
|
| + const ::std::string* me = *UnsafeRawStringPointer();
|
| + const ::std::string* other = *value.UnsafeRawStringPointer();
|
| + // If the pointers are the same then do nothing.
|
| + if (me != other) {
|
| + SetNoArena(default_value, value.GetNoArena(default_value));
|
| + }
|
| }
|
|
|
| } // namespace internal
|
|
|