I've been occasionally working on a patch that turns on narrowing detection in blink and I've found a number of issues specifically around implementation of IDL interfaces. In fact the test code for the bindings layer is also problematic so I've decided to write this message because it is one of these subtle things.
WebIDL defines
long/unsigned long = 32 bits
long long/unsigned long long = 64 bits
Ok as long as I always remember to look at the spec I can keep these clear in my mind.
C++ Defines
long/unsigned long = 32 or 64 bits (depends on Linux or Windows)
long long/unsigned long long = 64 bits
size_t depends on the size of a ptr, 64 bits for 64 bit builds, 32 bits for 32 bit builds.
Yes long on Linux on a 64 bit platform is 8 bytes yet on Windows on the same CPU architecture it is 4 bytes. Intel has some information
here.
Please, please stick to using stdint types; eg. uint64_t/int64_t/int64_t/uint64_t and avoid using size_t on interfaces implemented to the IDL.
Blink also tends to use a lot of unsigned or int and I urge you to start using the stdint types which are relatively easy to "understand how wide" is this field.
Some of this will be automatically caught when I get around to fully enabling the warnings but I thought it was useful to communicate some guidance.