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

Unified Diff: third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc

Issue 6737030: third_party/protobuf: update to upstream r371 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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/compiler/cpp/cpp_message_field.cc
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc
index c04bdc66b0878c783666c9458638cc21f7a72b21..23e75b87d42c5c5ef7213f8f7e9222fc7e980ccf 100644
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc
+++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc
@@ -75,7 +75,8 @@ void MessageFieldGenerator::
GenerateAccessorDeclarations(io::Printer* printer) const {
printer->Print(variables_,
"inline const $type$& $name$() const$deprecation$;\n"
- "inline $type$* mutable_$name$()$deprecation$;\n");
+ "inline $type$* mutable_$name$()$deprecation$;\n"
+ "inline $type$* release_$name$()$deprecation$;\n");
}
void MessageFieldGenerator::
@@ -85,9 +86,15 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const {
" return $name$_ != NULL ? *$name$_ : *default_instance_->$name$_;\n"
"}\n"
"inline $type$* $classname$::mutable_$name$() {\n"
- " _set_bit($index$);\n"
+ " set_has_$name$();\n"
" if ($name$_ == NULL) $name$_ = new $type$;\n"
" return $name$_;\n"
+ "}\n"
+ "inline $type$* $classname$::release_$name$() {\n"
+ " clear_has_$name$();\n"
+ " $type$* temp = $name$_;\n"
+ " $name$_ = NULL;\n"
+ " return temp;\n"
"}\n");
}

Powered by Google App Engine
This is Rietveld 408576698