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

Unified Diff: third_party/protobuf/src/google/protobuf/generated_message_util.cc

Issue 164743002: Replace kEmptyString with OnceInit initialized string* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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/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 ac32150146f21c1d122dcec7be22ee79a6ad7c25..794be3571053165bf5b56e75a3b5e8afd6d9edf7 100644
--- a/third_party/protobuf/src/google/protobuf/generated_message_util.cc
+++ b/third_party/protobuf/src/google/protobuf/generated_message_util.cc
@@ -47,7 +47,12 @@ double NaN() {
return std::numeric_limits<double>::quiet_NaN();
}
-const ::std::string kEmptyString;
+const ::std::string* empty_string_;
+ProtobufOnceType empty_string_once_init_;
+
+void InitEmptyString() {
+ empty_string_ = new std::string();
+}
} // namespace internal
} // namespace protobuf

Powered by Google App Engine
This is Rietveld 408576698