Mojo enum types incompatible with variants. |
||
Issue description
It looks like the templates for Mojo enum types don't take into consideration variants. Adding an enum to test_wtf_types.mojom generates compile errors because of the absolute symbol name referring to ::mojo::test::internal instead of ::mojo::test::blink::internal.
--- a/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom
+++ b/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom
@@ -4,7 +4,13 @@
module mojo.test;
+enum MojoBoolean {
+ MOJO_TRUE,
+ MOJO_FALSE,
+};
+
struct TestWTFCodeGeneration {
+ MojoBoolean test_bool;
string str;
string? nullable_str;
array<string> strs;
In file included from ../../mojo/public/cpp/bindings/tests/wtf_types_unittest.cc:13:
gen/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h:51:10: error: no member named 'internal' in namespace 'mojo::test'; did you mean simply 'internal'?
return ::mojo::test::internal::MojoBoolean_Data::IsKnownValue(
^~~~~~~~~~~~~~~~~~~~~~
internal
gen/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink-internal.h:27:11: note: 'internal' declared here
namespace internal {
^
1 error generated.
,
Mar 17 2016
,
Mar 18 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ff43dcf4c622fb46b062abca1024a89fb01b54c7 commit ff43dcf4c622fb46b062abca1024a89fb01b54c7 Author: yzshen <yzshen@chromium.org> Date: Fri Mar 18 03:19:49 2016 Mojo C++ bindings: fix sanity check of wtf string serialization. Previously the code had a check that we use exactly the same WTF::String object for GetSerializedSize_ and Serialize_ call. However, because WTF::String is ref-counted, we may end up using different WTF::String objects referring to the same contents. That may happen, e.g., when moving WTF::String to a different container. This CL changes the sanity check to verify that the size of WTF::String remains unchanged. BUG= 595791 Review URL: https://codereview.chromium.org/1810253002 Cr-Commit-Position: refs/heads/master@{#381880} [modify] https://crrev.com/ff43dcf4c622fb46b062abca1024a89fb01b54c7/mojo/public/cpp/bindings/lib/wtf_string_serialization.cc |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Mar 17 2016