diff options
author | eugenis@chromium.org <eugenis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-22 09:30:00 +0000 |
---|---|---|
committer | eugenis@chromium.org <eugenis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-22 09:30:00 +0000 |
commit | 5304c1b047782c367e014d8ec7dc9563b43c1157 (patch) | |
tree | 0d3c32515b7ce4ba62307f74a8537257e4693dbf /third_party/protobuf | |
parent | ee95a5aa13c2701578650c738314a441d2aa5b82 (diff) | |
download | chromium_src-5304c1b047782c367e014d8ec7dc9563b43c1157.zip chromium_src-5304c1b047782c367e014d8ec7dc9563b43c1157.tar.gz chromium_src-5304c1b047782c367e014d8ec7dc9563b43c1157.tar.bz2 |
third-party/protobuf: Cherry-pick r475 and r476 from upstream.
These changes are required to build with libcxx.
R=rsimha@chromium.org,brettw@chromium.org
TBR=cpu@chromium.org
BUG=178409
Review URL: https://codereview.chromium.org/12854003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/protobuf')
5 files changed, 17 insertions, 7 deletions
diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.chromium index 20c2810..6e82e82 100644 --- a/third_party/protobuf/README.chromium +++ b/third_party/protobuf/README.chromium @@ -26,10 +26,9 @@ This code has been patched to make the target protobuf_lite a component so that targets that depend on it can be componentized. See http://crbug.com/172800 for details, and r179806 for the patch. - -Revisions r427 and r430 were cherry-picked from upstream. - -Cherry-pick patch from http://code.google.com/p/protobuf/issues/detail?id=425. +Revisions r427, r430, r475 and r476 were cherry-picked from upstream. +Patch from http://code.google.com/p/protobuf/issues/detail?id=425 was +cherry-picked from upstream. Notes about Java: We have not forked the Java version of protobuf-lite, so the Java version does diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_service.cc b/third_party/protobuf/src/google/protobuf/compiler/java/java_service.cc index 1ae4f46..2d85b7a 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/java/java_service.cc +++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_service.cc @@ -86,6 +86,12 @@ void ServiceGenerator::Generate(io::Printer* printer) { GenerateStub(printer); GenerateBlockingStub(printer); + // Add an insertion point. + printer->Print( + "\n" + "// @@protoc_insertion_point(class_scope:$full_name$)\n", + "full_name", descriptor_->full_name()); + printer->Outdent(); printer->Print("}\n\n"); } diff --git a/third_party/protobuf/src/google/protobuf/extension_set.h b/third_party/protobuf/src/google/protobuf/extension_set.h index 68ce423..a1b6f35 100644 --- a/third_party/protobuf/src/google/protobuf/extension_set.h +++ b/third_party/protobuf/src/google/protobuf/extension_set.h @@ -483,7 +483,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet { // only contain a small number of extensions whereas hash_map is optimized // for 100 elements or more. Also, we want AppendToList() to order fields // by field number. - map<int, Extension> extensions_; + std::map<int, Extension> extensions_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionSet); }; diff --git a/third_party/protobuf/src/google/protobuf/io/coded_stream_inl.h b/third_party/protobuf/src/google/protobuf/io/coded_stream_inl.h index e9799d4..8156602 100644 --- a/third_party/protobuf/src/google/protobuf/io/coded_stream_inl.h +++ b/third_party/protobuf/src/google/protobuf/io/coded_stream_inl.h @@ -50,8 +50,12 @@ inline bool CodedInputStream::InternalReadStringInline(string* buffer, if (BufferSize() >= size) { STLStringResizeUninitialized(buffer, size); - memcpy(string_as_array(buffer), buffer_, size); - Advance(size); + // When buffer is empty, string_as_array(buffer) will return NULL but memcpy + // requires non-NULL pointers even when size is 0. Hench this check. + if (size > 0) { + memcpy(string_as_array(buffer), buffer_, size); + Advance(size); + } return true; } diff --git a/third_party/protobuf/src/google/protobuf/message.cc b/third_party/protobuf/src/google/protobuf/message.cc index 91e6878..0409a94 100644 --- a/third_party/protobuf/src/google/protobuf/message.cc +++ b/third_party/protobuf/src/google/protobuf/message.cc @@ -32,6 +32,7 @@ // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. +#include <istream> #include <stack> #include <google/protobuf/stubs/hash.h> |