Steps to reproduce:
1. Build Chrome with -Wshorten-64-to-32
2. Edit services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom and change "importance" from int64 to int32
3. Rebuild with -Wshorten-64-to-32
Warning produced... (see below).
But, if you clean your workspace, and do a rebuild with the 'int32' change in place, there is no warning, so something is not being picked up as changed, when editing a mojom file.
The error produced was:
[522/526] CXX obj/services/resource_coordinator/public/mojom/mojom/memory_instrumentation.mojom.obj
In file included from gen/services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom.cc:15:
In file included from gen\services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom.h:28:
gen\services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom-shared.h(1562,29): warning: implicit conversion loses integer precision: 'long long' to 'int32_t' (aka 'int') [-Wshorten-64-to-32]
(*output)->importance = CallWithContext(Traits::importance, input, custom_context);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../..\mojo/public/cpp/bindings/lib/serialization_forward.h(43,7): note: in instantiation of member function 'mojo::internal::Serializer<memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView, base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge>::Serialize' requested here
Serialize(std::forward<InputUserType>(input),
^
../..\mojo/public/cpp/bindings/lib/array_serialization.h(395,7): note: in instantiation of function template specialization 'mojo::internal::Serialize<memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView, base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge &, mojo::internal::Buffer *&, memory_instrumentation::mojom::internal::RawAllocatorDumpEdge_Data::BufferWriter *&, mojo::internal::SerializationContext *&, nullptr>' requested here
Serialize<T>(std::forward<InputElementType>(input), buf, writer, context);
^
../..\mojo/public/cpp/bindings/lib/array_serialization.h(357,33): note: in instantiation of function template specialization 'mojo::internal::ArraySerializer<mojo::ArrayDataView<memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView>, std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> >, mojo::internal::ArrayIterator<mojo::ArrayTraits<std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> > >, std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> >, false>, void>::SerializeCaller<memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView, false>::Run<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge &>' requested here
SerializeCaller<Element>::Run(next, buf, &data_writer,
^
../..\mojo/public/cpp/bindings/lib/array_serialization.h(492,11): note: in instantiation of member function 'mojo::internal::ArraySerializer<mojo::ArrayDataView<memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView>, std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> >, mojo::internal::ArrayIterator<mojo::ArrayTraits<std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> > >, std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> >, false>, void>::SerializeElements' requested here
Impl::SerializeElements(&iterator, buf, writer, validate_params, context);
^
../..\mojo/public/cpp/bindings/lib/serialization_forward.h(43,7): note: in instantiation of member function 'mojo::internal::Serializer<mojo::ArrayDataView<memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView>, std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> > >::Serialize' requested here
Serialize(std::forward<InputUserType>(input),
^
gen\services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom-shared.h(1727,21): note: in instantiation of function template specialization 'mojo::internal::Serialize<mojo::ArrayDataView<memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView>, std::vector<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge, std::allocator<base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge> > &, mojo::internal::Buffer *&, mojo::internal::Array_Data<mojo::internal::Pointer<memory_instrumentation::mojom::internal::RawAllocatorDumpEdge_Data> >::BufferWriter *, const mojo::internal::ContainerValidateParams *, mojo::internal::SerializationContext *&, nullptr>' requested here
mojo::internal::Serialize<mojo::ArrayDataView<::memory_instrumentation::mojom::RawAllocatorDumpEdgeDataView>>(
^
../..\mojo/public/cpp/bindings/lib/serialization_forward.h(43,7): note: in instantiation of member function 'mojo::internal::Serializer<memory_instrumentation::mojom::RawProcessMemoryDumpDataView, std::unique_ptr<base::trace_event::ProcessMemoryDump, std::default_delete<base::trace_event::ProcessMemoryDump> > >::Serialize' requested here
Serialize(std::forward<InputUserType>(input),
^
gen/services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom.cc(670,19): note: in instantiation of function template specialization 'mojo::internal::Serialize<memory_instrumentation::mojom::RawProcessMemoryDumpDataView, std::unique_ptr<base::trace_event::ProcessMemoryDump, std::default_delete<base::trace_event::ProcessMemoryDump> > &, mojo::internal::Buffer *&, memory_instrumentation::mojom::internal::RawProcessMemoryDump_Data::BufferWriter *, mojo::internal::SerializationContext *, nullptr>' requested here
mojo::internal::Serialize<::memory_instrumentation::mojom::RawProcessMemoryDumpDataView>(
^
1 warning generated.