| Index: third_party/protobuf/src/google/protobuf/generated_message_util.cc
|
| diff --git a/third_party/protobuf/src/google/protobuf/generated_message_util.cc b/third_party/protobuf/src/google/protobuf/generated_message_util.cc
|
| index 8b3d037097946231474cd1eff0928881f9410488..92882d79ce7ae63cbf1964fc20474a0db6115609 100644
|
| --- a/third_party/protobuf/src/google/protobuf/generated_message_util.cc
|
| +++ b/third_party/protobuf/src/google/protobuf/generated_message_util.cc
|
| @@ -1,6 +1,6 @@
|
| // Protocol Buffers - Google's data interchange format
|
| // Copyright 2008 Google Inc. All rights reserved.
|
| -// https://developers.google.com/protocol-buffers/
|
| +// http://code.google.com/p/protobuf/
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -36,7 +36,6 @@
|
|
|
| #include <limits>
|
|
|
| -
|
| namespace google {
|
| namespace protobuf {
|
| namespace internal {
|
| @@ -49,32 +48,15 @@ double NaN() {
|
| }
|
|
|
| const ::std::string* empty_string_;
|
| -GOOGLE_PROTOBUF_DECLARE_ONCE(empty_string_once_init_);
|
| -
|
| -void DeleteEmptyString() {
|
| - delete empty_string_;
|
| -}
|
| +ProtobufOnceType empty_string_once_init_;
|
|
|
| void InitEmptyString() {
|
| - empty_string_ = new string;
|
| - OnShutdown(&DeleteEmptyString);
|
| + empty_string_ = new std::string();
|
| }
|
|
|
| const ::std::string& GetEmptyString() {
|
| - ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString);
|
| - return GetEmptyStringAlreadyInited();
|
| -}
|
| -
|
| -int StringSpaceUsedExcludingSelf(const string& str) {
|
| - const void* start = &str;
|
| - const void* end = &str + 1;
|
| -
|
| - if (start <= str.data() && str.data() < end) {
|
| - // The string's data is stored inside the string object itself.
|
| - return 0;
|
| - } else {
|
| - return str.capacity();
|
| - }
|
| + GoogleOnceInit(&empty_string_once_init_, &InitEmptyString);
|
| + return *empty_string_;
|
| }
|
|
|
| } // namespace internal
|
|
|