New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 595791 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Mar 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Mojo enum types incompatible with variants.

Project Member Reported by reillyg@chromium.org, Mar 17 2016

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.

 
Status: Verified (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, 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