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

Unified Diff: third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Update to new HEAD (b7632464b4) + restore GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER Created 4 years, 1 month 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/compiler/cpp/cpp_field.h
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h
index 3b01252780da26393e0056c802f068bea1b7f044..fdd338a65a968e1b13336d49c2c7471be9ab1761 100644
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h
+++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h
@@ -136,6 +136,13 @@ class FieldGenerator {
// GenerateMergeFrom method.
virtual void GenerateMergingCode(io::Printer* printer) const = 0;
+ // The same, but the generated code may or may not check the possibility that
+ // the two objects being merged have the same address. To be safe, callers
+ // should avoid calling this unless they know the objects are different.
+ virtual void GenerateUnsafeMergingCode(io::Printer* printer) const {
+ GenerateMergingCode(printer);
+ }
+
// Generate lines of code (statements, not declarations) which swaps
// this field and the corresponding field of another message, which
// is stored in the generated code variable "other". This is used to

Powered by Google App Engine
This is Rietveld 408576698