diff options
author | Zeno Albisser <zeno.albisser@digia.com> | 2013-11-21 14:09:57 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2013-11-29 15:14:36 +0100 |
commit | eb32ba6f51d0c21d58cd7d89785285ff8fa64624 (patch) | |
tree | 2c7c940e1dbee81b89d935626110816b494aa32c /chromium/third_party/protobuf | |
parent | 9427c1a0222ebd67efef1a2c7990a0fa5c9aac84 (diff) | |
download | qtwebengine-chromium-eb32ba6f51d0c21d58cd7d89785285ff8fa64624.tar.gz |
Update chromium to branch 1599.
Change-Id: I04e775a946a208bb4500d3b722bcb05c82b9d7cb
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/third_party/protobuf')
58 files changed, 406 insertions, 579 deletions
diff --git a/chromium/third_party/protobuf/README.chromium b/chromium/third_party/protobuf/README.chromium index 50c39c02c72..c8e411f030f 100644 --- a/chromium/third_party/protobuf/README.chromium +++ b/chromium/third_party/protobuf/README.chromium @@ -4,7 +4,7 @@ URL: http://protobuf.googlecode.com/svn/trunk License: BSD License File: COPYING.txt Version: unknown -Revision: r476 +Revision: r428 Security Critical: yes Local files (not taken from upstream): @@ -26,7 +26,7 @@ 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. -Revision 504 was cherry-picked from upstream. +Revisions r430, r475, r476 and 504 were 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/chromium/third_party/protobuf/README.txt b/chromium/third_party/protobuf/README.txt index 17551a5a0cb..a8f66044829 100644 --- a/chromium/third_party/protobuf/README.txt +++ b/chromium/third_party/protobuf/README.txt @@ -115,7 +115,7 @@ For advanced usage information on configure and make, see INSTALL.txt. C++ Installation - Windows ========================== -If you are using Microsoft Visual C++, see vsprojects/readme.txt. +If you are using Micosoft Visual C++, see vsprojects/readme.txt. If you are using Cygwin or MinGW, follow the Unix installation instructions, above. diff --git a/chromium/third_party/protobuf/java/pom.xml b/chromium/third_party/protobuf/java/pom.xml index 9f464c140a3..7ec6d918a4b 100644 --- a/chromium/third_party/protobuf/java/pom.xml +++ b/chromium/third_party/protobuf/java/pom.xml @@ -10,8 +10,8 @@ </parent> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> - <version>2.5.0-pre</version> - <packaging>bundle</packaging> + <version>2.4.2-pre</version> + <packaging>jar</packaging> <name>Protocol Buffer Java API</name> <description> Protocol Buffers are a way of encoding structured data in an efficient yet @@ -132,16 +132,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - <configuration> - <instructions> - <Export-Package>*</Export-Package> - </instructions> - </configuration> - </plugin> </plugins> </build> <profiles> diff --git a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/ByteString.java b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/ByteString.java index 73d831f6eec..1b18169e9e1 100644 --- a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/ByteString.java +++ b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/ByteString.java @@ -37,6 +37,7 @@ import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -775,15 +776,6 @@ public abstract class ByteString implements Iterable<Byte> { flushLastBuffer(); return ByteString.copyFrom(flushedBuffers); } - - /** - * Implement java.util.Arrays.copyOf() for jdk 1.5. - */ - private byte[] copyArray(byte[] buffer, int length) { - byte[] result = new byte[length]; - System.arraycopy(buffer, 0, result, 0, Math.min(buffer.length, length)); - return result; - } /** * Writes the complete contents of this byte array output stream to @@ -808,7 +800,7 @@ public abstract class ByteString implements Iterable<Byte> { byteString.writeTo(out); } - out.write(copyArray(cachedBuffer, cachedBufferPos)); + out.write(Arrays.copyOf(cachedBuffer, cachedBufferPos)); } /** @@ -861,7 +853,7 @@ public abstract class ByteString implements Iterable<Byte> { private void flushLastBuffer() { if (bufferPos < buffer.length) { if (bufferPos > 0) { - byte[] bufferCopy = copyArray(buffer, bufferPos); + byte[] bufferCopy = Arrays.copyOf(buffer, bufferPos); flushedBuffers.add(new LiteralByteString(bufferCopy)); } // We reuse this buffer for further writes. diff --git a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyField.java b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyField.java index c4f9201cdc2..df9425eb360 100644 --- a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyField.java +++ b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyField.java @@ -157,10 +157,12 @@ class LazyField { this.entry = entry; } + @Override public K getKey() { return entry.getKey(); } + @Override public Object getValue() { LazyField field = entry.getValue(); if (field == null) { @@ -173,6 +175,7 @@ class LazyField { return entry.getValue(); } + @Override public Object setValue(Object value) { if (!(value instanceof MessageLite)) { throw new IllegalArgumentException( @@ -190,11 +193,13 @@ class LazyField { this.iterator = iterator; } + @Override public boolean hasNext() { return iterator.hasNext(); } @SuppressWarnings("unchecked") + @Override public Entry<K, Object> next() { Entry<K, ?> entry = iterator.next(); if (entry.getValue() instanceof LazyField) { @@ -203,6 +208,7 @@ class LazyField { return (Entry<K, Object>) entry; } + @Override public void remove() { iterator.remove(); } diff --git a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyStringArrayList.java b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyStringArrayList.java index a5f0bd901fd..75c6a4b73d3 100644 --- a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyStringArrayList.java +++ b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/LazyStringArrayList.java @@ -172,6 +172,7 @@ public class LazyStringArrayList extends AbstractList<String> } } + @Override public List<?> getUnderlyingElements() { return Collections.unmodifiableList(list); } diff --git a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/RopeByteString.java b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/RopeByteString.java index 46997823469..8d44d117723 100644 --- a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/RopeByteString.java +++ b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/RopeByteString.java @@ -36,12 +36,13 @@ import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.io.ByteArrayInputStream; import java.nio.ByteBuffer; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; +import java.util.Deque; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; -import java.util.Stack; /** * Class to represent {@code ByteStrings} formed by concatenation of other @@ -589,7 +590,8 @@ class RopeByteString extends ByteString { // Stack containing the part of the string, starting from the left, that // we've already traversed. The final string should be the equivalent of // concatenating the strings on the stack from bottom to top. - private final Stack<ByteString> prefixesStack = new Stack<ByteString>(); + private final Deque<ByteString> prefixesStack = + new ArrayDeque<ByteString>(minLengthByDepth.length); private ByteString balance(ByteString left, ByteString right) { doBalance(left); @@ -701,8 +703,8 @@ class RopeByteString extends ByteString { */ private static class PieceIterator implements Iterator<LiteralByteString> { - private final Stack<RopeByteString> breadCrumbs = - new Stack<RopeByteString>(); + private final Deque<RopeByteString> breadCrumbs = + new ArrayDeque<RopeByteString>(minLengthByDepth.length); private LiteralByteString next; private PieceIterator(ByteString root) { diff --git a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java index 591bca54091..f80f09680bb 100644 --- a/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java +++ b/chromium/third_party/protobuf/java/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java @@ -145,6 +145,7 @@ public class UnmodifiableLazyStringList extends AbstractList<String> }; } + @Override public List<?> getUnderlyingElements() { // The returned value is already unmodifiable. return list.getUnderlyingElements(); diff --git a/chromium/third_party/protobuf/protobuf_lite.gypi b/chromium/third_party/protobuf/protobuf_lite.gypi index bbdc072715d..e66d29f758b 100644 --- a/chromium/third_party/protobuf/protobuf_lite.gypi +++ b/chromium/third_party/protobuf/protobuf_lite.gypi @@ -32,6 +32,7 @@ 'src/google/protobuf/stubs/once.cc', 'src/google/protobuf/stubs/hash.h', 'src/google/protobuf/stubs/map-util.h', + 'src/google/protobuf/stubs/stl_util-inl.h', 'src/google/protobuf/extension_set.cc', 'src/google/protobuf/generated_message_util.cc', 'src/google/protobuf/message_lite.cc', diff --git a/chromium/third_party/protobuf/python/google/protobuf/pyext/python-proto2.cc b/chromium/third_party/protobuf/python/google/protobuf/pyext/python-proto2.cc index eebb752b780..627534135d8 100644 --- a/chromium/third_party/protobuf/python/google/protobuf/pyext/python-proto2.cc +++ b/chromium/third_party/protobuf/python/google/protobuf/pyext/python-proto2.cc @@ -427,6 +427,9 @@ static bool CheckAndSetString( GOOGLE_DCHECK(descriptor->type() == google::protobuf::FieldDescriptor::TYPE_STRING || descriptor->type() == google::protobuf::FieldDescriptor::TYPE_BYTES); if (descriptor->type() == google::protobuf::FieldDescriptor::TYPE_STRING) { +#else + if (descriptor->file()->options().cc_api_version() == 2 && + descriptor->type() == google::protobuf::FieldDescriptor::TYPE_STRING) { if (!PyString_Check(arg) && !PyUnicode_Check(arg)) { FormatTypeError(arg, "str, unicode"); return false; @@ -454,6 +457,9 @@ static bool CheckAndSetString( PyObject* encoded_string = NULL; if (descriptor->type() == google::protobuf::FieldDescriptor::TYPE_STRING) { +#else + if (descriptor->file()->options().cc_api_version() == 2 && + descriptor->type() == google::protobuf::FieldDescriptor::TYPE_STRING) { if (PyString_Check(arg)) { encoded_string = PyString_AsEncodedObject(arg, "utf-8", NULL); } else { diff --git a/chromium/third_party/protobuf/python/setup.py b/chromium/third_party/protobuf/python/setup.py index 8a986298664..fbe2766030c 100755 --- a/chromium/third_party/protobuf/python/setup.py +++ b/chromium/third_party/protobuf/python/setup.py @@ -26,9 +26,7 @@ from distutils.spawn import find_executable maintainer_email = "protobuf@googlegroups.com" # Find the Protocol Compiler. -if 'PROTOC' in os.environ and os.path.exists(os.environ['PROTOC']): - protoc = os.environ['PROTOC'] -elif os.path.exists("../src/protoc"): +if os.path.exists("../src/protoc"): protoc = "../src/protoc" elif os.path.exists("../src/protoc.exe"): protoc = "../src/protoc.exe" @@ -156,7 +154,7 @@ if __name__ == '__main__': libraries = [ "protobuf" ])) setup(name = 'protobuf', - version = '2.5.0-pre', + version = '2.4.2-pre', packages = [ 'google' ], namespace_packages = [ 'google' ], test_suite = 'setup.MakeTestSuite', @@ -167,7 +165,6 @@ if __name__ == '__main__': 'google.protobuf.internal.cpp_message', 'google.protobuf.internal.decoder', 'google.protobuf.internal.encoder', - 'google.protobuf.internal.enum_type_wrapper', 'google.protobuf.internal.message_listener', 'google.protobuf.internal.python_message', 'google.protobuf.internal.type_checkers', diff --git a/chromium/third_party/protobuf/src/Makefile.am b/chromium/third_party/protobuf/src/Makefile.am index df733d9b874..172d0cdddfc 100644 --- a/chromium/third_party/protobuf/src/Makefile.am +++ b/chromium/third_party/protobuf/src/Makefile.am @@ -37,63 +37,57 @@ CLEANFILES = $(protoc_outputs) unittest_proto_middleman \ MAINTAINERCLEANFILES = \ Makefile.in -nobase_include_HEADERS = \ - google/protobuf/stubs/atomicops.h \ - google/protobuf/stubs/atomicops_internals_arm_gcc.h \ - google/protobuf/stubs/atomicops_internals_arm_qnx.h \ - google/protobuf/stubs/atomicops_internals_atomicword_compat.h \ - google/protobuf/stubs/atomicops_internals_macosx.h \ - google/protobuf/stubs/atomicops_internals_mips_gcc.h \ - google/protobuf/stubs/atomicops_internals_pnacl.h \ - google/protobuf/stubs/atomicops_internals_x86_gcc.h \ - google/protobuf/stubs/atomicops_internals_x86_msvc.h \ - google/protobuf/stubs/common.h \ - google/protobuf/stubs/platform_macros.h \ - google/protobuf/stubs/once.h \ - google/protobuf/stubs/template_util.h \ - google/protobuf/stubs/type_traits.h \ - google/protobuf/descriptor.h \ - google/protobuf/descriptor.pb.h \ - google/protobuf/descriptor_database.h \ - google/protobuf/dynamic_message.h \ - google/protobuf/extension_set.h \ - google/protobuf/generated_enum_reflection.h \ - google/protobuf/generated_message_util.h \ - google/protobuf/generated_message_reflection.h \ - google/protobuf/message.h \ - google/protobuf/message_lite.h \ - google/protobuf/reflection_ops.h \ - google/protobuf/repeated_field.h \ - google/protobuf/service.h \ - google/protobuf/text_format.h \ - google/protobuf/unknown_field_set.h \ - google/protobuf/wire_format.h \ - google/protobuf/wire_format_lite.h \ - google/protobuf/wire_format_lite_inl.h \ - google/protobuf/io/coded_stream.h \ - $(GZHEADERS) \ - google/protobuf/io/printer.h \ - google/protobuf/io/tokenizer.h \ - google/protobuf/io/zero_copy_stream.h \ - google/protobuf/io/zero_copy_stream_impl.h \ - google/protobuf/io/zero_copy_stream_impl_lite.h \ - google/protobuf/compiler/code_generator.h \ - google/protobuf/compiler/command_line_interface.h \ - google/protobuf/compiler/importer.h \ - google/protobuf/compiler/parser.h \ - google/protobuf/compiler/plugin.h \ - google/protobuf/compiler/plugin.pb.h \ - google/protobuf/compiler/cpp/cpp_generator.h \ - google/protobuf/compiler/java/java_generator.h \ +nobase_include_HEADERS = \ + google/protobuf/stubs/atomicops.h \ + google/protobuf/stubs/atomicops_internals_arm_gcc.h \ + google/protobuf/stubs/atomicops_internals_macosx.h \ + google/protobuf/stubs/atomicops_internals_mips_gcc.h \ + google/protobuf/stubs/atomicops_internals_x86_gcc.h \ + google/protobuf/stubs/atomicops_internals_x86_msvc.h \ + google/protobuf/stubs/common.h \ + google/protobuf/stubs/platform_macros.h \ + google/protobuf/stubs/once.h \ + google/protobuf/descriptor.h \ + google/protobuf/descriptor.pb.h \ + google/protobuf/descriptor_database.h \ + google/protobuf/dynamic_message.h \ + google/protobuf/extension_set.h \ + google/protobuf/generated_enum_reflection.h \ + google/protobuf/generated_message_util.h \ + google/protobuf/generated_message_reflection.h \ + google/protobuf/message.h \ + google/protobuf/message_lite.h \ + google/protobuf/reflection_ops.h \ + google/protobuf/repeated_field.h \ + google/protobuf/service.h \ + google/protobuf/text_format.h \ + google/protobuf/unknown_field_set.h \ + google/protobuf/wire_format.h \ + google/protobuf/wire_format_lite.h \ + google/protobuf/wire_format_lite_inl.h \ + google/protobuf/io/coded_stream.h \ + $(GZHEADERS) \ + google/protobuf/io/printer.h \ + google/protobuf/io/tokenizer.h \ + google/protobuf/io/zero_copy_stream.h \ + google/protobuf/io/zero_copy_stream_impl.h \ + google/protobuf/io/zero_copy_stream_impl_lite.h \ + google/protobuf/compiler/code_generator.h \ + google/protobuf/compiler/command_line_interface.h \ + google/protobuf/compiler/importer.h \ + google/protobuf/compiler/parser.h \ + google/protobuf/compiler/plugin.h \ + google/protobuf/compiler/plugin.pb.h \ + google/protobuf/compiler/cpp/cpp_generator.h \ + google/protobuf/compiler/java/java_generator.h \ google/protobuf/compiler/python/python_generator.h lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_lite_la_LDFLAGS = -version-info 8:0:0 -export-dynamic -no-undefined +libprotobuf_lite_la_LDFLAGS = -version-info 7:0:0 -export-dynamic -no-undefined libprotobuf_lite_la_SOURCES = \ google/protobuf/stubs/atomicops_internals_x86_gcc.cc \ - google/protobuf/stubs/atomicops_internals_x86_msvc.cc \ google/protobuf/stubs/common.cc \ google/protobuf/stubs/once.cc \ google/protobuf/stubs/hash.h \ @@ -101,6 +95,8 @@ libprotobuf_lite_la_SOURCES = \ google/protobuf/stubs/stl_util.h \ google/protobuf/stubs/stringprintf.cc \ google/protobuf/stubs/stringprintf.h \ + google/protobuf/stubs/template_util.h \ + google/protobuf/stubs/type_traits.h \ google/protobuf/extension_set.cc \ google/protobuf/generated_message_util.cc \ google/protobuf/message_lite.cc \ @@ -112,7 +108,7 @@ libprotobuf_lite_la_SOURCES = \ google/protobuf/io/zero_copy_stream_impl_lite.cc libprotobuf_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_la_LDFLAGS = -version-info 8:0:0 -export-dynamic -no-undefined +libprotobuf_la_LDFLAGS = -version-info 7:0:0 -export-dynamic -no-undefined libprotobuf_la_SOURCES = \ $(libprotobuf_lite_la_SOURCES) \ google/protobuf/stubs/strutil.cc \ @@ -140,7 +136,7 @@ libprotobuf_la_SOURCES = \ google/protobuf/compiler/parser.cc libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la -libprotoc_la_LDFLAGS = -version-info 8:0:0 -export-dynamic -no-undefined +libprotoc_la_LDFLAGS = -version-info 7:0:0 -export-dynamic -no-undefined libprotoc_la_SOURCES = \ google/protobuf/compiler/code_generator.cc \ google/protobuf/compiler/command_line_interface.cc \ diff --git a/chromium/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_unittest.cc index 1eae29b531f..b5f9ab58fdd 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_unittest.cc @@ -381,6 +381,7 @@ TEST(GeneratedMessageTest, StringCharStarLength) { EXPECT_EQ("wx", message.repeated_string(0)); } + TEST(GeneratedMessageTest, CopyFrom) { unittest::TestAllTypes message1, message2; @@ -393,6 +394,7 @@ TEST(GeneratedMessageTest, CopyFrom) { TestUtil::ExpectAllFieldsSet(message2); } + TEST(GeneratedMessageTest, SwapWithEmpty) { unittest::TestAllTypes message1, message2; TestUtil::SetAllFields(&message1); @@ -491,8 +493,6 @@ TEST(GeneratedMessageTest, CopyAssignmentOperator) { TestUtil::ExpectAllFieldsSet(message2); } -#if !defined(PROTOBUF_TEST_NO_DESCRIPTORS) || \ - !defined(GOOGLE_PROTOBUF_NO_RTTI) TEST(GeneratedMessageTest, UpcastCopyFrom) { // Test the CopyFrom method that takes in the generic const Message& // parameter. @@ -505,7 +505,6 @@ TEST(GeneratedMessageTest, UpcastCopyFrom) { TestUtil::ExpectAllFieldsSet(message2); } -#endif #ifndef PROTOBUF_TEST_NO_DESCRIPTORS @@ -557,9 +556,7 @@ TEST(GeneratedMessageTest, NonEmptyMergeFrom) { TestUtil::ExpectAllFieldsSet(message1); } -#if !defined(PROTOBUF_TEST_NO_DESCRIPTORS) || \ - !defined(GOOGLE_PROTOBUF_NO_RTTI) -#ifdef PROTOBUF_HAS_DEATH_TEST +#ifdef GTEST_HAS_DEATH_TEST TEST(GeneratedMessageTest, MergeFromSelf) { unittest::TestAllTypes message; @@ -568,8 +565,7 @@ TEST(GeneratedMessageTest, MergeFromSelf) { "&from"); } -#endif // PROTOBUF_HAS_DEATH_TEST -#endif // !PROTOBUF_TEST_NO_DESCRIPTORS || !GOOGLE_PROTOBUF_NO_RTTI +#endif // GTEST_HAS_DEATH_TEST // Test the generated SerializeWithCachedSizesToArray(), TEST(GeneratedMessageTest, SerializationToArray) { @@ -1203,7 +1199,7 @@ TEST_F(GeneratedServiceTest, CallMethod) { TEST_F(GeneratedServiceTest, CallMethodTypeFailure) { // Verify death if we call Foo() with Bar's message types. -#ifdef PROTOBUF_HAS_DEATH_TEST // death tests do not work on Windows yet +#ifdef GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet EXPECT_DEBUG_DEATH( mock_service_.CallMethod(foo_, &mock_controller_, &foo_request_, &bar_response_, done_.get()), @@ -1214,7 +1210,7 @@ TEST_F(GeneratedServiceTest, CallMethodTypeFailure) { mock_service_.CallMethod(foo_, &mock_controller_, &bar_request_, &foo_response_, done_.get()), "dynamic_cast"); -#endif // PROTOBUF_HAS_DEATH_TEST +#endif // GTEST_HAS_DEATH_TEST } TEST_F(GeneratedServiceTest, GetPrototypes) { diff --git a/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc b/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc index 88559b8fcaf..7b0b1f92478 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc @@ -139,9 +139,7 @@ void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() { "atorResponse\022\r\n\005error\030\001 \001(\t\022B\n\004file\030\017 \003(" "\01324.google.protobuf.compiler.CodeGenerat" "orResponse.File\032>\n\004File\022\014\n\004name\030\001 \001(\t\022\027\n" - "\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001(\tB" - ",\n\034com.google.protobuf.compilerB\014PluginP" - "rotos", 445); + "\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001(\t", 399); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/compiler/plugin.proto", &protobuf_RegisterTypes); CodeGeneratorRequest::default_instance_ = new CodeGeneratorRequest(); diff --git a/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h b/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h index 68cc21c7f8f..46478c739c1 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h +++ b/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h @@ -8,12 +8,12 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2004000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2004002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.proto b/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.proto index 77b888f37ed..651ed10c222 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.proto +++ b/chromium/third_party/protobuf/src/google/protobuf/compiler/plugin.proto @@ -45,8 +45,6 @@ // flag "--${NAME}_out" is passed to protoc. package google.protobuf.compiler; -option java_package = "com.google.protobuf.compiler"; -option java_outer_classname = "PluginProtos"; import "google/protobuf/descriptor.proto"; diff --git a/chromium/third_party/protobuf/src/google/protobuf/compiler/subprocess.cc b/chromium/third_party/protobuf/src/google/protobuf/compiler/subprocess.cc index 67da120d622..860fc8755c4 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/compiler/subprocess.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/compiler/subprocess.cc @@ -295,8 +295,8 @@ void Subprocess::Start(const string& program, SearchMode search_mode) { int stdin_pipe[2]; int stdout_pipe[2]; - GOOGLE_CHECK(pipe(stdin_pipe) != -1); - GOOGLE_CHECK(pipe(stdout_pipe) != -1); + pipe(stdin_pipe); + pipe(stdout_pipe); char* argv[2] = { strdup(program.c_str()), NULL }; @@ -324,11 +324,9 @@ void Subprocess::Start(const string& program, SearchMode search_mode) { // Write directly to STDERR_FILENO to avoid stdio code paths that may do // stuff that is unsafe here. - int ignored; - ignored = write(STDERR_FILENO, argv[0], strlen(argv[0])); + write(STDERR_FILENO, argv[0], strlen(argv[0])); const char* message = ": program not found or is not executable\n"; - ignored = write(STDERR_FILENO, message, strlen(message)); - (void) ignored; + write(STDERR_FILENO, message, strlen(message)); // Must use _exit() rather than exit() to avoid flushing output buffers // that will also be flushed by the parent. diff --git a/chromium/third_party/protobuf/src/google/protobuf/descriptor.cc b/chromium/third_party/protobuf/src/google/protobuf/descriptor.cc index bcbf1e079f6..45293fef7d3 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/descriptor.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/descriptor.cc @@ -2987,11 +2987,7 @@ template<class DescriptorT> void DescriptorBuilder::AllocateOptionsImpl( // tables_->AllocateMessage<typename DescriptorT::OptionsType>(); typename DescriptorT::OptionsType* const dummy = NULL; typename DescriptorT::OptionsType* options = tables_->AllocateMessage(dummy); - // Avoid using MergeFrom()/CopyFrom() in this class to make it -fno-rtti - // friendly. Without RTTI, MergeFrom() and CopyFrom() will fallback to the - // reflection based method, which requires the Descriptor. However, we are in - // the middle of building the descriptors, thus the deadlock. - options->ParseFromString(orig_options.SerializeAsString()); + options->CopyFrom(orig_options); descriptor->options_ = options; // Don't add to options_to_interpret_ unless there were uninterpreted @@ -4132,26 +4128,16 @@ void DescriptorBuilder::ValidateFieldOptions(FieldDescriptor* field, void DescriptorBuilder::ValidateEnumOptions(EnumDescriptor* enm, const EnumDescriptorProto& proto) { VALIDATE_OPTIONS_FROM_ARRAY(enm, value, EnumValue); - if (!enm->options().has_allow_alias() || !enm->options().allow_alias()) { + if (!enm->options().allow_alias()) { map<int, string> used_values; for (int i = 0; i < enm->value_count(); ++i) { const EnumValueDescriptor* enum_value = enm->value(i); if (used_values.find(enum_value->number()) != used_values.end()) { - string error = - "\"" + enum_value->full_name() + - "\" uses the same enum value as \"" + - used_values[enum_value->number()] + "\". If this is intended, set " - "'option allow_alias = true;' to the enum definition."; - if (!enm->options().allow_alias()) { - // Generate error if duplicated enum values are explicitly disallowed. - AddError(enm->full_name(), proto, - DescriptorPool::ErrorCollector::NUMBER, - error); - } else { - // Generate warning if duplicated values are found but the option - // isn't set. - GOOGLE_LOG(ERROR) << error; - } + AddError(enm->full_name(), proto, + DescriptorPool::ErrorCollector::NUMBER, + "\"" + enum_value->full_name() + + "\" uses the same enum value as \"" + + used_values[enum_value->number()] + "\""); } else { used_values[enum_value->number()] = enum_value->full_name(); } diff --git a/chromium/third_party/protobuf/src/google/protobuf/descriptor.h b/chromium/third_party/protobuf/src/google/protobuf/descriptor.h index 33e3af7241b..410d3ed4df4 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/descriptor.h +++ b/chromium/third_party/protobuf/src/google/protobuf/descriptor.h @@ -58,10 +58,6 @@ #include <vector> #include <google/protobuf/stubs/common.h> -// TYPE_BOOL is defined in the MacOS's ConditionalMacros.h. -#ifdef TYPE_BOOL -#undef TYPE_BOOL -#endif // TYPE_BOOL namespace google { namespace protobuf { @@ -1338,7 +1334,7 @@ PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension_range, const Descriptor::ExtensionRange*) PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension, const FieldDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(Descriptor, MessageOptions) +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(Descriptor, MessageOptions); PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, name) PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, full_name) @@ -1355,7 +1351,7 @@ PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, message_type, const Descriptor*) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, enum_type, const EnumDescriptor*) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, experimental_map_key, const FieldDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FieldDescriptor, FieldOptions) +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FieldDescriptor, FieldOptions); PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_default_value, bool) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int32 , int32 ) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int64 , int64 ) @@ -1375,13 +1371,13 @@ PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, containing_type, const Descriptor*) PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, value_count, int) PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, value, const EnumValueDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumDescriptor, EnumOptions) +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumDescriptor, EnumOptions); PROTOBUF_DEFINE_STRING_ACCESSOR(EnumValueDescriptor, name) PROTOBUF_DEFINE_STRING_ACCESSOR(EnumValueDescriptor, full_name) PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, number, int) PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, type, const EnumDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumValueDescriptor, EnumValueOptions) +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumValueDescriptor, EnumValueOptions); PROTOBUF_DEFINE_STRING_ACCESSOR(ServiceDescriptor, name) PROTOBUF_DEFINE_STRING_ACCESSOR(ServiceDescriptor, full_name) @@ -1389,14 +1385,14 @@ PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, file, const FileDescriptor*) PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, method_count, int) PROTOBUF_DEFINE_ARRAY_ACCESSOR(ServiceDescriptor, method, const MethodDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(ServiceDescriptor, ServiceOptions) +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(ServiceDescriptor, ServiceOptions); PROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, name) PROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, full_name) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, service, const ServiceDescriptor*) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, input_type, const Descriptor*) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, output_type, const Descriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(MethodDescriptor, MethodOptions) +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(MethodDescriptor, MethodOptions); PROTOBUF_DEFINE_STRING_ACCESSOR(FileDescriptor, name) PROTOBUF_DEFINE_STRING_ACCESSOR(FileDescriptor, package) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, pool, const DescriptorPool*) @@ -1407,7 +1403,7 @@ PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, message_type_count, int) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, enum_type_count, int) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, service_count, int) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, extension_count, int) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FileDescriptor, FileOptions) +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FileDescriptor, FileOptions); PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, message_type, const Descriptor*) PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, enum_type, const EnumDescriptor*) diff --git a/chromium/third_party/protobuf/src/google/protobuf/descriptor.pb.h b/chromium/third_party/protobuf/src/google/protobuf/descriptor.pb.h index f6b83cea5ae..5c1175cb7d7 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/descriptor.pb.h +++ b/chromium/third_party/protobuf/src/google/protobuf/descriptor.pb.h @@ -8,12 +8,12 @@ #include <google/protobuf/stubs/common.h> -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2004000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2004002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/chromium/third_party/protobuf/src/google/protobuf/descriptor_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/descriptor_unittest.cc index 86e6a49d8c8..3503f13ecdb 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/descriptor_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/descriptor_unittest.cc @@ -1739,7 +1739,7 @@ TEST_F(MiscTest, DefaultValues) { message->field(3)->default_value_uint64()); EXPECT_EQ(4.5 , message->field(4)->default_value_float ()); EXPECT_EQ(10e100 , message->field(5)->default_value_double()); - EXPECT_TRUE( message->field(6)->default_value_bool ()); + EXPECT_EQ(true , message->field(6)->default_value_bool ()); EXPECT_EQ("hello" , message->field(7)->default_value_string()); EXPECT_EQ("\001\002\003" , message->field(8)->default_value_string()); EXPECT_EQ(enum_value_b , message->field(9)->default_value_enum ()); @@ -1762,7 +1762,7 @@ TEST_F(MiscTest, DefaultValues) { EXPECT_EQ(0 , message->field(14)->default_value_uint64()); EXPECT_EQ(0.0f , message->field(15)->default_value_float ()); EXPECT_EQ(0.0 , message->field(16)->default_value_double()); - EXPECT_FALSE( message->field(17)->default_value_bool ()); + EXPECT_EQ(false, message->field(17)->default_value_bool ()); EXPECT_EQ("" , message->field(18)->default_value_string()); EXPECT_EQ("" , message->field(19)->default_value_string()); EXPECT_EQ(enum_value_a, message->field(20)->default_value_enum()); @@ -2167,7 +2167,7 @@ TEST(CustomOptions, OptionTypes) { options = &protobuf_unittest::CustomOptionMinIntegerValues::descriptor()->options(); - EXPECT_FALSE( options->GetExtension(protobuf_unittest::bool_opt)); + EXPECT_EQ(false , options->GetExtension(protobuf_unittest::bool_opt)); EXPECT_EQ(kint32min, options->GetExtension(protobuf_unittest::int32_opt)); EXPECT_EQ(kint64min, options->GetExtension(protobuf_unittest::int64_opt)); EXPECT_EQ(0 , options->GetExtension(protobuf_unittest::uint32_opt)); @@ -2181,7 +2181,7 @@ TEST(CustomOptions, OptionTypes) { options = &protobuf_unittest::CustomOptionMaxIntegerValues::descriptor()->options(); - EXPECT_TRUE( options->GetExtension(protobuf_unittest::bool_opt)); + EXPECT_EQ(true , options->GetExtension(protobuf_unittest::bool_opt)); EXPECT_EQ(kint32max , options->GetExtension(protobuf_unittest::int32_opt)); EXPECT_EQ(kint64max , options->GetExtension(protobuf_unittest::int64_opt)); EXPECT_EQ(kuint32max, options->GetExtension(protobuf_unittest::uint32_opt)); @@ -4001,9 +4001,7 @@ TEST_F(ValidationErrorTest, DisallowEnumAlias) { " options { allow_alias: false }" "}", "foo.proto: Bar: NUMBER: " - "\"ENUM_B\" uses the same enum value as \"ENUM_A\". " - "If this is intended, set 'option allow_alias = true;' to the enum " - "definition.\n"); + "\"ENUM_B\" uses the same enum value as \"ENUM_A\"\n"); } // =================================================================== diff --git a/chromium/third_party/protobuf/src/google/protobuf/dynamic_message.cc b/chromium/third_party/protobuf/src/google/protobuf/dynamic_message.cc index 09bec54363a..e4bebb2531c 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/dynamic_message.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/dynamic_message.cc @@ -208,6 +208,14 @@ class DynamicMessage : public Message { Metadata GetMetadata() const; + // We actually allocate more memory than sizeof(*this) when this + // class's memory is allocated via the global operator new. Thus, we need to + // manually call the global operator delete. Calling the destructor is taken + // care of for us. + static void operator delete(void* ptr) { + ::operator delete(ptr); + } + private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMessage); diff --git a/chromium/third_party/protobuf/src/google/protobuf/extension_set_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/extension_set_unittest.cc index 559de6e138f..1e7c5a5e8d9 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/extension_set_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/extension_set_unittest.cc @@ -550,7 +550,7 @@ TEST(ExtensionSetTest, SpaceUsedExcludingSelf) { } } -#ifdef PROTOBUF_HAS_DEATH_TEST +#ifdef GTEST_HAS_DEATH_TEST TEST(ExtensionSetTest, InvalidEnumDeath) { unittest::TestAllExtensions message; @@ -560,7 +560,7 @@ TEST(ExtensionSetTest, InvalidEnumDeath) { "IsValid"); } -#endif // PROTOBUF_HAS_DEATH_TEST +#endif // GTEST_HAS_DEATH_TEST TEST(ExtensionSetTest, DynamicExtensions) { // Test adding a dynamic extension to a compiled-in message object. @@ -695,11 +695,7 @@ TEST(ExtensionSetTest, DynamicExtensions) { const Message& sub_message = message.GetReflection()->GetMessage(message, message_extension); const unittest::ForeignMessage* typed_sub_message = -#ifdef GOOGLE_PROTOBUF_NO_RTTI - static_cast<const unittest::ForeignMessage*>(&sub_message); -#else dynamic_cast<const unittest::ForeignMessage*>(&sub_message); -#endif ASSERT_TRUE(typed_sub_message != NULL); EXPECT_EQ(456, typed_sub_message->c()); } diff --git a/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection.h b/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection.h index c1c142fa8aa..e6670aea4cd 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection.h +++ b/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection.h @@ -50,9 +50,9 @@ namespace google { namespace upb { -namespace google_opensource { -class GMR_Handlers; -} // namespace google_opensource +namespace proto2_bridge_opensource { +class FieldAccessor; +} // namespace protobuf_bridge_google3 } // namespace upb namespace protobuf { @@ -287,9 +287,9 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection : public Reflection { private: friend class GeneratedMessage; - // To parse directly into a proto2 generated class, the class GMR_Handlers - // needs access to member offsets and hasbits. - friend class LIBPROTOBUF_EXPORT upb::google_opensource::GMR_Handlers; + // To parse directly into a proto2 generated class, FieldAccessor needs + // access to member offsets and hasbits. + friend class LIBPROTOBUF_EXPORT upb::proto2_bridge_opensource::FieldAccessor; const Descriptor* descriptor_; const Message* default_instance_; diff --git a/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection_unittest.cc index 39aa55fb4a5..f60e430d589 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection_unittest.cc @@ -427,7 +427,7 @@ TEST(GeneratedMessageReflectionTest, ReleaseExtensionMessageTest) { TestUtil::ExpectAllExtensionsSet(message); } -#ifdef PROTOBUF_HAS_DEATH_TEST +#ifdef GTEST_HAS_DEATH_TEST TEST(GeneratedMessageReflectionTest, UsageErrors) { unittest::TestAllTypes message; @@ -476,7 +476,7 @@ TEST(GeneratedMessageReflectionTest, UsageErrors) { #undef f } -#endif // PROTOBUF_HAS_DEATH_TEST +#endif // GTEST_HAS_DEATH_TEST } // namespace diff --git a/chromium/third_party/protobuf/src/google/protobuf/io/gzip_stream.h b/chromium/third_party/protobuf/src/google/protobuf/io/gzip_stream.h index 365e9ea5f58..7ee24bc3183 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/io/gzip_stream.h +++ b/chromium/third_party/protobuf/src/google/protobuf/io/gzip_stream.h @@ -118,7 +118,7 @@ class LIBPROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream { ZLIB = 2, }; - struct LIBPROTOBUF_EXPORT Options { + struct Options { // Defaults to GZIP. Format format; diff --git a/chromium/third_party/protobuf/src/google/protobuf/io/printer_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/io/printer_unittest.cc index c9b3035960f..399395c81e1 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/io/printer_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/io/printer_unittest.cc @@ -220,7 +220,7 @@ TEST(Printer, Indenting) { } // Death tests do not work on Windows as of yet. -#ifdef PROTOBUF_HAS_DEATH_TEST +#ifdef GTEST_HAS_DEATH_TEST TEST(Printer, Death) { char buffer[8192]; @@ -231,7 +231,7 @@ TEST(Printer, Death) { EXPECT_DEBUG_DEATH(printer.Print("$unclosed"), "Unclosed variable name"); EXPECT_DEBUG_DEATH(printer.Outdent(), "without matching Indent"); } -#endif // PROTOBUF__HAS_DEATH_TEST +#endif // GTEST_HAS_DEATH_TEST TEST(Printer, WriteFailurePartial) { char buffer[17]; diff --git a/chromium/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc index dbb5be4f601..8de43939be8 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc @@ -741,7 +741,7 @@ TEST_F(TokenizerTest, ParseInteger) { EXPECT_EQ(0, ParseInteger("0x")); uint64 i; -#ifdef PROTOBUF_HASDEATH_TEST // death tests do not work on Windows yet +#ifdef GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet // Test invalid integers that will never be tokenized as integers. EXPECT_DEBUG_DEATH(Tokenizer::ParseInteger("zxy", kuint64max, &i), "passed text that could not have been tokenized as an integer"); @@ -753,7 +753,7 @@ TEST_F(TokenizerTest, ParseInteger) { "passed text that could not have been tokenized as an integer"); EXPECT_DEBUG_DEATH(Tokenizer::ParseInteger("-1", kuint64max, &i), "passed text that could not have been tokenized as an integer"); -#endif // PROTOBUF_HASDEATH_TEST +#endif // GTEST_HAS_DEATH_TEST // Test overflows. EXPECT_TRUE (Tokenizer::ParseInteger("0", 0, &i)); @@ -796,7 +796,7 @@ TEST_F(TokenizerTest, ParseFloat) { EXPECT_EQ( 0.0, Tokenizer::ParseFloat("1e-9999999999999999999999999999")); EXPECT_EQ(HUGE_VAL, Tokenizer::ParseFloat("1e+9999999999999999999999999999")); -#ifdef PROTOBUF_HASDEATH_TEST // death tests do not work on Windows yet +#ifdef GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet // Test invalid integers that will never be tokenized as integers. EXPECT_DEBUG_DEATH(Tokenizer::ParseFloat("zxy"), "passed text that could not have been tokenized as a float"); @@ -804,7 +804,7 @@ TEST_F(TokenizerTest, ParseFloat) { "passed text that could not have been tokenized as a float"); EXPECT_DEBUG_DEATH(Tokenizer::ParseFloat("-1.0"), "passed text that could not have been tokenized as a float"); -#endif // PROTOBUF_HASDEATH_TEST +#endif // GTEST_HAS_DEATH_TEST } TEST_F(TokenizerTest, ParseString) { @@ -843,10 +843,10 @@ TEST_F(TokenizerTest, ParseString) { EXPECT_EQ("u0", output); // Test invalid strings that will never be tokenized as strings. -#ifdef PROTOBUF_HASDEATH_TEST // death tests do not work on Windows yet +#ifdef GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet EXPECT_DEBUG_DEATH(Tokenizer::ParseString("", &output), "passed text that could not have been tokenized as a string"); -#endif // PROTOBUF_HASDEATH_TEST +#endif // GTEST_HAS_DEATH_TEST } TEST_F(TokenizerTest, ParseStringAppend) { diff --git a/chromium/third_party/protobuf/src/google/protobuf/message.h b/chromium/third_party/protobuf/src/google/protobuf/message.h index 0f90bc1a15b..77faa9a77a5 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/message.h +++ b/chromium/third_party/protobuf/src/google/protobuf/message.h @@ -750,27 +750,6 @@ class LIBPROTOBUF_EXPORT MessageFactory { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFactory); }; -#define DECLARE_GET_REPEATED_FIELD(TYPE) \ -template<> \ -LIBPROTOBUF_EXPORT \ -const RepeatedField<TYPE>& Reflection::GetRepeatedField<TYPE>( \ - const Message& message, const FieldDescriptor* field) const; \ - \ -template<> \ -LIBPROTOBUF_EXPORT \ -RepeatedField<TYPE>* Reflection::MutableRepeatedField<TYPE>( \ - Message* message, const FieldDescriptor* field) const; - -DECLARE_GET_REPEATED_FIELD(int32) -DECLARE_GET_REPEATED_FIELD(int64) -DECLARE_GET_REPEATED_FIELD(uint32) -DECLARE_GET_REPEATED_FIELD(uint64) -DECLARE_GET_REPEATED_FIELD(float) -DECLARE_GET_REPEATED_FIELD(double) -DECLARE_GET_REPEATED_FIELD(bool) - -#undef DECLARE_GET_REPEATED_FIELD - // ============================================================================= // Implementation details for {Get,Mutable}RawRepeatedPtrField. We provide // specializations for <string>, <StringPieceField> and <Message> and handle diff --git a/chromium/third_party/protobuf/src/google/protobuf/message_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/message_unittest.cc index a1449c76f47..8aaeabb4be9 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/message_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/message_unittest.cc @@ -205,7 +205,7 @@ TEST(MessageTest, InitializationErrorString) { EXPECT_EQ("a, b, c", message.InitializationErrorString()); } -#ifdef PROTOBUF_HAS_DEATH_TEST +#ifdef GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet. TEST(MessageTest, SerializeFailsIfNotInitialized) { unittest::TestRequired message; @@ -222,7 +222,7 @@ TEST(MessageTest, CheckInitialized) { "fields: a, b, c"); } -#endif // PROTOBUF_HAS_DEATH_TEST +#endif // GTEST_HAS_DEATH_TEST TEST(MessageTest, BypassInitializationCheckOnSerialize) { unittest::TestRequired message; diff --git a/chromium/third_party/protobuf/src/google/protobuf/reflection_ops_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/reflection_ops_unittest.cc index 29229b5a7e4..1cd56f1e64e 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/reflection_ops_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/reflection_ops_unittest.cc @@ -152,7 +152,7 @@ TEST(ReflectionOpsTest, MergeUnknown) { EXPECT_EQ(2, message1.unknown_fields().field(1).varint()); } -#ifdef PROTOBUF_HAS_DEATH_TEST +#ifdef GTEST_HAS_DEATH_TEST TEST(ReflectionOpsTest, MergeFromSelf) { // Note: Copy is implemented in terms of Merge() so technically the Copy @@ -165,7 +165,7 @@ TEST(ReflectionOpsTest, MergeFromSelf) { "&from"); } -#endif // PROTOBUF_HAS_DEATH_TEST +#endif // GTEST_HAS_DEATH_TEST TEST(ReflectionOpsTest, Clear) { unittest::TestAllTypes message; diff --git a/chromium/third_party/protobuf/src/google/protobuf/repeated_field.h b/chromium/third_party/protobuf/src/google/protobuf/repeated_field.h index 570d4b75129..b9db2b61dd3 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/repeated_field.h +++ b/chromium/third_party/protobuf/src/google/protobuf/repeated_field.h @@ -57,9 +57,9 @@ namespace google { namespace upb { -namespace google_opensource { -class GMR_Handlers; -} // namespace google_opensource +namespace proto2_bridge_opensource { +class FieldAccessor; +} // namespace protobuf_bridge_opensource } // namespace upb namespace protobuf { @@ -235,9 +235,9 @@ class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase { // use of AddFromCleared(), which is not part of the public interface. friend class ExtensionSet; - // To parse directly into a proto2 generated class, the upb class GMR_Handlers + // To parse directly into a proto2 generated class, the upb FieldAccessor // needs to be able to modify a RepeatedPtrFieldBase directly. - friend class LIBPROTOBUF_EXPORT upb::google_opensource::GMR_Handlers; + friend class LIBPROTOBUF_EXPORT upb::proto2_bridge_opensource::FieldAccessor; RepeatedPtrFieldBase(); diff --git a/chromium/third_party/protobuf/src/google/protobuf/repeated_field_reflection_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/repeated_field_reflection_unittest.cc index a40162d0b78..5fcfb007b67 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/repeated_field_reflection_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/repeated_field_reflection_unittest.cc @@ -120,7 +120,7 @@ TEST(RepeatedFieldReflectionTest, RegularFields) { EXPECT_EQ(rf_double.Get(i), Func(i, 2)); EXPECT_EQ(rpf_string.Get(i), StrFunc(i, 5)); EXPECT_EQ(rpf_foreign_message.Get(i).c(), Func(i, 6)); - EXPECT_EQ(down_cast<const ForeignMessage*>(&rpf_message.Get(i))->c(), + EXPECT_EQ(down_cast<const ForeignMessage&>(rpf_message.Get(i)).c(), Func(i, 6)); // Check gets through mutable objects. @@ -128,7 +128,7 @@ TEST(RepeatedFieldReflectionTest, RegularFields) { EXPECT_EQ(mrf_double->Get(i), Func(i, 2)); EXPECT_EQ(mrpf_string->Get(i), StrFunc(i, 5)); EXPECT_EQ(mrpf_foreign_message->Get(i).c(), Func(i, 6)); - EXPECT_EQ(down_cast<const ForeignMessage*>(&mrpf_message->Get(i))->c(), + EXPECT_EQ(down_cast<const ForeignMessage&>(mrpf_message->Get(i)).c(), Func(i, 6)); // Check sets through mutable objects. @@ -144,7 +144,6 @@ TEST(RepeatedFieldReflectionTest, RegularFields) { EXPECT_EQ(message.repeated_foreign_message(i).c(), Func(i, 7)); } -#ifdef PROTOBUF_HAS_DEATH_TEST // Make sure types are checked correctly at runtime. const FieldDescriptor* fd_optional_int32 = desc->FindFieldByName("optional_int32"); @@ -154,7 +153,6 @@ TEST(RepeatedFieldReflectionTest, RegularFields) { message, fd_repeated_int32), "not the right type"); EXPECT_DEATH(refl->GetRepeatedPtrField<TestAllTypes>( message, fd_repeated_foreign_message), "wrong submessage type"); -#endif // PROTOBUF_HAS_DEATH_TEST } diff --git a/chromium/third_party/protobuf/src/google/protobuf/repeated_field_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/repeated_field_unittest.cc index 257701eb317..99d5842d593 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/repeated_field_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/repeated_field_unittest.cc @@ -331,7 +331,7 @@ TEST(RepeatedField, Truncate) { // Truncations that don't change the size are allowed, but growing is not // allowed. field.Truncate(field.size()); -#ifdef PROTOBUF_HAS_DEATH_TEST +#ifdef GTEST_HAS_DEATH_TEST EXPECT_DEBUG_DEATH(field.Truncate(field.size() + 1), "new_size"); #endif } @@ -1007,13 +1007,11 @@ class RepeatedPtrFieldPtrsIteratorTest : public testing::Test { TEST_F(RepeatedPtrFieldPtrsIteratorTest, ConvertiblePtr) { RepeatedPtrField<string>::pointer_iterator iter = proto_array_.pointer_begin(); - (void) iter; } TEST_F(RepeatedPtrFieldPtrsIteratorTest, ConvertibleConstPtr) { RepeatedPtrField<string>::const_pointer_iterator iter = const_proto_array_->pointer_begin(); - (void) iter; } TEST_F(RepeatedPtrFieldPtrsIteratorTest, MutablePtrIteration) { @@ -1138,6 +1136,8 @@ TEST_F(RepeatedPtrFieldPtrsIteratorTest, PtrSTLAlgorithms_lower_bound) { proto_array_.Add()->assign("y"); { + RepeatedPtrField<string>::pointer_iterator iter = + proto_array_.pointer_begin(); string v = "f"; RepeatedPtrField<string>::pointer_iterator it = lower_bound(proto_array_.pointer_begin(), proto_array_.pointer_end(), @@ -1149,6 +1149,8 @@ TEST_F(RepeatedPtrFieldPtrsIteratorTest, PtrSTLAlgorithms_lower_bound) { EXPECT_TRUE(it == proto_array_.pointer_begin() + 3); } { + RepeatedPtrField<string>::const_pointer_iterator iter = + const_proto_array_->pointer_begin(); string v = "f"; RepeatedPtrField<string>::const_pointer_iterator it = lower_bound(const_proto_array_->pointer_begin(), diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops.h index ab935b02c6b..9b795ee4bfc 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops.h @@ -54,7 +54,7 @@ #define GOOGLE_PROTOBUF_ATOMICOPS_H_ // Don't include this file for people not concerned about thread safety. -#ifndef GOOGLE_PROTOBUF_NO_THREAD_SAFETY +#ifndef GOOGLE_PROTOBUF_NO_THREADSAFETY #include <google/protobuf/stubs/platform_macros.h> @@ -181,12 +181,8 @@ GOOGLE_PROTOBUF_ATOMICOPS_ERROR #include <google/protobuf/stubs/atomicops_internals_x86_gcc.h> #elif defined(GOOGLE_PROTOBUF_ARCH_ARM) #include <google/protobuf/stubs/atomicops_internals_arm_gcc.h> -#elif defined(GOOGLE_PROTOBUF_ARCH_ARM_QNX) -#include <google/protobuf/stubs/atomicops_internals_arm_qnx.h> #elif defined(GOOGLE_PROTOBUF_ARCH_MIPS) #include <google/protobuf/stubs/atomicops_internals_mips_gcc.h> -#elif defined(__pnacl__) -#include <google/protobuf/stubs/atomicops_internals_pnacl.h> #else GOOGLE_PROTOBUF_ATOMICOPS_ERROR #endif @@ -204,6 +200,6 @@ GOOGLE_PROTOBUF_ATOMICOPS_ERROR #undef GOOGLE_PROTOBUF_ATOMICOPS_ERROR -#endif // GOOGLE_PROTOBUF_NO_THREAD_SAFETY +#endif // GOOGLE_PROTOBUF_NO_THREADSAFETY #endif // GOOGLE_PROTOBUF_ATOMICOPS_H_ diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_qnx.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_qnx.h deleted file mode 100644 index f0507697868..00000000000 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_qnx.h +++ /dev/null @@ -1,146 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2012 Google Inc. All rights reserved. -// 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 -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file is an internal atomic implementation, use atomicops.h instead. - -#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_ -#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_ - -// For _smp_cmpxchg() -#include <pthread.h> - -namespace google { -namespace protobuf { -namespace internal { - -inline Atomic32 QNXCmpxchg(Atomic32 old_value, - Atomic32 new_value, - volatile Atomic32* ptr) { - return static_cast<Atomic32>( - _smp_cmpxchg((volatile unsigned *)ptr, - (unsigned)old_value, - (unsigned)new_value)); -} - - -inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - Atomic32 prev_value = *ptr; - do { - if (!QNXCmpxchg(old_value, new_value, - const_cast<Atomic32*>(ptr))) { - return old_value; - } - prev_value = *ptr; - } while (prev_value == old_value); - return prev_value; -} - -inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, - Atomic32 new_value) { - Atomic32 old_value; - do { - old_value = *ptr; - } while (QNXCmpxchg(old_value, new_value, - const_cast<Atomic32*>(ptr))); - return old_value; -} - -inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, - Atomic32 increment) { - return Barrier_AtomicIncrement(ptr, increment); -} - -inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, - Atomic32 increment) { - for (;;) { - // Atomic exchange the old value with an incremented one. - Atomic32 old_value = *ptr; - Atomic32 new_value = old_value + increment; - if (QNXCmpxchg(old_value, new_value, - const_cast<Atomic32*>(ptr)) == 0) { - // The exchange took place as expected. - return new_value; - } - // Otherwise, *ptr changed mid-loop and we need to retry. - } -} - -inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - return NoBarrier_CompareAndSwap(ptr, old_value, new_value); -} - -inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - return NoBarrier_CompareAndSwap(ptr, old_value, new_value); -} - -inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { - *ptr = value; -} - -inline void MemoryBarrier() { - __sync_synchronize(); -} - -inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { - *ptr = value; - MemoryBarrier(); -} - -inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { - MemoryBarrier(); - *ptr = value; -} - -inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { - return *ptr; -} - -inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { - Atomic32 value = *ptr; - MemoryBarrier(); - return value; -} - -inline Atomic32 Release_Load(volatile const Atomic32* ptr) { - MemoryBarrier(); - return *ptr; -} - -} // namespace internal -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_ diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h index e9d86797b53..8d9a726c280 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h @@ -44,7 +44,7 @@ // On LP64 platforms, AtomicWord and Atomic64 are both always long, // so this problem doesn't occur. -#if !defined(GOOGLE_PROTOBUF_ARCH_64_BIT) +#if !defined(GOOGLE_PROTOBUF_HOST_ARCH_64_BIT) namespace google { namespace protobuf { @@ -117,6 +117,6 @@ inline AtomicWord Release_Load(volatile const AtomicWord* ptr) { } // namespace protobuf } // namespace google -#endif // !defined(GOOGLE_PROTOBUF_ARCH_64_BIT) +#endif // !defined(GOOGLE_PROTOBUF_HOST_ARCH_64_BIT) #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_macosx.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_macosx.h index f9b7581ad56..9af6d636d6c 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_macosx.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_macosx.h @@ -136,7 +136,7 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, Atomic64 prev_value; do { if (OSAtomicCompareAndSwap64(old_value, new_value, - reinterpret_cast<volatile int64_t*>(ptr))) { + const_cast<Atomic64*>(ptr))) { return old_value; } prev_value = *ptr; @@ -150,19 +150,18 @@ inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, do { old_value = *ptr; } while (!OSAtomicCompareAndSwap64(old_value, new_value, - reinterpret_cast<volatile int64_t*>(ptr))); + const_cast<Atomic64*>(ptr))); return old_value; } inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) { - return OSAtomicAdd64(increment, reinterpret_cast<volatile int64_t*>(ptr)); + return OSAtomicAdd64(increment, const_cast<Atomic64*>(ptr)); } inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) { - return OSAtomicAdd64Barrier(increment, - reinterpret_cast<volatile int64_t*>(ptr)); + return OSAtomicAdd64Barrier(increment, const_cast<Atomic64*>(ptr)); } inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, @@ -170,8 +169,8 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, Atomic64 new_value) { Atomic64 prev_value; do { - if (OSAtomicCompareAndSwap64Barrier( - old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) { + if (OSAtomicCompareAndSwap64Barrier(old_value, new_value, + const_cast<Atomic64*>(ptr))) { return old_value; } prev_value = *ptr; diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_pnacl.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_pnacl.h deleted file mode 100644 index 04a91a83f87..00000000000 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_pnacl.h +++ /dev/null @@ -1,73 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2012 Google Inc. All rights reserved. -// 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 -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file is an internal atomic implementation, use atomicops.h instead. - -#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ -#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ - -namespace google { -namespace protobuf { -namespace internal { - -inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - return __sync_val_compare_and_swap(ptr, old_value, new_value); -} - -inline void MemoryBarrier() { - __sync_synchronize(); -} - -inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, - Atomic32 old_value, - Atomic32 new_value) { - Atomic32 ret = NoBarrier_CompareAndSwap(ptr, old_value, new_value); - MemoryBarrier(); - return ret; -} - -inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { - MemoryBarrier(); - *ptr = value; -} - -inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { - Atomic32 value = *ptr; - MemoryBarrier(); - return value; -} - -} // namespace internal -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc index 0b359796ed2..8366a891069 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc @@ -32,7 +32,7 @@ // Therefore we move the code depending on windows.h to this separate cc file. // Don't compile this file for people not concerned about thread safety. -#ifndef GOOGLE_PROTOBUF_NO_THREAD_SAFETY +#ifndef GOOGLE_PROTOBUF_NO_THREADSAFETY #include <google/protobuf/stubs/atomicops.h> @@ -109,4 +109,4 @@ Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, } // namespace google #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_ -#endif // GOOGLE_PROTOBUF_NO_THREAD_SAFETY +#endif // GOOGLE_PROTOBUF_NO_THREADSAFETY diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/common.cc b/chromium/third_party/protobuf/src/google/protobuf/stubs/common.cc index e6045026774..16d7852820b 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/common.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/common.cc @@ -110,7 +110,7 @@ void DefaultLogHandler(LogLevel level, const char* filename, int line, // We use fprintf() instead of cerr because we want this to work at static // initialization time. - fprintf(stderr, "[libprotobuf %s %s:%d] %s\n", + fprintf(stderr, "libprotobuf %s %s:%d] %s\n", level_names[level], filename, line, message.c_str()); fflush(stderr); // Needed on MSVC. } @@ -183,15 +183,15 @@ void LogMessage::Finish() { if (level_ != LOGLEVEL_FATAL) { InitLogSilencerCountOnce(); MutexLock lock(log_silencer_count_mutex_); - suppress = log_silencer_count_ > 0; + suppress = internal::log_silencer_count_ > 0; } if (!suppress) { - log_handler_(level_, filename_, line_, message_); + internal::log_handler_(level_, filename_, line_, message_); } if (level_ == LOGLEVEL_FATAL) { -#if PROTOBUF_USE_EXCEPTIONS +#ifdef PROTOBUF_USE_EXCEPTIONS throw FatalException(filename_, line_, message_); #else abort(); @@ -383,7 +383,7 @@ void ShutdownProtobufLibrary() { internal::shutdown_functions_mutex = NULL; } -#if PROTOBUF_USE_EXCEPTIONS +#ifdef PROTOBUF_USE_EXCEPTIONS FatalException::~FatalException() throw() {} const char* FatalException::what() const throw() { diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h index e9d0e352556..4c3e0cb313f 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/common.h @@ -48,17 +48,12 @@ #include <stdint.h> #endif -#ifndef PROTOBUF_USE_EXCEPTIONS #if defined(_MSC_VER) && defined(_CPPUNWIND) - #define PROTOBUF_USE_EXCEPTIONS 1 + #define PROTOBUF_USE_EXCEPTIONS #elif defined(__EXCEPTIONS) - #define PROTOBUF_USE_EXCEPTIONS 1 -#else - #define PROTOBUF_USE_EXCEPTIONS 0 -#endif + #define PROTOBUF_USE_EXCEPTIONS #endif - -#if PROTOBUF_USE_EXCEPTIONS +#ifdef PROTOBUF_USE_EXCEPTIONS #include <exception> #endif @@ -128,24 +123,24 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 2005000 +#define GOOGLE_PROTOBUF_VERSION 2004002 // The minimum library version which works with the current version of the // headers. -#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 2005000 +#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 2004000 // The minimum header version which works with the current version of // the library. This constant should only be used by protoc's C++ code // generator. -static const int kMinHeaderVersionForLibrary = 2005000; +static const int kMinHeaderVersionForLibrary = 2004000; // The minimum protoc version which works with the current version of the // headers. -#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 2005000 +#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 2004000 // The minimum header version which works with the current version of // protoc. This constant should only be used in VerifyVersion(). -static const int kMinHeaderVersionForProtoc = 2005000; +static const int kMinHeaderVersionForProtoc = 2004000; // Verifies that the headers and libraries are compatible. Use the macro // below to call this. @@ -361,6 +356,12 @@ inline To down_cast(From* f) { // so we only accept pointers return static_cast<To>(f); } +// Simplified down_cast for reference type. +template<typename To, typename From> +inline To down_cast(From& f) { + return static_cast<To>(f); +} + } // namespace internal // We made these internal so that they would show up as such in the docs, @@ -1208,7 +1209,7 @@ LIBPROTOBUF_EXPORT void OnShutdown(void (*func)()); } // namespace internal -#if PROTOBUF_USE_EXCEPTIONS +#ifdef PROTOBUF_USE_EXCEPTIONS class FatalException : public std::exception { public: FatalException(const char* filename, int line, const std::string& message) diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/common_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/stubs/common_unittest.cc index 43cd6d010be..4109a52cb95 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/common_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/common_unittest.cc @@ -94,9 +94,9 @@ TEST(LoggingTest, DefaultLogging) { string text = GetCapturedTestStderr(); EXPECT_EQ( - "[libprotobuf INFO "__FILE__":" + SimpleItoa(line + 1) + "] A message.\n" - "[libprotobuf WARNING "__FILE__":" + SimpleItoa(line + 2) + "] A warning.\n" - "[libprotobuf ERROR "__FILE__":" + SimpleItoa(line + 3) + "] An error.\n", + "libprotobuf INFO "__FILE__":" + SimpleItoa(line + 1) + "] A message.\n" + "libprotobuf WARNING "__FILE__":" + SimpleItoa(line + 2) + "] A warning.\n" + "libprotobuf ERROR "__FILE__":" + SimpleItoa(line + 3) + "] An error.\n", text); } diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/once.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/once.h index 7fbc117fe43..ead86fbd59e 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/once.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/once.h @@ -118,8 +118,8 @@ typedef internal::AtomicWord ProtobufOnceType; #define GOOGLE_PROTOBUF_ONCE_INIT ::google::protobuf::ONCE_STATE_UNINITIALIZED -LIBPROTOBUF_EXPORT -void GoogleOnceInitImpl(ProtobufOnceType* once, Closure* closure); +LIBPROTOBUF_EXPORT void GoogleOnceInitImpl(ProtobufOnceType* once, + Closure* closure); inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()) { if (internal::Acquire_Load(once) != ONCE_STATE_DONE) { diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/platform_macros.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/platform_macros.h index b1df60e4679..cba9fbd029e 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/platform_macros.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/platform_macros.h @@ -43,9 +43,6 @@ #elif defined(_M_IX86) || defined(__i386__) #define GOOGLE_PROTOBUF_ARCH_IA32 1 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 -#elif defined(__QNX__) -#define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1 -#define GOOGLE_PROTOBUF_ARCH_32_BIT 1 #elif defined(__ARMEL__) #define GOOGLE_PROTOBUF_ARCH_ARM 1 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 @@ -54,9 +51,6 @@ #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 #elif defined(__pnacl__) #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 -#elif defined(__ppc__) -#define GOOGLE_PROTOBUF_ARCH_PPC 1 -#define GOOGLE_PROTOBUF_ARCH_32_BIT 1 #else #error Host architecture was not detected as supported by protobuf #endif diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/stl_util-inl.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/stl_util-inl.h new file mode 100644 index 00000000000..a2e671bb746 --- /dev/null +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/stl_util-inl.h @@ -0,0 +1,121 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// 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 +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// from google3/util/gtl/stl_util-inl.h + +#ifndef GOOGLE_PROTOBUF_STUBS_STL_UTIL_INL_H__ +#define GOOGLE_PROTOBUF_STUBS_STL_UTIL_INL_H__ + +#include <google/protobuf/stubs/common.h> + +namespace google { +namespace protobuf { + +// STLDeleteContainerPointers() +// For a range within a container of pointers, calls delete +// (non-array version) on these pointers. +// NOTE: for these three functions, we could just implement a DeleteObject +// functor and then call for_each() on the range and functor, but this +// requires us to pull in all of algorithm.h, which seems expensive. +// For hash_[multi]set, it is important that this deletes behind the iterator +// because the hash_set may call the hash function on the iterator when it is +// advanced, which could result in the hash function trying to deference a +// stale pointer. +template <class ForwardIterator> +void STLDeleteContainerPointers(ForwardIterator begin, + ForwardIterator end) { + while (begin != end) { + ForwardIterator temp = begin; + ++begin; + delete *temp; + } +} + +// Inside Google, this function implements a horrible, disgusting hack in which +// we reach into the string's private implementation and resize it without +// initializing the new bytes. In some cases doing this can significantly +// improve performance. However, since it's totally non-portable it has no +// place in open source code. Feel free to fill this function in with your +// own disgusting hack if you want the perf boost. +inline void STLStringResizeUninitialized(string* s, size_t new_size) { + s->resize(new_size); +} + +// Return a mutable char* pointing to a string's internal buffer, +// which may not be null-terminated. Writing through this pointer will +// modify the string. +// +// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the +// next call to a string method that invalidates iterators. +// +// As of 2006-04, there is no standard-blessed way of getting a +// mutable reference to a string's internal buffer. However, issue 530 +// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530) +// proposes this as the method. According to Matt Austern, this should +// already work on all current implementations. +inline char* string_as_array(string* str) { + // DO NOT USE const_cast<char*>(str->data())! See the unittest for why. + return str->empty() ? NULL : &*str->begin(); +} + +// STLDeleteElements() deletes all the elements in an STL container and clears +// the container. This function is suitable for use with a vector, set, +// hash_set, or any other STL container which defines sensible begin(), end(), +// and clear() methods. +// +// If container is NULL, this function is a no-op. +// +// As an alternative to calling STLDeleteElements() directly, consider +// ElementDeleter (defined below), which ensures that your container's elements +// are deleted when the ElementDeleter goes out of scope. +template <class T> +void STLDeleteElements(T *container) { + if (!container) return; + STLDeleteContainerPointers(container->begin(), container->end()); + container->clear(); +} + +// Given an STL container consisting of (key, value) pairs, STLDeleteValues +// deletes all the "value" components and clears the container. Does nothing +// in the case it's given a NULL pointer. + +template <class T> +void STLDeleteValues(T *v) { + if (!v) return; + for (typename T::iterator i = v->begin(); i != v->end(); ++i) { + delete i->second; + } + v->clear(); +} + +} // namespace protobuf +} // namespace google + +#endif // GOOGLE_PROTOBUF_STUBS_STL_UTIL_INL_H__ diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/stringprintf.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/stringprintf.h index 4a03e5ff99a..573f30f3aef 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/stringprintf.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/stringprintf.h @@ -50,25 +50,25 @@ namespace google { namespace protobuf { // Return a C++ string -LIBPROTOBUF_EXPORT extern string StringPrintf(const char* format, ...); +extern string StringPrintf(const char* format, ...); // Store result into a supplied string and return it -LIBPROTOBUF_EXPORT extern const string& SStringPrintf(string* dst, const char* format, ...); +extern const string& SStringPrintf(string* dst, const char* format, ...); // Append result to a supplied string -LIBPROTOBUF_EXPORT extern void StringAppendF(string* dst, const char* format, ...); +extern void StringAppendF(string* dst, const char* format, ...); // Lower-level routine that takes a va_list and appends to a specified // string. All other routines are just convenience wrappers around it. -LIBPROTOBUF_EXPORT extern void StringAppendV(string* dst, const char* format, va_list ap); +extern void StringAppendV(string* dst, const char* format, va_list ap); // The max arguments supported by StringPrintfVector -LIBPROTOBUF_EXPORT extern const int kStringPrintfVectorMaxArgs; +extern const int kStringPrintfVectorMaxArgs; // You can use this version when all your arguments are strings, but // you don't know how many arguments you'll have at compile time. // StringPrintfVector will LOG(FATAL) if v.size() > kStringPrintfVectorMaxArgs -LIBPROTOBUF_EXPORT extern string StringPrintfVector(const char* format, const vector<string>& v); +extern string StringPrintfVector(const char* format, const vector<string>& v); } // namespace protobuf } // namespace google diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits.h b/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits.h index e41f5e6f699..997f35d4d6e 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits.h +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits.h @@ -333,4 +333,14 @@ struct is_convertible } // namespace protobuf } // namespace google +// Right now these macros are no-ops, and mostly just document the fact +// these types are PODs, for human use. They may be made more contentful +// later. The typedef is just to make it legal to put a semicolon after +// these macros. +#define DECLARE_POD(TypeName) typedef int Dummy_Type_For_DECLARE_POD +#define DECLARE_NESTED_POD(TypeName) DECLARE_POD(TypeName) +#define PROPAGATE_POD_FROM_TEMPLATE_ARGUMENT(TemplateName) \ + typedef int Dummy_Type_For_PROPAGATE_POD_FROM_TEMPLATE_ARGUMENT +#define ENFORCE_POD(TypeName) typedef int Dummy_Type_For_ENFORCE_POD + #endif // GOOGLE_PROTOBUF_TYPE_TRAITS_H_ diff --git a/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits_unittest.cc index 7a8cbfb8b28..00e5a47636b 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/stubs/type_traits_unittest.cc @@ -47,6 +47,27 @@ using std::string; using std::vector; using std::pair; +using google::protobuf::internal::add_reference; +using google::protobuf::internal::has_trivial_assign; +using google::protobuf::internal::has_trivial_constructor; +using google::protobuf::internal::has_trivial_copy; +using google::protobuf::internal::has_trivial_destructor; +#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3) +using google::protobuf::internal::is_convertible; +using google::protobuf::internal::is_enum; +#endif +using google::protobuf::internal::is_floating_point; +using google::protobuf::internal::is_integral; +using google::protobuf::internal::is_pointer; +using google::protobuf::internal::is_pod; +using google::protobuf::internal::is_reference; +using google::protobuf::internal::is_same; +using google::protobuf::internal::remove_const; +using google::protobuf::internal::remove_cv; +using google::protobuf::internal::remove_pointer; +using google::protobuf::internal::remove_reference; +using google::protobuf::internal::remove_volatile; + // This assertion produces errors like "error: invalid use of // incomplete type 'struct <unnamed>::AssertTypesEq<const int, int>'" @@ -154,7 +175,6 @@ class J { namespace google { namespace protobuf { -namespace internal { namespace { // A base class and a derived class that inherits from it, used for @@ -623,6 +643,5 @@ TEST(TypeTraitsTest, TestConvertible) { } } // anonymous namespace -} // namespace internal } // namespace protobuf } // namespace google diff --git a/chromium/third_party/protobuf/src/google/protobuf/test_util.cc b/chromium/third_party/protobuf/src/google/protobuf/test_util.cc index a9666fe409f..841f4b30b7c 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/test_util.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/test_util.cc @@ -309,7 +309,7 @@ void TestUtil::ExpectAllFieldsSet(const unittest::TestAllTypes& message) { EXPECT_EQ(110 , message.optional_sfixed64()); EXPECT_EQ(111 , message.optional_float ()); EXPECT_EQ(112 , message.optional_double ()); - EXPECT_TRUE( message.optional_bool ()); + EXPECT_EQ(true , message.optional_bool ()); EXPECT_EQ("115", message.optional_string ()); EXPECT_EQ("116", message.optional_bytes ()); @@ -369,7 +369,7 @@ void TestUtil::ExpectAllFieldsSet(const unittest::TestAllTypes& message) { EXPECT_EQ(210 , message.repeated_sfixed64(0)); EXPECT_EQ(211 , message.repeated_float (0)); EXPECT_EQ(212 , message.repeated_double (0)); - EXPECT_TRUE( message.repeated_bool (0)); + EXPECT_EQ(true , message.repeated_bool (0)); EXPECT_EQ("215", message.repeated_string (0)); EXPECT_EQ("216", message.repeated_bytes (0)); @@ -396,7 +396,7 @@ void TestUtil::ExpectAllFieldsSet(const unittest::TestAllTypes& message) { EXPECT_EQ(310 , message.repeated_sfixed64(1)); EXPECT_EQ(311 , message.repeated_float (1)); EXPECT_EQ(312 , message.repeated_double (1)); - EXPECT_FALSE( message.repeated_bool (1)); + EXPECT_EQ(false, message.repeated_bool (1)); EXPECT_EQ("315", message.repeated_string (1)); EXPECT_EQ("316", message.repeated_bytes (1)); @@ -446,7 +446,7 @@ void TestUtil::ExpectAllFieldsSet(const unittest::TestAllTypes& message) { EXPECT_EQ(410 , message.default_sfixed64()); EXPECT_EQ(411 , message.default_float ()); EXPECT_EQ(412 , message.default_double ()); - EXPECT_FALSE( message.default_bool ()); + EXPECT_EQ(false, message.default_bool ()); EXPECT_EQ("415", message.default_string ()); EXPECT_EQ("416", message.default_bytes ()); @@ -503,7 +503,7 @@ void TestUtil::ExpectClear(const unittest::TestAllTypes& message) { EXPECT_EQ(0 , message.optional_sfixed64()); EXPECT_EQ(0 , message.optional_float ()); EXPECT_EQ(0 , message.optional_double ()); - EXPECT_FALSE( message.optional_bool ()); + EXPECT_EQ(false, message.optional_bool ()); EXPECT_EQ("" , message.optional_string ()); EXPECT_EQ("" , message.optional_bytes ()); @@ -592,7 +592,7 @@ void TestUtil::ExpectClear(const unittest::TestAllTypes& message) { EXPECT_EQ(-50 , message.default_sfixed64()); EXPECT_EQ( 51.5 , message.default_float ()); EXPECT_EQ( 52e3 , message.default_double ()); - EXPECT_TRUE( message.default_bool ()); + EXPECT_EQ(true , message.default_bool ()); EXPECT_EQ("hello", message.default_string ()); EXPECT_EQ("world", message.default_bytes ()); @@ -651,7 +651,7 @@ void TestUtil::ExpectRepeatedFieldsModified( EXPECT_EQ(210 , message.repeated_sfixed64(0)); EXPECT_EQ(211 , message.repeated_float (0)); EXPECT_EQ(212 , message.repeated_double (0)); - EXPECT_TRUE( message.repeated_bool (0)); + EXPECT_EQ(true , message.repeated_bool (0)); EXPECT_EQ("215", message.repeated_string (0)); EXPECT_EQ("216", message.repeated_bytes (0)); @@ -679,7 +679,7 @@ void TestUtil::ExpectRepeatedFieldsModified( EXPECT_EQ(510 , message.repeated_sfixed64(1)); EXPECT_EQ(511 , message.repeated_float (1)); EXPECT_EQ(512 , message.repeated_double (1)); - EXPECT_TRUE( message.repeated_bool (1)); + EXPECT_EQ(true , message.repeated_bool (1)); EXPECT_EQ("515", message.repeated_string (1)); EXPECT_EQ("516", message.repeated_bytes (1)); @@ -812,7 +812,7 @@ void TestUtil::ExpectPackedFieldsSet(const unittest::TestPackedTypes& message) { EXPECT_EQ(610 , message.packed_sfixed64(0)); EXPECT_EQ(611 , message.packed_float (0)); EXPECT_EQ(612 , message.packed_double (0)); - EXPECT_TRUE( message.packed_bool (0)); + EXPECT_EQ(true , message.packed_bool (0)); EXPECT_EQ(unittest::FOREIGN_BAR, message.packed_enum(0)); EXPECT_EQ(701 , message.packed_int32 (1)); @@ -827,7 +827,7 @@ void TestUtil::ExpectPackedFieldsSet(const unittest::TestPackedTypes& message) { EXPECT_EQ(710 , message.packed_sfixed64(1)); EXPECT_EQ(711 , message.packed_float (1)); EXPECT_EQ(712 , message.packed_double (1)); - EXPECT_FALSE( message.packed_bool (1)); + EXPECT_EQ(false, message.packed_bool (1)); EXPECT_EQ(unittest::FOREIGN_BAZ, message.packed_enum(1)); } @@ -862,7 +862,7 @@ void TestUtil::ExpectUnpackedFieldsSet( EXPECT_EQ(610 , message.unpacked_sfixed64(0)); EXPECT_EQ(611 , message.unpacked_float (0)); EXPECT_EQ(612 , message.unpacked_double (0)); - EXPECT_TRUE( message.unpacked_bool (0)); + EXPECT_EQ(true , message.unpacked_bool (0)); EXPECT_EQ(unittest::FOREIGN_BAR, message.unpacked_enum(0)); EXPECT_EQ(701 , message.unpacked_int32 (1)); @@ -877,7 +877,7 @@ void TestUtil::ExpectUnpackedFieldsSet( EXPECT_EQ(710 , message.unpacked_sfixed64(1)); EXPECT_EQ(711 , message.unpacked_float (1)); EXPECT_EQ(712 , message.unpacked_double (1)); - EXPECT_FALSE( message.unpacked_bool (1)); + EXPECT_EQ(false, message.unpacked_bool (1)); EXPECT_EQ(unittest::FOREIGN_BAZ, message.unpacked_enum(1)); } @@ -934,7 +934,7 @@ void TestUtil::ExpectPackedFieldsModified( EXPECT_EQ(610 , message.packed_sfixed64(0)); EXPECT_EQ(611 , message.packed_float (0)); EXPECT_EQ(612 , message.packed_double (0)); - EXPECT_TRUE( message.packed_bool (0)); + EXPECT_EQ(true , message.packed_bool (0)); EXPECT_EQ(unittest::FOREIGN_BAR, message.packed_enum(0)); // Actually verify the second (modified) elements now. EXPECT_EQ(801 , message.packed_int32 (1)); @@ -949,7 +949,7 @@ void TestUtil::ExpectPackedFieldsModified( EXPECT_EQ(810 , message.packed_sfixed64(1)); EXPECT_EQ(811 , message.packed_float (1)); EXPECT_EQ(812 , message.packed_double (1)); - EXPECT_TRUE( message.packed_bool (1)); + EXPECT_EQ(true , message.packed_bool (1)); EXPECT_EQ(unittest::FOREIGN_FOO, message.packed_enum(1)); } @@ -1178,7 +1178,7 @@ void TestUtil::ExpectAllExtensionsSet( EXPECT_EQ(110 , message.GetExtension(unittest::optional_sfixed64_extension)); EXPECT_EQ(111 , message.GetExtension(unittest::optional_float_extension )); EXPECT_EQ(112 , message.GetExtension(unittest::optional_double_extension )); - EXPECT_TRUE( message.GetExtension(unittest::optional_bool_extension )); + EXPECT_EQ(true , message.GetExtension(unittest::optional_bool_extension )); EXPECT_EQ("115", message.GetExtension(unittest::optional_string_extension )); EXPECT_EQ("116", message.GetExtension(unittest::optional_bytes_extension )); @@ -1238,7 +1238,7 @@ void TestUtil::ExpectAllExtensionsSet( EXPECT_EQ(210 , message.GetExtension(unittest::repeated_sfixed64_extension, 0)); EXPECT_EQ(211 , message.GetExtension(unittest::repeated_float_extension , 0)); EXPECT_EQ(212 , message.GetExtension(unittest::repeated_double_extension , 0)); - EXPECT_TRUE( message.GetExtension(unittest::repeated_bool_extension , 0)); + EXPECT_EQ(true , message.GetExtension(unittest::repeated_bool_extension , 0)); EXPECT_EQ("215", message.GetExtension(unittest::repeated_string_extension , 0)); EXPECT_EQ("216", message.GetExtension(unittest::repeated_bytes_extension , 0)); @@ -1267,7 +1267,7 @@ void TestUtil::ExpectAllExtensionsSet( EXPECT_EQ(310 , message.GetExtension(unittest::repeated_sfixed64_extension, 1)); EXPECT_EQ(311 , message.GetExtension(unittest::repeated_float_extension , 1)); EXPECT_EQ(312 , message.GetExtension(unittest::repeated_double_extension , 1)); - EXPECT_FALSE( message.GetExtension(unittest::repeated_bool_extension , 1)); + EXPECT_EQ(false, message.GetExtension(unittest::repeated_bool_extension , 1)); EXPECT_EQ("315", message.GetExtension(unittest::repeated_string_extension , 1)); EXPECT_EQ("316", message.GetExtension(unittest::repeated_bytes_extension , 1)); @@ -1321,7 +1321,7 @@ void TestUtil::ExpectAllExtensionsSet( EXPECT_EQ(410 , message.GetExtension(unittest::default_sfixed64_extension)); EXPECT_EQ(411 , message.GetExtension(unittest::default_float_extension )); EXPECT_EQ(412 , message.GetExtension(unittest::default_double_extension )); - EXPECT_FALSE( message.GetExtension(unittest::default_bool_extension )); + EXPECT_EQ(false, message.GetExtension(unittest::default_bool_extension )); EXPECT_EQ("415", message.GetExtension(unittest::default_string_extension )); EXPECT_EQ("416", message.GetExtension(unittest::default_bytes_extension )); @@ -1386,7 +1386,7 @@ void TestUtil::ExpectExtensionsClear( EXPECT_EQ(0 , message.GetExtension(unittest::optional_sfixed64_extension)); EXPECT_EQ(0 , message.GetExtension(unittest::optional_float_extension )); EXPECT_EQ(0 , message.GetExtension(unittest::optional_double_extension )); - EXPECT_FALSE( message.GetExtension(unittest::optional_bool_extension )); + EXPECT_EQ(false, message.GetExtension(unittest::optional_bool_extension )); EXPECT_EQ("" , message.GetExtension(unittest::optional_string_extension )); EXPECT_EQ("" , message.GetExtension(unittest::optional_bytes_extension )); @@ -1479,7 +1479,7 @@ void TestUtil::ExpectExtensionsClear( EXPECT_EQ(-50 , message.GetExtension(unittest::default_sfixed64_extension)); EXPECT_EQ( 51.5 , message.GetExtension(unittest::default_float_extension )); EXPECT_EQ( 52e3 , message.GetExtension(unittest::default_double_extension )); - EXPECT_TRUE( message.GetExtension(unittest::default_bool_extension )); + EXPECT_EQ(true , message.GetExtension(unittest::default_bool_extension )); EXPECT_EQ("hello", message.GetExtension(unittest::default_string_extension )); EXPECT_EQ("world", message.GetExtension(unittest::default_bytes_extension )); @@ -1538,7 +1538,7 @@ void TestUtil::ExpectRepeatedExtensionsModified( EXPECT_EQ(210 , message.GetExtension(unittest::repeated_sfixed64_extension, 0)); EXPECT_EQ(211 , message.GetExtension(unittest::repeated_float_extension , 0)); EXPECT_EQ(212 , message.GetExtension(unittest::repeated_double_extension , 0)); - EXPECT_TRUE( message.GetExtension(unittest::repeated_bool_extension , 0)); + EXPECT_EQ(true , message.GetExtension(unittest::repeated_bool_extension , 0)); EXPECT_EQ("215", message.GetExtension(unittest::repeated_string_extension , 0)); EXPECT_EQ("216", message.GetExtension(unittest::repeated_bytes_extension , 0)); @@ -1568,7 +1568,7 @@ void TestUtil::ExpectRepeatedExtensionsModified( EXPECT_EQ(510 , message.GetExtension(unittest::repeated_sfixed64_extension, 1)); EXPECT_EQ(511 , message.GetExtension(unittest::repeated_float_extension , 1)); EXPECT_EQ(512 , message.GetExtension(unittest::repeated_double_extension , 1)); - EXPECT_TRUE( message.GetExtension(unittest::repeated_bool_extension , 1)); + EXPECT_EQ(true , message.GetExtension(unittest::repeated_bool_extension , 1)); EXPECT_EQ("515", message.GetExtension(unittest::repeated_string_extension , 1)); EXPECT_EQ("516", message.GetExtension(unittest::repeated_bytes_extension , 1)); @@ -1671,7 +1671,7 @@ void TestUtil::ExpectPackedExtensionsSet( EXPECT_EQ(610 , message.GetExtension(unittest::packed_sfixed64_extension, 0)); EXPECT_EQ(611 , message.GetExtension(unittest::packed_float_extension , 0)); EXPECT_EQ(612 , message.GetExtension(unittest::packed_double_extension , 0)); - EXPECT_TRUE( message.GetExtension(unittest::packed_bool_extension , 0)); + EXPECT_EQ(true , message.GetExtension(unittest::packed_bool_extension , 0)); EXPECT_EQ(unittest::FOREIGN_BAR, message.GetExtension(unittest::packed_enum_extension, 0)); EXPECT_EQ(701 , message.GetExtension(unittest::packed_int32_extension , 1)); @@ -1686,7 +1686,7 @@ void TestUtil::ExpectPackedExtensionsSet( EXPECT_EQ(710 , message.GetExtension(unittest::packed_sfixed64_extension, 1)); EXPECT_EQ(711 , message.GetExtension(unittest::packed_float_extension , 1)); EXPECT_EQ(712 , message.GetExtension(unittest::packed_double_extension , 1)); - EXPECT_FALSE( message.GetExtension(unittest::packed_bool_extension , 1)); + EXPECT_EQ(false, message.GetExtension(unittest::packed_bool_extension , 1)); EXPECT_EQ(unittest::FOREIGN_BAZ, message.GetExtension(unittest::packed_enum_extension, 1)); } @@ -1741,7 +1741,7 @@ void TestUtil::ExpectPackedExtensionsModified( EXPECT_EQ(610 , message.GetExtension(unittest::packed_sfixed64_extension, 0)); EXPECT_EQ(611 , message.GetExtension(unittest::packed_float_extension , 0)); EXPECT_EQ(612 , message.GetExtension(unittest::packed_double_extension , 0)); - EXPECT_TRUE( message.GetExtension(unittest::packed_bool_extension , 0)); + EXPECT_EQ(true , message.GetExtension(unittest::packed_bool_extension , 0)); EXPECT_EQ(unittest::FOREIGN_BAR, message.GetExtension(unittest::packed_enum_extension, 0)); @@ -1758,7 +1758,7 @@ void TestUtil::ExpectPackedExtensionsModified( EXPECT_EQ(810 , message.GetExtension(unittest::packed_sfixed64_extension, 1)); EXPECT_EQ(811 , message.GetExtension(unittest::packed_float_extension , 1)); EXPECT_EQ(812 , message.GetExtension(unittest::packed_double_extension , 1)); - EXPECT_TRUE( message.GetExtension(unittest::packed_bool_extension , 1)); + EXPECT_EQ(true , message.GetExtension(unittest::packed_bool_extension , 1)); EXPECT_EQ(unittest::FOREIGN_FOO, message.GetExtension(unittest::packed_enum_extension, 1)); } @@ -1835,7 +1835,7 @@ void TestUtil::ExpectLastRepeatedsRemoved( EXPECT_EQ(210 , message.repeated_sfixed64(0)); EXPECT_EQ(211 , message.repeated_float (0)); EXPECT_EQ(212 , message.repeated_double (0)); - EXPECT_TRUE( message.repeated_bool (0)); + EXPECT_EQ(true , message.repeated_bool (0)); EXPECT_EQ("215", message.repeated_string (0)); EXPECT_EQ("216", message.repeated_bytes (0)); @@ -1895,7 +1895,7 @@ void TestUtil::ExpectLastRepeatedExtensionsRemoved( EXPECT_EQ(210 , message.GetExtension(unittest::repeated_sfixed64_extension, 0)); EXPECT_EQ(211 , message.GetExtension(unittest::repeated_float_extension , 0)); EXPECT_EQ(212 , message.GetExtension(unittest::repeated_double_extension , 0)); - EXPECT_TRUE( message.GetExtension(unittest::repeated_bool_extension , 0)); + EXPECT_EQ(true , message.GetExtension(unittest::repeated_bool_extension , 0)); EXPECT_EQ("215", message.GetExtension(unittest::repeated_string_extension , 0)); EXPECT_EQ("216", message.GetExtension(unittest::repeated_bytes_extension , 0)); @@ -1988,7 +1988,7 @@ void TestUtil::ExpectRepeatedsSwapped( EXPECT_EQ(210 , message.repeated_sfixed64(1)); EXPECT_EQ(211 , message.repeated_float (1)); EXPECT_EQ(212 , message.repeated_double (1)); - EXPECT_TRUE( message.repeated_bool (1)); + EXPECT_EQ(true , message.repeated_bool (1)); EXPECT_EQ("215", message.repeated_string (1)); EXPECT_EQ("216", message.repeated_bytes (1)); @@ -2014,7 +2014,7 @@ void TestUtil::ExpectRepeatedsSwapped( EXPECT_EQ(310 , message.repeated_sfixed64(0)); EXPECT_EQ(311 , message.repeated_float (0)); EXPECT_EQ(312 , message.repeated_double (0)); - EXPECT_FALSE( message.repeated_bool (0)); + EXPECT_EQ(false, message.repeated_bool (0)); EXPECT_EQ("315", message.repeated_string (0)); EXPECT_EQ("316", message.repeated_bytes (0)); @@ -2072,7 +2072,7 @@ void TestUtil::ExpectRepeatedExtensionsSwapped( EXPECT_EQ(210 , message.GetExtension(unittest::repeated_sfixed64_extension, 1)); EXPECT_EQ(211 , message.GetExtension(unittest::repeated_float_extension , 1)); EXPECT_EQ(212 , message.GetExtension(unittest::repeated_double_extension , 1)); - EXPECT_TRUE( message.GetExtension(unittest::repeated_bool_extension , 1)); + EXPECT_EQ(true , message.GetExtension(unittest::repeated_bool_extension , 1)); EXPECT_EQ("215", message.GetExtension(unittest::repeated_string_extension , 1)); EXPECT_EQ("216", message.GetExtension(unittest::repeated_bytes_extension , 1)); @@ -2101,7 +2101,7 @@ void TestUtil::ExpectRepeatedExtensionsSwapped( EXPECT_EQ(310 , message.GetExtension(unittest::repeated_sfixed64_extension, 0)); EXPECT_EQ(311 , message.GetExtension(unittest::repeated_float_extension , 0)); EXPECT_EQ(312 , message.GetExtension(unittest::repeated_double_extension , 0)); - EXPECT_FALSE( message.GetExtension(unittest::repeated_bool_extension , 0)); + EXPECT_EQ(false, message.GetExtension(unittest::repeated_bool_extension , 0)); EXPECT_EQ("315", message.GetExtension(unittest::repeated_string_extension , 0)); EXPECT_EQ("316", message.GetExtension(unittest::repeated_bytes_extension , 0)); @@ -2443,7 +2443,7 @@ void TestUtil::ReflectionTester::ExpectAllFieldsSetViaReflection1( EXPECT_EQ(110 , reflection->GetInt64 (message, F("optional_sfixed64"))); EXPECT_EQ(111 , reflection->GetFloat (message, F("optional_float" ))); EXPECT_EQ(112 , reflection->GetDouble(message, F("optional_double" ))); - EXPECT_TRUE( reflection->GetBool (message, F("optional_bool" ))); + EXPECT_EQ(true , reflection->GetBool (message, F("optional_bool" ))); EXPECT_EQ("115", reflection->GetString(message, F("optional_string" ))); EXPECT_EQ("116", reflection->GetString(message, F("optional_bytes" ))); @@ -2523,7 +2523,7 @@ void TestUtil::ReflectionTester::ExpectAllFieldsSetViaReflection2( EXPECT_EQ(210 , reflection->GetRepeatedInt64 (message, F("repeated_sfixed64"), 0)); EXPECT_EQ(211 , reflection->GetRepeatedFloat (message, F("repeated_float" ), 0)); EXPECT_EQ(212 , reflection->GetRepeatedDouble(message, F("repeated_double" ), 0)); - EXPECT_TRUE( reflection->GetRepeatedBool (message, F("repeated_bool" ), 0)); + EXPECT_EQ(true , reflection->GetRepeatedBool (message, F("repeated_bool" ), 0)); EXPECT_EQ("215", reflection->GetRepeatedString(message, F("repeated_string" ), 0)); EXPECT_EQ("216", reflection->GetRepeatedString(message, F("repeated_bytes" ), 0)); @@ -2565,7 +2565,7 @@ void TestUtil::ReflectionTester::ExpectAllFieldsSetViaReflection2( EXPECT_EQ(310 , reflection->GetRepeatedInt64 (message, F("repeated_sfixed64"), 1)); EXPECT_EQ(311 , reflection->GetRepeatedFloat (message, F("repeated_float" ), 1)); EXPECT_EQ(312 , reflection->GetRepeatedDouble(message, F("repeated_double" ), 1)); - EXPECT_FALSE( reflection->GetRepeatedBool (message, F("repeated_bool" ), 1)); + EXPECT_EQ(false, reflection->GetRepeatedBool (message, F("repeated_bool" ), 1)); EXPECT_EQ("315", reflection->GetRepeatedString(message, F("repeated_string" ), 1)); EXPECT_EQ("316", reflection->GetRepeatedString(message, F("repeated_bytes" ), 1)); @@ -2640,7 +2640,7 @@ void TestUtil::ReflectionTester::ExpectAllFieldsSetViaReflection3( EXPECT_EQ(410 , reflection->GetInt64 (message, F("default_sfixed64"))); EXPECT_EQ(411 , reflection->GetFloat (message, F("default_float" ))); EXPECT_EQ(412 , reflection->GetDouble(message, F("default_double" ))); - EXPECT_FALSE( reflection->GetBool (message, F("default_bool" ))); + EXPECT_EQ(false, reflection->GetBool (message, F("default_bool" ))); EXPECT_EQ("415", reflection->GetString(message, F("default_string" ))); EXPECT_EQ("416", reflection->GetString(message, F("default_bytes" ))); @@ -2690,7 +2690,7 @@ void TestUtil::ReflectionTester::ExpectPackedFieldsSetViaReflection( EXPECT_EQ(610 , reflection->GetRepeatedInt64 (message, F("packed_sfixed64"), 0)); EXPECT_EQ(611 , reflection->GetRepeatedFloat (message, F("packed_float" ), 0)); EXPECT_EQ(612 , reflection->GetRepeatedDouble(message, F("packed_double" ), 0)); - EXPECT_TRUE( reflection->GetRepeatedBool (message, F("packed_bool" ), 0)); + EXPECT_EQ(true , reflection->GetRepeatedBool (message, F("packed_bool" ), 0)); EXPECT_EQ(foreign_bar_, reflection->GetRepeatedEnum(message, F("packed_enum"), 0)); @@ -2706,7 +2706,7 @@ void TestUtil::ReflectionTester::ExpectPackedFieldsSetViaReflection( EXPECT_EQ(710 , reflection->GetRepeatedInt64 (message, F("packed_sfixed64"), 1)); EXPECT_EQ(711 , reflection->GetRepeatedFloat (message, F("packed_float" ), 1)); EXPECT_EQ(712 , reflection->GetRepeatedDouble(message, F("packed_double" ), 1)); - EXPECT_FALSE( reflection->GetRepeatedBool (message, F("packed_bool" ), 1)); + EXPECT_EQ(false, reflection->GetRepeatedBool (message, F("packed_bool" ), 1)); EXPECT_EQ(foreign_baz_, reflection->GetRepeatedEnum(message, F("packed_enum"), 1)); } @@ -2763,7 +2763,7 @@ void TestUtil::ReflectionTester::ExpectClearViaReflection( EXPECT_EQ(0 , reflection->GetInt64 (message, F("optional_sfixed64"))); EXPECT_EQ(0 , reflection->GetFloat (message, F("optional_float" ))); EXPECT_EQ(0 , reflection->GetDouble(message, F("optional_double" ))); - EXPECT_FALSE( reflection->GetBool (message, F("optional_bool" ))); + EXPECT_EQ(false, reflection->GetBool (message, F("optional_bool" ))); EXPECT_EQ("" , reflection->GetString(message, F("optional_string" ))); EXPECT_EQ("" , reflection->GetString(message, F("optional_bytes" ))); @@ -2867,7 +2867,7 @@ void TestUtil::ReflectionTester::ExpectClearViaReflection( EXPECT_EQ(-50 , reflection->GetInt64 (message, F("default_sfixed64"))); EXPECT_EQ( 51.5 , reflection->GetFloat (message, F("default_float" ))); EXPECT_EQ( 52e3 , reflection->GetDouble(message, F("default_double" ))); - EXPECT_TRUE( reflection->GetBool (message, F("default_bool" ))); + EXPECT_EQ(true , reflection->GetBool (message, F("default_bool" ))); EXPECT_EQ("hello", reflection->GetString(message, F("default_string" ))); EXPECT_EQ("world", reflection->GetString(message, F("default_bytes" ))); diff --git a/chromium/third_party/protobuf/src/google/protobuf/testing/googletest.h b/chromium/third_party/protobuf/src/google/protobuf/testing/googletest.h index 003be106072..6b17ae4ff82 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/testing/googletest.h +++ b/chromium/third_party/protobuf/src/google/protobuf/testing/googletest.h @@ -38,11 +38,6 @@ #include <vector> #include <google/protobuf/stubs/common.h> -// Disable death tests if we use exceptions in CHECK(). -#if !PROTOBUF_USE_EXCEPTIONS && defined(GTEST_HAS_DEATH_TEST) -#define PROTOBUF_HAS_DEATH_TEST -#endif - namespace google { namespace protobuf { diff --git a/chromium/third_party/protobuf/src/google/protobuf/text_format.cc b/chromium/third_party/protobuf/src/google/protobuf/text_format.cc index cabb99ed9ce..1ee3df50ded 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/text_format.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/text_format.cc @@ -434,8 +434,8 @@ class TextFormat::Parser::ParserImpl { // If a parse info tree exists, add the location for the parsed // field. if (parse_info_tree_ != NULL) { - RecordLocation(parse_info_tree_, field, - ParseLocation(start_line, start_column)); + parse_info_tree_->RecordLocation(field, + ParseLocation(start_line, start_column)); } return true; @@ -483,7 +483,7 @@ class TextFormat::Parser::ParserImpl { // for the nested message. ParseInfoTree* parent = parse_info_tree_; if (parent != NULL) { - parse_info_tree_ = CreateNested(parent, field); + parse_info_tree_ = parent->CreateNested(field); } string delimeter; diff --git a/chromium/third_party/protobuf/src/google/protobuf/text_format.h b/chromium/third_party/protobuf/src/google/protobuf/text_format.h index 01f3ffb0865..0974139708a 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/text_format.h +++ b/chromium/third_party/protobuf/src/google/protobuf/text_format.h @@ -339,30 +339,9 @@ class LIBPROTOBUF_EXPORT TextFormat { }; private: - // Hack: ParseInfoTree declares TextFormat as a friend which should extend - // the friendship to TextFormat::Parser::ParserImpl, but unfortunately some - // old compilers (e.g. GCC 3.4.6) don't implement this correctly. We provide - // helpers for ParserImpl to call methods of ParseInfoTree. - static inline void RecordLocation(ParseInfoTree* info_tree, - const FieldDescriptor* field, - ParseLocation location); - static inline ParseInfoTree* CreateNested(ParseInfoTree* info_tree, - const FieldDescriptor* field); - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TextFormat); }; -inline void TextFormat::RecordLocation(ParseInfoTree* info_tree, - const FieldDescriptor* field, - ParseLocation location) { - info_tree->RecordLocation(field, location); -} - -inline TextFormat::ParseInfoTree* TextFormat::CreateNested( - ParseInfoTree* info_tree, const FieldDescriptor* field) { - return info_tree->CreateNested(field); -} - } // namespace protobuf } // namespace google diff --git a/chromium/third_party/protobuf/src/google/protobuf/text_format_unittest.cc b/chromium/third_party/protobuf/src/google/protobuf/text_format_unittest.cc index 304fb844048..353a5e49b8e 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/text_format_unittest.cc +++ b/chromium/third_party/protobuf/src/google/protobuf/text_format_unittest.cc @@ -858,12 +858,6 @@ TEST_F(TextFormatParserTest, ParseFieldValueFromString) { EXPECT_EQ(value, message->optional_##name()); \ EXPECT_TRUE(message->has_optional_##name()); -#define EXPECT_BOOL_FIELD(name, value, valuestring) \ - EXPECT_TRUE(TextFormat::ParseFieldValueFromString( \ - valuestring, d->FindFieldByName("optional_" #name), message.get())); \ - EXPECT_TRUE(message->optional_##name() == value); \ - EXPECT_TRUE(message->has_optional_##name()); - #define EXPECT_FLOAT_FIELD(name, value, valuestring) \ EXPECT_TRUE(TextFormat::ParseFieldValueFromString( \ valuestring, d->FindFieldByName("optional_" #name), message.get())); \ @@ -921,12 +915,12 @@ TEST_F(TextFormatParserTest, ParseFieldValueFromString) { EXPECT_INVALID(fixed64, "1,2"); // bool - EXPECT_BOOL_FIELD(bool, true, "true"); - EXPECT_BOOL_FIELD(bool, false, "false"); - EXPECT_BOOL_FIELD(bool, true, "1"); - EXPECT_BOOL_FIELD(bool, true, "t"); - EXPECT_BOOL_FIELD(bool, false, "0"); - EXPECT_BOOL_FIELD(bool, false, "f"); + EXPECT_FIELD(bool, true, "true"); + EXPECT_FIELD(bool, false, "false"); + EXPECT_FIELD(bool, true, "1"); + EXPECT_FIELD(bool, true, "t"); + EXPECT_FIELD(bool, false, "0"); + EXPECT_FIELD(bool, false, "f"); EXPECT_INVALID(bool, "2"); EXPECT_INVALID(bool, "-0"); EXPECT_INVALID(bool, "on"); @@ -968,7 +962,6 @@ TEST_F(TextFormatParserTest, ParseFieldValueFromString) { EXPECT_INVALID(nested_message, "any"); #undef EXPECT_FIELD -#undef EXPECT_BOOL_FIELD #undef EXPECT_FLOAT_FIELD #undef EXPECT_DOUBLE_FIELD #undef EXPECT_INVALID diff --git a/chromium/third_party/protobuf/src/google/protobuf/unittest.proto b/chromium/third_party/protobuf/src/google/protobuf/unittest.proto index 6eb2d86f51f..0305be6534f 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/unittest.proto +++ b/chromium/third_party/protobuf/src/google/protobuf/unittest.proto @@ -434,7 +434,6 @@ message TestNestedMessageHasBits { // Test an enum that has multiple values with the same number. enum TestEnumWithDupValue { - option allow_alias = true; FOO1 = 1; BAR1 = 2; BAZ = 3; diff --git a/chromium/third_party/protobuf/src/google/protobuf/wire_format.h b/chromium/third_party/protobuf/src/google/protobuf/wire_format.h index fc60f51bf6d..8a89881bec0 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/wire_format.h +++ b/chromium/third_party/protobuf/src/google/protobuf/wire_format.h @@ -230,9 +230,6 @@ inline void WireFormat::VerifyUTF8String(const char* data, int size, WireFormat::Operation op) { #ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED WireFormat::VerifyUTF8StringFallback(data, size, op); -#else - // Avoid the compiler warning about unsued variables. - (void)data; (void)size; (void)op; #endif } diff --git a/chromium/third_party/protobuf/src/google/protobuf/wire_format_lite_inl.h b/chromium/third_party/protobuf/src/google/protobuf/wire_format_lite_inl.h index 641cc92f65b..0f97386d8ac 100644 --- a/chromium/third_party/protobuf/src/google/protobuf/wire_format_lite_inl.h +++ b/chromium/third_party/protobuf/src/google/protobuf/wire_format_lite_inl.h @@ -299,12 +299,12 @@ inline bool WireFormatLite::ReadRepeatedPrimitive< \ tag_size, tag, input, values); \ } -READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint32, TYPE_FIXED32) -READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint64, TYPE_FIXED64) -READ_REPEATED_FIXED_SIZE_PRIMITIVE(int32, TYPE_SFIXED32) -READ_REPEATED_FIXED_SIZE_PRIMITIVE(int64, TYPE_SFIXED64) -READ_REPEATED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT) -READ_REPEATED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE) +READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint32, TYPE_FIXED32); +READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint64, TYPE_FIXED64); +READ_REPEATED_FIXED_SIZE_PRIMITIVE(int32, TYPE_SFIXED32); +READ_REPEATED_FIXED_SIZE_PRIMITIVE(int64, TYPE_SFIXED64); +READ_REPEATED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT); +READ_REPEATED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE); #undef READ_REPEATED_FIXED_SIZE_PRIMITIVE diff --git a/chromium/third_party/protobuf/vsprojects/extract_includes.bat b/chromium/third_party/protobuf/vsprojects/extract_includes.bat index a92d114bdf5..4dcb4e1446e 100755 --- a/chromium/third_party/protobuf/vsprojects/extract_includes.bat +++ b/chromium/third_party/protobuf/vsprojects/extract_includes.bat @@ -12,8 +12,6 @@ copy ..\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h include\google\ copy ..\src\google\protobuf\stubs\common.h include\google\protobuf\stubs\common.h
copy ..\src\google\protobuf\stubs\once.h include\google\protobuf\stubs\once.h
copy ..\src\google\protobuf\stubs\platform_macros.h include\google\protobuf\stubs\platform_macros.h
-copy ..\src\google\protobuf\stubs\template_util.h include\google\protobuf\stubs\template_util.h
-copy ..\src\google\protobuf\stubs\type_traits.h include\google\protobuf\stubs\type_traits.h
copy ..\src\google\protobuf\descriptor.h include\google\protobuf\descriptor.h
copy ..\src\google\protobuf\descriptor.pb.h include\google\protobuf\descriptor.pb.h
copy ..\src\google\protobuf\descriptor_database.h include\google\protobuf\descriptor_database.h
|